From 3af4eabea7b909829eb59bac7de506fe9eefde86 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 5 Apr 2022 19:55:01 +0300 Subject: [PATCH] [Library & Monitor Dashboard | new-theme]: Small update on notifications & filters offcanvas. 1. shadow.css: Added variable --shadow-main-dark. 2. offcanvas.css: a. Set --offcanvas-shadow: var(--shadow-main-dark); b. In class .offcanvas-switcher remove transition (will not be visible when offcanvas is open) c. [Bug fix] In class .offcanvas-count increased font size and make background always round, added line-height: 20px. d. In rule ".offcanvas .uk-offcanvas-bar" set border-radius to 4px. 3. notification-utils.ts: Full stop added in messages. 4. notification-sidebar.component.css: In rule "#notifications .notification-list ul" set height: calc(100% - 77px). 5. notifications-sidebar.component.ts: a. Removed anything related to offcavnas events b. Removed commented code c. Added in icons visuallyHidden. 6. monitor.component.html: a. Removed "open" class when offcanvas is open. b. Added in icons visuallyHidden c. Added sign in link in filters when user is not logged in d. Added uk-text-small class in "Clear". 7. monitor.component.ts: a. Removed anything related to offcavnas events b. Added method "logIn()". --- notifications/notification-utils.ts | 12 ++-- .../notification-sidebar.component.css | 2 +- .../notifications-sidebar.component.ts | 61 +++---------------- 3 files changed, 15 insertions(+), 60 deletions(-) diff --git a/notifications/notification-utils.ts b/notifications/notification-utils.ts index 9979aeb3..16e249ac 100644 --- a/notifications/notification-utils.ts +++ b/notifications/notification-utils.ts @@ -3,12 +3,12 @@ import {HelperFunctions} from "../utils/HelperFunctions.class"; import {Composer} from "../utils/email/composer"; export class NotificationUtils { - public static IMPORT_INDICATORS: Notification = new Notification('IMPORT', ['monitor'], 'User ((__user__)) has imported new indicators in ((__stakeholder__)) profile', 'section') - public static CREATE_STAKEHOLDER: Notification = new Notification('CREATE', ['monitor'], 'User ((__user__)) has created a new profile', 'stakeholder') - public static EDIT_STAKEHOLDER: Notification = new Notification('EDIT', ['monitor'], 'User ((__user__)) has updated ((__stakeholder__)) profile', 'stakeholder') - public static CREATE_INDICATOR: Notification = new Notification('CREATE', ['monitor'], 'User ((__user__)) has created a new indicator in ((__stakeholder__)) profile', 'indicator'); - public static EDIT_INDICATOR: Notification = new Notification('EDIT', ['monitor'], 'User ((__user__)) has updated an indicator in ((__stakeholder__)) profile', 'indicator'); - public static DELETE_INDICATOR: Notification = new Notification('DELETE', ['monitor'], 'User ((__user__)) has deleted an indicator in ((__stakeholder__)) profile', 'indicator'); + public static IMPORT_INDICATORS: Notification = new Notification('IMPORT', ['monitor'], 'User ((__user__)) has imported new indicators in ((__stakeholder__)) profile.', 'section') + public static CREATE_STAKEHOLDER: Notification = new Notification('CREATE', ['monitor'], 'User ((__user__)) has created a new profile.', 'stakeholder') + public static EDIT_STAKEHOLDER: Notification = new Notification('EDIT', ['monitor'], 'User ((__user__)) has updated ((__stakeholder__)) profile.', 'stakeholder') + public static CREATE_INDICATOR: Notification = new Notification('CREATE', ['monitor'], 'User ((__user__)) has created a new indicator in ((__stakeholder__)) profile.', 'indicator'); + public static EDIT_INDICATOR: Notification = new Notification('EDIT', ['monitor'], 'User ((__user__)) has updated an indicator in ((__stakeholder__)) profile.', 'indicator'); + public static DELETE_INDICATOR: Notification = new Notification('DELETE', ['monitor'], 'User ((__user__)) has deleted an indicator in ((__stakeholder__)) profile.', 'indicator'); public static INVITE_MONITOR_MANAGER: Notification = new Notification('INVITE_MANAGER', ['monitor'], null, 'user'); public static INVITE_MONITOR_MEMBER: Notification = new Notification('INVITE_MEMBER', ['monitor'], null, 'user'); diff --git a/notifications/notifications-sidebar/notification-sidebar.component.css b/notifications/notifications-sidebar/notification-sidebar.component.css index 29063d36..8b26695e 100644 --- a/notifications/notifications-sidebar/notification-sidebar.component.css +++ b/notifications/notifications-sidebar/notification-sidebar.component.css @@ -14,7 +14,7 @@ #notifications .notification-list ul { overflow: auto; padding: 10px 45px 10px 0; - height: calc(100% - 66px); + height: calc(100% - 77px); } #notifications .notification-list ul > li:nth-child(n+2){ diff --git a/notifications/notifications-sidebar/notifications-sidebar.component.ts b/notifications/notifications-sidebar/notifications-sidebar.component.ts index 797d6437..b0dd9365 100644 --- a/notifications/notifications-sidebar/notifications-sidebar.component.ts +++ b/notifications/notifications-sidebar/notifications-sidebar.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation} from "@angular/core"; +import {Component, Input, OnDestroy, OnInit, ViewEncapsulation} from "@angular/core"; import {Notification} from "../notifications"; import {NotificationService} from "../notification.service"; import {Subscription} from "rxjs"; @@ -11,33 +11,16 @@ declare var UIkit; @Component({ selector: 'notification-sidebar', template: ` -
- - - - +
+ + {{unreadCount}}
- - - - - - - - - -
- - - @@ -60,7 +43,7 @@ declare var UIkit;

- +
{{getDate(notification.date)}} @@ -74,7 +57,7 @@ declare var UIkit;
- +

{{notification.title}}

@@ -106,10 +89,8 @@ export class NotificationsSidebarComponent implements OnInit, OnDestroy { public service: string; public notification: Notification; private subscriptions: any[] = []; - public notificationsOpen: boolean = false; - // public notificationsStatus: string = "closed"; - constructor(private notificationService: NotificationService, private cdr: ChangeDetectorRef) { + constructor(private notificationService: NotificationService) { } ngOnInit() { @@ -123,31 +104,6 @@ export class NotificationsSidebarComponent implements OnInit, OnDestroy { pos: 'bottom-right' }); })); - - UIkit.util.on('#notifications', 'beforeshow', () => { - // do something - console.log("notifications beforeshow..."); - this.notificationsOpen = true; - this.cdr.detectChanges(); - // self.notificationsStatus = "opening"; - - }); - - // UIkit.util.on('#notifications', 'shown', function () { - // // do something - // console.log("notifications open"); - // self.notificationsStatus = "open"; - // - // }); - - UIkit.util.on('#notifications', 'beforehide', () => { - // do something - console.log("notifications beforehide..."); - this.notificationsOpen = false; - this.cdr.detectChanges(); - - // self.notificationsStatus = "closing"; - }); } ngOnDestroy() { @@ -156,7 +112,6 @@ export class NotificationsSidebarComponent implements OnInit, OnDestroy { subscription.unsubscribe(); } }) - // UIkit.util.$destroy(); } get unreadCount(): number {