@posiwise/dashboard-module 0.0.86 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/index.mjs +16 -0
- package/esm2022/lib/customizer/customizer.component.mjs +17 -0
- package/esm2022/lib/dashboard.module.mjs +101 -0
- package/esm2022/lib/faq/faq.component.mjs +108 -0
- package/esm2022/lib/faq-details/faq-details.component.mjs +38 -0
- package/esm2022/lib/footer/footer.component.mjs +22 -0
- package/esm2022/lib/home/home.component.mjs +79 -0
- package/esm2022/lib/navbar/navbar.component.mjs +162 -0
- package/esm2022/lib/notifications-page/current-notifications/current-notifications.component.mjs +58 -0
- package/esm2022/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.mjs +73 -0
- package/esm2022/lib/notifications-page/notifications-page.component.mjs +14 -0
- package/esm2022/lib/search/search.component.mjs +48 -0
- package/esm2022/lib/sidebar/sidebar-routes.config.mjs +350 -0
- package/esm2022/lib/sidebar/sidebar.metadata.mjs +2 -0
- package/esm2022/lib/user-feedback/user-feedback.component.mjs +73 -0
- package/esm2022/lib/user-notifications/user-notifications.component.mjs +65 -0
- package/esm2022/posiwise-dashboard-module.mjs +5 -0
- package/fesm2022/posiwise-dashboard-module.mjs +1118 -0
- package/fesm2022/posiwise-dashboard-module.mjs.map +1 -0
- package/{src/index.ts → index.d.ts} +0 -1
- package/lib/customizer/customizer.component.d.ts +7 -0
- package/lib/dashboard.module.d.ts +28 -0
- package/lib/faq/faq.component.d.ts +37 -0
- package/lib/faq-details/faq-details.component.d.ts +16 -0
- package/lib/footer/footer.component.d.ts +12 -0
- package/lib/home/home.component.d.ts +18 -0
- package/lib/navbar/navbar.component.d.ts +35 -0
- package/lib/notifications-page/current-notifications/current-notifications.component.d.ts +17 -0
- package/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.d.ts +18 -0
- package/lib/notifications-page/notifications-page.component.d.ts +5 -0
- package/lib/search/search.component.d.ts +24 -0
- package/lib/sidebar/sidebar-routes.config.d.ts +64 -0
- package/{src/lib/sidebar/sidebar.metadata.ts → lib/sidebar/sidebar.metadata.d.ts} +0 -1
- package/lib/user-feedback/user-feedback.component.d.ts +24 -0
- package/lib/user-notifications/user-notifications.component.d.ts +20 -0
- package/package.json +23 -10
- package/.eslintrc.json +0 -21
- package/ng-package.json +0 -15
- package/project.json +0 -72
- package/src/lib/customizer/customizer.component.html +0 -184
- package/src/lib/customizer/customizer.component.scss +0 -101
- package/src/lib/customizer/customizer.component.ts +0 -13
- package/src/lib/dashboard.module.ts +0 -63
- package/src/lib/faq/faq.component.html +0 -110
- package/src/lib/faq/faq.component.scss +0 -58
- package/src/lib/faq/faq.component.spec.ts +0 -143
- package/src/lib/faq/faq.component.ts +0 -144
- package/src/lib/faq-details/faq-details.component.html +0 -21
- package/src/lib/faq-details/faq-details.component.scss +0 -3
- package/src/lib/faq-details/faq-details.component.spec.ts +0 -69
- package/src/lib/faq-details/faq-details.component.ts +0 -38
- package/src/lib/footer/footer.component.html +0 -14
- package/src/lib/footer/footer.component.spec.ts +0 -42
- package/src/lib/footer/footer.component.ts +0 -24
- package/src/lib/home/home.component.html +0 -93
- package/src/lib/home/home.component.scss +0 -0
- package/src/lib/home/home.component.spec.ts +0 -69
- package/src/lib/home/home.component.ts +0 -88
- package/src/lib/navbar/navbar.component.html +0 -189
- package/src/lib/navbar/navbar.component.scss +0 -92
- package/src/lib/navbar/navbar.component.spec.ts +0 -76
- package/src/lib/navbar/navbar.component.ts +0 -198
- package/src/lib/notifications-page/current-notifications/current-notifications.component.html +0 -61
- package/src/lib/notifications-page/current-notifications/current-notifications.component.spec.ts +0 -57
- package/src/lib/notifications-page/current-notifications/current-notifications.component.ts +0 -63
- package/src/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.html +0 -65
- package/src/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.spec.ts +0 -71
- package/src/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.ts +0 -79
- package/src/lib/notifications-page/notifications-page.component.html +0 -24
- package/src/lib/notifications-page/notifications-page.component.scss +0 -28
- package/src/lib/notifications-page/notifications-page.component.spec.ts +0 -26
- package/src/lib/notifications-page/notifications-page.component.ts +0 -8
- package/src/lib/search/search.component.html +0 -215
- package/src/lib/search/search.component.scss +0 -98
- package/src/lib/search/search.component.spec.ts +0 -64
- package/src/lib/search/search.component.ts +0 -50
- package/src/lib/sidebar/sidebar-routes.config.ts +0 -355
- package/src/lib/user-feedback/user-feedback.component.html +0 -53
- package/src/lib/user-feedback/user-feedback.component.scss +0 -18
- package/src/lib/user-feedback/user-feedback.component.spec.ts +0 -54
- package/src/lib/user-feedback/user-feedback.component.ts +0 -83
- package/src/lib/user-notifications/user-notifications.component.html +0 -21
- package/src/lib/user-notifications/user-notifications.component.scss +0 -21
- package/src/lib/user-notifications/user-notifications.component.spec.ts +0 -47
- package/src/lib/user-notifications/user-notifications.component.ts +0 -74
- package/tsconfig.json +0 -30
- package/tsconfig.lib.json +0 -19
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -11
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<pw-user-feedback></pw-user-feedback>
|
|
2
|
-
<div class="row mt-3">
|
|
3
|
-
<div class="col-12 col-lg-6 mt-2 mb-4">
|
|
4
|
-
<div class="card">
|
|
5
|
-
<div class="card-content p-0">
|
|
6
|
-
<div class="card-header d-flex mt-0">
|
|
7
|
-
<div class="w-100">
|
|
8
|
-
<div id="cards"></div>
|
|
9
|
-
<h3 class="mb-3">{{'ManageYourAccount'|transloco}}</h3>
|
|
10
|
-
<p>{{'ManageYourAccountDescription'|transloco}}</p>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="ms-3 img-wrapper">
|
|
13
|
-
<img src="assets/img/products/hyper-dashboard/ManageYourAccount.png"
|
|
14
|
-
alt="img"
|
|
15
|
-
class="img-fluid" />
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="card-footer px-3">
|
|
19
|
-
<a routerLink="/account/details"
|
|
20
|
-
class="d-block">{{'ManageYourAccount'|transloco}}</a>
|
|
21
|
-
</div>
|
|
22
|
-
<div id="tips-onboarding-step2"></div>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
<div class="col-12 col-lg-6 mt-2 mb-4">
|
|
27
|
-
<div class="card">
|
|
28
|
-
<div class="card-content p-0">
|
|
29
|
-
<div class="card-header d-flex mt-0">
|
|
30
|
-
<div class="w-100">
|
|
31
|
-
<h3 class="mb-3">{{'UpdateYourProfile'|transloco}}</h3>
|
|
32
|
-
<p>{{'UpdateYourProfileDescription'|transloco}}</p>
|
|
33
|
-
</div>
|
|
34
|
-
<div class="ms-3 img-wrapper">
|
|
35
|
-
<img src="assets/img/products/hyper-dashboard/UpdateYourProfile.png"
|
|
36
|
-
alt="img"
|
|
37
|
-
class="img-fluid" />
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
<div class="card-footer px-3">
|
|
41
|
-
<a [routerLink]="['/members', userSlug]"
|
|
42
|
-
class="d-block">{{'UpdateYourProfile'|transloco}}</a>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
<div class="col-12 col-lg-6 mt-2 mb-4">
|
|
48
|
-
<div class="card">
|
|
49
|
-
<div class="card-content p-0">
|
|
50
|
-
<div class="card-header d-flex mt-0">
|
|
51
|
-
<div class="w-100">
|
|
52
|
-
<h3 class="mb-3">{{'CommunicationSettings'|transloco}}</h3>
|
|
53
|
-
<p>
|
|
54
|
-
{{'CommunicationSettingsDescription'|transloco}}
|
|
55
|
-
</p>
|
|
56
|
-
</div>
|
|
57
|
-
<div class="ms-3 img-wrapper">
|
|
58
|
-
<img src="assets/img/products/hyper-dashboard/CommunicationSettings.png"
|
|
59
|
-
alt="img"
|
|
60
|
-
class="img-fluid" />
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
<div class="card-footer px-3">
|
|
64
|
-
<a routerLink="/settings/communication"
|
|
65
|
-
class="d-block">{{'GotoCommunicationSettings'|transloco}}</a>
|
|
66
|
-
</div>
|
|
67
|
-
<div id="tips-onboarding-step3"></div>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
<div class="col-12 col-lg-6 mt-2 mb-4">
|
|
72
|
-
<div class="card">
|
|
73
|
-
<div class="card-content p-0">
|
|
74
|
-
<div class="card-header d-flex mt-0">
|
|
75
|
-
<div class="w-100">
|
|
76
|
-
<h3 class="mb-3">{{'NeedHelp'|transloco}}</h3>
|
|
77
|
-
<p>{{'NeedHelpDescription'|transloco}}</p>
|
|
78
|
-
</div>
|
|
79
|
-
<div class="ms-3 img-wrapper">
|
|
80
|
-
<img src="assets/img/products/hyper-dashboard/NeedHelp.png"
|
|
81
|
-
alt="img"
|
|
82
|
-
class="img-fluid" />
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
<div class="card-footer px-3">
|
|
86
|
-
<a [routerLink]="'/' + selectedSubscriptionSlug + '/faq'"
|
|
87
|
-
class="d-block">{{'SeeAllOurFaq'|transloco}}</a>
|
|
88
|
-
</div>
|
|
89
|
-
<div id="tips-onboarding-step4"></div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
File without changes
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { TestBed } from "@angular/core/testing";
|
|
2
|
-
import { CommonService, CommonServicesModule, UserService } from "@posiwise/common-services";
|
|
3
|
-
import { DEFAULT_USER, TestHelper } from "@posiwise/test-helpers";
|
|
4
|
-
import { MockProvider } from "ng-mocks";
|
|
5
|
-
import { SharedModule } from "@posiwise/shared-module";
|
|
6
|
-
import { of } from "rxjs";
|
|
7
|
-
import { HomeComponent } from "./home.component";
|
|
8
|
-
import { DashboardLibModule } from "../dashboard.module";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class UserServiceMock {
|
|
12
|
-
getUserState() {
|
|
13
|
-
return of({ currentUser: DEFAULT_USER });
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
postTipsDisregarded() {
|
|
17
|
-
return of({});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
getCurrentUserObject() {
|
|
21
|
-
return of([
|
|
22
|
-
{
|
|
23
|
-
id: 1,
|
|
24
|
-
active: true,
|
|
25
|
-
name: 'welcome',
|
|
26
|
-
deleted_at: null,
|
|
27
|
-
created_at: '2021-07-31T12:28:48.503+00:00',
|
|
28
|
-
updated_at: '2021-07-31T12:28:48.503+00:00',
|
|
29
|
-
instructions:
|
|
30
|
-
'{"steps":[{"title": "Step 1", "content":"PosiWise welcomes you on board", "target": "cards", "placement": "top"}, {"title":"Step 2","content": "We have great features to showcase", "target":"cards", "placement":"top", "showPrevButton":true}, {"title":"Step 3", "content": "Get Help", "target":"step3", "placement":"top", "showPrevButton":true}]}'
|
|
31
|
-
}
|
|
32
|
-
]);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
describe('HomeComponent', () => {
|
|
36
|
-
const createComponent = TestHelper.createComponentFactory({
|
|
37
|
-
component: HomeComponent,
|
|
38
|
-
imports: [ SharedModule,CommonServicesModule,DashboardLibModule],
|
|
39
|
-
providers: [
|
|
40
|
-
...TestHelper.TEST_PROVIDERS,
|
|
41
|
-
MockProvider(CommonService, {
|
|
42
|
-
userLoginNotification: () => of({}),
|
|
43
|
-
feedbackQuestions: () => of([])
|
|
44
|
-
}),
|
|
45
|
-
{
|
|
46
|
-
provide: UserService,
|
|
47
|
-
useClass: UserServiceMock
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
beforeEach(() => {
|
|
53
|
-
TestHelper.setUpPermissionsAndUser();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
xit('should create', async () => {
|
|
57
|
-
const spectator = await createComponent();
|
|
58
|
-
expect(spectator.component).toBeTruthy();
|
|
59
|
-
const service = TestBed.inject(UserService);
|
|
60
|
-
const spy = spyOn(service, 'postTipsDisregarded').and.callThrough();
|
|
61
|
-
await TestHelper.stabilize(spectator);
|
|
62
|
-
spectator.click(spectator.query('.hopscotch-next', { root: true }));
|
|
63
|
-
await TestHelper.stabilize(spectator);
|
|
64
|
-
spectator.click(spectator.query('.hopscotch-next', { root: true }));
|
|
65
|
-
await TestHelper.stabilize(spectator);
|
|
66
|
-
spectator.click(spectator.query('.hopscotch-next', { root: true }));
|
|
67
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
4
|
-
import { User } from '@posiwise/common-utilities';
|
|
5
|
-
import { PermissionService, ScriptLoaderService } from '@posiwise/common-services';
|
|
6
|
-
|
|
7
|
-
declare let window: { hopscotch: any };
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'pw-home',
|
|
11
|
-
templateUrl: './home.component.html',
|
|
12
|
-
styleUrls: ['./home.component.scss']
|
|
13
|
-
})
|
|
14
|
-
export class HomeComponent extends AppBaseComponent implements OnInit, OnDestroy {
|
|
15
|
-
user: User;
|
|
16
|
-
|
|
17
|
-
private tour = {
|
|
18
|
-
id: 'dashboard',
|
|
19
|
-
steps: []
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
userSlug: string;
|
|
23
|
-
|
|
24
|
-
componentActive = true;
|
|
25
|
-
|
|
26
|
-
selectedSubscriptionSlug: string;
|
|
27
|
-
|
|
28
|
-
constructor(injector: Injector, private scriptLoader: ScriptLoaderService) {
|
|
29
|
-
super(injector);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
ngOnInit() {
|
|
33
|
-
this.selectedSubscriptionSlug = PermissionService.selectedSubscription?.slug;
|
|
34
|
-
this.userStore().subscribe(state => {
|
|
35
|
-
if (state) {
|
|
36
|
-
this.userService.getCurrentUserObject('active_tips').subscribe(response => {
|
|
37
|
-
if (response?.length) {
|
|
38
|
-
const welcomeTips = response.find(x => x.name === 'welcome');
|
|
39
|
-
|
|
40
|
-
if (welcomeTips) {
|
|
41
|
-
this.tour.steps = JSON.parse(welcomeTips.instructions).steps;
|
|
42
|
-
|
|
43
|
-
this.scriptLoader
|
|
44
|
-
.loadScript('head', '/assets/js/hopscotch.min.js', true)
|
|
45
|
-
.then(() => {
|
|
46
|
-
window.hopscotch.startTour(this.tour);
|
|
47
|
-
// eslint-disable-next-line func-names
|
|
48
|
-
window.hopscotch.nextStep = function () {
|
|
49
|
-
const stepNumber = $('.hopscotch-bubble-number').text();
|
|
50
|
-
|
|
51
|
-
if (this.tour.steps.length === Number(stepNumber)) {
|
|
52
|
-
this.userService
|
|
53
|
-
.postTipsDisregarded({
|
|
54
|
-
tip_id: welcomeTips.id,
|
|
55
|
-
disregarded: true
|
|
56
|
-
})
|
|
57
|
-
.subscribe(() => {
|
|
58
|
-
window?.hopscotch?.endTour();
|
|
59
|
-
});
|
|
60
|
-
} else {
|
|
61
|
-
window.hopscotch.showStep(Number(stepNumber));
|
|
62
|
-
}
|
|
63
|
-
}.bind(this);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
this.userStore().subscribe({
|
|
72
|
-
next: user => {
|
|
73
|
-
this.user = user;
|
|
74
|
-
if (this.user) {
|
|
75
|
-
this.userSlug = user.slug;
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
error: error => this.toast.showToast(error)
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
override ngOnDestroy() {
|
|
83
|
-
if (window?.hopscotch) {
|
|
84
|
-
window?.hopscotch?.endTour();
|
|
85
|
-
}
|
|
86
|
-
super.ngOnDestroy();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
<!-- Navbar (Header) Starts -->
|
|
2
|
-
<nav class="navbar navbar-expand-lg navbar-light fixed-top bg-faded shadow-sm">
|
|
3
|
-
<div class="container-fluid">
|
|
4
|
-
<div class="navbar-header">
|
|
5
|
-
<button type="button"
|
|
6
|
-
class="navbar-toggle d-lg-none float-start"
|
|
7
|
-
data-bs-toggle="collapse">
|
|
8
|
-
<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span>
|
|
9
|
-
<span class="icon-bar"></span>
|
|
10
|
-
<span class="icon-bar"></span>
|
|
11
|
-
</button>
|
|
12
|
-
<form class="navbar-form navbar-right mt-1"
|
|
13
|
-
role="search"
|
|
14
|
-
(ngSubmit)="onSearch(search)">
|
|
15
|
-
<div class="input-group navbar-search-input">
|
|
16
|
-
<input type="text"
|
|
17
|
-
#search
|
|
18
|
-
class="form-control"
|
|
19
|
-
placeholder="Search" />
|
|
20
|
-
<button class="input-group-text btn"
|
|
21
|
-
type="submit">
|
|
22
|
-
<i class="ft-search" aria-hidden="true"></i>
|
|
23
|
-
</button>
|
|
24
|
-
</div>
|
|
25
|
-
<div id="tips-onboarding-step6"></div>
|
|
26
|
-
</form>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="logo-img">
|
|
29
|
-
<ng-template [ngIf]="logo">
|
|
30
|
-
<img [src]="logo.full"
|
|
31
|
-
onerror="this.onerror=null;this.src='assets/img/logos/logo_text_big_dark.png';"
|
|
32
|
-
alt="img" />
|
|
33
|
-
</ng-template>
|
|
34
|
-
</div>
|
|
35
|
-
<div *rbacAllow="'SuperAdmin'">
|
|
36
|
-
<div class="mb-0">
|
|
37
|
-
<select class="form-select form-control-sm"
|
|
38
|
-
data-flag="true"
|
|
39
|
-
(change)="onLangChange($event.target.value)">
|
|
40
|
-
<option value="en">English</option>
|
|
41
|
-
<option value="es">Spanish</option>
|
|
42
|
-
<option value="de">German</option>
|
|
43
|
-
<option value="pt">Portuguese</option>
|
|
44
|
-
</select>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
<div class="navbar-container">
|
|
48
|
-
<div id="navbarSupportedContent">
|
|
49
|
-
<ul class="navbar-nav">
|
|
50
|
-
<li class="nav-item"
|
|
51
|
-
ngbDropdown
|
|
52
|
-
#notiDrop="ngbDropdown"
|
|
53
|
-
placement="bottom-left"
|
|
54
|
-
autoClose="true">
|
|
55
|
-
<a class="nav-link position-relative"
|
|
56
|
-
id="dropdownBasic2"
|
|
57
|
-
ngbDropdownToggle
|
|
58
|
-
(click)="checkNoti()">
|
|
59
|
-
<i
|
|
60
|
-
class="ft-bell font-medium-3 blue-grey darken-4"
|
|
61
|
-
aria-hidden="true"
|
|
62
|
-
></i>
|
|
63
|
-
<span class="notification badge rounded-pill bg-danger"
|
|
64
|
-
*ngIf="notificationCount > 0">
|
|
65
|
-
{{ notificationCount }}
|
|
66
|
-
</span>
|
|
67
|
-
<p class="d-none">Notifications</p>
|
|
68
|
-
</a>
|
|
69
|
-
<div id="tips-onboarding-step5"></div>
|
|
70
|
-
<div ngbDropdownMenu
|
|
71
|
-
aria-labelledby="dropdownBasic2"
|
|
72
|
-
class="notification-dropdown">
|
|
73
|
-
<div class="noti-list"
|
|
74
|
-
*ngIf="noNoti === false">
|
|
75
|
-
<li *ngFor="let noti of notifications; let idx = index"
|
|
76
|
-
#notiRef
|
|
77
|
-
[id]="'noti' + idx"
|
|
78
|
-
[pTooltip]="noti?.content"
|
|
79
|
-
tooltipPosition="top"
|
|
80
|
-
class="dropdown-item noti-container border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center">
|
|
81
|
-
<div class="d-flex justify-content-between w-100">
|
|
82
|
-
<div>
|
|
83
|
-
<div class="btn btn-circle me-3"
|
|
84
|
-
[ngClass]="{
|
|
85
|
-
'btn-danger':
|
|
86
|
-
noti.note_type === 'administrative',
|
|
87
|
-
'btn-secondary':
|
|
88
|
-
noti.note_type === 'object_event',
|
|
89
|
-
'btn-primary':
|
|
90
|
-
noti.note_type === 'user_generated'
|
|
91
|
-
}">
|
|
92
|
-
<i
|
|
93
|
-
class="fal float-start"
|
|
94
|
-
[ngClass]="{
|
|
95
|
-
'fa-bell':
|
|
96
|
-
noti.note_type === 'administrative',
|
|
97
|
-
'fa-share-alt':
|
|
98
|
-
noti.note_type === 'object_event',
|
|
99
|
-
'fa-bells':
|
|
100
|
-
noti.note_type === 'user_generated'
|
|
101
|
-
}"
|
|
102
|
-
aria-hidden="true"
|
|
103
|
-
></i>
|
|
104
|
-
</div>
|
|
105
|
-
<div class="d-inline-block text-truncate noti-content">
|
|
106
|
-
{{ noti?.content }}
|
|
107
|
-
<span class="noti-text d-block">
|
|
108
|
-
<span class="fal fa-clock"></span>
|
|
109
|
-
{{ noti?.created_at | sinceAgo }}
|
|
110
|
-
</span>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
<div>
|
|
114
|
-
<a (click)="dismiss(noti.id, $event)">
|
|
115
|
-
<i class="far fa-times" aria-hidden="true"></i></a>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
</li>
|
|
119
|
-
</div>
|
|
120
|
-
<div class="noti-list"
|
|
121
|
-
*ngIf="noNoti === true">
|
|
122
|
-
<a class="dropdown-item noti-container border-bottom border-bottom-blue-grey border-bottom-lighten-4">
|
|
123
|
-
<i
|
|
124
|
-
class="ft-bell success float-start d-block font-large-1 mt-1 me-2"
|
|
125
|
-
aria-hidden="true"
|
|
126
|
-
></i>
|
|
127
|
-
<span class="noti-wrapper">
|
|
128
|
-
<span class="noti-title line-height-1 d-block success">You are all caught up.</span>
|
|
129
|
-
<span class="noti-text">You currently do not have any notifications.</span>
|
|
130
|
-
</span>
|
|
131
|
-
</a>
|
|
132
|
-
</div>
|
|
133
|
-
<a (click)="redirectToNotification()"
|
|
134
|
-
class="noti-footer text-center d-block border-top border-top-blue-grey border-top-lighten-4 text-bold-400 p-3">Read All Notifications</a>
|
|
135
|
-
</div>
|
|
136
|
-
</li>
|
|
137
|
-
<li class="nav-item"
|
|
138
|
-
ngbDropdown
|
|
139
|
-
placement="bottom-left"
|
|
140
|
-
autoClose="true">
|
|
141
|
-
<button class="nav-link position-relative dropdown-toggle"
|
|
142
|
-
type="button"
|
|
143
|
-
id="dropdownBasic3"
|
|
144
|
-
data-bs-toggle="dropdown"
|
|
145
|
-
aria-haspopup="true"
|
|
146
|
-
aria-expanded="false"
|
|
147
|
-
style="border: none">
|
|
148
|
-
<i
|
|
149
|
-
class="ft-user font-medium-3 blue-grey darken-4"
|
|
150
|
-
aria-hidden="true"
|
|
151
|
-
></i>
|
|
152
|
-
<p class="d-none">User Settings</p>
|
|
153
|
-
</button>
|
|
154
|
-
<div ngbDropdownMenu
|
|
155
|
-
aria-labelledby="dropdownBasic3">
|
|
156
|
-
<button class="dropdown-item py-2"
|
|
157
|
-
[routerLink]="['/members', slug]">
|
|
158
|
-
<i class="ft-edit me-2" aria-hidden="true"></i>
|
|
159
|
-
<span>My Profile</span>
|
|
160
|
-
</button>
|
|
161
|
-
<button class="dropdown-item py-2"
|
|
162
|
-
routerLink="/account/details">
|
|
163
|
-
<i class="ft-user me-2" aria-hidden="true"></i> <span>Account</span>
|
|
164
|
-
</button>
|
|
165
|
-
<button class="dropdown-item py-2"
|
|
166
|
-
routerLink="/settings/communication">
|
|
167
|
-
<i class="ft-settings me-2" aria-hidden="true"></i>
|
|
168
|
-
<span>Settings</span>
|
|
169
|
-
</button>
|
|
170
|
-
<button *ngIf="isSupportMenu"
|
|
171
|
-
class="dropdown-item py-2"
|
|
172
|
-
routerLink="/support">
|
|
173
|
-
<i class="fa fa-question me-2" aria-hidden="true"></i>
|
|
174
|
-
<span> Support</span>
|
|
175
|
-
</button>
|
|
176
|
-
<div class="dropdown-divider"></div>
|
|
177
|
-
<button class="dropdown-item logout"
|
|
178
|
-
(click)="logout()">
|
|
179
|
-
<i class="fa fa-sign-out-alt me-2" aria-hidden="true"></i>
|
|
180
|
-
<span>Logout</span>
|
|
181
|
-
</button>
|
|
182
|
-
</div>
|
|
183
|
-
</li>
|
|
184
|
-
</ul>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
</div>
|
|
188
|
-
</nav>
|
|
189
|
-
<!-- Navbar (Header) Ends -->
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
.navbar,
|
|
2
|
-
.fixed-top {
|
|
3
|
-
position: fixed !important;
|
|
4
|
-
background-color: rgb(255 255 255);
|
|
5
|
-
padding: 0 30px 5px;
|
|
6
|
-
height: 45px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.mb-0 {
|
|
10
|
-
margin-bottom: -4px !important;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.navbar-nav > li {
|
|
14
|
-
margin-right: 20px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.logo-img {
|
|
18
|
-
img {
|
|
19
|
-
margin-right: 15px;
|
|
20
|
-
max-height: 30px;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.logo-text {
|
|
25
|
-
color: rgb(0 0 0);
|
|
26
|
-
display: block;
|
|
27
|
-
font-size: 1.4rem;
|
|
28
|
-
font-weight: 400;
|
|
29
|
-
letter-spacing: 2px;
|
|
30
|
-
padding: 5px 0;
|
|
31
|
-
text-align: left;
|
|
32
|
-
text-transform: uppercase;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.dropdown-menu {
|
|
36
|
-
left: auto;
|
|
37
|
-
right: 0;
|
|
38
|
-
z-index: 25000 !important;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.noti-container {
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.noti-content {
|
|
46
|
-
vertical-align: top !important;
|
|
47
|
-
width: 280px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.noti-container,
|
|
51
|
-
.icon-dismiss {
|
|
52
|
-
padding: 15px;
|
|
53
|
-
position: relative;
|
|
54
|
-
z-index: 9;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.noti-list {
|
|
58
|
-
max-height: 400px;
|
|
59
|
-
overflow: auto;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.nav-link {
|
|
63
|
-
background-color: rgb(255 255 255);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@media screen and (max-width: 991px) {
|
|
67
|
-
.navbar {
|
|
68
|
-
padding: 0 30px 5px;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@media screen and (max-width: 575px) {
|
|
73
|
-
.navbar {
|
|
74
|
-
padding: 0 15px 5px 10px;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@media screen and (max-width: 575px) {
|
|
79
|
-
.noti-content {
|
|
80
|
-
width: 250px;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@media only screen and (max-width: 480px) {
|
|
85
|
-
.logo-img {
|
|
86
|
-
max-width: 100px;
|
|
87
|
-
|
|
88
|
-
img {
|
|
89
|
-
width: 100%;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { TestBed } from "@angular/core/testing";
|
|
2
|
-
import { Store } from "@ngrx/store";
|
|
3
|
-
import { PermissionService, NotificationService, UserService, CommonServicesModule } from "@posiwise/common-services";
|
|
4
|
-
import { DEFAULT_USER, TestHelper } from "@posiwise/test-helpers";
|
|
5
|
-
import { MockProvider } from "ng-mocks";
|
|
6
|
-
import { of } from "rxjs";
|
|
7
|
-
import { NavbarComponent } from "./navbar.component";
|
|
8
|
-
import { SharedModule } from "@posiwise/shared-module";
|
|
9
|
-
import { DashboardLibModule } from "../dashboard.module";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class UserServiceMock {
|
|
13
|
-
getUserState() {
|
|
14
|
-
return of({ currentUser: DEFAULT_USER });
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
describe('NavbarComponent', () => {
|
|
18
|
-
const data = [
|
|
19
|
-
{
|
|
20
|
-
id: 1,
|
|
21
|
-
note_type: 'administrative',
|
|
22
|
-
content: 'test',
|
|
23
|
-
created_at: '2021-11-26T10:13:10.687+00:00',
|
|
24
|
-
updated_at: '2021-11-26T10:13:10.687+00:00',
|
|
25
|
-
show_on_dashboard: true,
|
|
26
|
-
dismissed: false,
|
|
27
|
-
unread: null
|
|
28
|
-
}
|
|
29
|
-
];
|
|
30
|
-
const createComponent = TestHelper.createComponentFactory({
|
|
31
|
-
component: NavbarComponent,
|
|
32
|
-
imports: [SharedModule,CommonServicesModule,DashboardLibModule],
|
|
33
|
-
providers: [
|
|
34
|
-
...TestHelper.TEST_PROVIDERS,
|
|
35
|
-
MockProvider(PermissionService, {
|
|
36
|
-
evaluatePermissions: () => {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
}),
|
|
40
|
-
MockProvider(NotificationService, {
|
|
41
|
-
getNotifications: () => of(data),
|
|
42
|
-
notiWebSocket: () => of(data),
|
|
43
|
-
dismissNotification: () => of(JSON.stringify(data)),
|
|
44
|
-
readNotifications: () => of({}),
|
|
45
|
-
showNotifications: () => {}
|
|
46
|
-
}),
|
|
47
|
-
{
|
|
48
|
-
provide: UserService,
|
|
49
|
-
useClass: UserServiceMock
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
beforeEach(() => {
|
|
55
|
-
TestHelper.setUpPermissionsAndUser();
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('should create', async () => {
|
|
59
|
-
const store = TestBed.inject(Store);
|
|
60
|
-
spyOn(store, 'select').and.returnValue(of({ currentUser: DEFAULT_USER }));
|
|
61
|
-
const spectator = await createComponent();
|
|
62
|
-
expect(spectator.component).toBeTruthy();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('should dismiss notification', async () => {
|
|
66
|
-
const store = TestBed.inject(Store);
|
|
67
|
-
spyOn(store, 'select').and.returnValue(of({ currentUser: DEFAULT_USER }));
|
|
68
|
-
const service = TestBed.inject(NotificationService);
|
|
69
|
-
const spy = spyOn(service, 'dismissNotification').and.callThrough();
|
|
70
|
-
const spectator = await createComponent();
|
|
71
|
-
spectator.click('.ft-bell');
|
|
72
|
-
spectator.fixture.detectChanges();
|
|
73
|
-
spectator.click('.noti-container .fa-times');
|
|
74
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
75
|
-
});
|
|
76
|
-
});
|