Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4079 from ncloudioj/bz1451749
Browse files Browse the repository at this point in the history
Fix Bug 1451749 - make events compatible with UT event telemetry
  • Loading branch information
ncloudioj committed Apr 5, 2018
2 parents f26e883 + ad887db commit 72f0c56
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Expand Up @@ -20,7 +20,7 @@ export class Disclaimer extends React.PureComponent {

onAcknowledge() {
this.props.dispatch(ac.SetPref(this.props.disclaimerPref, false));
this.props.dispatch(ac.UserEvent({event: "SECTION_DISCLAIMER_ACKNOWLEDGED", source: this.props.eventSource}));
this.props.dispatch(ac.UserEvent({event: "DISCLAIMER_ACKED", source: this.props.eventSource}));
}

render() {
Expand Down
16 changes: 8 additions & 8 deletions system-addon/content-src/lib/section-menu-options.js
Expand Up @@ -13,7 +13,7 @@ export const SectionMenuOptions = {
type: at.SECTION_MOVE,
data: {id: section.id, direction: -1}
}),
userEvent: "SECTION_MENU_MOVE_UP",
userEvent: "MENU_MOVE_UP",
disabled: !!section.isFirst
}),
MoveDown: section => ({
Expand All @@ -23,38 +23,38 @@ export const SectionMenuOptions = {
type: at.SECTION_MOVE,
data: {id: section.id, direction: +1}
}),
userEvent: "SECTION_MENU_MOVE_DOWN",
userEvent: "MENU_MOVE_DOWN",
disabled: !!section.isLast
}),
RemoveSection: section => ({
id: "section_menu_action_remove_section",
icon: "dismiss",
action: ac.SetPref(section.showPrefName, false),
userEvent: "SECTION_MENU_REMOVE"
userEvent: "MENU_REMOVE"
}),
CollapseSection: section => ({
id: "section_menu_action_collapse_section",
icon: "minimize",
action: ac.OnlyToMain({type: at.UPDATE_SECTION_PREFS, data: {id: section.id, value: {collapsed: true}}}),
userEvent: "SECTION_MENU_COLLAPSE"
userEvent: "MENU_COLLAPSE"
}),
ExpandSection: section => ({
id: "section_menu_action_expand_section",
icon: "maximize",
action: ac.OnlyToMain({type: at.UPDATE_SECTION_PREFS, data: {id: section.id, value: {collapsed: false}}}),
userEvent: "SECTION_MENU_EXPAND"
userEvent: "MENU_EXPAND"
}),
ManageSection: section => ({
id: "section_menu_action_manage_section",
icon: "settings",
action: ac.OnlyToMain({type: at.SETTINGS_OPEN}),
userEvent: "SECTION_MENU_MANAGE"
userEvent: "MENU_MANAGE"
}),
AddTopSite: section => ({
id: "section_menu_action_add_topsite",
icon: "add",
action: {type: at.TOP_SITES_EDIT, data: {index: -1}},
userEvent: "SECTION_MENU_ADD_TOPSITE"
userEvent: "MENU_ADD_TOPSITE"
}),
PrivacyNotice: section => ({
id: "section_menu_action_privacy_notice",
Expand All @@ -63,7 +63,7 @@ export const SectionMenuOptions = {
type: at.OPEN_LINK,
data: {url: section.privacyNoticeURL}
}),
userEvent: "SECTION_MENU_PRIVACY_NOTICE"
userEvent: "MENU_PRIVACY_NOTICE"
}),
CheckCollapsed: section => (section.collapsed ? SectionMenuOptions.ExpandSection(section) : SectionMenuOptions.CollapseSection(section))
};
16 changes: 8 additions & 8 deletions system-addon/test/schemas/pings.js
Expand Up @@ -79,15 +79,15 @@ export const UserEventAction = Joi.object().keys({
"PREVIEW_REQUEST",
"UNPIN",
"SAVE_TO_POCKET",
"SECTION_MENU_MOVE_UP",
"SECTION_MENU_MOVE_DOWN",
"MENU_MOVE_UP",
"MENU_MOVE_DOWN",
"SCREENSHOT_REQUEST",
"SECTION_MENU_REMOVE",
"SECTION_MENU_COLLAPSE",
"SECTION_MENU_EXPAND",
"SECTION_MENU_MANAGE",
"SECTION_MENU_ADD_TOPSITE",
"SECTION_MENU_PRIVACY_NOTICE",
"MENU_REMOVE",
"MENU_COLLAPSE",
"MENU_EXPAND",
"MENU_MANAGE",
"MENU_ADD_TOPSITE",
"MENU_PRIVACY_NOTICE",
"DELETE_FROM_POCKET",
"ARCHIVE_FROM_POCKET"
]).required(),
Expand Down
Expand Up @@ -181,6 +181,6 @@ describe("<Disclaimer>", () => {
wrapper.find(".section-disclaimer").childAt(1).simulate("click");
assert.calledTwice(dispatch);
assert.calledWith(dispatch.firstCall, ac.SetPref("section.test.showDisclaimer", false));
assert.calledWith(dispatch.secondCall, ac.UserEvent({event: "SECTION_DISCLAIMER_ACKNOWLEDGED", source: "test"}));
assert.calledWith(dispatch.secondCall, ac.UserEvent({event: "DISCLAIMER_ACKED", source: "test"}));
});
});

0 comments on commit 72f0c56

Please sign in to comment.