Skip to content

Commit

Permalink
Merge pull request #1865 from DavidResende0/notification-fix
Browse files Browse the repository at this point in the history
Fix Notification Drawer in Production
  • Loading branch information
Fryguy authored Sep 27, 2023
2 parents d08b1b5 + 4a0177c commit 963cf8a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions client/app/components/notifications/subheading.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span class="subheading-class">{{notificationGroup.unreadCount}} {{'New' | translate}}</span>
3 changes: 2 additions & 1 deletion client/app/core/core.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { ExceptionModule } from './exception/exception.module.js'
import { LanguageFactory } from './language.service.js'
import { ListConfigurationFactory } from './list-configuration.service.js'
import { ListViewFactory } from './list-view.service.js'
import { NavigationController } from './navigation/navigation-controller.js'
import { NavigationController, navigationInit } from './navigation/navigation-controller.js'
import { NavigationFactory } from './navigation.service.js'
import { PollingFactory } from './polling.service.js'
import { RBACFactory } from './rbac.service.js'
Expand Down Expand Up @@ -93,4 +93,5 @@ export const CoreModule = angular
.run(authInit)
.run(gettextInit)
.run(layoutInit)
.run(navigationInit)
.name
18 changes: 14 additions & 4 deletions client/app/core/navigation/navigation-controller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import heading from '../../components/notifications/heading.html';
import notificationBody from '../../components/notifications/notification-body.html';
import notificationFooter from '../../components/notifications/notification-footer.html';

/** @ngInject */
export function NavigationController (Text, Navigation, Session, API_BASE, ShoppingCart, $scope, $uibModal, $state, EventNotifications, ApplianceInfo, CollectionsApi, RBAC, Language, lodash, $rootScope, sprintf) {
const vm = this
Expand Down Expand Up @@ -60,7 +64,6 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
helpMenu: RBAC.hasAny(['about', 'product', 'documentation'])
}
EventNotifications.setToastDisplay(vm.permissions.suiNotifications)
const appBasePath = process.env.NODE_ENV === 'production' ? '' : 'assets/'
angular.extend(vm, {
state: Navigation.state,
text: Text.app,
Expand All @@ -72,9 +75,10 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
notificationsDrawerShown: false,
newNotifications: false,
html: {
heading: `${appBasePath}html/heading.html`,
notificationBody: `${appBasePath}html/notification-body.html`,
notificationFooter: `${appBasePath}html/notification-footer.html`,
// injected into templateCache by navigationInit
heading: 'notifications/heading.html',
notificationBody: 'notifications/notification-body.html',
notificationFooter: 'notifications/notification-footer.html',
},
handleItemClick: handleItemClick,
toggleNotificationsList: () => { vm.notificationsDrawerShown = !vm.notificationsDrawerShown },
Expand Down Expand Up @@ -250,3 +254,9 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
}
}

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

0 comments on commit 963cf8a

Please sign in to comment.