From c3303952e8f8a89b8378b3bc0ed50634b5a6f7e2 Mon Sep 17 00:00:00 2001 From: Erik Kieckhafer Date: Tue, 16 May 2017 10:44:57 -0700 Subject: [PATCH 1/3] update Router to adjust when shop URL is in provided data --- imports/plugins/core/router/lib/router.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/imports/plugins/core/router/lib/router.js b/imports/plugins/core/router/lib/router.js index 4e1ec2f0550..f8202c0a75f 100644 --- a/imports/plugins/core/router/lib/router.js +++ b/imports/plugins/core/router/lib/router.js @@ -141,12 +141,18 @@ Router.pathFor = (path, options = {}) => { Router.go = (path, params, query) => { - const actualPath = Router.pathFor(path, { - hash: { - ...params, - query - } - }); + let actualPath; + + if (typeof path === "string" && path.startsWith("/")) { + actualPath = path; + } else { + actualPath = Router.pathFor(path, { + hash: { + ...params, + query + } + }); + } if (window) { history.push(actualPath); From 7bab62c3981098cf022ee95b7a532bb5882aa803 Mon Sep 17 00:00:00 2001 From: Erik Kieckhafer Date: Tue, 16 May 2017 10:45:11 -0700 Subject: [PATCH 2/3] update notification onClick to open dashboard panel when needed --- .../client/components/notificationDropdown.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/imports/plugins/included/notifications/client/components/notificationDropdown.js b/imports/plugins/included/notifications/client/components/notificationDropdown.js index 5b31aa0dfe4..242af02846b 100644 --- a/imports/plugins/included/notifications/client/components/notificationDropdown.js +++ b/imports/plugins/included/notifications/client/components/notificationDropdown.js @@ -27,8 +27,15 @@ class NotificationDropdown extends Component { } handleClick(notify) { - const { markOneAsRead } = this.props; - return markOneAsRead(notify._id); + if (notify.type === "forAdmin") { + const actionViewData = Reaction.Apps({ + name: "reaction-orders", + provides: "dashboard" + }); + Reaction.showActionView(actionViewData); + } else { + return Reaction.Router.go(notify.url); + } } renderDropdownHead() { @@ -61,7 +68,7 @@ class NotificationDropdown extends Component { const i18n = `notifications.messages.${notify.type}`; return (
  • - { + { this.handleClick(notify); }} > From 163e6d478f0bc2e6d0724781827d86f049ce4a40 Mon Sep 17 00:00:00 2001 From: Erik Kieckhafer Date: Tue, 16 May 2017 10:46:44 -0700 Subject: [PATCH 3/3] re-add markOneAsRead --- .../notifications/client/components/notificationDropdown.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imports/plugins/included/notifications/client/components/notificationDropdown.js b/imports/plugins/included/notifications/client/components/notificationDropdown.js index 242af02846b..c51cd608bfc 100644 --- a/imports/plugins/included/notifications/client/components/notificationDropdown.js +++ b/imports/plugins/included/notifications/client/components/notificationDropdown.js @@ -34,8 +34,11 @@ class NotificationDropdown extends Component { }); Reaction.showActionView(actionViewData); } else { - return Reaction.Router.go(notify.url); + Reaction.Router.go(notify.url); } + + const { markOneAsRead } = this.props; + return markOneAsRead(notify._id); } renderDropdownHead() {