-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from zakibinary/contract_and_reports_update
zaki/markets_trade_types_toolip_popover
- Loading branch information
Showing
9 changed files
with
125 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
...ules/Reports/Helpers/market-underyling.js → ...ules/Reports/Helpers/market-underlying.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import { getMarketNamesMap, getContractConfig } from 'Constants'; | ||
|
||
export const getMarketInformation = (payload) => { | ||
const market_info = { | ||
category : '', | ||
underlying: '', | ||
}; | ||
|
||
const pattern = new RegExp('^([A-Z]+)_((OTC_[A-Z0-9]+)|R_[\\d]{2,3}|[A-Z]+)_'); // Used to get market name from shortcode | ||
const extracted = pattern.exec(typeof payload === 'string' ? payload : payload.shortcode); | ||
const extracted = pattern.exec(payload.shortcode); | ||
if (extracted !== null) { | ||
market_info.category = extracted[1].toLowerCase(); | ||
market_info.underlying = extracted[2]; | ||
} | ||
|
||
return market_info; | ||
}; | ||
|
||
export const getMarketName = (underlying) => underlying ? getMarketNamesMap()[underlying.toUpperCase()] : null; | ||
|
||
export const getTradeTypeName = (category) => category ? getContractConfig()[category.toUpperCase()].name : null; |
2 changes: 1 addition & 1 deletion
2
src/javascript/app/Stores/Modules/Portfolio/Helpers/format-response.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/javascript/app/Stores/Modules/Profit/Helpers/format-response.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters