-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maryia/dtra-369/Send chart events using stateChangeListener for analytics collection #1439
Changes from 24 commits
d960caf
1e47460
ce5492d
4814974
5b18f1f
6aa4022
0fca774
79ea276
1e053ee
582a225
2c565df
483b066
7f7aeed
4603a2a
e45a521
a10dfff
73570e6
2ad7bbc
ee0eea6
2fe0f12
2e45c0f
75cfd84
32722ff
40a4490
f13f208
b3cfd72
ab6d6d5
67d9432
c8924af
0cd7e29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ import ReactDOM from 'react-dom'; | |
import { TProcessedSymbolItem } from 'src/binaryapi/ActiveSymbols'; | ||
import { useStores } from 'src/store'; | ||
import { TOpenMarket } from 'src/types'; | ||
import { getSymbolMarketCategory } from 'src/utils'; | ||
import { STATE } from 'src/Constant'; | ||
import '../../sass/components/_chart-title.scss'; | ||
import { CategoricalDisplay } from './categoricaldisplay'; | ||
import Menu from './Menu'; | ||
|
@@ -21,9 +23,8 @@ export type TChartTitleProps = { | |
}; | ||
|
||
const ChartTitle = (props: TChartTitleProps) => { | ||
const { chartTitle, chart, chartSetting } = useStores(); | ||
const { chartTitle, chart, chartSetting, state } = useStores(); | ||
const { isMobile } = chart; | ||
|
||
const { theme } = chartSetting; | ||
const { | ||
menuStore, | ||
|
@@ -36,7 +37,6 @@ const ChartTitle = (props: TChartTitleProps) => { | |
} = chartTitle; | ||
const onChange = props.onChange || setSymbol; | ||
const setMenuOpen = menuStore.setOpen; | ||
|
||
const { containerId, enabled, portalNodeId, searchInputClassName, open, open_market, isNestedList } = props; | ||
|
||
React.useEffect(() => { | ||
|
@@ -68,9 +68,14 @@ const ChartTitle = (props: TChartTitleProps) => { | |
store={categoricalDisplay} | ||
isNestedList={isNestedList} | ||
searchInputClassName={searchInputClassName} | ||
onSelectItem={(x: TProcessedSymbolItem) => { | ||
if (x.symbol !== currentSymbol.symbol) { | ||
onChange(x.symbol); | ||
onSelectItem={(symbol_object: TProcessedSymbolItem, category_id: string) => { | ||
if (symbol_object.symbol !== currentSymbol.symbol) { | ||
onChange(symbol_object.symbol); | ||
state.stateChange(STATE.SYMBOL_CHANGE, { | ||
tab_market_name: | ||
category_id === 'favorite' ? 'favorites' : getSymbolMarketCategory(symbol_object), | ||
market_type_name: symbol_object.symbol, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. im just wondering why are we setting market_type_name to symbol name? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @henry-deriv it's because we need to send it in this form to rudderstack via deriv-app. I can either call this property straight the way it needs to go to analytics and have less logic in deriv-app - it's what I do know, or name it in the way we want here and rename this properties later when they are received inside deriv-app. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @henry-deriv marketing team has their own names for all this :)) hm, I think I can change it here, and rename the property in deriv-app PR before we send it to rudderstack There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds good |
||
}); | ||
} | ||
setMenuOpen(false); | ||
}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referring to this it could also be
symbol_market_category
name instead oftab_market_name
https://github.com/binary-com/deriv-app/pull/9848/files#r1316656672There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@henry-deriv Please see this comment in the related deriv-app deriv-com/deriv-app#9848 (comment)
I stuck to the properties requested by marketing.
Here I explain what options we have: #1439 (comment)