fix: fix Authentication section is not rendered

fixes #590
This commit is contained in:
Roman Hotsiy 2018-08-07 11:19:13 +03:00
parent 8fb9cd6bac
commit 2ecc8bc58e
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 4 additions and 4 deletions

View File

@ -89,13 +89,13 @@ export class SectionItem extends React.Component<ContentItemProps> {
{name} {name}
</H1> </H1>
{components ? ( {components ? (
<Markdown source={description || ''} />
) : (
<StoreConsumer> <StoreConsumer>
{store => ( {store => (
<Markdown source={description || ''} allowedComponents={components} store={store} /> <Markdown source={description || ''} allowedComponents={components} store={store} />
)} )}
</StoreConsumer> </StoreConsumer>
) : (
<Markdown source={description || ''} />
)} )}
</MiddlePanel> </MiddlePanel>
</Row> </Row>

View File

@ -76,11 +76,11 @@ export class OpenAPIParser {
const description = spec.info.description || ''; const description = spec.info.description || '';
const legacySecurityRegexp = new RegExp( const legacySecurityRegexp = new RegExp(
COMPONENT_REGEXP.replace('{component}', '<security-definitions>'), COMPONENT_REGEXP.replace('{component}', '<security-definitions>'),
'gmi', 'mi',
); );
const securityRegexp = new RegExp( const securityRegexp = new RegExp(
MDX_COMPONENT_REGEXP.replace('{component}', 'security-definitions'), MDX_COMPONENT_REGEXP.replace('{component}', 'security-definitions'),
'gmi', 'mi',
); );
if (!legacySecurityRegexp.test(description) && !securityRegexp.test(description)) { if (!legacySecurityRegexp.test(description) && !securityRegexp.test(description)) {
const comment = buildComponentComment('security-definitions'); const comment = buildComponentComment('security-definitions');