mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 06:04:56 +03:00
added operation/* style data-test-id to OperationRow
This commit is contained in:
parent
2b06692959
commit
3f31094182
|
@ -17,8 +17,11 @@ import { RequestSamples } from '../RequestSamples/RequestSamples';
|
||||||
import { ResponsesList } from '../Responses/ResponsesList';
|
import { ResponsesList } from '../Responses/ResponsesList';
|
||||||
import { ResponseSamples } from '../ResponseSamples/ResponseSamples';
|
import { ResponseSamples } from '../ResponseSamples/ResponseSamples';
|
||||||
import { SecurityRequirements } from '../SecurityRequirement/SecurityRequirement';
|
import { SecurityRequirements } from '../SecurityRequirement/SecurityRequirement';
|
||||||
|
import {SECTION_ATTR} from '../../services';
|
||||||
|
|
||||||
const OperationRow = styled(Row)`
|
const OperationRow = styled(Row).attrs(props => ({
|
||||||
|
[SECTION_ATTR]: props.id,
|
||||||
|
}))`
|
||||||
backface-visibility: hidden;
|
backface-visibility: hidden;
|
||||||
contain: content;
|
contain: content;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -43,7 +46,7 @@ export class Operation extends React.Component<OperationProps> {
|
||||||
return (
|
return (
|
||||||
<OptionsContext.Consumer>
|
<OptionsContext.Consumer>
|
||||||
{options => (
|
{options => (
|
||||||
<OperationRow>
|
<OperationRow id={operation.operationHash}>
|
||||||
<MiddlePanel>
|
<MiddlePanel>
|
||||||
<H2>
|
<H2>
|
||||||
<ShareLink to={operation.id} />
|
<ShareLink to={operation.id} />
|
||||||
|
|
|
@ -66,6 +66,7 @@ export class OperationModel implements IMenuItem {
|
||||||
|
|
||||||
pointer: string;
|
pointer: string;
|
||||||
operationId?: string;
|
operationId?: string;
|
||||||
|
operationHash?: string;
|
||||||
httpVerb: string;
|
httpVerb: string;
|
||||||
deprecated: boolean;
|
deprecated: boolean;
|
||||||
path: string;
|
path: string;
|
||||||
|
@ -106,9 +107,10 @@ export class OperationModel implements IMenuItem {
|
||||||
// TODO: update getting pathInfo for overriding servers on path level
|
// TODO: update getting pathInfo for overriding servers on path level
|
||||||
this.servers = normalizeServers('', operationSpec.servers || operationSpec.pathServers || []);
|
this.servers = normalizeServers('', operationSpec.servers || operationSpec.pathServers || []);
|
||||||
} else {
|
} else {
|
||||||
|
this.operationHash = operationSpec.operationId && 'operation/' + operationSpec.operationId
|
||||||
this.id =
|
this.id =
|
||||||
operationSpec.operationId !== undefined
|
operationSpec.operationId !== undefined
|
||||||
? (parent ? parent.id + '/' : '') + 'operation/' + operationSpec.operationId
|
? (parent ? parent.id + '/' : '') + this.operationHash
|
||||||
: parent !== undefined
|
: parent !== undefined
|
||||||
? parent.id + this.pointer
|
? parent.id + this.pointer
|
||||||
: this.pointer;
|
: this.pointer;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user