@oanda/labs-currency-cross-table 1.0.24 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +212 -0
- package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +11 -11
- package/dist/main/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/Main.js +11 -11
- package/dist/main/CurrencyCrossTableWidget/Main.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js +8 -7
- package/dist/main/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/Cell.js +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/Cell.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js +13 -13
- package/dist/main/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/TextCell.js +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/TextCell.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/components/types.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/constant.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/index.js +8 -8
- package/dist/main/CurrencyCrossTableWidget/index.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/render.js +6 -6
- package/dist/main/CurrencyCrossTableWidget/render.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/types.js.map +1 -1
- package/dist/main/CurrencyCrossTableWidget/utils.js +1 -1
- package/dist/main/CurrencyCrossTableWidget/utils.js.map +1 -1
- package/dist/main/gql/types/fragment-masking.js +3 -2
- package/dist/main/gql/types/fragment-masking.js.map +1 -1
- package/dist/main/gql/types/gql.js +3 -2
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +73 -73
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/gql/types/index.js.map +1 -1
- package/dist/main/gql/validateInstruments.js +3 -8
- package/dist/main/gql/validateInstruments.js.map +1 -1
- package/dist/main/translations/index.js +1 -1
- package/dist/main/translations/index.js.map +1 -1
- package/dist/main/translations/translations.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js +11 -11
- package/dist/module/CurrencyCrossTableWidget/CurrencyCrossTableWidget.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/Main.js +11 -11
- package/dist/module/CurrencyCrossTableWidget/Main.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js +8 -7
- package/dist/module/CurrencyCrossTableWidget/ValidationWrapper.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/Cell.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/Cell.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js +13 -13
- package/dist/module/CurrencyCrossTableWidget/components/CellWithData.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/TextCell.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/TextCell.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/components/types.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/constant.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/constant.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/index.js +1 -1
- package/dist/module/CurrencyCrossTableWidget/index.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/render.js +6 -6
- package/dist/module/CurrencyCrossTableWidget/render.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/types.js.map +1 -1
- package/dist/module/CurrencyCrossTableWidget/utils.js +2 -2
- package/dist/module/CurrencyCrossTableWidget/utils.js.map +1 -1
- package/dist/module/gql/types/fragment-masking.js +3 -2
- package/dist/module/gql/types/fragment-masking.js.map +1 -1
- package/dist/module/gql/types/gql.js +3 -2
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +73 -73
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/gql/types/index.js +2 -2
- package/dist/module/gql/types/index.js.map +1 -1
- package/dist/module/gql/validateInstruments.js +3 -8
- package/dist/module/gql/validateInstruments.js.map +1 -1
- package/dist/module/translations/index.js +1 -1
- package/dist/module/translations/index.js.map +1 -1
- package/dist/module/translations/translations.js.map +1 -1
- package/dist/types/CurrencyCrossTableWidget/CurrencyCrossTableWidget.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/Main.d.ts +2 -2
- package/dist/types/CurrencyCrossTableWidget/ValidationWrapper.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/Cell.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/CellWithData.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/TextCell.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/components/types.d.ts +2 -2
- package/dist/types/CurrencyCrossTableWidget/constant.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/index.d.ts +1 -1
- package/dist/types/CurrencyCrossTableWidget/types.d.ts +2 -2
- package/dist/types/CurrencyCrossTableWidget/utils.d.ts +3 -3
- package/dist/types/gql/types/gql.d.ts +2 -2
- package/dist/types/gql/types/index.d.ts +2 -2
- package/dist/types/translations/index.d.ts +2 -2
- package/package.json +3 -3
- package/src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx +11 -13
- package/src/CurrencyCrossTableWidget/Main.tsx +21 -28
- package/src/CurrencyCrossTableWidget/ValidationWrapper.tsx +28 -21
- package/src/CurrencyCrossTableWidget/components/Cell.tsx +11 -8
- package/src/CurrencyCrossTableWidget/components/CellWithData.tsx +24 -15
- package/src/CurrencyCrossTableWidget/components/TextCell.tsx +14 -9
- package/src/CurrencyCrossTableWidget/components/types.ts +3 -2
- package/src/CurrencyCrossTableWidget/constant.ts +13 -4
- package/src/CurrencyCrossTableWidget/index.ts +1 -1
- package/src/CurrencyCrossTableWidget/render.tsx +44 -30
- package/src/CurrencyCrossTableWidget/types.tsx +3 -2
- package/src/CurrencyCrossTableWidget/utils.ts +10 -7
- package/src/gql/types/fragment-masking.ts +41 -21
- package/src/gql/types/gql.ts +7 -3
- package/src/gql/types/graphql.ts +129 -47
- package/src/gql/types/index.ts +2 -2
- package/src/gql/validateInstruments.ts +4 -1
- package/src/translations/index.ts +4 -4
- package/src/translations/translations.ts +2 -1
- package/test/Main.test.tsx +17 -5
- package/test/mocks.ts +23 -14
- package/test/utils.test.ts +119 -19
package/src/gql/types/graphql.ts
CHANGED
|
@@ -2,18 +2,31 @@
|
|
|
2
2
|
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
3
3
|
export type Maybe<T> = T | null;
|
|
4
4
|
export type InputMaybe<T> = Maybe<T>;
|
|
5
|
-
export type Exact<T extends { [key: string]: unknown }> = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export type
|
|
9
|
-
|
|
5
|
+
export type Exact<T extends { [key: string]: unknown }> = {
|
|
6
|
+
[K in keyof T]: T[K];
|
|
7
|
+
};
|
|
8
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
9
|
+
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
10
|
+
};
|
|
11
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
12
|
+
[SubKey in K]: Maybe<T[SubKey]>;
|
|
13
|
+
};
|
|
14
|
+
export type MakeEmpty<
|
|
15
|
+
T extends { [key: string]: unknown },
|
|
16
|
+
K extends keyof T,
|
|
17
|
+
> = { [_ in K]?: never };
|
|
18
|
+
export type Incremental<T> =
|
|
19
|
+
| T
|
|
20
|
+
| {
|
|
21
|
+
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
|
|
22
|
+
};
|
|
10
23
|
/** All built-in and custom scalars, mapped to their actual values */
|
|
11
24
|
export type Scalars = {
|
|
12
|
-
ID: { input: string; output: string
|
|
13
|
-
String: { input: string; output: string
|
|
14
|
-
Boolean: { input: boolean; output: boolean
|
|
15
|
-
Int: { input: number; output: number
|
|
16
|
-
Float: { input: number; output: number
|
|
25
|
+
ID: { input: string; output: string };
|
|
26
|
+
String: { input: string; output: string };
|
|
27
|
+
Boolean: { input: boolean; output: boolean };
|
|
28
|
+
Int: { input: number; output: number };
|
|
29
|
+
Float: { input: number; output: number };
|
|
17
30
|
};
|
|
18
31
|
|
|
19
32
|
export type AssetClass = {
|
|
@@ -28,12 +41,12 @@ export enum AssetClassName {
|
|
|
28
41
|
Currency = 'CURRENCY',
|
|
29
42
|
EquityShares = 'EQUITY_SHARES',
|
|
30
43
|
Indices = 'INDICES',
|
|
31
|
-
Rates = 'RATES'
|
|
44
|
+
Rates = 'RATES',
|
|
32
45
|
}
|
|
33
46
|
|
|
34
47
|
export enum BookType {
|
|
35
48
|
Order = 'ORDER',
|
|
36
|
-
Position = 'POSITION'
|
|
49
|
+
Position = 'POSITION',
|
|
37
50
|
}
|
|
38
51
|
|
|
39
52
|
export type CorrelationHeatmap = {
|
|
@@ -56,7 +69,7 @@ export enum CorrelationTimeUnit {
|
|
|
56
69
|
M3 = 'M3',
|
|
57
70
|
M6 = 'M6',
|
|
58
71
|
W1 = 'W1',
|
|
59
|
-
Y1 = 'Y1'
|
|
72
|
+
Y1 = 'Y1',
|
|
60
73
|
}
|
|
61
74
|
|
|
62
75
|
export enum CurrencyName {
|
|
@@ -67,7 +80,7 @@ export enum CurrencyName {
|
|
|
67
80
|
Gbp = 'GBP',
|
|
68
81
|
Jpy = 'JPY',
|
|
69
82
|
Nzd = 'NZD',
|
|
70
|
-
Usd = 'USD'
|
|
83
|
+
Usd = 'USD',
|
|
71
84
|
}
|
|
72
85
|
|
|
73
86
|
export type CurrencyPower = {
|
|
@@ -92,7 +105,7 @@ export enum CurrencyPowerBalanceTimeUnit {
|
|
|
92
105
|
M1 = 'M1',
|
|
93
106
|
M3 = 'M3',
|
|
94
107
|
PreviousDay = 'PREVIOUS_DAY',
|
|
95
|
-
W1 = 'W1'
|
|
108
|
+
W1 = 'W1',
|
|
96
109
|
}
|
|
97
110
|
|
|
98
111
|
export type CurrencyStrength = {
|
|
@@ -104,7 +117,7 @@ export type CurrencyStrength = {
|
|
|
104
117
|
|
|
105
118
|
export enum DataSource {
|
|
106
119
|
Ny4 = 'NY4',
|
|
107
|
-
Ty3 = 'TY3'
|
|
120
|
+
Ty3 = 'TY3',
|
|
108
121
|
}
|
|
109
122
|
|
|
110
123
|
export enum Division {
|
|
@@ -116,7 +129,7 @@ export enum Division {
|
|
|
116
129
|
Ogm = 'OGM',
|
|
117
130
|
Oj = 'OJ',
|
|
118
131
|
Opt = 'OPT',
|
|
119
|
-
Otms = 'OTMS'
|
|
132
|
+
Otms = 'OTMS',
|
|
120
133
|
}
|
|
121
134
|
|
|
122
135
|
export type Heatmap = {
|
|
@@ -184,41 +197,34 @@ export type Query = {
|
|
|
184
197
|
volatilityChartAssetClasses?: Maybe<Array<AssetClass>>;
|
|
185
198
|
};
|
|
186
199
|
|
|
187
|
-
|
|
188
200
|
export type QueryAssetClassesArgs = {
|
|
189
201
|
division: Division;
|
|
190
202
|
};
|
|
191
203
|
|
|
192
|
-
|
|
193
204
|
export type QueryCorrelationHeatmapArgs = {
|
|
194
205
|
division: Division;
|
|
195
206
|
instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
|
196
207
|
timeSpans?: InputMaybe<Array<InputMaybe<CorrelationTimeUnit>>>;
|
|
197
208
|
};
|
|
198
209
|
|
|
199
|
-
|
|
200
210
|
export type QueryCorrelationMatrixArgs = {
|
|
201
211
|
division: Division;
|
|
202
212
|
instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
|
203
213
|
};
|
|
204
214
|
|
|
205
|
-
|
|
206
215
|
export type QueryCurrencyPowerBalanceArgs = {
|
|
207
216
|
timeUnit: CurrencyPowerBalanceTimeUnit;
|
|
208
217
|
};
|
|
209
218
|
|
|
210
|
-
|
|
211
219
|
export type QueryIsAllowedPartnerArgs = {
|
|
212
220
|
url: Scalars['String']['input'];
|
|
213
221
|
};
|
|
214
222
|
|
|
215
|
-
|
|
216
223
|
export type QueryMapInstrumentNamesArgs = {
|
|
217
224
|
division?: InputMaybe<Division>;
|
|
218
225
|
instruments: Array<InputMaybe<Scalars['String']['input']>>;
|
|
219
226
|
};
|
|
220
227
|
|
|
221
|
-
|
|
222
228
|
export type QueryOrderPositionBooksArgs = {
|
|
223
229
|
bookType: BookType;
|
|
224
230
|
dataSource?: InputMaybe<DataSource>;
|
|
@@ -227,25 +233,21 @@ export type QueryOrderPositionBooksArgs = {
|
|
|
227
233
|
region?: InputMaybe<Region>;
|
|
228
234
|
};
|
|
229
235
|
|
|
230
|
-
|
|
231
236
|
export type QueryResolveInstrumentsByDivisionArgs = {
|
|
232
237
|
division: Division;
|
|
233
238
|
instruments: Array<InputMaybe<Scalars['String']['input']>>;
|
|
234
239
|
};
|
|
235
240
|
|
|
236
|
-
|
|
237
241
|
export type QuerySentimentArgs = {
|
|
238
242
|
division?: InputMaybe<Division>;
|
|
239
243
|
name: Scalars['String']['input'];
|
|
240
244
|
};
|
|
241
245
|
|
|
242
|
-
|
|
243
246
|
export type QuerySentimentListArgs = {
|
|
244
247
|
division?: InputMaybe<Division>;
|
|
245
248
|
sort?: InputMaybe<Sort>;
|
|
246
249
|
};
|
|
247
250
|
|
|
248
|
-
|
|
249
251
|
export type QueryTopicalInstrumentsArgs = {
|
|
250
252
|
assetClass?: InputMaybe<AssetClassName>;
|
|
251
253
|
count?: InputMaybe<Scalars['Int']['input']>;
|
|
@@ -254,25 +256,21 @@ export type QueryTopicalInstrumentsArgs = {
|
|
|
254
256
|
sort: TopicalSort;
|
|
255
257
|
};
|
|
256
258
|
|
|
257
|
-
|
|
258
259
|
export type QueryTopicalInstrumentsChartsArgs = {
|
|
259
260
|
division?: InputMaybe<Division>;
|
|
260
261
|
instruments?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
261
262
|
};
|
|
262
263
|
|
|
263
|
-
|
|
264
264
|
export type QueryTopicalInstrumentsTotalCountArgs = {
|
|
265
265
|
assetClass?: InputMaybe<AssetClassName>;
|
|
266
266
|
division?: InputMaybe<Division>;
|
|
267
267
|
sort: TopicalSort;
|
|
268
268
|
};
|
|
269
269
|
|
|
270
|
-
|
|
271
270
|
export type QueryValueAtRiskAssetClassesArgs = {
|
|
272
271
|
division?: InputMaybe<Division>;
|
|
273
272
|
};
|
|
274
273
|
|
|
275
|
-
|
|
276
274
|
export type QueryValueAtRiskChartArgs = {
|
|
277
275
|
bars: ValueAtRiskBars;
|
|
278
276
|
division?: InputMaybe<Division>;
|
|
@@ -280,7 +278,6 @@ export type QueryValueAtRiskChartArgs = {
|
|
|
280
278
|
instrument: Scalars['String']['input'];
|
|
281
279
|
};
|
|
282
280
|
|
|
283
|
-
|
|
284
281
|
export type QueryVolatilityChartArgs = {
|
|
285
282
|
division?: InputMaybe<Division>;
|
|
286
283
|
instrument: Scalars['String']['input'];
|
|
@@ -288,7 +285,6 @@ export type QueryVolatilityChartArgs = {
|
|
|
288
285
|
timeUnit: VolatilityChartTimeUnit;
|
|
289
286
|
};
|
|
290
287
|
|
|
291
|
-
|
|
292
288
|
export type QueryVolatilityChartAssetClassesArgs = {
|
|
293
289
|
division?: InputMaybe<Division>;
|
|
294
290
|
};
|
|
@@ -296,7 +292,7 @@ export type QueryVolatilityChartAssetClassesArgs = {
|
|
|
296
292
|
export enum Region {
|
|
297
293
|
Amer = 'AMER',
|
|
298
294
|
Apac = 'APAC',
|
|
299
|
-
Emea = 'EMEA'
|
|
295
|
+
Emea = 'EMEA',
|
|
300
296
|
}
|
|
301
297
|
|
|
302
298
|
export type Sentiment = {
|
|
@@ -315,7 +311,7 @@ export type SentimentInstrument = {
|
|
|
315
311
|
|
|
316
312
|
export enum Sort {
|
|
317
313
|
Bearish = 'BEARISH',
|
|
318
|
-
Bullish = 'BULLISH'
|
|
314
|
+
Bullish = 'BULLISH',
|
|
319
315
|
}
|
|
320
316
|
|
|
321
317
|
export type StrengthRelation = {
|
|
@@ -350,13 +346,13 @@ export enum TopicalSort {
|
|
|
350
346
|
Bullish = 'BULLISH',
|
|
351
347
|
Hot = 'HOT',
|
|
352
348
|
Popular = 'POPULAR',
|
|
353
|
-
Volatile = 'VOLATILE'
|
|
349
|
+
Volatile = 'VOLATILE',
|
|
354
350
|
}
|
|
355
351
|
|
|
356
352
|
export enum ValueAtRiskBars {
|
|
357
353
|
C100 = 'C100',
|
|
358
354
|
C200 = 'C200',
|
|
359
|
-
C300 = 'C300'
|
|
355
|
+
C300 = 'C300',
|
|
360
356
|
}
|
|
361
357
|
|
|
362
358
|
export type ValueAtRiskChart = {
|
|
@@ -386,7 +382,7 @@ export enum ValueAtRiskDuration {
|
|
|
386
382
|
C3 = 'C3',
|
|
387
383
|
C4 = 'C4',
|
|
388
384
|
C5 = 'C5',
|
|
389
|
-
C10 = 'C10'
|
|
385
|
+
C10 = 'C10',
|
|
390
386
|
}
|
|
391
387
|
|
|
392
388
|
export type VolatilityChart = {
|
|
@@ -409,22 +405,108 @@ export enum VolatilityChartTimeSpan {
|
|
|
409
405
|
/** Valid for: W */
|
|
410
406
|
W5 = 'W5',
|
|
411
407
|
/** Valid for: W */
|
|
412
|
-
W10 = 'W10'
|
|
408
|
+
W10 = 'W10',
|
|
413
409
|
}
|
|
414
410
|
|
|
415
411
|
export enum VolatilityChartTimeUnit {
|
|
416
412
|
D = 'D',
|
|
417
413
|
H = 'H',
|
|
418
|
-
W = 'W'
|
|
414
|
+
W = 'W',
|
|
419
415
|
}
|
|
420
416
|
|
|
421
417
|
export type ValidateInstrumentsQueryVariables = Exact<{
|
|
422
|
-
instruments:
|
|
418
|
+
instruments:
|
|
419
|
+
| Array<InputMaybe<Scalars['String']['input']>>
|
|
420
|
+
| InputMaybe<Scalars['String']['input']>;
|
|
423
421
|
division: Division;
|
|
424
422
|
}>;
|
|
425
423
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
424
|
+
export type ValidateInstrumentsQuery = {
|
|
425
|
+
__typename?: 'Query';
|
|
426
|
+
resolveInstrumentsByDivision?: Array<{
|
|
427
|
+
__typename?: 'Instrument';
|
|
428
|
+
name: string;
|
|
429
|
+
displayName: string;
|
|
430
|
+
}> | null;
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
export const ValidateInstrumentsDocument = {
|
|
434
|
+
kind: 'Document',
|
|
435
|
+
definitions: [
|
|
436
|
+
{
|
|
437
|
+
kind: 'OperationDefinition',
|
|
438
|
+
operation: 'query',
|
|
439
|
+
name: { kind: 'Name', value: 'validateInstruments' },
|
|
440
|
+
variableDefinitions: [
|
|
441
|
+
{
|
|
442
|
+
kind: 'VariableDefinition',
|
|
443
|
+
variable: {
|
|
444
|
+
kind: 'Variable',
|
|
445
|
+
name: { kind: 'Name', value: 'instruments' },
|
|
446
|
+
},
|
|
447
|
+
type: {
|
|
448
|
+
kind: 'NonNullType',
|
|
449
|
+
type: {
|
|
450
|
+
kind: 'ListType',
|
|
451
|
+
type: {
|
|
452
|
+
kind: 'NamedType',
|
|
453
|
+
name: { kind: 'Name', value: 'String' },
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
kind: 'VariableDefinition',
|
|
460
|
+
variable: {
|
|
461
|
+
kind: 'Variable',
|
|
462
|
+
name: { kind: 'Name', value: 'division' },
|
|
463
|
+
},
|
|
464
|
+
type: {
|
|
465
|
+
kind: 'NonNullType',
|
|
466
|
+
type: {
|
|
467
|
+
kind: 'NamedType',
|
|
468
|
+
name: { kind: 'Name', value: 'Division' },
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
},
|
|
472
|
+
],
|
|
473
|
+
selectionSet: {
|
|
474
|
+
kind: 'SelectionSet',
|
|
475
|
+
selections: [
|
|
476
|
+
{
|
|
477
|
+
kind: 'Field',
|
|
478
|
+
name: { kind: 'Name', value: 'resolveInstrumentsByDivision' },
|
|
479
|
+
arguments: [
|
|
480
|
+
{
|
|
481
|
+
kind: 'Argument',
|
|
482
|
+
name: { kind: 'Name', value: 'instruments' },
|
|
483
|
+
value: {
|
|
484
|
+
kind: 'Variable',
|
|
485
|
+
name: { kind: 'Name', value: 'instruments' },
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
kind: 'Argument',
|
|
490
|
+
name: { kind: 'Name', value: 'division' },
|
|
491
|
+
value: {
|
|
492
|
+
kind: 'Variable',
|
|
493
|
+
name: { kind: 'Name', value: 'division' },
|
|
494
|
+
},
|
|
495
|
+
},
|
|
496
|
+
],
|
|
497
|
+
selectionSet: {
|
|
498
|
+
kind: 'SelectionSet',
|
|
499
|
+
selections: [
|
|
500
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
|
|
501
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'displayName' } },
|
|
502
|
+
],
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
],
|
|
506
|
+
},
|
|
507
|
+
},
|
|
508
|
+
],
|
|
509
|
+
} as unknown as DocumentNode<
|
|
510
|
+
ValidateInstrumentsQuery,
|
|
511
|
+
ValidateInstrumentsQueryVariables
|
|
512
|
+
>;
|
package/src/gql/types/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './fragment-masking';
|
|
2
|
+
export * from './gql';
|
|
@@ -2,7 +2,10 @@ import { gql } from '@apollo/client';
|
|
|
2
2
|
|
|
3
3
|
export const validateInstruments = gql`
|
|
4
4
|
query validateInstruments($instruments: [String]!, $division: Division!) {
|
|
5
|
-
resolveInstrumentsByDivision(
|
|
5
|
+
resolveInstrumentsByDivision(
|
|
6
|
+
instruments: $instruments
|
|
7
|
+
division: $division
|
|
8
|
+
) {
|
|
6
9
|
name
|
|
7
10
|
displayName
|
|
8
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Translations } from '@oanda/mono-i18n';
|
|
2
|
+
import { Locale } from '@oanda/mono-i18n';
|
|
2
3
|
|
|
3
4
|
import en from './sources/en.json';
|
|
4
|
-
import zhTW from './sources/zh_TW.json';
|
|
5
5
|
import es from './sources/es.json';
|
|
6
6
|
import th from './sources/th.json';
|
|
7
|
-
|
|
8
|
-
import { defaultTranslations } from './translations';
|
|
7
|
+
import zhTW from './sources/zh_TW.json';
|
|
8
|
+
import type { defaultTranslations } from './translations';
|
|
9
9
|
|
|
10
10
|
export type TranslationKey = keyof typeof defaultTranslations;
|
|
11
11
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const defaultTranslations = {
|
|
2
2
|
data_unavailable: 'Data unavailable',
|
|
3
|
-
pagination_entries_range:
|
|
3
|
+
pagination_entries_range:
|
|
4
|
+
'{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries',
|
|
4
5
|
};
|
package/test/Main.test.tsx
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { render } from '@testing-library/react';
|
|
6
4
|
import { MockedProvider } from '@apollo/client/testing';
|
|
7
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
LiveRatesProvider,
|
|
7
|
+
MockLayoutProvider,
|
|
8
|
+
} from '@oanda/labs-widget-common';
|
|
9
|
+
import { render } from '@testing-library/react';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
|
|
8
12
|
import { Main } from '../src/CurrencyCrossTableWidget/Main';
|
|
9
13
|
import { Division } from '../src/gql/types/graphql';
|
|
10
14
|
import { widgetMocks } from './mocks';
|
|
@@ -20,11 +24,19 @@ describe('Main component', () => {
|
|
|
20
24
|
<Main
|
|
21
25
|
currencies={currencies}
|
|
22
26
|
division={Division.Oc}
|
|
23
|
-
validInstruments={[
|
|
27
|
+
validInstruments={[
|
|
28
|
+
'EUR_USD',
|
|
29
|
+
'EUR_GBP',
|
|
30
|
+
'EUR_CHF',
|
|
31
|
+
'USD_GBP',
|
|
32
|
+
'USD_CHF',
|
|
33
|
+
'GBP_CHF',
|
|
34
|
+
'CHF_EUR',
|
|
35
|
+
]}
|
|
24
36
|
/>
|
|
25
37
|
</MockLayoutProvider>
|
|
26
38
|
</LiveRatesProvider>
|
|
27
|
-
</MockedProvider
|
|
39
|
+
</MockedProvider>
|
|
28
40
|
);
|
|
29
41
|
|
|
30
42
|
expect(getByTestId('currency-cross-table-wrapper')).toBeInTheDocument();
|
package/test/mocks.ts
CHANGED
|
@@ -19,7 +19,8 @@ const widgetMocks = [
|
|
|
19
19
|
],
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
|
-
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
23
24
|
request: {
|
|
24
25
|
query: validateInstruments,
|
|
25
26
|
variables: {
|
|
@@ -37,7 +38,8 @@ const widgetMocks = [
|
|
|
37
38
|
],
|
|
38
39
|
},
|
|
39
40
|
},
|
|
40
|
-
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
41
43
|
request: {
|
|
42
44
|
query: validateInstruments,
|
|
43
45
|
variables: {
|
|
@@ -55,7 +57,8 @@ const widgetMocks = [
|
|
|
55
57
|
],
|
|
56
58
|
},
|
|
57
59
|
},
|
|
58
|
-
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
59
62
|
request: {
|
|
60
63
|
query: validateInstruments,
|
|
61
64
|
variables: {
|
|
@@ -73,7 +76,8 @@ const widgetMocks = [
|
|
|
73
76
|
],
|
|
74
77
|
},
|
|
75
78
|
},
|
|
76
|
-
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
77
81
|
request: {
|
|
78
82
|
query: validateInstruments,
|
|
79
83
|
variables: {
|
|
@@ -91,7 +95,8 @@ const widgetMocks = [
|
|
|
91
95
|
],
|
|
92
96
|
},
|
|
93
97
|
},
|
|
94
|
-
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
95
100
|
request: {
|
|
96
101
|
query: validateInstruments,
|
|
97
102
|
variables: {
|
|
@@ -109,7 +114,8 @@ const widgetMocks = [
|
|
|
109
114
|
],
|
|
110
115
|
},
|
|
111
116
|
},
|
|
112
|
-
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
113
119
|
request: {
|
|
114
120
|
query: validateInstruments,
|
|
115
121
|
variables: {
|
|
@@ -127,7 +133,8 @@ const widgetMocks = [
|
|
|
127
133
|
],
|
|
128
134
|
},
|
|
129
135
|
},
|
|
130
|
-
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
131
138
|
request: {
|
|
132
139
|
query: validateInstruments,
|
|
133
140
|
variables: {
|
|
@@ -145,7 +152,8 @@ const widgetMocks = [
|
|
|
145
152
|
],
|
|
146
153
|
},
|
|
147
154
|
},
|
|
148
|
-
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
149
157
|
request: {
|
|
150
158
|
query: validateInstruments,
|
|
151
159
|
variables: {
|
|
@@ -163,7 +171,8 @@ const widgetMocks = [
|
|
|
163
171
|
],
|
|
164
172
|
},
|
|
165
173
|
},
|
|
166
|
-
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
167
176
|
request: {
|
|
168
177
|
query: validateInstruments,
|
|
169
178
|
variables: {
|
|
@@ -181,7 +190,8 @@ const widgetMocks = [
|
|
|
181
190
|
],
|
|
182
191
|
},
|
|
183
192
|
},
|
|
184
|
-
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
185
195
|
request: {
|
|
186
196
|
query: validateInstruments,
|
|
187
197
|
variables: {
|
|
@@ -199,7 +209,8 @@ const widgetMocks = [
|
|
|
199
209
|
],
|
|
200
210
|
},
|
|
201
211
|
},
|
|
202
|
-
},
|
|
212
|
+
},
|
|
213
|
+
{
|
|
203
214
|
request: {
|
|
204
215
|
query: validateInstruments,
|
|
205
216
|
variables: {
|
|
@@ -220,6 +231,4 @@ const widgetMocks = [
|
|
|
220
231
|
},
|
|
221
232
|
];
|
|
222
233
|
|
|
223
|
-
export {
|
|
224
|
-
widgetMocks,
|
|
225
|
-
};
|
|
234
|
+
export { widgetMocks };
|