@posiwise/dashboard-module 0.0.85 → 0.0.86

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.
Files changed (89) hide show
  1. package/.eslintrc.json +21 -0
  2. package/ng-package.json +15 -0
  3. package/package.json +10 -23
  4. package/project.json +72 -0
  5. package/{index.d.ts → src/index.ts} +1 -0
  6. package/src/lib/customizer/customizer.component.html +184 -0
  7. package/src/lib/customizer/customizer.component.scss +101 -0
  8. package/src/lib/customizer/customizer.component.ts +13 -0
  9. package/src/lib/dashboard.module.ts +63 -0
  10. package/src/lib/faq/faq.component.html +110 -0
  11. package/src/lib/faq/faq.component.scss +58 -0
  12. package/src/lib/faq/faq.component.spec.ts +143 -0
  13. package/src/lib/faq/faq.component.ts +144 -0
  14. package/src/lib/faq-details/faq-details.component.html +21 -0
  15. package/src/lib/faq-details/faq-details.component.scss +3 -0
  16. package/src/lib/faq-details/faq-details.component.spec.ts +69 -0
  17. package/src/lib/faq-details/faq-details.component.ts +38 -0
  18. package/src/lib/footer/footer.component.html +14 -0
  19. package/src/lib/footer/footer.component.spec.ts +42 -0
  20. package/src/lib/footer/footer.component.ts +24 -0
  21. package/src/lib/home/home.component.html +93 -0
  22. package/src/lib/home/home.component.scss +0 -0
  23. package/src/lib/home/home.component.spec.ts +69 -0
  24. package/src/lib/home/home.component.ts +88 -0
  25. package/src/lib/navbar/navbar.component.html +189 -0
  26. package/src/lib/navbar/navbar.component.scss +92 -0
  27. package/src/lib/navbar/navbar.component.spec.ts +76 -0
  28. package/src/lib/navbar/navbar.component.ts +198 -0
  29. package/src/lib/notifications-page/current-notifications/current-notifications.component.html +61 -0
  30. package/src/lib/notifications-page/current-notifications/current-notifications.component.spec.ts +57 -0
  31. package/src/lib/notifications-page/current-notifications/current-notifications.component.ts +63 -0
  32. package/src/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.html +65 -0
  33. package/src/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.spec.ts +71 -0
  34. package/src/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.ts +79 -0
  35. package/src/lib/notifications-page/notifications-page.component.html +24 -0
  36. package/src/lib/notifications-page/notifications-page.component.scss +28 -0
  37. package/src/lib/notifications-page/notifications-page.component.spec.ts +26 -0
  38. package/src/lib/notifications-page/notifications-page.component.ts +8 -0
  39. package/src/lib/search/search.component.html +215 -0
  40. package/src/lib/search/search.component.scss +98 -0
  41. package/src/lib/search/search.component.spec.ts +64 -0
  42. package/src/lib/search/search.component.ts +50 -0
  43. package/src/lib/sidebar/sidebar-routes.config.ts +355 -0
  44. package/{lib/sidebar/sidebar.metadata.d.ts → src/lib/sidebar/sidebar.metadata.ts} +1 -0
  45. package/src/lib/user-feedback/user-feedback.component.html +53 -0
  46. package/src/lib/user-feedback/user-feedback.component.scss +18 -0
  47. package/src/lib/user-feedback/user-feedback.component.spec.ts +54 -0
  48. package/src/lib/user-feedback/user-feedback.component.ts +83 -0
  49. package/src/lib/user-notifications/user-notifications.component.html +21 -0
  50. package/src/lib/user-notifications/user-notifications.component.scss +21 -0
  51. package/src/lib/user-notifications/user-notifications.component.spec.ts +47 -0
  52. package/src/lib/user-notifications/user-notifications.component.ts +74 -0
  53. package/tsconfig.json +30 -0
  54. package/tsconfig.lib.json +19 -0
  55. package/tsconfig.lib.prod.json +9 -0
  56. package/tsconfig.spec.json +11 -0
  57. package/esm2022/index.mjs +0 -16
  58. package/esm2022/lib/customizer/customizer.component.mjs +0 -17
  59. package/esm2022/lib/dashboard.module.mjs +0 -101
  60. package/esm2022/lib/faq/faq.component.mjs +0 -108
  61. package/esm2022/lib/faq-details/faq-details.component.mjs +0 -38
  62. package/esm2022/lib/footer/footer.component.mjs +0 -22
  63. package/esm2022/lib/home/home.component.mjs +0 -79
  64. package/esm2022/lib/navbar/navbar.component.mjs +0 -162
  65. package/esm2022/lib/notifications-page/current-notifications/current-notifications.component.mjs +0 -58
  66. package/esm2022/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.mjs +0 -73
  67. package/esm2022/lib/notifications-page/notifications-page.component.mjs +0 -14
  68. package/esm2022/lib/search/search.component.mjs +0 -48
  69. package/esm2022/lib/sidebar/sidebar-routes.config.mjs +0 -350
  70. package/esm2022/lib/sidebar/sidebar.metadata.mjs +0 -2
  71. package/esm2022/lib/user-feedback/user-feedback.component.mjs +0 -73
  72. package/esm2022/lib/user-notifications/user-notifications.component.mjs +0 -65
  73. package/esm2022/posiwise-dashboard-module.mjs +0 -5
  74. package/fesm2022/posiwise-dashboard-module.mjs +0 -1118
  75. package/fesm2022/posiwise-dashboard-module.mjs.map +0 -1
  76. package/lib/customizer/customizer.component.d.ts +0 -7
  77. package/lib/dashboard.module.d.ts +0 -28
  78. package/lib/faq/faq.component.d.ts +0 -37
  79. package/lib/faq-details/faq-details.component.d.ts +0 -16
  80. package/lib/footer/footer.component.d.ts +0 -12
  81. package/lib/home/home.component.d.ts +0 -18
  82. package/lib/navbar/navbar.component.d.ts +0 -35
  83. package/lib/notifications-page/current-notifications/current-notifications.component.d.ts +0 -17
  84. package/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.d.ts +0 -18
  85. package/lib/notifications-page/notifications-page.component.d.ts +0 -5
  86. package/lib/search/search.component.d.ts +0 -24
  87. package/lib/sidebar/sidebar-routes.config.d.ts +0 -64
  88. package/lib/user-feedback/user-feedback.component.d.ts +0 -24
  89. package/lib/user-notifications/user-notifications.component.d.ts +0 -20
@@ -0,0 +1,143 @@
1
+ import {
2
+ PermissionService,
3
+ ProductService,
4
+ CommonService,
5
+ UserService,
6
+ CommonServicesModule
7
+ } from '@posiwise/common-services';
8
+ import { DEFAULT_USER, TestHelper } from '@posiwise/test-helpers';
9
+ import { SharedModule } from '@posiwise/shared-module';
10
+ import { of } from 'rxjs';
11
+ import { FaqComponent } from './faq.component';
12
+ import { DashboardLibModule } from '../dashboard.module';
13
+ import { MockProvider } from 'ng-mocks';
14
+
15
+ class UserServiceMock {
16
+ getUserState() {
17
+ return of({ currentUser: DEFAULT_USER });
18
+ }
19
+ }
20
+
21
+ describe('FaqComponent', () => {
22
+ const createComponent = TestHelper.createComponentFactory({
23
+ component: FaqComponent,
24
+ imports: [SharedModule, CommonServicesModule, DashboardLibModule],
25
+ providers: [
26
+ ...TestHelper.TEST_PROVIDERS,
27
+ MockProvider(PermissionService, {
28
+ evaluatePermissions: () => {
29
+ return true;
30
+ }
31
+ }),
32
+ MockProvider(ProductService, {
33
+ getProducts: () =>
34
+ of({
35
+ products: [
36
+ {
37
+ id: 10,
38
+ name: 'Talent Hub',
39
+ visible: true,
40
+ product_key: 'TalentHub',
41
+ permission_key: 'TalentHub',
42
+ subscription_id: 7
43
+ }
44
+ ]
45
+ })
46
+ }),
47
+ MockProvider(CommonService, {
48
+ getPublicFaq: () =>
49
+ of({
50
+ available_category: [
51
+ {
52
+ key: 'public',
53
+ name: 'Public',
54
+ description:
55
+ 'These FAQs will be visible on all internal as well as public pages'
56
+ },
57
+ {
58
+ key: 'master_development',
59
+ name: 'MasterSubscription - Development',
60
+ description:
61
+ 'These FAQs are meant to help MasterSubscription Admins develop new features and/or products'
62
+ },
63
+ {
64
+ key: 'master_admin',
65
+ name: 'MasterSubscription - Admin',
66
+ description:
67
+ 'These FAQs are meant to help SubscriptionAdmin Users to manage their Subscription, such as adding and remove Subscription Members'
68
+ },
69
+ {
70
+ key: 'subscription',
71
+ name: 'Subscriptions Admin',
72
+ description:
73
+ 'These FAQs are meant to help regular Subscription Users to manage the basic features of their Subscription'
74
+ },
75
+ {
76
+ key: 'account',
77
+ name: 'Accounts Admin',
78
+ description:
79
+ 'These FAQs are meant to help regular Account Owners to manage their Account'
80
+ },
81
+ {
82
+ key: 'onboarding',
83
+ name: 'Onboarding',
84
+ description:
85
+ 'These FAQs are meant to facilitate the onboarding of a new user'
86
+ },
87
+ {
88
+ key: 'product',
89
+ name: 'Product',
90
+ description: 'These FAQs are related to specific product features'
91
+ }
92
+ ],
93
+ faqs: [
94
+ {
95
+ id: 5,
96
+ question: 'test',
97
+ answer: '\u003cp\u003etest\u003c/p\u003e',
98
+ visible: true,
99
+ position: null,
100
+ category: 'public',
101
+ product_id: 10,
102
+ public: true,
103
+ product: {
104
+ id: 10,
105
+ name: 'Talent Hub',
106
+ visible: true,
107
+ product_key: 'TalentHub',
108
+ permission_key: 'TalentHub',
109
+ subscription_id: 7
110
+ }
111
+ },
112
+ {
113
+ id: 4,
114
+ question: 'test question',
115
+ answer: '\u003cp\u003etest\u003c/p\u003e',
116
+ visible: true,
117
+ position: null,
118
+ category: 'public',
119
+ product_id: null,
120
+ public: true,
121
+ product: null
122
+ }
123
+ ]
124
+ })
125
+ }),
126
+ {
127
+ provide: UserService,
128
+ useClass: UserServiceMock
129
+ }
130
+ ]
131
+ });
132
+
133
+ beforeEach(() => {
134
+ TestHelper.setUpPermissionsAndUser();
135
+ });
136
+
137
+ it('should create', async () => {
138
+ const spectator = await createComponent();
139
+ expect(spectator.component).toBeTruthy();
140
+ spectator.typeInElement('test', 'input');
141
+ expect(spectator.query('.accordion-toggle:first-of-type')).toContainText('test');
142
+ });
143
+ });
@@ -0,0 +1,144 @@
1
+ import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
2
+ import groupBy from 'lodash/groupBy';
3
+
4
+ import { AppBaseComponent } from '@posiwise/app-base-component';
5
+ import { FAQ, User } from '@posiwise/common-utilities';
6
+ import { CommonService, PermissionService, ProductService } from '@posiwise/common-services';
7
+ import sortBy from 'lodash/sortBy';
8
+
9
+ @Component({
10
+ selector: 'pw-faq',
11
+ templateUrl: './faq.component.html',
12
+ styleUrls: ['./faq.component.scss']
13
+ })
14
+ export class FaqComponent extends AppBaseComponent implements OnInit, OnDestroy {
15
+ faqs: any;
16
+
17
+ productFaq: FAQ[];
18
+
19
+ private nonProductFaqs: FAQ[];
20
+
21
+ private allProductFaqs: FAQ[];
22
+
23
+ subscriptions = [];
24
+
25
+ objectKeys = Object.keys;
26
+
27
+ isLoaded = false;
28
+
29
+ totalRecords: number;
30
+
31
+ products: any;
32
+
33
+ private faqsResponse: any[];
34
+
35
+ allFaqFalse: boolean;
36
+
37
+ subscriptionId: number;
38
+
39
+ showSupport: boolean;
40
+
41
+ faqHashMap = {};
42
+
43
+ constructor(
44
+ private commonService: CommonService,
45
+ injector: Injector,
46
+ private productService: ProductService
47
+ ) {
48
+ super(injector);
49
+ }
50
+
51
+ ngOnInit() {
52
+ this.faqHashMap = {};
53
+ this.showSupport = PermissionService.selectedProduct?.gitlab_service_desk_email;
54
+ this.subscriptionId = PermissionService?.selectedSubscription?.id;
55
+ const masterProductId = this.appConfig.master_subscription.product_id;
56
+ this.getProducts();
57
+ this.commonService
58
+ .getPublicFaq(this.subscriptionId)
59
+ .subscribe((response: any) => {
60
+ this.faqsResponse = response.faqs;
61
+ response?.available_category?.forEach(x => {
62
+ this.faqHashMap[x.key] = x;
63
+ });
64
+ this.totalRecords = response.faqs.length;
65
+ this.nonProductFaqs = this.faqsResponse.filter(x => x.visible && !x.product_id);
66
+ this.allProductFaqs = this.faqsResponse.filter(x => x.visible && x.product_id);
67
+ const noProductObjects: boolean = this.faqsResponse.every(x => x.product === null);
68
+ this.allFaqFalse = this.faqsResponse.every(x => x.visible === false);
69
+
70
+ if (!noProductObjects) {
71
+ this.productService
72
+ .getProducts({ master_product_id: masterProductId })
73
+ .subscribe(resp => {
74
+ this.products = resp.products;
75
+ this.faqValidation();
76
+ });
77
+ } else {
78
+ this.products = '';
79
+ this.faqValidation();
80
+ }
81
+ })
82
+ .add(() => {
83
+ this.isLoaded = true;
84
+ });
85
+ }
86
+
87
+ private faqValidation() {
88
+ this.productFaq = <any>groupBy(this.allProductFaqs, 'category');
89
+ this.faqs = groupBy(this.nonProductFaqs, 'category');
90
+ Object.keys(this.productFaq).forEach(x => {
91
+ this.productFaq[x] = sortBy(this.productFaq[x], 'position');
92
+ });
93
+ Object.keys(this.faqs).forEach(x => {
94
+ this.faqs[x] = sortBy(this.faqs[x], 'position');
95
+ });
96
+ }
97
+
98
+ private getProducts() {
99
+ this.subscriptions = [];
100
+ this.userStore().subscribe((user: User) => {
101
+ if (user) {
102
+ this.subscriptions = user.subscriptions;
103
+ }
104
+ });
105
+ }
106
+
107
+ filter(searchValue: string) {
108
+ if (searchValue === '') {
109
+ this.faqs = groupBy(this.nonProductFaqs, 'category');
110
+ this.productFaq = <any>groupBy(this.allProductFaqs, 'category');
111
+ } else {
112
+ const filtered = this.nonProductFaqs.filter(
113
+ (faqs: FAQ) =>
114
+ faqs.question.toUpperCase().includes(searchValue.toUpperCase()) ||
115
+ faqs.answer.toUpperCase().includes(searchValue.toUpperCase())
116
+ );
117
+
118
+ const productBasedFilter = this.allProductFaqs.filter(
119
+ (faqs: FAQ) =>
120
+ faqs.question.toUpperCase().includes(searchValue.toUpperCase()) ||
121
+ faqs.answer.toUpperCase().includes(searchValue.toUpperCase())
122
+ );
123
+
124
+ this.productFaq = <any>groupBy(productBasedFilter, 'category');
125
+ this.faqs = groupBy(filtered, 'category');
126
+ }
127
+ }
128
+
129
+ navigateToSupport() {
130
+ this.router.navigate(['/support']);
131
+ }
132
+
133
+ trackByProductFaqId(_index: number, item: any) {
134
+ return item.id;
135
+ }
136
+
137
+ trackByNonProductFaqId(_index: number, item: any) {
138
+ return item.id;
139
+ }
140
+
141
+ override ngOnDestroy() {
142
+ super.ngOnDestroy();
143
+ }
144
+ }
@@ -0,0 +1,21 @@
1
+ <div class="container-fluid overflow-hidden mt-4 p-3">
2
+ <h2>{{faq?.question}}</h2>
3
+ <ng-container *ngIf="faq?.answer">
4
+ <div class="ql-container ql-snow"
5
+ style="border-width: 0;">
6
+ <div class="ql-editor"
7
+ [innerHTML]="faq?.answer |safe:'html'">
8
+ </div>
9
+ </div>
10
+ </ng-container>
11
+ <pw-no-data *ngIf="!faq && !isLoading"
12
+ message="No Faq found"> </pw-no-data>
13
+ <div class="text-end mt-3">
14
+ <button class="btn btn-outline-primary"
15
+ [routerLink]="['/',slug,'faq']">See all FAQs</button>
16
+ </div>
17
+ </div>
18
+ <div class="w-100 text-center mt-3"
19
+ *ngIf="isLoading">
20
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
21
+ </div>
@@ -0,0 +1,3 @@
1
+ .ql-container {
2
+ resize: none !important;
3
+ }
@@ -0,0 +1,69 @@
1
+ import { PermissionService, CommonService, UserService, CommonServicesModule } from '@posiwise/common-services';
2
+ import { DEFAULT_USER, TestHelper } from '@posiwise/test-helpers';
3
+ import { MockProvider } from 'ng-mocks';
4
+ import { SharedModule } from '@posiwise/shared-module';
5
+ import { of } from 'rxjs';
6
+ import { FaqDetailsComponent } from './faq-details.component';
7
+ import { DashboardLibModule } from '../dashboard.module';
8
+
9
+
10
+ class UserServiceMock {
11
+ getUserState() {
12
+ return of({ currentUser: DEFAULT_USER });
13
+ }
14
+ }
15
+
16
+ describe('FaqDetailsComponent', () => {
17
+ const createComponent = TestHelper.createComponentFactory({
18
+ component: FaqDetailsComponent,
19
+ imports: [ SharedModule,CommonServicesModule,DashboardLibModule],
20
+ providers: [
21
+ ...TestHelper.TEST_PROVIDERS,
22
+ MockProvider(PermissionService, {
23
+ evaluatePermissions: () => {
24
+ return true;
25
+ }
26
+ }),
27
+ MockProvider(CommonService, {
28
+ getPublicFaqById: () =>
29
+ of({
30
+ id: 5,
31
+ question: 'test',
32
+ answer: '\u003cp\u003etest\u003c/p\u003e',
33
+ visible: true,
34
+ position: null,
35
+ category: 'public',
36
+ product_id: 10,
37
+ public: true,
38
+ product: {
39
+ id: 10,
40
+ name: 'Talent Hub',
41
+ visible: true,
42
+ product_key: 'TalentHub',
43
+ permission_key: 'TalentHub',
44
+ subscription_id: 7
45
+ }
46
+ })
47
+ }),
48
+ {
49
+ provide: UserService,
50
+ useClass: UserServiceMock
51
+ }
52
+ ]
53
+ });
54
+
55
+ beforeEach(() => {
56
+ TestHelper.setUpPermissionsAndUser();
57
+ });
58
+
59
+ it('should create', async () => {
60
+ TestHelper.setActivatedRoute({
61
+ params: { id: 5 },
62
+ parent: { params: of({ slug: 'posiwise-263' }) }
63
+ });
64
+ const spectator = await createComponent();
65
+ expect(spectator.component).toBeTruthy();
66
+ await TestHelper.stabilize(spectator);
67
+ expect(spectator.component.faq.question).toEqual('test');
68
+ });
69
+ });
@@ -0,0 +1,38 @@
1
+ import { Component, Injector, OnInit } from '@angular/core';
2
+ import { AppBaseComponent } from '@posiwise/app-base-component';
3
+ import { CommonService, PermissionService } from '@posiwise/common-services';
4
+
5
+ @Component({
6
+ selector: 'pw-faq-details',
7
+ templateUrl: './faq-details.component.html',
8
+ styleUrls: ['./faq-details.component.scss']
9
+ })
10
+ export class FaqDetailsComponent extends AppBaseComponent implements OnInit {
11
+ id: number;
12
+
13
+ faq: any;
14
+
15
+ isLoading = false;
16
+
17
+ slug: string;
18
+
19
+ constructor(private commonService: CommonService, injector: Injector) {
20
+ super(injector);
21
+ this.id = Number(this.route.snapshot.params['id']);
22
+ this.slug = PermissionService.selectedSubscription?.slug;
23
+ }
24
+
25
+ ngOnInit() {
26
+ this.getFaq();
27
+ }
28
+
29
+ getFaq() {
30
+ this.isLoading = true;
31
+ this.commonService
32
+ .getPublicFaqById(this.id)
33
+ .subscribe(res => {
34
+ this.faq = res;
35
+ })
36
+ .add(() => (this.isLoading = false));
37
+ }
38
+ }
@@ -0,0 +1,14 @@
1
+ <!-- Footer Starts -->
2
+ <footer>
3
+ <div class="container-fluid">
4
+ <div class="text-center">
5
+ <a [routerLink]="['/privacy-and-tos', productPrivacyId]">Privacy</a> and
6
+ <a [routerLink]="['/privacy-and-tos', productPrivacyId]">Terms of Service</a>
7
+ </div>
8
+ <p class="copyright text-center">
9
+ Copyright &copy; {{ currentDate | date: 'yyyy' }} {{ companyName }}. All rights
10
+ reserved.
11
+ </p>
12
+ </div>
13
+ </footer>
14
+ <!-- Footer Ends -->
@@ -0,0 +1,42 @@
1
+ import { CommonServicesModule, PermissionService, UserService } from '@posiwise/common-services';
2
+ import { MockProvider } from 'ng-mocks';
3
+ import { of } from 'rxjs';
4
+ import { DashboardLibModule } from '../dashboard.module';
5
+ import { DEFAULT_USER, TestHelper } from '@posiwise/test-helpers';
6
+ import { SharedModule } from '@posiwise/shared-module';
7
+ import { FooterComponent } from './footer.component';
8
+
9
+
10
+ class UserServiceMock {
11
+ getUserState() {
12
+ return of({ currentUser: DEFAULT_USER });
13
+ }
14
+ }
15
+
16
+ describe('FooterComponent', () => {
17
+ const createComponent = TestHelper.createComponentFactory({
18
+ component: FooterComponent,
19
+ imports: [ SharedModule,CommonServicesModule,DashboardLibModule],
20
+ providers: [
21
+ ...TestHelper.TEST_PROVIDERS,
22
+ MockProvider(PermissionService, {
23
+ evaluatePermissions: () => {
24
+ return true;
25
+ }
26
+ }),
27
+ {
28
+ provide: UserService,
29
+ useClass: UserServiceMock
30
+ }
31
+ ]
32
+ });
33
+
34
+ beforeEach(() => {
35
+ TestHelper.setUpPermissionsAndUser();
36
+ });
37
+
38
+ it('should create', async () => {
39
+ const spectator = await createComponent();
40
+ expect(spectator.component).toBeTruthy();
41
+ });
42
+ });
@@ -0,0 +1,24 @@
1
+ import { Component, Injector, OnInit } from '@angular/core';
2
+
3
+ import { AppBaseComponent } from '@posiwise/app-base-component';
4
+
5
+ @Component({
6
+ selector: 'pw-footer',
7
+ templateUrl: './footer.component.html'
8
+ })
9
+ export class FooterComponent extends AppBaseComponent implements OnInit {
10
+ currentDate: Date = new Date();
11
+
12
+ companyName: string;
13
+
14
+ productPrivacyId: number;
15
+
16
+ constructor(injector: Injector) {
17
+ super(injector);
18
+ }
19
+
20
+ ngOnInit(): void {
21
+ this.productPrivacyId = this.appConfig?.main_tos_id;
22
+ this.companyName = this.appConfig?.company?.name;
23
+ }
24
+ }
@@ -0,0 +1,93 @@
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
@@ -0,0 +1,69 @@
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
+ });