Skip to content

Commit

Permalink
solve issue #486
Browse files Browse the repository at this point in the history
  • Loading branch information
bengaid committed Jan 13, 2025
1 parent e5844a5 commit dd125aa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 171 deletions.

This file was deleted.

26 changes: 16 additions & 10 deletions front-end/source/angular/modules/libs/notification/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ export function XdashNotifications() {
var $body = angular.element(document.body);
var $rootScope = $body.scope().$root;
$rootScope.PnotifyStatus = false;
var enablePnotify = true;

function Pnotify(notificationObject) {
let notice = new PNotify({
title: notificationObject.title,
text: notificationObject.text,
type: notificationObject.type,
delay: 1800,
styling: 'bootstrap3',
});
$('.ui-pnotify-container').on('click', function () {
notice.remove();
});
if ( $rootScope.navBarNotification==false ) {
enablePnotify = false;
}
if (enablePnotify) {
let notice = new PNotify({
title: notificationObject.title,
text: notificationObject.text,
type: notificationObject.type,
delay: 1800,
styling: 'bootstrap3',
});
$('.ui-pnotify-container').on('click', function () {
notice.remove();
});
}
}

const self = {
Expand Down
1 change: 0 additions & 1 deletion front-end/source/kernel/runtime/xdash-load-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ angularModule.run([
'$rootScope',
function ($rootScope) {
$rootScope.urlBase = urlBase; // TODO
$rootScope.navBarNotification = window.dashboardConfig?.navBarNotification === 'true'; //AEF: visible if show notifications is checked // TODO
$rootScope.notificationFilterDataValue = '';
$rootScope.listNotifications = [];
$rootScope.nbNotifications = 0;
Expand Down
2 changes: 2 additions & 0 deletions front-end/source/kernel/runtime/xdash-runtime-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ export function loadDashboard(jsonContent) {
try {
const dataJson = processJsonContent(jsonContent);
window.dashboardConfig = getDashboardConfig();
const $rootScope = angular.element(document.body).scope().$root;
$rootScope.navBarNotification = window.dashboardConfig?.navBarNotification == true;

if (jsonContent.pages?.pageNames?.length) {
initPageRuntime(jsonContent.pages);
Expand Down

0 comments on commit dd125aa

Please sign in to comment.