@posiwise/dashboard-module 0.0.86 → 0.0.87

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/esm2022/index.mjs +16 -0
  2. package/esm2022/lib/customizer/customizer.component.mjs +17 -0
  3. package/esm2022/lib/dashboard.module.mjs +101 -0
  4. package/esm2022/lib/faq/faq.component.mjs +108 -0
  5. package/esm2022/lib/faq-details/faq-details.component.mjs +38 -0
  6. package/esm2022/lib/footer/footer.component.mjs +22 -0
  7. package/esm2022/lib/home/home.component.mjs +79 -0
  8. package/esm2022/lib/navbar/navbar.component.mjs +162 -0
  9. package/esm2022/lib/notifications-page/current-notifications/current-notifications.component.mjs +58 -0
  10. package/esm2022/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.mjs +73 -0
  11. package/esm2022/lib/notifications-page/notifications-page.component.mjs +14 -0
  12. package/esm2022/lib/search/search.component.mjs +48 -0
  13. package/esm2022/lib/sidebar/sidebar-routes.config.mjs +350 -0
  14. package/esm2022/lib/sidebar/sidebar.metadata.mjs +2 -0
  15. package/esm2022/lib/user-feedback/user-feedback.component.mjs +73 -0
  16. package/esm2022/lib/user-notifications/user-notifications.component.mjs +65 -0
  17. package/esm2022/posiwise-dashboard-module.mjs +5 -0
  18. package/fesm2022/posiwise-dashboard-module.mjs +1118 -0
  19. package/fesm2022/posiwise-dashboard-module.mjs.map +1 -0
  20. package/{src/index.ts → index.d.ts} +0 -1
  21. package/lib/customizer/customizer.component.d.ts +7 -0
  22. package/lib/dashboard.module.d.ts +28 -0
  23. package/lib/faq/faq.component.d.ts +37 -0
  24. package/lib/faq-details/faq-details.component.d.ts +16 -0
  25. package/lib/footer/footer.component.d.ts +12 -0
  26. package/lib/home/home.component.d.ts +18 -0
  27. package/lib/navbar/navbar.component.d.ts +35 -0
  28. package/lib/notifications-page/current-notifications/current-notifications.component.d.ts +17 -0
  29. package/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.d.ts +18 -0
  30. package/lib/notifications-page/notifications-page.component.d.ts +5 -0
  31. package/lib/search/search.component.d.ts +24 -0
  32. package/lib/sidebar/sidebar-routes.config.d.ts +64 -0
  33. package/{src/lib/sidebar/sidebar.metadata.ts → lib/sidebar/sidebar.metadata.d.ts} +0 -1
  34. package/lib/user-feedback/user-feedback.component.d.ts +24 -0
  35. package/lib/user-notifications/user-notifications.component.d.ts +20 -0
  36. package/package.json +23 -10
  37. package/.eslintrc.json +0 -21
  38. package/ng-package.json +0 -15
  39. package/project.json +0 -72
  40. package/src/lib/customizer/customizer.component.html +0 -184
  41. package/src/lib/customizer/customizer.component.scss +0 -101
  42. package/src/lib/customizer/customizer.component.ts +0 -13
  43. package/src/lib/dashboard.module.ts +0 -63
  44. package/src/lib/faq/faq.component.html +0 -110
  45. package/src/lib/faq/faq.component.scss +0 -58
  46. package/src/lib/faq/faq.component.spec.ts +0 -143
  47. package/src/lib/faq/faq.component.ts +0 -144
  48. package/src/lib/faq-details/faq-details.component.html +0 -21
  49. package/src/lib/faq-details/faq-details.component.scss +0 -3
  50. package/src/lib/faq-details/faq-details.component.spec.ts +0 -69
  51. package/src/lib/faq-details/faq-details.component.ts +0 -38
  52. package/src/lib/footer/footer.component.html +0 -14
  53. package/src/lib/footer/footer.component.spec.ts +0 -42
  54. package/src/lib/footer/footer.component.ts +0 -24
  55. package/src/lib/home/home.component.html +0 -93
  56. package/src/lib/home/home.component.scss +0 -0
  57. package/src/lib/home/home.component.spec.ts +0 -69
  58. package/src/lib/home/home.component.ts +0 -88
  59. package/src/lib/navbar/navbar.component.html +0 -189
  60. package/src/lib/navbar/navbar.component.scss +0 -92
  61. package/src/lib/navbar/navbar.component.spec.ts +0 -76
  62. package/src/lib/navbar/navbar.component.ts +0 -198
  63. package/src/lib/notifications-page/current-notifications/current-notifications.component.html +0 -61
  64. package/src/lib/notifications-page/current-notifications/current-notifications.component.spec.ts +0 -57
  65. package/src/lib/notifications-page/current-notifications/current-notifications.component.ts +0 -63
  66. package/src/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.html +0 -65
  67. package/src/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.spec.ts +0 -71
  68. package/src/lib/notifications-page/dismissed-notifications/dismissed-notifications.component.ts +0 -79
  69. package/src/lib/notifications-page/notifications-page.component.html +0 -24
  70. package/src/lib/notifications-page/notifications-page.component.scss +0 -28
  71. package/src/lib/notifications-page/notifications-page.component.spec.ts +0 -26
  72. package/src/lib/notifications-page/notifications-page.component.ts +0 -8
  73. package/src/lib/search/search.component.html +0 -215
  74. package/src/lib/search/search.component.scss +0 -98
  75. package/src/lib/search/search.component.spec.ts +0 -64
  76. package/src/lib/search/search.component.ts +0 -50
  77. package/src/lib/sidebar/sidebar-routes.config.ts +0 -355
  78. package/src/lib/user-feedback/user-feedback.component.html +0 -53
  79. package/src/lib/user-feedback/user-feedback.component.scss +0 -18
  80. package/src/lib/user-feedback/user-feedback.component.spec.ts +0 -54
  81. package/src/lib/user-feedback/user-feedback.component.ts +0 -83
  82. package/src/lib/user-notifications/user-notifications.component.html +0 -21
  83. package/src/lib/user-notifications/user-notifications.component.scss +0 -21
  84. package/src/lib/user-notifications/user-notifications.component.spec.ts +0 -47
  85. package/src/lib/user-notifications/user-notifications.component.ts +0 -74
  86. package/tsconfig.json +0 -30
  87. package/tsconfig.lib.json +0 -19
  88. package/tsconfig.lib.prod.json +0 -9
  89. package/tsconfig.spec.json +0 -11
@@ -1,110 +0,0 @@
1
- <div class="container-fluid overflow-hidden">
2
- <div class="row mb-3">
3
- <div class="col-12">
4
- <div class="card gradient-custom-branding white text-center p-1 p-sm-2">
5
- <div class="card-header p-1 p-sm-2">
6
- <button *ngIf="showSupport"
7
- class="ms-auto d-block btn btn-sm btn-outline-primary"
8
- (click)="navigateToSupport()">
9
- Support
10
- </button>
11
- <h1>You need help?</h1>
12
- <p><em>Please search through our frequently asked questions first.</em></p>
13
- </div>
14
- <div class="card-block p-2 p-sm-2">
15
- <fieldset>
16
- <legend></legend>
17
- <input type="text"
18
- class="form-control bg-white"
19
- placeholder="Search in faqs.."
20
- (input)="filter($event.target.value)"
21
- #messageInput />
22
- </fieldset>
23
- </div>
24
- </div>
25
- </div>
26
- </div>
27
- <div class="w-100 text-center mt-3"
28
- *ngIf="!isLoaded">
29
- <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
30
- </div>
31
- <ng-container *ngIf="faqs">
32
- <!-- Non Product FAQ -->
33
- <div *ngFor="let category of objectKeys(faqs); let idx1 = index">
34
- <ng-container *ngIf="faqs[category]?.length">
35
- <h6 class="text-uppercase mt-3 p-1">{{ faqHashMap[category]?.name }}</h6>
36
- <div class="dashboard">
37
- <div class="faq-item"
38
- *ngFor="
39
- let faq of faqs[category];
40
- let idx = index;
41
- trackBy: trackByProductFaqId
42
- ">
43
- <div class="dashboard-header p-2">
44
- <h5 class="accordion-title mt-2">
45
- <a class="accordion-toggle collapsed"
46
- data-bs-toggle="collapse"
47
- [href]="'#collapse' + idx + idx1">
48
- {{ faq.question }}
49
- </a>
50
- </h5>
51
- </div>
52
- <div [id]="'collapse' + idx + idx1"
53
- class="panel-collapse p-3 collapse in">
54
- <div class="card-block">
55
- <ng-container *ngIf="faq?.answer">
56
- <div class="ql-container ql-snow"
57
- style="border-width: 0;">
58
- <div class="ql-editor"
59
- [innerHTML]="faq?.answer |safe:'html'">
60
- </div>
61
- </div>
62
- </ng-container>
63
- </div>
64
- </div>
65
- </div>
66
- </div>
67
- </ng-container>
68
- </div>
69
- <!-- Product based FAQ -->
70
- <div *ngFor="let product of objectKeys(productFaq); let idx2 = index">
71
- <ng-container *ngIf="productFaq[product]?.length">
72
- <h6 class="text-uppercase p-1">{{ product }}</h6>
73
- <div class="dashboard">
74
- <div class="faq-item"
75
- *ngFor="
76
- let faq of productFaq[product];
77
- let idx = index;
78
- trackBy: trackByNonProductFaqId
79
- ">
80
- <div class="dashboard-header p-2">
81
- <h5 class="accordion-title mt-2">
82
- <a class="accordion-toggle"
83
- data-bs-toggle="collapse"
84
- [href]="'#collapse1' + idx + idx2">
85
- {{ faq.question }}
86
- </a>
87
- </h5>
88
- </div>
89
- <div [id]="'collapse1' + idx + idx2"
90
- class="panel-collapse p-3 collapse in">
91
- <div class="card-block">
92
- <ng-container *ngIf="faq?.answer">
93
- <div class="ql-container ql-snow"
94
- style="border-width: 0;">
95
- <div class="ql-editor"
96
- [innerHTML]="faq?.answer |safe:'html'">
97
- </div>
98
- </div>
99
- </ng-container>
100
- </div>
101
- </div>
102
- </div>
103
- </div>
104
- </ng-container>
105
- </div>
106
- </ng-container>
107
- <div *ngIf="totalRecords === 0 || allFaqFalse">
108
- <pw-no-data [withImage]="true" message="No faqs present"> </pw-no-data>
109
- </div>
110
- </div>
@@ -1,58 +0,0 @@
1
- @import 'variables/branding-variables';
2
- @import 'variables';
3
-
4
- .card-header {
5
- h1,
6
- p {
7
- color: rgb(255 255 255) !important;
8
- }
9
- }
10
-
11
- .faq-item {
12
- border: 1px dashed rgb(0 0 0 / 10%);
13
- background-color: map-get($grey, lighten-3);
14
- border-radius: 3px;
15
- margin: 10px 0;
16
- transition: all 0.2s ease-in-out;
17
-
18
- .dashboard-header {
19
- background: rgb(255 255 255);
20
- }
21
- }
22
-
23
- .card {
24
- .accordion-toggle {
25
- &::before {
26
- content: '\f078';
27
- }
28
-
29
- &.collapsed {
30
- transition: all 0.3s ease-in-out;
31
-
32
- &::before {
33
- content: '\f054';
34
- }
35
- }
36
- }
37
- }
38
-
39
- .card-block {
40
- p {
41
- font-size: 16px;
42
- }
43
- }
44
-
45
- .card,
46
- h6 {
47
- background: $sidebar-bg !important;
48
- color: $sidebar-text !important;
49
- padding: 0.8rem !important;
50
- }
51
- .accordion-title {
52
- a {
53
- color: $sidebar-bg !important;
54
- }
55
- }
56
- .ql-container {
57
- resize: none !important;
58
- }
@@ -1,143 +0,0 @@
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
- });
@@ -1,144 +0,0 @@
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
- }
@@ -1,21 +0,0 @@
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>
@@ -1,3 +0,0 @@
1
- .ql-container {
2
- resize: none !important;
3
- }
@@ -1,69 +0,0 @@
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
- });
@@ -1,38 +0,0 @@
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
- }
@@ -1,14 +0,0 @@
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 -->
@@ -1,42 +0,0 @@
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
- });
@@ -1,24 +0,0 @@
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
- }