refactor: rename SecurityDefs to SecuritySchemes

This commit is contained in:
Roman Hotsiy 2017-11-24 11:51:59 +02:00
parent 426e5b67ab
commit c484411171
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
3 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@ import { observer } from 'mobx-react';
import { AppStore } from '../../services/AppStore';
import { SecurityDefs } from '../SecurityDefs/SecurityDefs';
import { SecurityDefs } from '../SecuritySchemes/SecuritySchemes';
import { Markdown } from '../Markdown/Markdown';
import { MiddlePanel, DarkRightPanel, Row } from '../../common-elements/';
@ -102,7 +102,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
'security-definitions': {
component: SecurityDefs,
propsSelector: store => ({
securitySchemes: store!.spec.security,
securitySchemes: store!.spec.securitySchemes,
}),
},
}}

View File

@ -1,6 +1,6 @@
import * as React from 'react';
import { SecuritySchemesModel } from '../../services/models/';
import { SecuritySchemesModel } from '../../services/models';
import styled from '../../styled-components';
import { H2 } from '../../common-elements';
@ -14,11 +14,6 @@ const AUTH_TYPES = {
openIdConnect: 'Open ID Connect',
};
export interface OAuthFlowProps {
type: string;
flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']];
}
const AuthTable = styled.table`
ul > li {
margin: 0.5em 0 !important;
@ -29,6 +24,11 @@ const AuthTable = styled.table`
}
`;
export interface OAuthFlowProps {
type: string;
flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']];
}
export class OAuthFlow extends React.PureComponent<OAuthFlowProps> {
render() {
const { type, flow } = this.props;

View File

@ -38,7 +38,7 @@ export class SpecStore {
}
@computed
get security() {
get securitySchemes() {
const schemes = this.parser.spec.components && this.parser.spec.components.securitySchemes;
return schemes && new SecuritySchemesModel(this.parser);
}