Skip to content

Commit 963cf8a

Browse files
authored
Merge pull request #1865 from DavidResende0/notification-fix
Fix Notification Drawer in Production
2 parents d08b1b5 + 4a0177c commit 963cf8a

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<span class="subheading-class">{{notificationGroup.unreadCount}} {{'New' | translate}}</span>

client/app/core/core.module.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { ExceptionModule } from './exception/exception.module.js'
2323
import { LanguageFactory } from './language.service.js'
2424
import { ListConfigurationFactory } from './list-configuration.service.js'
2525
import { ListViewFactory } from './list-view.service.js'
26-
import { NavigationController } from './navigation/navigation-controller.js'
26+
import { NavigationController, navigationInit } from './navigation/navigation-controller.js'
2727
import { NavigationFactory } from './navigation.service.js'
2828
import { PollingFactory } from './polling.service.js'
2929
import { RBACFactory } from './rbac.service.js'
@@ -93,4 +93,5 @@ export const CoreModule = angular
9393
.run(authInit)
9494
.run(gettextInit)
9595
.run(layoutInit)
96+
.run(navigationInit)
9697
.name

client/app/core/navigation/navigation-controller.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import heading from '../../components/notifications/heading.html';
2+
import notificationBody from '../../components/notifications/notification-body.html';
3+
import notificationFooter from '../../components/notifications/notification-footer.html';
4+
15
/** @ngInject */
26
export function NavigationController (Text, Navigation, Session, API_BASE, ShoppingCart, $scope, $uibModal, $state, EventNotifications, ApplianceInfo, CollectionsApi, RBAC, Language, lodash, $rootScope, sprintf) {
37
const vm = this
@@ -60,7 +64,6 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
6064
helpMenu: RBAC.hasAny(['about', 'product', 'documentation'])
6165
}
6266
EventNotifications.setToastDisplay(vm.permissions.suiNotifications)
63-
const appBasePath = process.env.NODE_ENV === 'production' ? '' : 'assets/'
6467
angular.extend(vm, {
6568
state: Navigation.state,
6669
text: Text.app,
@@ -72,9 +75,10 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
7275
notificationsDrawerShown: false,
7376
newNotifications: false,
7477
html: {
75-
heading: `${appBasePath}html/heading.html`,
76-
notificationBody: `${appBasePath}html/notification-body.html`,
77-
notificationFooter: `${appBasePath}html/notification-footer.html`,
78+
// injected into templateCache by navigationInit
79+
heading: 'notifications/heading.html',
80+
notificationBody: 'notifications/notification-body.html',
81+
notificationFooter: 'notifications/notification-footer.html',
7882
},
7983
handleItemClick: handleItemClick,
8084
toggleNotificationsList: () => { vm.notificationsDrawerShown = !vm.notificationsDrawerShown },
@@ -250,3 +254,9 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
250254
}
251255
}
252256

257+
/** @ngInject */
258+
export const navigationInit = function($templateCache) {
259+
$templateCache.put('notifications/heading.html', heading);
260+
$templateCache.put('notifications/notification-body.html', notificationBody);
261+
$templateCache.put('notifications/notification-footer.html', notificationFooter);
262+
};

0 commit comments

Comments
 (0)