Skip to content

Commit

Permalink
Merge pull request #110 from shafin-deriv/shafin/DAPI/chore-align-fea…
Browse files Browse the repository at this point in the history
…ture-translation-to-master

Shafin/dapi/chore align feature translation to master
  • Loading branch information
shafin-deriv authored Sep 2, 2024
2 parents a852162 + 7c8a08d commit daa00ba
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 32 deletions.
3 changes: 2 additions & 1 deletion config/v3/mt5_new_account/send.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@
"p01_ts03",
"p01_ts04",
"p02_ts02",
"p03_ts01"
"p03_ts01",
"p03_ts02"
]
},
"state": {
Expand Down
5 changes: 5 additions & 0 deletions config/v3/partner_settings/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"company"
]
},
"platform_URL": {
"description": "Platform URL for Dynamic works dashboard to be redirected from Partners Hub which will be set in BackOffice.",
"type": "string",
"pattern": "^[\\w_@./:#&+-]*$"
},
"provider": {
"description": "Defines the provider platform.",
"type": "string",
Expand Down
43 changes: 39 additions & 4 deletions config/v3/proposal/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"description": "[Only for vanilla options] The choices of predefined strike price for client to choose",
"type": "array"
},
"barrier_spot_distance": {
"description": "[Only for Turbos] The relative distance between current spot and the barrier.",
"type": "string"
},
"cancellation": {
"description": "Contains information about contract cancellation option.",
"type": "object",
Expand Down Expand Up @@ -202,8 +206,15 @@
"description": "Localized display name",
"type": "string"
},
"display_order_amount": {
"description": "Stop loss amount for display purpose.",
"type": [
"null",
"string"
]
},
"order_amount": {
"description": "Stop loss amount",
"description": "Stop loss amount. Will be deprecated soon. Please use [display_order_amount].",
"type": [
"null",
"number"
Expand Down Expand Up @@ -231,9 +242,19 @@
"description": "Localized display name",
"type": "string"
},
"display_order_amount": {
"description": "Stop out amount for display purpose.",
"type": [
"null",
"string"
]
},
"order_amount": {
"description": "Stop out amount",
"type": "number"
"description": "Stop out amount. Will be deprecated soon. Please use [display_order_amount].",
"type": [
"null",
"number"
]
},
"order_date": {
"description": "Stop out order epoch",
Expand All @@ -254,8 +275,15 @@
"description": "Localized display name",
"type": "string"
},
"display_order_amount": {
"description": "Take profit amount for display purpose.",
"type": [
"null",
"string"
]
},
"order_amount": {
"description": "Take profit amount",
"description": "Take profit amount. Will be deprecated soon. Please use [display_order_amount].",
"type": [
"null",
"number"
Expand Down Expand Up @@ -299,6 +327,13 @@
10
]
},
"payout_choices": {
"description": "[Only for Turbos] The choices of predefined payout per point for client to choose",
"type": "array",
"items": {
"type": "string"
}
},
"spot": {
"description": "Spot value (if there are no Exchange data-feed licensing restrictions for the underlying symbol).",
"type": "number",
Expand Down
32 changes: 28 additions & 4 deletions config/v3/proposal_open_contract/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,15 @@
"description": "Localized display name",
"type": "string"
},
"display_order_amount": {
"description": "Stop loss amount for display purpose.",
"type": [
"null",
"string"
]
},
"order_amount": {
"description": "Stop loss amount",
"description": "Stop loss amount. Will be deprecated soon. Please use [display_order_amount].",
"type": [
"null",
"number"
Expand Down Expand Up @@ -546,9 +553,19 @@
"description": "Localized display name",
"type": "string"
},
"display_order_amount": {
"description": "Stop out amount for display purpose.",
"type": [
"null",
"string"
]
},
"order_amount": {
"description": "Stop out amount",
"type": "number"
"description": "Stop out amount. Will be deprecated soon. Please use [display_order_amount].",
"type": [
"null",
"number"
]
},
"order_date": {
"description": "Stop out order epoch",
Expand All @@ -569,8 +586,15 @@
"description": "Localized display name",
"type": "string"
},
"display_order_amount": {
"description": "Take profit amount for display purpose.",
"type": [
"null",
"string"
]
},
"order_amount": {
"description": "Take profit amount",
"description": "Take profit amount. Will be deprecated soon. Please use [display_order_amount].",
"type": [
"null",
"number"
Expand Down
3 changes: 2 additions & 1 deletion config/v3/trading_servers/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
"p01_ts03",
"p01_ts04",
"p02_ts02",
"p03_ts01"
"p03_ts01",
"p03_ts02"
]
},
"market_type": {
Expand Down
61 changes: 39 additions & 22 deletions src/features/Apiexplorer/Dropdown/DropdownList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import clsx from 'clsx';
import styles from './DropdownList.module.scss';
import Translate from '@docusaurus/Translate';

type TOption = {
name: string;
title: string;
body: Record<string, any>;
};

type TDropdownList = {
selected: string;
setSelected: (value: string) => void;
Expand All @@ -14,14 +20,29 @@ type TDropdownList = {
setSearchResults: (result: string) => void;
};

const DropdownList = ({
const filterOptions = (options: Record<string, any>, query: string) => {
query = query.toLowerCase();
return Object.values(options).filter((option: TOption) => {
const title = option.title.toLowerCase();
const firstKey = Object.keys(option.body)[0];

if (title.includes(query) || (firstKey && firstKey.toLowerCase().includes(query))) {
return true;
}
return false;
});
};

const DropdownList: React.FC<TDropdownList> = ({
setSelected,
handleChange,
setIsActive,
searchResults,
setSearchResults,
selected_value,
}: TDropdownList) => {
}) => {
const filteredOptions = filterOptions(playground_requests, searchResults);

return (
<div>
<input
Expand All @@ -44,26 +65,22 @@ const DropdownList = ({
<Translate>ALL CALLS</Translate>
</span>
</div>
{playground_requests
.filter((option) => {
return option.title.toLowerCase().includes(searchResults.toLowerCase()) ? option : null;
})
.map((option) => (
<div
key={option.name}
onClick={(e) => {
setSelected(option.title);
setIsActive(false);
handleChange(e, option.name);
}}
className={clsx(styles.dropdownItem, {
[styles.dropdownSelected]: selected_value === option.title,
})}
data-testid={`apiDropdownItems{option.name}`}
>
{option.title}
</div>
))}
{filteredOptions.map((option) => (
<div
key={option.name}
onClick={(e) => {
setSelected(option.title);
setIsActive(false);
handleChange(e, option.name);
}}
className={clsx(styles.dropdownItem, {
[styles.dropdownSelected]: selected_value === option.title,
})}
data-testid={`apiDropdownItems${option.name}`}
>
{option.title}
</div>
))}
</div>
</div>
);
Expand Down

0 comments on commit daa00ba

Please sign in to comment.