-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: colocate segment events (#2840)
* refactor: segment events refactoring * refactor: alternative refactoring variant for event segments * refactor: some refactoring * refactor: refactoring after review * refactor: refactoring after review * refactor: refactoring after review * refactor: corrected settings changed event * refactor: added segment constant for component generator
- Loading branch information
1 parent
de070d2
commit e3a34e1
Showing
14 changed files
with
105 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* Events are identified by the following structured pattern: | ||
* openedx.paragon.event_environment.event_name.event_action | ||
*/ | ||
|
||
export const ICON_COPIED_EVENT = 'openedx.paragon.docs.icons-table.selected-icon.copied'; | ||
export const LEAVE_FEEDBACK_CLICKED_EVENT = 'openedx.paragon.docs.leave-feedback.clicked'; | ||
export const CONTRAST_CHECKER_CLICKED_EVENT = 'openedx.paragon.docs.menu.tools.visit-contrast-checker.clicked'; | ||
export const PAGE_EDIT_BTN_CLICKED_EVENT = 'openedx.paragon.docs.page-edit.clicked'; | ||
export const COMPONENT_GENERATED_EVENT = 'openedx.paragon.functions.track-generate-component.created'; | ||
|
||
export const PLAYGROUND_EVENTS = { | ||
LINK_CLICKED: 'openedx.paragon.docs.menu.playground.visit-playground.clicked', | ||
URL_COPIED: 'openedx.paragon.docs.playground.copy-url.copied', | ||
}; | ||
|
||
export const SHADOW_GENERATOR_LAYER_EVENTS = { | ||
ENABLED: 'openedx.paragon.docs.elevation.shadow-generator.layer.enabled', | ||
DISABLED: 'openedx.paragon.docs.elevation.shadow-generator.layer.disabled', | ||
REMOVED: 'openedx.paragon.docs.elevation.shadow-generator.layer.removed', | ||
ADDED: 'openedx.paragon.docs.elevation.shadow-generator.layer.added', | ||
UPDATED: 'openedx.paragon.docs.elevation.shadow-generator.layer.updated', | ||
}; | ||
|
||
export const SETTINGS_EVENTS = { | ||
OPENED: 'openedx.paragon.docs.settings.opened', | ||
CLOSED: 'openedx.paragon.docs.settings.closed', | ||
CHANGED: 'openedx.paragon.docs.setting.changed', | ||
}; | ||
|
||
export const EXAMPLE_CODE_BLOCK_WITH_HEADING_EVENTS = { | ||
CLOSED: 'openedx.paragon.docs.example-code-block.closed', | ||
OPENED: 'openedx.paragon.docs.example-code-block.opened', | ||
}; | ||
|
||
export const EXAMPLE_CODE_BLOCK_WITHOUT_HEADING_EVENTS = { | ||
CLOSED: 'openedx.paragon.docs.example-code-block.without-heading.closed', | ||
OPENED: 'openedx.paragon.docs.example-code-block.without-heading.opened', | ||
}; | ||
|
||
export const USAGE_INSIGHTS_EVENTS = { | ||
TAB_CLICKED: 'openedx.paragon.docs.usage-insights.tab.clicked', | ||
COMPONENT_LINK_CLICKED: 'openedx.paragon.docs.usage-insights.component-usage-link.clicked', | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './constants'; | ||
|
||
export { sendUserAnalyticsEvent } from './utils'; |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function sendUserAnalyticsEvent(eventName, context) { | ||
if (context) { | ||
return global.analytics.track(eventName, context); | ||
} | ||
return global.analytics.track(eventName); | ||
} | ||
|
||
module.exports = { sendUserAnalyticsEvent }; |
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
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
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