This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +27
-41
lines changed
features/Apiexplorer/Schema/RecursiveContent Expand file tree Collapse file tree 5 files changed +27
-41
lines changed Original file line number Diff line number Diff line change @@ -120,13 +120,11 @@ const SchemaBodyHeader = ({
120120 ) }
121121
122122 { is_stream_types && (
123- < React . Fragment >
124- < div className = { styles . schemaObjectContent } >
125- < span className = { styles . enumLabel } > { 'one of' } </ span >
126- < button onClick = { ( ) => setIsOpenObject ( ! is_open_object ) } > { 'stream_types' } </ button >
127- < span className = { `${ styles . enumType } ${ styles . array } ` } > { 'array' } </ span >
128- </ div >
129- </ React . Fragment >
123+ < div className = { styles . schemaObjectContent } >
124+ < span className = { styles . enumLabel } > { 'one of' } </ span >
125+ < button onClick = { ( ) => setIsOpenObject ( ! is_open_object ) } > { 'stream_types' } </ button >
126+ < span className = { `${ styles . enumType } ${ styles . array } ` } > { 'array' } </ span >
127+ </ div >
130128 ) }
131129
132130 { pattern && (
Original file line number Diff line number Diff line change 11import React from 'react' ;
2+ import { TEnumStreamType } from '@site/src/types' ;
23import styles from '../../Schema.module.scss' ;
34
45type TStreamTypesBody = {
56 type : string ;
6- _enum : Array <
7- | 'balance'
8- | 'candles'
9- | 'cashier_payments'
10- | 'p2p_advert'
11- | 'p2p_advertiser'
12- | 'p2p_order'
13- | 'proposal'
14- | 'proposal_open_contract'
15- | 'ticks'
16- | 'transaction'
17- | 'trading_platform_asset_listing'
18- | 'website_status'
19- | 'p2p_settings'
20- | 'crypto_estimations'
21- > ;
7+ _enum : TEnumStreamType ;
228} ;
239
2410const StreamTypesBody = ( { type, _enum } : TStreamTypesBody ) => {
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import userEvent from '@testing-library/user-event' ;
33import { screen , render } from '@testing-library/react' ;
4+ import { TEnumStreamType } from '@site/src/types' ;
45import StreamTypesObject from '..' ;
56
67describe ( 'StreamTypesObject' , ( ) => {
8+ const _enum : TEnumStreamType = [
9+ 'balance' ,
10+ 'candles' ,
11+ 'cashier_payments' ,
12+ 'p2p_advert' ,
13+ 'p2p_advertiser' ,
14+ 'p2p_order' ,
15+ 'proposal' ,
16+ 'proposal_open_contract' ,
17+ 'ticks' ,
18+ 'transaction' ,
19+ 'website_status' ,
20+ ] ;
721 const json_schema = {
822 stream_types : {
923 description : 'This stream_types description' ,
1024 type : 'string' ,
11- enum : [
12- 'balance' ,
13- 'candles' ,
14- 'cashier_payments' ,
15- 'p2p_advert' ,
16- 'p2p_advertiser' ,
17- 'p2p_order' ,
18- 'proposal' ,
19- 'proposal_open_contract' ,
20- 'ticks' ,
21- 'transaction' ,
22- 'trading_platform_asset_listing' ,
23- 'website_status' ,
24- 'p2p_settings' ,
25- 'crypto_estimations' ,
26- ] ,
25+ enum : _enum ,
2726 } ,
2827 } ;
2928
Original file line number Diff line number Diff line change @@ -2,14 +2,15 @@ import React, { Suspense } from 'react';
22import StreamTypesHeader from './StreamTypesHeader' ;
33import StreamTypesBody from './StreamTypesBody' ;
44import SourceButton from '../../SourceButton/SourceButton' ;
5+ import { TEnumStreamType } from '@site/src/types' ;
56import styles from '../../Schema.module.scss' ;
67
78type TStreamTypesObject = {
89 definitions : {
910 stream_types : {
1011 description : string ;
1112 type : string ;
12- enum ;
13+ enum : TEnumStreamType ;
1314 } ;
1415 } ;
1516} ;
Original file line number Diff line number Diff line change 1- import { ApiToken } from '@deriv/api-types' ;
1+ import { ApiToken , StreamTypes } from '@deriv/api-types' ;
22import { Column } from 'react-table' ;
33
44export type TTokensArrayType = ApiToken [ 'tokens' ] ;
@@ -15,3 +15,5 @@ export type TInfo = {
1515 auth_required ?: number ;
1616 auth_scopes ?: string [ ] ;
1717} ;
18+
19+ export type TEnumStreamType = Array < StreamTypes > ;
You can’t perform that action at this time.
0 commit comments