Skip to content

Commit daa00ba

Browse files
authored
Merge pull request #110 from shafin-deriv/shafin/DAPI/chore-align-feature-translation-to-master
Shafin/dapi/chore align feature translation to master
2 parents a852162 + 7c8a08d commit daa00ba

File tree

6 files changed

+115
-32
lines changed

6 files changed

+115
-32
lines changed

config/v3/mt5_new_account/send.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@
155155
"p01_ts03",
156156
"p01_ts04",
157157
"p02_ts02",
158-
"p03_ts01"
158+
"p03_ts01",
159+
"p03_ts02"
159160
]
160161
},
161162
"state": {

config/v3/partner_settings/receive.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
"company"
3434
]
3535
},
36+
"platform_URL": {
37+
"description": "Platform URL for Dynamic works dashboard to be redirected from Partners Hub which will be set in BackOffice.",
38+
"type": "string",
39+
"pattern": "^[\\w_@./:#&+-]*$"
40+
},
3641
"provider": {
3742
"description": "Defines the provider platform.",
3843
"type": "string",

config/v3/proposal/receive.json

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
"description": "[Only for vanilla options] The choices of predefined strike price for client to choose",
3636
"type": "array"
3737
},
38+
"barrier_spot_distance": {
39+
"description": "[Only for Turbos] The relative distance between current spot and the barrier.",
40+
"type": "string"
41+
},
3842
"cancellation": {
3943
"description": "Contains information about contract cancellation option.",
4044
"type": "object",
@@ -202,8 +206,15 @@
202206
"description": "Localized display name",
203207
"type": "string"
204208
},
209+
"display_order_amount": {
210+
"description": "Stop loss amount for display purpose.",
211+
"type": [
212+
"null",
213+
"string"
214+
]
215+
},
205216
"order_amount": {
206-
"description": "Stop loss amount",
217+
"description": "Stop loss amount. Will be deprecated soon. Please use [display_order_amount].",
207218
"type": [
208219
"null",
209220
"number"
@@ -231,9 +242,19 @@
231242
"description": "Localized display name",
232243
"type": "string"
233244
},
245+
"display_order_amount": {
246+
"description": "Stop out amount for display purpose.",
247+
"type": [
248+
"null",
249+
"string"
250+
]
251+
},
234252
"order_amount": {
235-
"description": "Stop out amount",
236-
"type": "number"
253+
"description": "Stop out amount. Will be deprecated soon. Please use [display_order_amount].",
254+
"type": [
255+
"null",
256+
"number"
257+
]
237258
},
238259
"order_date": {
239260
"description": "Stop out order epoch",
@@ -254,8 +275,15 @@
254275
"description": "Localized display name",
255276
"type": "string"
256277
},
278+
"display_order_amount": {
279+
"description": "Take profit amount for display purpose.",
280+
"type": [
281+
"null",
282+
"string"
283+
]
284+
},
257285
"order_amount": {
258-
"description": "Take profit amount",
286+
"description": "Take profit amount. Will be deprecated soon. Please use [display_order_amount].",
259287
"type": [
260288
"null",
261289
"number"
@@ -299,6 +327,13 @@
299327
10
300328
]
301329
},
330+
"payout_choices": {
331+
"description": "[Only for Turbos] The choices of predefined payout per point for client to choose",
332+
"type": "array",
333+
"items": {
334+
"type": "string"
335+
}
336+
},
302337
"spot": {
303338
"description": "Spot value (if there are no Exchange data-feed licensing restrictions for the underlying symbol).",
304339
"type": "number",

config/v3/proposal_open_contract/receive.json

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,15 @@
517517
"description": "Localized display name",
518518
"type": "string"
519519
},
520+
"display_order_amount": {
521+
"description": "Stop loss amount for display purpose.",
522+
"type": [
523+
"null",
524+
"string"
525+
]
526+
},
520527
"order_amount": {
521-
"description": "Stop loss amount",
528+
"description": "Stop loss amount. Will be deprecated soon. Please use [display_order_amount].",
522529
"type": [
523530
"null",
524531
"number"
@@ -546,9 +553,19 @@
546553
"description": "Localized display name",
547554
"type": "string"
548555
},
556+
"display_order_amount": {
557+
"description": "Stop out amount for display purpose.",
558+
"type": [
559+
"null",
560+
"string"
561+
]
562+
},
549563
"order_amount": {
550-
"description": "Stop out amount",
551-
"type": "number"
564+
"description": "Stop out amount. Will be deprecated soon. Please use [display_order_amount].",
565+
"type": [
566+
"null",
567+
"number"
568+
]
552569
},
553570
"order_date": {
554571
"description": "Stop out order epoch",
@@ -569,8 +586,15 @@
569586
"description": "Localized display name",
570587
"type": "string"
571588
},
589+
"display_order_amount": {
590+
"description": "Take profit amount for display purpose.",
591+
"type": [
592+
"null",
593+
"string"
594+
]
595+
},
572596
"order_amount": {
573-
"description": "Take profit amount",
597+
"description": "Take profit amount. Will be deprecated soon. Please use [display_order_amount].",
574598
"type": [
575599
"null",
576600
"number"

config/v3/trading_servers/receive.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@
7575
"p01_ts03",
7676
"p01_ts04",
7777
"p02_ts02",
78-
"p03_ts01"
78+
"p03_ts01",
79+
"p03_ts02"
7980
]
8081
},
8182
"market_type": {

src/features/Apiexplorer/Dropdown/DropdownList/index.tsx

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import clsx from 'clsx';
44
import styles from './DropdownList.module.scss';
55
import Translate from '@docusaurus/Translate';
66

7+
type TOption = {
8+
name: string;
9+
title: string;
10+
body: Record<string, any>;
11+
};
12+
713
type TDropdownList = {
814
selected: string;
915
setSelected: (value: string) => void;
@@ -14,14 +20,29 @@ type TDropdownList = {
1420
setSearchResults: (result: string) => void;
1521
};
1622

17-
const DropdownList = ({
23+
const filterOptions = (options: Record<string, any>, query: string) => {
24+
query = query.toLowerCase();
25+
return Object.values(options).filter((option: TOption) => {
26+
const title = option.title.toLowerCase();
27+
const firstKey = Object.keys(option.body)[0];
28+
29+
if (title.includes(query) || (firstKey && firstKey.toLowerCase().includes(query))) {
30+
return true;
31+
}
32+
return false;
33+
});
34+
};
35+
36+
const DropdownList: React.FC<TDropdownList> = ({
1837
setSelected,
1938
handleChange,
2039
setIsActive,
2140
searchResults,
2241
setSearchResults,
2342
selected_value,
24-
}: TDropdownList) => {
43+
}) => {
44+
const filteredOptions = filterOptions(playground_requests, searchResults);
45+
2546
return (
2647
<div>
2748
<input
@@ -44,26 +65,22 @@ const DropdownList = ({
4465
<Translate>ALL CALLS</Translate>
4566
</span>
4667
</div>
47-
{playground_requests
48-
.filter((option) => {
49-
return option.title.toLowerCase().includes(searchResults.toLowerCase()) ? option : null;
50-
})
51-
.map((option) => (
52-
<div
53-
key={option.name}
54-
onClick={(e) => {
55-
setSelected(option.title);
56-
setIsActive(false);
57-
handleChange(e, option.name);
58-
}}
59-
className={clsx(styles.dropdownItem, {
60-
[styles.dropdownSelected]: selected_value === option.title,
61-
})}
62-
data-testid={`apiDropdownItems{option.name}`}
63-
>
64-
{option.title}
65-
</div>
66-
))}
68+
{filteredOptions.map((option) => (
69+
<div
70+
key={option.name}
71+
onClick={(e) => {
72+
setSelected(option.title);
73+
setIsActive(false);
74+
handleChange(e, option.name);
75+
}}
76+
className={clsx(styles.dropdownItem, {
77+
[styles.dropdownSelected]: selected_value === option.title,
78+
})}
79+
data-testid={`apiDropdownItems${option.name}`}
80+
>
81+
{option.title}
82+
</div>
83+
))}
6784
</div>
6885
</div>
6986
);

0 commit comments

Comments
 (0)