chore: prettier all

This commit is contained in:
Roman Hotsiy 2018-08-18 16:23:33 +03:00
parent 93e844c3d0
commit 528b8fbebc
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
11 changed files with 40 additions and 16 deletions

View File

@ -28,7 +28,14 @@ export class FieldDetails extends React.PureComponent<FieldProps> {
<div> <div>
<TypePrefix>{schema.typePrefix}</TypePrefix> <TypePrefix>{schema.typePrefix}</TypePrefix>
<TypeName>{schema.displayType}</TypeName> <TypeName>{schema.displayType}</TypeName>
{schema.displayFormat && <TypeFormat> &lt;{schema.displayFormat}&gt; </TypeFormat>} {schema.displayFormat && (
<TypeFormat>
{' '}
&lt;
{schema.displayFormat}
&gt;{' '}
</TypeFormat>
)}
{schema.title && <TypeTitle> ({schema.title}) </TypeTitle>} {schema.title && <TypeTitle> ({schema.title}) </TypeTitle>}
<ConstraintsView constraints={schema.constraints} /> <ConstraintsView constraints={schema.constraints} />
{schema.nullable && <NullableLabel> Nullable </NullableLabel>} {schema.nullable && <NullableLabel> Nullable </NullableLabel>}

View File

@ -34,7 +34,9 @@ export class MediaTypeSamples extends React.Component<PayloadSamplesProps> {
return ( return (
<SmallTabs> <SmallTabs>
<TabList> <TabList>
{examplesNames.map(name => <Tab key={name}> {examples[name].summary || name} </Tab>)} {examplesNames.map(name => (
<Tab key={name}> {examples[name].summary || name} </Tab>
))}
</TabList> </TabList>
{examplesNames.map(name => ( {examplesNames.map(name => (
<TabPanel key={name}>{sampleView(examples[name].value)}</TabPanel> <TabPanel key={name}>{sampleView(examples[name].value)}</TabPanel>

View File

@ -24,7 +24,7 @@ export const SearchInput = styled.input.attrs({
outline: none; outline: none;
`; `;
export const SearchIcon = styled((props: {className?: string}) => ( export const SearchIcon = styled((props: { className?: string }) => (
<svg <svg
className={props.className} className={props.className}
version="1.1" version="1.1"

View File

@ -72,7 +72,9 @@ export class SecurityRequirement extends React.PureComponent<SecurityRequirement
<SecurityRequirementAndWrap key={scheme.id}> <SecurityRequirementAndWrap key={scheme.id}>
<Link to={scheme.sectionId}>{scheme.id}</Link> <Link to={scheme.sectionId}>{scheme.id}</Link>
{scheme.scopes.length > 0 && ' ('} {scheme.scopes.length > 0 && ' ('}
{scheme.scopes.map(scope => <ScopeName key={scope}>{scope}</ScopeName>)} {scheme.scopes.map(scope => (
<ScopeName key={scope}>{scope}</ScopeName>
))}
{scheme.scopes.length > 0 && ') '} {scheme.scopes.length > 0 && ') '}
</SecurityRequirementAndWrap> </SecurityRequirementAndWrap>
); );
@ -117,7 +119,9 @@ export class SecurityRequirements extends React.PureComponent<SecurityRequiremen
<AuthHeader>Authorizations: </AuthHeader> <AuthHeader>Authorizations: </AuthHeader>
</AuthHeaderColumn> </AuthHeaderColumn>
<SecuritiesColumn> <SecuritiesColumn>
{securities.map((security, idx) => <SecurityRequirement key={idx} security={security} />)} {securities.map((security, idx) => (
<SecurityRequirement key={idx} security={security} />
))}
</SecuritiesColumn> </SecuritiesColumn>
</Wrap> </Wrap>
); );

View File

@ -52,12 +52,14 @@ export class MenuStore {
/** /**
* active item absolute index (when flattened). -1 means nothing is selected * active item absolute index (when flattened). -1 means nothing is selected
*/ */
@observable activeItemIdx: number = -1; @observable
activeItemIdx: number = -1;
/** /**
* whether sidebar with menu is opened or not * whether sidebar with menu is opened or not
*/ */
@observable sideBarOpened: boolean = false; @observable
sideBarOpened: boolean = false;
items: IMenuItem[]; items: IMenuItem[];
flatItems: IMenuItem[]; flatItems: IMenuItem[];

View File

@ -10,7 +10,8 @@ import { SchemaModel } from './Schema';
* Field or Parameter model ready to be used by components * Field or Parameter model ready to be used by components
*/ */
export class FieldModel { export class FieldModel {
@observable expanded: boolean = false; @observable
expanded: boolean = false;
schema: SchemaModel; schema: SchemaModel;
name: string; name: string;

View File

@ -21,8 +21,10 @@ export class GroupModel implements IMenuItem {
parent?: GroupModel; parent?: GroupModel;
externalDocs?: OpenAPIExternalDocumentation; externalDocs?: OpenAPIExternalDocumentation;
@observable active: boolean = false; @observable
@observable expanded: boolean = false; active: boolean = false;
@observable
expanded: boolean = false;
depth: number; depth: number;
level: number; level: number;

View File

@ -14,7 +14,8 @@ import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
export class MediaContentModel { export class MediaContentModel {
mediaTypes: MediaTypeModel[]; mediaTypes: MediaTypeModel[];
@observable activeMimeIdx = 0; @observable
activeMimeIdx = 0;
/** /**
* @param isRequestType needed to know if skipe RO/RW fields in objects * @param isRequestType needed to know if skipe RO/RW fields in objects

View File

@ -40,9 +40,12 @@ export class OperationModel implements IMenuItem {
depth: number; depth: number;
@observable ready?: boolean = true; @observable
@observable active: boolean = false; ready?: boolean = true;
@observable expanded: boolean = false; @observable
active: boolean = false;
@observable
expanded: boolean = false;
//#endregion //#endregion
pointer: string; pointer: string;

View File

@ -9,7 +9,8 @@ import { FieldModel } from './Field';
import { MediaContentModel } from './MediaContent'; import { MediaContentModel } from './MediaContent';
export class ResponseModel { export class ResponseModel {
@observable expanded: boolean; @observable
expanded: boolean;
content?: MediaContentModel; content?: MediaContentModel;
code: string; code: string;

View File

@ -48,7 +48,8 @@ export class SchemaModel {
oneOf?: SchemaModel[]; oneOf?: SchemaModel[];
oneOfType: string; oneOfType: string;
discriminatorProp: string; discriminatorProp: string;
@observable activeOneOf: number = 0; @observable
activeOneOf: number = 0;
rawSchema: OpenAPISchema; rawSchema: OpenAPISchema;
schema: MergedOpenAPISchema; schema: MergedOpenAPISchema;