mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 21:54:53 +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 { ResponseSamples } from '../ResponseSamples/ResponseSamples';
|
||||
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;
|
||||
contain: content;
|
||||
overflow: hidden;
|
||||
|
@ -43,7 +46,7 @@ export class Operation extends React.Component<OperationProps> {
|
|||
return (
|
||||
<OptionsContext.Consumer>
|
||||
{options => (
|
||||
<OperationRow>
|
||||
<OperationRow id={operation.operationHash}>
|
||||
<MiddlePanel>
|
||||
<H2>
|
||||
<ShareLink to={operation.id} />
|
||||
|
|
|
@ -66,6 +66,7 @@ export class OperationModel implements IMenuItem {
|
|||
|
||||
pointer: string;
|
||||
operationId?: string;
|
||||
operationHash?: string;
|
||||
httpVerb: string;
|
||||
deprecated: boolean;
|
||||
path: string;
|
||||
|
@ -106,9 +107,10 @@ export class OperationModel implements IMenuItem {
|
|||
// TODO: update getting pathInfo for overriding servers on path level
|
||||
this.servers = normalizeServers('', operationSpec.servers || operationSpec.pathServers || []);
|
||||
} else {
|
||||
this.operationHash = operationSpec.operationId && 'operation/' + operationSpec.operationId
|
||||
this.id =
|
||||
operationSpec.operationId !== undefined
|
||||
? (parent ? parent.id + '/' : '') + 'operation/' + operationSpec.operationId
|
||||
? (parent ? parent.id + '/' : '') + this.operationHash
|
||||
: parent !== undefined
|
||||
? parent.id + this.pointer
|
||||
: this.pointer;
|
||||
|
|
Loading…
Reference in New Issue
Block a user