@posiwise/dashboard-module 0.0.147 → 0.0.148
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.
|
@@ -1,1158 +1,1964 @@
|
|
|
1
|
-
import * as i2
|
|
2
|
-
import { CommonModule } from
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import {
|
|
5
|
-
import * as i2$1 from
|
|
6
|
-
import { FormsModule, ReactiveFormsModule } from
|
|
7
|
-
import * as i1 from
|
|
8
|
-
import { PermissionService, SubscriptionService } from
|
|
9
|
-
import { CoreTranslocoModule } from
|
|
10
|
-
import * as
|
|
11
|
-
import { DirectivesModule } from
|
|
12
|
-
import * as i5
|
|
13
|
-
import { PipesModule } from
|
|
14
|
-
import { UserModuleModule } from
|
|
15
|
-
import * as
|
|
16
|
-
import { ProgressSpinnerModule } from
|
|
17
|
-
import * as i3
|
|
18
|
-
import { RadioButtonModule } from
|
|
19
|
-
import { SelectModule } from
|
|
20
|
-
import * as i1
|
|
21
|
-
import {
|
|
22
|
-
import * as
|
|
23
|
-
import { RouterModule } from
|
|
24
|
-
import * as
|
|
25
|
-
import { ResourceSharedComponentsModule } from
|
|
26
|
-
import * as i5 from
|
|
27
|
-
import { TooltipModule } from
|
|
28
|
-
import * as
|
|
29
|
-
import { AppBaseComponent } from
|
|
30
|
-
import { ADMIN_ROUTERS } from
|
|
31
|
-
import { HelperService } from
|
|
32
|
-
import { Subject, forkJoin, of } from
|
|
33
|
-
import {
|
|
34
|
-
import groupBy from
|
|
35
|
-
import sortBy from
|
|
36
|
-
import * as i7 from
|
|
37
|
-
import moment from
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
1
|
+
import * as i2 from "@angular/common";
|
|
2
|
+
import { CommonModule } from "@angular/common";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { CUSTOM_ELEMENTS_SCHEMA, Component, NgModule } from "@angular/core";
|
|
5
|
+
import * as i2$1 from "@angular/forms";
|
|
6
|
+
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
|
7
|
+
import * as i1$1 from "@posiwise/common-services";
|
|
8
|
+
import { PermissionService, SubscriptionService } from "@posiwise/common-services";
|
|
9
|
+
import { CoreTranslocoModule } from "@posiwise/core-transloco";
|
|
10
|
+
import * as i4 from "@posiwise/directives";
|
|
11
|
+
import { DirectivesModule } from "@posiwise/directives";
|
|
12
|
+
import * as i5 from "@posiwise/pipes";
|
|
13
|
+
import { PipesModule } from "@posiwise/pipes";
|
|
14
|
+
import { UserModuleModule } from "@posiwise/user-module";
|
|
15
|
+
import * as i2$2 from "primeng/progressspinner";
|
|
16
|
+
import { ProgressSpinnerModule } from "primeng/progressspinner";
|
|
17
|
+
import * as i3 from "primeng/radiobutton";
|
|
18
|
+
import { RadioButtonModule } from "primeng/radiobutton";
|
|
19
|
+
import { SelectModule } from "primeng/select";
|
|
20
|
+
import * as i1 from "@ng-bootstrap/ng-bootstrap";
|
|
21
|
+
import { NgbDropdownModule, NgbNavModule } from "@ng-bootstrap/ng-bootstrap";
|
|
22
|
+
import * as i3$1 from "@angular/router";
|
|
23
|
+
import { RouterModule } from "@angular/router";
|
|
24
|
+
import * as i6 from "@posiwise/shared-components";
|
|
25
|
+
import { ResourceSharedComponentsModule } from "@posiwise/shared-components";
|
|
26
|
+
import * as i5$1 from "primeng/tooltip";
|
|
27
|
+
import { TooltipModule } from "primeng/tooltip";
|
|
28
|
+
import * as i1$2 from "@angular/platform-browser";
|
|
29
|
+
import { AppBaseComponent } from "@posiwise/app-base-component";
|
|
30
|
+
import { ADMIN_ROUTERS } from "@posiwise/common-utilities";
|
|
31
|
+
import { HelperService } from "@posiwise/helper-service";
|
|
32
|
+
import { Subject, forkJoin, of } from "rxjs";
|
|
33
|
+
import { catchError, debounceTime, finalize, map, switchMap, take, takeUntil } from "rxjs/operators";
|
|
34
|
+
import groupBy from "lodash/groupBy";
|
|
35
|
+
import sortBy from "lodash/sortBy";
|
|
36
|
+
import * as i7 from "@jsverse/transloco";
|
|
37
|
+
import moment from "moment";
|
|
38
|
+
var DocumentationComponent = class DocumentationComponent {
|
|
39
|
+
constructor(sanitizer) {
|
|
40
|
+
this.sanitizer = sanitizer;
|
|
41
|
+
this.isLoaded = false;
|
|
42
|
+
}
|
|
43
|
+
ngOnInit() {
|
|
44
|
+
const rawUrl = sessionStorage.getItem("documentation_url");
|
|
45
|
+
if (rawUrl) this.iframeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(rawUrl);
|
|
46
|
+
else this.isLoaded = true;
|
|
47
|
+
}
|
|
48
|
+
onIframeLoad() {
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
this.isLoaded = true;
|
|
51
|
+
}, 0);
|
|
52
|
+
}
|
|
53
|
+
static {
|
|
54
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
55
|
+
minVersion: "12.0.0",
|
|
56
|
+
version: "22.2.0",
|
|
57
|
+
ngImport: i0,
|
|
58
|
+
type: DocumentationComponent,
|
|
59
|
+
deps: [{ token: i1$2.DomSanitizer }],
|
|
60
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
static {
|
|
64
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
65
|
+
minVersion: "17.0.0",
|
|
66
|
+
version: "22.2.0",
|
|
67
|
+
type: DocumentationComponent,
|
|
68
|
+
isStandalone: false,
|
|
69
|
+
selector: "pw-documentation",
|
|
70
|
+
ngImport: i0,
|
|
71
|
+
template: "@if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"></p-progress-spinner>\n </div>\n}\n\n<div class=\"documentation-wrapper\" [hidden]=\"!isLoaded || !iframeUrl\">\n @if (iframeUrl) {\n <iframe\n [src]=\"iframeUrl\"\n width=\"100%\"\n height=\"100%\"\n allowfullscreen\n title=\"Documentation Frame\"\n (load)=\"onIframeLoad()\"\n ></iframe>\n }\n</div>\n",
|
|
72
|
+
styles: [".documentation-wrapper{width:100%;height:100vh}.documentation-wrapper iframe{width:100%;height:100%;border:none}\n"],
|
|
73
|
+
dependencies: [{
|
|
74
|
+
kind: "component",
|
|
75
|
+
type: i2$2.ProgressSpinner,
|
|
76
|
+
selector: "p-progress-spinner, p-progressspinner",
|
|
77
|
+
inputs: [
|
|
78
|
+
"value",
|
|
79
|
+
"strokeWidth",
|
|
80
|
+
"animationDuration",
|
|
81
|
+
"min",
|
|
82
|
+
"max",
|
|
83
|
+
"ariaLabel",
|
|
84
|
+
"fill"
|
|
85
|
+
]
|
|
86
|
+
}]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
91
|
+
minVersion: "12.0.0",
|
|
92
|
+
version: "22.2.0",
|
|
93
|
+
ngImport: i0,
|
|
94
|
+
type: DocumentationComponent,
|
|
95
|
+
decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{
|
|
98
|
+
selector: "pw-documentation",
|
|
99
|
+
standalone: false,
|
|
100
|
+
template: "@if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"></p-progress-spinner>\n </div>\n}\n\n<div class=\"documentation-wrapper\" [hidden]=\"!isLoaded || !iframeUrl\">\n @if (iframeUrl) {\n <iframe\n [src]=\"iframeUrl\"\n width=\"100%\"\n height=\"100%\"\n allowfullscreen\n title=\"Documentation Frame\"\n (load)=\"onIframeLoad()\"\n ></iframe>\n }\n</div>\n",
|
|
101
|
+
styles: [".documentation-wrapper{width:100%;height:100vh}.documentation-wrapper iframe{width:100%;height:100%;border:none}\n"]
|
|
102
|
+
}]
|
|
103
|
+
}],
|
|
104
|
+
ctorParameters: () => [{ type: i1$2.DomSanitizer }]
|
|
105
|
+
});
|
|
106
|
+
const FAQ_ADMIN_PERMISSION = "Pages.Admin.FAQ || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager";
|
|
83
107
|
function groupFaqsByCategory(nonProductFaqs, productFaqs) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
108
|
+
const grouped = groupBy([...nonProductFaqs, ...productFaqs], "category");
|
|
109
|
+
Object.keys(grouped).forEach((category) => {
|
|
110
|
+
grouped[category] = sortBy(grouped[category], "position");
|
|
111
|
+
});
|
|
112
|
+
return grouped;
|
|
89
113
|
}
|
|
90
|
-
/// Sanitize every answer up front so the markup is present before the collapse
|
|
91
|
-
/// measures its target height — prevents the end-of-animation height snap that
|
|
92
|
-
/// made expand/collapse feel clunky. Keyed `{itemIndex}-{categoryIndex}` to
|
|
93
|
-
/// match the template's collapse ids.
|
|
94
114
|
function buildSanitizedAnswers(faqs, sanitize) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
103
|
-
return answers;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
class FaqComponent extends AppBaseComponent {
|
|
107
|
-
constructor(commonService, injector, productService, sanitizer, cdr) {
|
|
108
|
-
super(injector);
|
|
109
|
-
this.commonService = commonService;
|
|
110
|
-
this.productService = productService;
|
|
111
|
-
this.sanitizer = sanitizer;
|
|
112
|
-
this.cdr = cdr;
|
|
113
|
-
this.searchSubject = new Subject();
|
|
114
|
-
this.destroy$ = new Subject();
|
|
115
|
-
this.sanitizedFaqAnswers = {};
|
|
116
|
-
this.subscriptions = [];
|
|
117
|
-
this.objectKeys = Object.keys;
|
|
118
|
-
this.isLoaded = false;
|
|
119
|
-
this.faqsResponse = [];
|
|
120
|
-
this.faqHashMap = {};
|
|
121
|
-
this.routers = ADMIN_ROUTERS;
|
|
122
|
-
/// Whether to offer the inline link through to the admin edit form. Unlike
|
|
123
|
-
/// the detail page, the list endpoint returns each FAQ's `id`, so no
|
|
124
|
-
/// fallback is needed here.
|
|
125
|
-
this.canEditFaq = false;
|
|
126
|
-
}
|
|
127
|
-
ngOnInit() {
|
|
128
|
-
this.faqHashMap = {};
|
|
129
|
-
this.showSupport = PermissionService.selectedProduct?.gitlab_service_desk_email;
|
|
130
|
-
this.showDocumentation = PermissionService.selectedProduct?.documentation_url;
|
|
131
|
-
this.slug = PermissionService.selectedSubscription?.slug;
|
|
132
|
-
this.subscriptionId = PermissionService?.selectedSubscription?.id;
|
|
133
|
-
this.masterProductId = this.appConfig.master_subscription.product_id;
|
|
134
|
-
this.canEditFaq = this.permissionService.evaluatePermissions(FAQ_ADMIN_PERMISSION);
|
|
135
|
-
this.getProducts();
|
|
136
|
-
this.searchSubject
|
|
137
|
-
.pipe(debounceTime(1000), takeUntil(this.destroy$))
|
|
138
|
-
.subscribe(searchValue => {
|
|
139
|
-
this.search_term = searchValue;
|
|
140
|
-
this.loadFaqData();
|
|
141
|
-
this.cdr.markForCheck();
|
|
142
|
-
});
|
|
143
|
-
this.loadFaqData();
|
|
144
|
-
}
|
|
145
|
-
loadFaqData() {
|
|
146
|
-
this.isLoaded = false;
|
|
147
|
-
forkJoin({
|
|
148
|
-
faqs: this.commonService.getPublicFaq(this.subscriptionId, this.search_term),
|
|
149
|
-
products: this.productService.getProducts({ master_product_id: this.masterProductId })
|
|
150
|
-
})
|
|
151
|
-
.pipe(finalize(() => {
|
|
152
|
-
this.isLoaded = true;
|
|
153
|
-
this.cdr.markForCheck();
|
|
154
|
-
}))
|
|
155
|
-
.subscribe(({ faqs, products }) => {
|
|
156
|
-
this.faqsResponse = faqs.faqs;
|
|
157
|
-
faqs?.available_category?.forEach(x => {
|
|
158
|
-
this.faqHashMap[x.key] = x;
|
|
159
|
-
});
|
|
160
|
-
this.totalRecords = faqs.faqs.length;
|
|
161
|
-
this.nonProductFaqs = this.faqsResponse.filter(x => x.visible && !x.product_id);
|
|
162
|
-
this.allProductFaqs = this.faqsResponse.filter(x => x.visible && x.product_id);
|
|
163
|
-
const noProductObjects = this.faqsResponse.every(x => x.product === null);
|
|
164
|
-
this.allFaqFalse = this.faqsResponse.every(x => x.visible === false);
|
|
165
|
-
if (!noProductObjects) {
|
|
166
|
-
this.products = products.products;
|
|
167
|
-
this.faqValidation();
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
this.products = [];
|
|
171
|
-
this.faqValidation();
|
|
172
|
-
}
|
|
173
|
-
this.cdr.markForCheck();
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
faqValidation() {
|
|
177
|
-
this.faqs = groupFaqsByCategory(this.nonProductFaqs, this.allProductFaqs);
|
|
178
|
-
this.sanitizedFaqAnswers = buildSanitizedAnswers(this.faqs, body => this.sanitizeFaqAnswer(body));
|
|
179
|
-
}
|
|
180
|
-
getProducts() {
|
|
181
|
-
this.subscriptions = [];
|
|
182
|
-
this.userStore().subscribe((user) => {
|
|
183
|
-
if (user) {
|
|
184
|
-
this.subscriptions = user.subscriptions;
|
|
185
|
-
}
|
|
186
|
-
this.cdr.markForCheck();
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
filter(searchValue) {
|
|
190
|
-
this.searchSubject.next(searchValue);
|
|
191
|
-
}
|
|
192
|
-
navigateToSupport() {
|
|
193
|
-
this.router.navigate(['/support']);
|
|
194
|
-
}
|
|
195
|
-
navigateToDocumentation() {
|
|
196
|
-
sessionStorage.setItem('documentation_url', this.showDocumentation);
|
|
197
|
-
const documentationRoute = this.router.createUrlTree([this.slug, 'documentation']);
|
|
198
|
-
const url = window.location.origin + this.router.serializeUrl(documentationRoute);
|
|
199
|
-
window.open(url, '_blank');
|
|
200
|
-
}
|
|
201
|
-
trackByProductFaqId(_index, item) {
|
|
202
|
-
return item.id;
|
|
203
|
-
}
|
|
204
|
-
onCollapseToggle(key, answer) {
|
|
205
|
-
if (!this.sanitizedFaqAnswers[key] && answer) {
|
|
206
|
-
this.sanitizedFaqAnswers[key] = this.sanitizeFaqAnswer(answer);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
sanitizeFaqAnswer(body) {
|
|
210
|
-
return HelperService.sanitizeQuillBody(body, this.sanitizer);
|
|
211
|
-
}
|
|
212
|
-
ngOnDestroy() {
|
|
213
|
-
this.destroy$.next();
|
|
214
|
-
this.destroy$.complete();
|
|
215
|
-
super.ngOnDestroy();
|
|
216
|
-
}
|
|
217
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FaqComponent, deps: [{ token: i1.CommonService }, { token: i0.Injector }, { token: i1.ProductService }, { token: i2.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
218
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: FaqComponent, isStandalone: false, selector: "pw-faq", usesInheritance: true, ngImport: i0, template: "<div class=\"mt-md-4 mt-4\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <div class=\"card gradient-custom-branding white text-center p-1 p-sm-2\">\n <div class=\"card-header p-1 p-sm-2\">\n <div class=\"d-flex justify-content-between align-items-start mb-3 mb-md-0\">\n <div>\n @if (showDocumentation) {\n <button\n class=\"btn btn-sm document-btn\"\n (click)=\"navigateToDocumentation()\">\n Documentation\n </button>\n }\n </div>\n <div>\n @if (showSupport) {\n <button\n class=\"btn btn-sm btn-primary\"\n (click)=\"navigateToSupport()\">\n Support\n </button>\n }\n </div>\n </div>\n\n <h1>You need help?</h1>\n <p><em>Please search through our frequently asked questions first.</em></p>\n </div>\n <div class=\"card-block p-2 p-sm-2\">\n <fieldset>\n <legend></legend>\n <label for=\"faq-search\" class=\"visually-hidden\">Search in FAQs</label>\n <input type=\"text\"\n id=\"faq-search\"\n name=\"faq-search\"\n class=\"form-control bg-white\"\n placeholder=\"Search FAQs...\"\n (input)=\"filter($event.target.value)\"\n #messageInput\n aria-label=\"Search FAQs...\" />\n </fieldset>\n </div>\n </div>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (faqs) {\n @for (category of objectKeys(faqs); track category; let idx1 = $index) {\n <div>\n @if (faqs[category]?.length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ faqHashMap[category]?.name }}</h6>\n <div class=\"dashboard\">\n @for (\n faq of faqs[category]; track trackByProductFaqId(idx,\n faq); let idx = $index) {\n <div class=\"faq-item\"\n >\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n (click)=\"onCollapseToggle(idx + '-' + idx1, faq?.answer)\"\n [href]=\"'#collapse' + idx + idx1\">\n {{ faq.question }}\n </a>\n </h5>\n @if (canEditFaq && faq?.id) {\n <a class=\"faq-edit-link\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + faq.id]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </div>\n <div [id]=\"'collapse' + idx + idx1\"\n class=\"panel-collapse p-3 collapse in\">\n <div class=\"card-block\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"sanitizedFaqAnswers[idx + '-' + idx1]\">\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n }\n @if (isLoaded && (totalRecords === 0 || allFaqFalse)) {\n <div>\n <pw-no-data [withImage]=\"true\" message=\"This is embarrassing - we couldn't find any FAQ.\"> </pw-no-data>\n </div>\n }\n</div>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.card-header h1,.card-header p{color:#fff!important}.faq-item{border:1px solid rgb(224,224,224);background-color:#fff;border-radius:8px;margin:8px 0;overflow:hidden;transition:border-color .16s ease-out,box-shadow .16s ease-out}.faq-item:hover{border-color:#bdbdbd}.faq-item .dashboard-header{background:transparent;padding:0;display:flex;align-items:center;position:relative}.faq-item .dashboard-header:after{content:\"\\f078\";font-family:\"Font Awesome 5 Pro\",sans-serif;font-weight:600;font-size:13px;color:#9e9e9e;flex:0 0 auto;margin-left:auto;margin-right:18px;transition:transform .18s ease-out,color .18s ease-out}.faq-item .dashboard-header:hover:after{color:var(--titles)}.faq-item .dashboard-header:has(.accordion-toggle:not(.collapsed)):after{transform:rotate(180deg);color:var(--titles)}.faq-item .accordion-title{margin:0;flex:0 1 auto;min-width:0}.faq-item .faq-edit-link{position:relative;z-index:1;display:inline-flex;align-items:center;flex:0 0 auto;padding:14px 8px;text-decoration:none}.faq-item .faq-edit-link .edit-icon{font-size:14px}.faq-item .accordion-toggle{display:flex;align-items:center;padding:14px 4px 14px 18px;font-size:15px;font-weight:600;line-height:1.45;color:var(--titles);text-decoration:none;cursor:pointer}.faq-item .accordion-toggle:before{content:\"\"!important;position:absolute;inset:0;width:auto;padding:0}.faq-item .accordion-toggle:focus-visible{outline:2px solid var(--first);outline-offset:-2px}.faq-item .panel-collapse{padding:0!important}.faq-item .card-block{padding:4px 18px 16px;border-top:1px solid rgb(238,238,238)}.faq-item .ql-editor{font-size:14px;line-height:1.65;color:#616161;text-align:left}.document-btn{background-color:var(--second);border-color:var(--second)!important;color:#fff}.document-btn:hover{color:var(--second)!important;background-color:transparent!important}.card{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}h6{color:var(--titles)!important;font-size:17px;font-weight:700;letter-spacing:.04em;padding:0 0 10px!important;margin:32px 0 14px!important;border-bottom:1px solid rgb(224,224,224)}.accordion-title a{color:var(--titles)!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "pipe", type: i7.TranslocoPipe, name: "transloco" }] }); }
|
|
115
|
+
const answers = {};
|
|
116
|
+
Object.keys(faqs).forEach((category, categoryIndex) => {
|
|
117
|
+
faqs[category].forEach((faq, itemIndex) => {
|
|
118
|
+
if (faq?.answer) answers[`${itemIndex}-${categoryIndex}`] = sanitize(faq.answer);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
return answers;
|
|
219
122
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
123
|
+
var FaqComponent = class FaqComponent extends AppBaseComponent {
|
|
124
|
+
constructor(commonService, injector, productService, sanitizer, cdr) {
|
|
125
|
+
super(injector);
|
|
126
|
+
this.commonService = commonService;
|
|
127
|
+
this.productService = productService;
|
|
128
|
+
this.sanitizer = sanitizer;
|
|
129
|
+
this.cdr = cdr;
|
|
130
|
+
this.searchSubject = new Subject();
|
|
131
|
+
this.destroy$ = new Subject();
|
|
132
|
+
this.sanitizedFaqAnswers = {};
|
|
133
|
+
this.subscriptions = [];
|
|
134
|
+
this.objectKeys = Object.keys;
|
|
135
|
+
this.isLoaded = false;
|
|
136
|
+
this.faqsResponse = [];
|
|
137
|
+
this.faqHashMap = {};
|
|
138
|
+
this.routers = ADMIN_ROUTERS;
|
|
139
|
+
this.canEditFaq = false;
|
|
140
|
+
}
|
|
141
|
+
ngOnInit() {
|
|
142
|
+
this.faqHashMap = {};
|
|
143
|
+
this.showSupport = PermissionService.selectedProduct?.gitlab_service_desk_email;
|
|
144
|
+
this.showDocumentation = PermissionService.selectedProduct?.documentation_url;
|
|
145
|
+
this.slug = PermissionService.selectedSubscription?.slug;
|
|
146
|
+
this.subscriptionId = PermissionService?.selectedSubscription?.id;
|
|
147
|
+
this.masterProductId = this.appConfig.master_subscription.product_id;
|
|
148
|
+
this.canEditFaq = this.permissionService.evaluatePermissions(FAQ_ADMIN_PERMISSION);
|
|
149
|
+
this.getProducts();
|
|
150
|
+
this.searchSubject.pipe(debounceTime(1e3), takeUntil(this.destroy$)).subscribe((searchValue) => {
|
|
151
|
+
this.search_term = searchValue;
|
|
152
|
+
this.loadFaqData();
|
|
153
|
+
this.cdr.markForCheck();
|
|
154
|
+
});
|
|
155
|
+
this.loadFaqData();
|
|
156
|
+
}
|
|
157
|
+
loadFaqData() {
|
|
158
|
+
this.isLoaded = false;
|
|
159
|
+
forkJoin({
|
|
160
|
+
faqs: this.commonService.getPublicFaq(this.subscriptionId, this.search_term),
|
|
161
|
+
products: this.productService.getProducts({ master_product_id: this.masterProductId })
|
|
162
|
+
}).pipe(finalize(() => {
|
|
163
|
+
this.isLoaded = true;
|
|
164
|
+
this.cdr.markForCheck();
|
|
165
|
+
})).subscribe(({ faqs, products }) => {
|
|
166
|
+
this.faqsResponse = faqs.faqs;
|
|
167
|
+
faqs?.available_category?.forEach((x) => {
|
|
168
|
+
this.faqHashMap[x.key] = x;
|
|
169
|
+
});
|
|
170
|
+
this.totalRecords = faqs.faqs.length;
|
|
171
|
+
this.nonProductFaqs = this.faqsResponse.filter((x) => x.visible && !x.product_id);
|
|
172
|
+
this.allProductFaqs = this.faqsResponse.filter((x) => x.visible && x.product_id);
|
|
173
|
+
const noProductObjects = this.faqsResponse.every((x) => x.product === null);
|
|
174
|
+
this.allFaqFalse = this.faqsResponse.every((x) => x.visible === false);
|
|
175
|
+
if (!noProductObjects) {
|
|
176
|
+
this.products = products.products;
|
|
177
|
+
this.faqValidation();
|
|
178
|
+
} else {
|
|
179
|
+
this.products = [];
|
|
180
|
+
this.faqValidation();
|
|
181
|
+
}
|
|
182
|
+
this.cdr.markForCheck();
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
faqValidation() {
|
|
186
|
+
this.faqs = groupFaqsByCategory(this.nonProductFaqs, this.allProductFaqs);
|
|
187
|
+
this.sanitizedFaqAnswers = buildSanitizedAnswers(this.faqs, (body) => this.sanitizeFaqAnswer(body));
|
|
188
|
+
}
|
|
189
|
+
getProducts() {
|
|
190
|
+
this.subscriptions = [];
|
|
191
|
+
this.userStore().subscribe((user) => {
|
|
192
|
+
if (user) this.subscriptions = user.subscriptions;
|
|
193
|
+
this.cdr.markForCheck();
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
filter(searchValue) {
|
|
197
|
+
this.searchSubject.next(searchValue);
|
|
198
|
+
}
|
|
199
|
+
navigateToSupport() {
|
|
200
|
+
this.router.navigate(["/support"]);
|
|
201
|
+
}
|
|
202
|
+
navigateToDocumentation() {
|
|
203
|
+
sessionStorage.setItem("documentation_url", this.showDocumentation);
|
|
204
|
+
const documentationRoute = this.router.createUrlTree([this.slug, "documentation"]);
|
|
205
|
+
const url = window.location.origin + this.router.serializeUrl(documentationRoute);
|
|
206
|
+
window.open(url, "_blank");
|
|
207
|
+
}
|
|
208
|
+
trackByProductFaqId(_index, item) {
|
|
209
|
+
return item.id;
|
|
210
|
+
}
|
|
211
|
+
onCollapseToggle(key, answer) {
|
|
212
|
+
if (!this.sanitizedFaqAnswers[key] && answer) this.sanitizedFaqAnswers[key] = this.sanitizeFaqAnswer(answer);
|
|
213
|
+
}
|
|
214
|
+
sanitizeFaqAnswer(body) {
|
|
215
|
+
return HelperService.sanitizeQuillBody(body, this.sanitizer);
|
|
216
|
+
}
|
|
217
|
+
ngOnDestroy() {
|
|
218
|
+
this.destroy$.next();
|
|
219
|
+
this.destroy$.complete();
|
|
220
|
+
super.ngOnDestroy();
|
|
221
|
+
}
|
|
222
|
+
static {
|
|
223
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
224
|
+
minVersion: "12.0.0",
|
|
225
|
+
version: "22.2.0",
|
|
226
|
+
ngImport: i0,
|
|
227
|
+
type: FaqComponent,
|
|
228
|
+
deps: [
|
|
229
|
+
{ token: i1$1.CommonService },
|
|
230
|
+
{ token: i0.Injector },
|
|
231
|
+
{ token: i1$1.ProductService },
|
|
232
|
+
{ token: i1$2.DomSanitizer },
|
|
233
|
+
{ token: i0.ChangeDetectorRef }
|
|
234
|
+
],
|
|
235
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
static {
|
|
239
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
240
|
+
minVersion: "17.0.0",
|
|
241
|
+
version: "22.2.0",
|
|
242
|
+
type: FaqComponent,
|
|
243
|
+
isStandalone: false,
|
|
244
|
+
selector: "pw-faq",
|
|
245
|
+
usesInheritance: true,
|
|
246
|
+
ngImport: i0,
|
|
247
|
+
template: "<div class=\"mt-md-4 mt-4\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <div class=\"card gradient-custom-branding white text-center p-1 p-sm-2\">\n <div class=\"card-header p-1 p-sm-2\">\n <div class=\"d-flex justify-content-between align-items-start mb-3 mb-md-0\">\n <div>\n @if (showDocumentation) {\n <button\n class=\"btn btn-sm document-btn\"\n (click)=\"navigateToDocumentation()\">\n Documentation\n </button>\n }\n </div>\n <div>\n @if (showSupport) {\n <button\n class=\"btn btn-sm btn-primary\"\n (click)=\"navigateToSupport()\">\n Support\n </button>\n }\n </div>\n </div>\n\n <h1>You need help?</h1>\n <p><em>Please search through our frequently asked questions first.</em></p>\n </div>\n <div class=\"card-block p-2 p-sm-2\">\n <fieldset>\n <legend></legend>\n <label for=\"faq-search\" class=\"visually-hidden\">Search in FAQs</label>\n <input type=\"text\"\n id=\"faq-search\"\n name=\"faq-search\"\n class=\"form-control bg-white\"\n placeholder=\"Search FAQs...\"\n (input)=\"filter($event.target.value)\"\n #messageInput\n aria-label=\"Search FAQs...\" />\n </fieldset>\n </div>\n </div>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (faqs) {\n @for (category of objectKeys(faqs); track category; let idx1 = $index) {\n <div>\n @if (faqs[category]?.length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ faqHashMap[category]?.name }}</h6>\n <div class=\"dashboard\">\n @for (\n faq of faqs[category]; track trackByProductFaqId(idx,\n faq); let idx = $index) {\n <div class=\"faq-item\"\n >\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n (click)=\"onCollapseToggle(idx + '-' + idx1, faq?.answer)\"\n [href]=\"'#collapse' + idx + idx1\">\n {{ faq.question }}\n </a>\n </h5>\n @if (canEditFaq && faq?.id) {\n <a class=\"faq-edit-link\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + faq.id]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </div>\n <div [id]=\"'collapse' + idx + idx1\"\n class=\"panel-collapse p-3 collapse in\">\n <div class=\"card-block\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"sanitizedFaqAnswers[idx + '-' + idx1]\">\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n }\n @if (isLoaded && (totalRecords === 0 || allFaqFalse)) {\n <div>\n <pw-no-data [withImage]=\"true\" message=\"This is embarrassing - we couldn't find any FAQ.\"> </pw-no-data>\n </div>\n }\n</div>\n",
|
|
248
|
+
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.card-header h1,.card-header p{color:#fff!important}.faq-item{border:1px solid rgb(224,224,224);background-color:#fff;border-radius:8px;margin:8px 0;overflow:hidden;transition:border-color .16s ease-out,box-shadow .16s ease-out}.faq-item:hover{border-color:#bdbdbd}.faq-item .dashboard-header{background:transparent;padding:0;display:flex;align-items:center;position:relative}.faq-item .dashboard-header:after{content:\"\\f078\";font-family:\"Font Awesome 5 Pro\",sans-serif;font-weight:600;font-size:13px;color:#9e9e9e;flex:0 0 auto;margin-left:auto;margin-right:18px;transition:transform .18s ease-out,color .18s ease-out}.faq-item .dashboard-header:hover:after{color:var(--titles)}.faq-item .dashboard-header:has(.accordion-toggle:not(.collapsed)):after{transform:rotate(180deg);color:var(--titles)}.faq-item .accordion-title{margin:0;flex:0 1 auto;min-width:0}.faq-item .faq-edit-link{position:relative;z-index:1;display:inline-flex;align-items:center;flex:0 0 auto;padding:14px 8px;text-decoration:none}.faq-item .faq-edit-link .edit-icon{font-size:14px}.faq-item .accordion-toggle{display:flex;align-items:center;padding:14px 4px 14px 18px;font-size:15px;font-weight:600;line-height:1.45;color:var(--titles);text-decoration:none;cursor:pointer}.faq-item .accordion-toggle:before{content:\"\"!important;position:absolute;inset:0;width:auto;padding:0}.faq-item .accordion-toggle:focus-visible{outline:2px solid var(--first);outline-offset:-2px}.faq-item .panel-collapse{padding:0!important}.faq-item .card-block{padding:4px 18px 16px;border-top:1px solid rgb(238,238,238)}.faq-item .ql-editor{font-size:14px;line-height:1.65;color:#616161;text-align:left}.document-btn{background-color:var(--second);border-color:var(--second)!important;color:#fff}.document-btn:hover{color:var(--second)!important;background-color:transparent!important}.card{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}h6{color:var(--titles)!important;font-size:17px;font-weight:700;letter-spacing:.04em;padding:0 0 10px!important;margin:32px 0 14px!important;border-bottom:1px solid rgb(224,224,224)}.accordion-title a{color:var(--titles)!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"],
|
|
249
|
+
dependencies: [
|
|
250
|
+
{
|
|
251
|
+
kind: "directive",
|
|
252
|
+
type: i3$1.RouterLink,
|
|
253
|
+
selector: "[routerLink]",
|
|
254
|
+
inputs: [
|
|
255
|
+
"target",
|
|
256
|
+
"queryParams",
|
|
257
|
+
"fragment",
|
|
258
|
+
"queryParamsHandling",
|
|
259
|
+
"state",
|
|
260
|
+
"info",
|
|
261
|
+
"relativeTo",
|
|
262
|
+
"preserveFragment",
|
|
263
|
+
"skipLocationChange",
|
|
264
|
+
"replaceUrl",
|
|
265
|
+
"browserUrl",
|
|
266
|
+
"routerLink"
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
kind: "component",
|
|
271
|
+
type: i2$2.ProgressSpinner,
|
|
272
|
+
selector: "p-progress-spinner, p-progressspinner",
|
|
273
|
+
inputs: [
|
|
274
|
+
"value",
|
|
275
|
+
"strokeWidth",
|
|
276
|
+
"animationDuration",
|
|
277
|
+
"min",
|
|
278
|
+
"max",
|
|
279
|
+
"ariaLabel",
|
|
280
|
+
"fill"
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
kind: "directive",
|
|
285
|
+
type: i5$1.Tooltip,
|
|
286
|
+
selector: "[pTooltip]",
|
|
287
|
+
inputs: [
|
|
288
|
+
"tooltipPosition",
|
|
289
|
+
"tooltipEvent",
|
|
290
|
+
"positionStyle",
|
|
291
|
+
"tooltipStyleClass",
|
|
292
|
+
"tooltipZIndex",
|
|
293
|
+
"escape",
|
|
294
|
+
"showDelay",
|
|
295
|
+
"hideDelay",
|
|
296
|
+
"life",
|
|
297
|
+
"positionTop",
|
|
298
|
+
"positionLeft",
|
|
299
|
+
"autoHide",
|
|
300
|
+
"fitContent",
|
|
301
|
+
"hideOnEscape",
|
|
302
|
+
"showOnEllipsis",
|
|
303
|
+
"pTooltip",
|
|
304
|
+
"tooltipDisabled",
|
|
305
|
+
"tooltipOptions",
|
|
306
|
+
"appendTo",
|
|
307
|
+
"pTooltipPT",
|
|
308
|
+
"pTooltipUnstyled"
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
kind: "component",
|
|
313
|
+
type: i6.NoDataComponent,
|
|
314
|
+
selector: "pw-no-data",
|
|
315
|
+
inputs: [
|
|
316
|
+
"message",
|
|
317
|
+
"description",
|
|
318
|
+
"withImage"
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
kind: "pipe",
|
|
323
|
+
type: i7.TranslocoPipe,
|
|
324
|
+
name: "transloco"
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
331
|
+
minVersion: "12.0.0",
|
|
332
|
+
version: "22.2.0",
|
|
333
|
+
ngImport: i0,
|
|
334
|
+
type: FaqComponent,
|
|
335
|
+
decorators: [{
|
|
336
|
+
type: Component,
|
|
337
|
+
args: [{
|
|
338
|
+
selector: "pw-faq",
|
|
339
|
+
standalone: false,
|
|
340
|
+
template: "<div class=\"mt-md-4 mt-4\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <div class=\"card gradient-custom-branding white text-center p-1 p-sm-2\">\n <div class=\"card-header p-1 p-sm-2\">\n <div class=\"d-flex justify-content-between align-items-start mb-3 mb-md-0\">\n <div>\n @if (showDocumentation) {\n <button\n class=\"btn btn-sm document-btn\"\n (click)=\"navigateToDocumentation()\">\n Documentation\n </button>\n }\n </div>\n <div>\n @if (showSupport) {\n <button\n class=\"btn btn-sm btn-primary\"\n (click)=\"navigateToSupport()\">\n Support\n </button>\n }\n </div>\n </div>\n\n <h1>You need help?</h1>\n <p><em>Please search through our frequently asked questions first.</em></p>\n </div>\n <div class=\"card-block p-2 p-sm-2\">\n <fieldset>\n <legend></legend>\n <label for=\"faq-search\" class=\"visually-hidden\">Search in FAQs</label>\n <input type=\"text\"\n id=\"faq-search\"\n name=\"faq-search\"\n class=\"form-control bg-white\"\n placeholder=\"Search FAQs...\"\n (input)=\"filter($event.target.value)\"\n #messageInput\n aria-label=\"Search FAQs...\" />\n </fieldset>\n </div>\n </div>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (faqs) {\n @for (category of objectKeys(faqs); track category; let idx1 = $index) {\n <div>\n @if (faqs[category]?.length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ faqHashMap[category]?.name }}</h6>\n <div class=\"dashboard\">\n @for (\n faq of faqs[category]; track trackByProductFaqId(idx,\n faq); let idx = $index) {\n <div class=\"faq-item\"\n >\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n (click)=\"onCollapseToggle(idx + '-' + idx1, faq?.answer)\"\n [href]=\"'#collapse' + idx + idx1\">\n {{ faq.question }}\n </a>\n </h5>\n @if (canEditFaq && faq?.id) {\n <a class=\"faq-edit-link\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + faq.id]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </div>\n <div [id]=\"'collapse' + idx + idx1\"\n class=\"panel-collapse p-3 collapse in\">\n <div class=\"card-block\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"sanitizedFaqAnswers[idx + '-' + idx1]\">\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n }\n @if (isLoaded && (totalRecords === 0 || allFaqFalse)) {\n <div>\n <pw-no-data [withImage]=\"true\" message=\"This is embarrassing - we couldn't find any FAQ.\"> </pw-no-data>\n </div>\n }\n</div>\n",
|
|
341
|
+
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.card-header h1,.card-header p{color:#fff!important}.faq-item{border:1px solid rgb(224,224,224);background-color:#fff;border-radius:8px;margin:8px 0;overflow:hidden;transition:border-color .16s ease-out,box-shadow .16s ease-out}.faq-item:hover{border-color:#bdbdbd}.faq-item .dashboard-header{background:transparent;padding:0;display:flex;align-items:center;position:relative}.faq-item .dashboard-header:after{content:\"\\f078\";font-family:\"Font Awesome 5 Pro\",sans-serif;font-weight:600;font-size:13px;color:#9e9e9e;flex:0 0 auto;margin-left:auto;margin-right:18px;transition:transform .18s ease-out,color .18s ease-out}.faq-item .dashboard-header:hover:after{color:var(--titles)}.faq-item .dashboard-header:has(.accordion-toggle:not(.collapsed)):after{transform:rotate(180deg);color:var(--titles)}.faq-item .accordion-title{margin:0;flex:0 1 auto;min-width:0}.faq-item .faq-edit-link{position:relative;z-index:1;display:inline-flex;align-items:center;flex:0 0 auto;padding:14px 8px;text-decoration:none}.faq-item .faq-edit-link .edit-icon{font-size:14px}.faq-item .accordion-toggle{display:flex;align-items:center;padding:14px 4px 14px 18px;font-size:15px;font-weight:600;line-height:1.45;color:var(--titles);text-decoration:none;cursor:pointer}.faq-item .accordion-toggle:before{content:\"\"!important;position:absolute;inset:0;width:auto;padding:0}.faq-item .accordion-toggle:focus-visible{outline:2px solid var(--first);outline-offset:-2px}.faq-item .panel-collapse{padding:0!important}.faq-item .card-block{padding:4px 18px 16px;border-top:1px solid rgb(238,238,238)}.faq-item .ql-editor{font-size:14px;line-height:1.65;color:#616161;text-align:left}.document-btn{background-color:var(--second);border-color:var(--second)!important;color:#fff}.document-btn:hover{color:var(--second)!important;background-color:transparent!important}.card{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}h6{color:var(--titles)!important;font-size:17px;font-weight:700;letter-spacing:.04em;padding:0 0 10px!important;margin:32px 0 14px!important;border-bottom:1px solid rgb(224,224,224)}.accordion-title a{color:var(--titles)!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"]
|
|
342
|
+
}]
|
|
343
|
+
}],
|
|
344
|
+
ctorParameters: () => [
|
|
345
|
+
{ type: i1$1.CommonService },
|
|
346
|
+
{ type: i0.Injector },
|
|
347
|
+
{ type: i1$1.ProductService },
|
|
348
|
+
{ type: i1$2.DomSanitizer },
|
|
349
|
+
{ type: i0.ChangeDetectorRef }
|
|
350
|
+
]
|
|
351
|
+
});
|
|
236
352
|
const EMPTY_FAQ_STATUS_BADGES = {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
353
|
+
isPublic: false,
|
|
354
|
+
isHidden: false,
|
|
355
|
+
category: void 0,
|
|
356
|
+
categoryLabel: "",
|
|
357
|
+
categoryKeys: [],
|
|
358
|
+
featureKeys: []
|
|
243
359
|
};
|
|
244
360
|
function buildStatusBadges(faq, categories) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
featureKeys: Array.isArray(faq.feature_keys) ? faq.feature_keys : []
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
class FaqDetailsComponent extends AppBaseComponent {
|
|
262
|
-
constructor(commonService, injector, sanitizer, cdr) {
|
|
263
|
-
super(injector);
|
|
264
|
-
this.commonService = commonService;
|
|
265
|
-
this.sanitizer = sanitizer;
|
|
266
|
-
this.cdr = cdr;
|
|
267
|
-
this.isLoading = false;
|
|
268
|
-
this.routers = ADMIN_ROUTERS;
|
|
269
|
-
/// Whether to offer the inline link through to the admin edit form.
|
|
270
|
-
this.canEditFaq = false;
|
|
271
|
-
/// Numeric id for the admin edit route, or null when none can be resolved.
|
|
272
|
-
this.editFaqId = null;
|
|
273
|
-
/// Editor-only status badges — see `faq-status-badges.ts` for what each
|
|
274
|
-
/// one means and why the booleans only render in their notable state.
|
|
275
|
-
this.badges = { ...EMPTY_FAQ_STATUS_BADGES };
|
|
276
|
-
/// Resolved before the request so the categories lookup can be issued in
|
|
277
|
-
/// parallel rather than chained behind the FAQ (AI54: one loader, one wait).
|
|
278
|
-
this.hasFaqAdminPermission = false;
|
|
279
|
-
this.faqRef = this.route.snapshot.params['id'];
|
|
280
|
-
this.slug = PermissionService.selectedSubscription?.slug;
|
|
281
|
-
}
|
|
282
|
-
ngOnInit() {
|
|
283
|
-
this.hasFaqAdminPermission =
|
|
284
|
-
this.permissionService.evaluatePermissions(FAQ_ADMIN_PERMISSION);
|
|
285
|
-
this.getFaq();
|
|
286
|
-
}
|
|
287
|
-
/// True once there is at least one badge worth a row of its own.
|
|
288
|
-
get showStatusBadges() {
|
|
289
|
-
return (this.canEditFaq &&
|
|
290
|
-
(this.badges.isPublic || this.badges.isHidden || !!this.badges.categoryLabel));
|
|
291
|
-
}
|
|
292
|
-
getFaq() {
|
|
293
|
-
this.isLoading = true;
|
|
294
|
-
forkJoin({
|
|
295
|
-
faq: this.commonService.getPublicFaqById(this.faqRef),
|
|
296
|
-
categories: this.faqCategories$()
|
|
297
|
-
})
|
|
298
|
-
.pipe(finalize(() => {
|
|
299
|
-
this.isLoading = false;
|
|
300
|
-
this.cdr.markForCheck();
|
|
301
|
-
}))
|
|
302
|
-
.subscribe(({ faq, categories }) => {
|
|
303
|
-
this.faq = { ...faq, answer: this.sanitizeAnswer(faq) };
|
|
304
|
-
// Only offer the edit affordance once a FAQ actually resolved —
|
|
305
|
-
// a miss still leaves `faq` truthy (spreading null yields
|
|
306
|
-
// `{answer: undefined}`), so key off the question itself.
|
|
307
|
-
const loaded = !!faq?.question;
|
|
308
|
-
this.canEditFaq = loaded && this.hasFaqAdminPermission;
|
|
309
|
-
this.editFaqId = loaded ? this.resolveEditFaqId(faq) : null;
|
|
310
|
-
this.badges = buildStatusBadges(loaded ? faq : null, categories);
|
|
311
|
-
this.cdr.markForCheck();
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
/// Category names are only ever rendered for an editor — skip the call
|
|
315
|
-
/// entirely otherwise.
|
|
316
|
-
///
|
|
317
|
-
/// Subscription resolution is [TEN2]-first: `getUserSubscriptionId()`
|
|
318
|
-
/// matches the route slug against the user's OWN subscriptions, never
|
|
319
|
-
/// trusting a raw route param. `PermissionService.selectedSubscription` is
|
|
320
|
-
/// kept only as a FALLBACK, for the one case that helper cannot serve — a
|
|
321
|
-
/// super admin viewing a subscription they are not a member of, where it
|
|
322
|
-
/// resolves to nothing and the badge would degrade to a raw
|
|
323
|
-
/// `master_admin`-style key for exactly the audience that needs the name.
|
|
324
|
-
///
|
|
325
|
-
/// 🔴 That fallback is safe HERE AND ONLY HERE because this endpoint's
|
|
326
|
-
/// payload is tenant-invariant: `available_categories` returns the frozen
|
|
327
|
-
/// `Faq::AVAILABLE_CATEGORIES` constant and never reads `subscription_id`
|
|
328
|
-
/// (main-api `app/api/v1/public/faqs.rb:27` -> `faq_helpers.rb:34`). The
|
|
329
|
-
/// param exists only to satisfy Grape's required-params contract, so a
|
|
330
|
-
/// stale id cannot surface another tenant's data. Do NOT copy this
|
|
331
|
-
/// fallback onto a call that returns tenant-scoped data.
|
|
332
|
-
///
|
|
333
|
-
/// `take(1)` is load-bearing: `getUserSubscriptionId()` wraps
|
|
334
|
-
/// `route.parent.params`, which never completes, and `forkJoin` waits for
|
|
335
|
-
/// EVERY source to complete — without it the page spins forever.
|
|
336
|
-
///
|
|
337
|
-
/// A failure must never take the FAQ itself down with it, so it degrades to
|
|
338
|
-
/// the raw category key rather than propagating.
|
|
339
|
-
faqCategories$() {
|
|
340
|
-
if (!this.hasFaqAdminPermission) {
|
|
341
|
-
return of(null);
|
|
342
|
-
}
|
|
343
|
-
return this.getUserSubscriptionId().pipe(take(1), map(id => id ?? PermissionService.selectedSubscription?.id), switchMap(id => (id ? this.commonService.getFaqCategories(id) : of(null))), catchError(() => of(null)));
|
|
344
|
-
}
|
|
345
|
-
sanitizeAnswer(faq) {
|
|
346
|
-
if (!faq?.answer) {
|
|
347
|
-
return undefined;
|
|
348
|
-
}
|
|
349
|
-
const doc = new DOMParser().parseFromString(faq.answer, 'text/html');
|
|
350
|
-
// Remove all button elements
|
|
351
|
-
doc.querySelectorAll('button').forEach(button => button.remove());
|
|
352
|
-
// Return sanitized HTML
|
|
353
|
-
// NOSONAR: Trusted HTML content is handled safely here
|
|
354
|
-
return this.sanitizer.bypassSecurityTrustHtml(doc.body.innerHTML); // NOSONAR
|
|
355
|
-
}
|
|
356
|
-
/// The admin edit route resolves a NUMERIC id (`+params['id'] || 0` in
|
|
357
|
-
/// `AddEditFaqComponent`), but this page is reachable by slug too and the
|
|
358
|
-
/// public endpoint does not return the id at all — main-api's
|
|
359
|
-
/// `FaqHelpers#faq_attributes_to_return` whitelists `slug`, not `id`. So
|
|
360
|
-
/// prefer a payload id if one ever appears, then fall back to the route
|
|
361
|
-
/// param only when it is already numeric. Returning null hides the link
|
|
362
|
-
/// rather than opening the admin form in "add a new FAQ" mode.
|
|
363
|
-
resolveEditFaqId(faq) {
|
|
364
|
-
const fromPayload = Number(faq?.id);
|
|
365
|
-
if (Number.isInteger(fromPayload) && fromPayload > 0) {
|
|
366
|
-
return fromPayload;
|
|
367
|
-
}
|
|
368
|
-
const fromRoute = Number(this.faqRef);
|
|
369
|
-
return Number.isInteger(fromRoute) && fromRoute > 0 ? fromRoute : null;
|
|
370
|
-
}
|
|
371
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FaqDetailsComponent, deps: [{ token: i1.CommonService }, { token: i0.Injector }, { token: i2.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
372
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: FaqDetailsComponent, isStandalone: false, selector: "pw-faq-details", usesInheritance: true, ngImport: i0, template: "@if (!isLoading) {\n <div class=\"content-quill-wrapper overflow-hidden mt-5 p-3\">\n <div class=\"content-quill-box\">\n <h2 [class.mb-3]=\"!showStatusBadges\" [class.mb-2]=\"showStatusBadges\">\n {{faq?.question}}\n @if (canEditFaq && editFaqId) {\n <a class=\"faq-edit-link ms-3\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + editFaqId]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </h2>\n @if (showStatusBadges) {\n <!-- `badge-soft` opts these out of Bootstrap's saturated fills and into\n the platform badge doctrine (admin-list-view \u00A7B-1..B-5: light tint +\n dark ink, status dot on success/danger, no dot on a taxonomy value).\n Defined once in @posiwise/core-styles \u2014 never restate the hexes. -->\n <div class=\"faq-status-badges d-flex flex-wrap align-items-center gap-2 mb-3\">\n @if (badges.categoryLabel) {\n <span class=\"badge badge-soft\"\n [appDynamicBadge]=\"{ itemsArray: badges.categoryKeys, item: badges.category }\"\n color=\"cyan\"\n [pTooltip]=\"badges.featureKeys.length ? badges.featureKeys.join(', ') : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ badges.categoryLabel }}</span>\n }\n @if (badges.isPublic) {\n <span class=\"badge badge-soft bg-success\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Public' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Public' | transloco }}</span>\n }\n @if (badges.isHidden) {\n <span class=\"badge badge-soft bg-danger\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Hidden' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Hidden' | transloco }}</span>\n }\n </div>\n }\n <ng-container>\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer\">\n </div>\n </div>\n </ng-container>\n </div>\n @if (!faq && !isLoading) {\n <pw-no-data\n message=\"No Faq found\">\n </pw-no-data>\n }\n <div class=\"text-end mt-3\">\n <button class=\"btn btn-outline-primary\"\n [routerLink]=\"['/',slug,'faq']\">See all FAQs</button>\n </div>\n </div>\n}\n@if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n}\n", styles: [".ql-container{resize:none!important}.faq-edit-link{text-decoration:none;vertical-align:middle}.faq-edit-link .edit-icon{font-size:16px}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3$1.DynamicBadgeDirective, selector: "[appDynamicBadge]", inputs: ["appDynamicBadge", "color", "colorByName", "dataName"] }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "pipe", type: i7.TranslocoPipe, name: "transloco" }] }); }
|
|
373
|
-
}
|
|
374
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FaqDetailsComponent, decorators: [{
|
|
375
|
-
type: Component,
|
|
376
|
-
args: [{ selector: 'pw-faq-details', standalone: false, template: "@if (!isLoading) {\n <div class=\"content-quill-wrapper overflow-hidden mt-5 p-3\">\n <div class=\"content-quill-box\">\n <h2 [class.mb-3]=\"!showStatusBadges\" [class.mb-2]=\"showStatusBadges\">\n {{faq?.question}}\n @if (canEditFaq && editFaqId) {\n <a class=\"faq-edit-link ms-3\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + editFaqId]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </h2>\n @if (showStatusBadges) {\n <!-- `badge-soft` opts these out of Bootstrap's saturated fills and into\n the platform badge doctrine (admin-list-view \u00A7B-1..B-5: light tint +\n dark ink, status dot on success/danger, no dot on a taxonomy value).\n Defined once in @posiwise/core-styles \u2014 never restate the hexes. -->\n <div class=\"faq-status-badges d-flex flex-wrap align-items-center gap-2 mb-3\">\n @if (badges.categoryLabel) {\n <span class=\"badge badge-soft\"\n [appDynamicBadge]=\"{ itemsArray: badges.categoryKeys, item: badges.category }\"\n color=\"cyan\"\n [pTooltip]=\"badges.featureKeys.length ? badges.featureKeys.join(', ') : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ badges.categoryLabel }}</span>\n }\n @if (badges.isPublic) {\n <span class=\"badge badge-soft bg-success\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Public' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Public' | transloco }}</span>\n }\n @if (badges.isHidden) {\n <span class=\"badge badge-soft bg-danger\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Hidden' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Hidden' | transloco }}</span>\n }\n </div>\n }\n <ng-container>\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer\">\n </div>\n </div>\n </ng-container>\n </div>\n @if (!faq && !isLoading) {\n <pw-no-data\n message=\"No Faq found\">\n </pw-no-data>\n }\n <div class=\"text-end mt-3\">\n <button class=\"btn btn-outline-primary\"\n [routerLink]=\"['/',slug,'faq']\">See all FAQs</button>\n </div>\n </div>\n}\n@if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n}\n", styles: [".ql-container{resize:none!important}.faq-edit-link{text-decoration:none;vertical-align:middle}.faq-edit-link .edit-icon{font-size:16px}\n"] }]
|
|
377
|
-
}], ctorParameters: () => [{ type: i1.CommonService }, { type: i0.Injector }, { type: i2.DomSanitizer }, { type: i0.ChangeDetectorRef }] });
|
|
378
|
-
|
|
379
|
-
class UserFeedbackComponent extends AppBaseComponent {
|
|
380
|
-
constructor(injector, commonService, cdr) {
|
|
381
|
-
super(injector);
|
|
382
|
-
this.commonService = commonService;
|
|
383
|
-
this.cdr = cdr;
|
|
384
|
-
this.rating = 3;
|
|
385
|
-
this.selectedValue = null;
|
|
386
|
-
this.questions = [];
|
|
387
|
-
this.counter = Array;
|
|
388
|
-
this.showSection = true;
|
|
389
|
-
}
|
|
390
|
-
ngOnInit() {
|
|
391
|
-
this.subscriptionId = PermissionService.selectedSubscription?.id;
|
|
392
|
-
this.getFeedbackQuestions();
|
|
393
|
-
this.userService.getUserInfo().subscribe({
|
|
394
|
-
next: user => {
|
|
395
|
-
this.user = user;
|
|
396
|
-
this.cdr.markForCheck();
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
this.checkFeedBackExpiry();
|
|
400
|
-
}
|
|
401
|
-
checkFeedBackExpiry() {
|
|
402
|
-
const item = localStorage.getItem('showFeedBack');
|
|
403
|
-
if (item) {
|
|
404
|
-
const currentDate = Date.now();
|
|
405
|
-
const expiryDate = new Date(JSON.parse(item)).getTime();
|
|
406
|
-
this.showSection = currentDate > expiryDate;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
closeSection() {
|
|
410
|
-
this.showSection = false;
|
|
411
|
-
const addedTime = moment(new Date()).add(7, 'days').toDate();
|
|
412
|
-
localStorage.setItem('showFeedBack', JSON.stringify(addedTime));
|
|
413
|
-
}
|
|
414
|
-
getFeedbackQuestions() {
|
|
415
|
-
if (this.subscriptionId) {
|
|
416
|
-
this.commonService.feedbackQuestions(this.subscriptionId).subscribe(res => {
|
|
417
|
-
this.questions = res;
|
|
418
|
-
this.cdr.markForCheck();
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
onSubmit(questionId, formValue) {
|
|
423
|
-
if (formValue?.feedback) {
|
|
424
|
-
const data = {
|
|
425
|
-
subscription_id: this.subscriptionId,
|
|
426
|
-
feedback_question_id: questionId,
|
|
427
|
-
value: Number(formValue?.feedback),
|
|
428
|
-
comment: formValue?.description
|
|
429
|
-
};
|
|
430
|
-
this.commonService.userFeedbacks(data).subscribe(() => {
|
|
431
|
-
this.getFeedbackQuestions();
|
|
432
|
-
this.cdr.markForCheck();
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
trackByQuestion(_index, item) {
|
|
437
|
-
return item.id;
|
|
438
|
-
}
|
|
439
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: UserFeedbackComponent, deps: [{ token: i0.Injector }, { token: i1.CommonService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
440
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: UserFeedbackComponent, isStandalone: false, selector: "pw-user-feedback", usesInheritance: true, ngImport: i0, template: "@if (showSection) {\n @if (questions?.length) {\n <div class=\"mt-4\"\n >\n <div class=\"card pb-1\">\n <h3 class=\"text-end me-3 pt-2 cursor-pointer\"\n (keydown.enter)=\"closeSection()\"\n (click)=\"closeSection()\">×</h3>\n @for (question of questions; track trackByQuestion($index, question); let first = $first) {\n <div class=\"card-content p-0\"\n >\n <div class=\"card-header\">\n <form #feedbackForm=\"ngForm\">\n <div class=\"col-lg-8 p-0 mx-auto\">\n @if (first) {\n <h3 class=\"mb-1\"\n >Your input is valuable to us</h3>\n }\n @if (first) {\n <p class=\"mb-4\"\n >\n Please take a moment to answer these questions\n </p>\n }\n <h6 class=\"fw-bold pb-3 mx-auto\">{{ question?.question }}</h6>\n <div class=\"text-center row p-2 mx-md-2 feedback-value\">\n <span class=\"col-auto me-0\">Not at all</span>\n @for (val of counter(11); track val; let i = $index) {\n <div class=\"p-field-checkbox col-auto ms-0 me-0\">\n <p-radioButton name=\"feedback\" [(ngModel)]=\"selectedValue\" [value]=\"i\" [inputId]=\"i\"></p-radioButton>\n <br />\n <label [for]=\"i\">{{ i }}</label>\n </div>\n }\n <span class=\"col-auto ms-0\">Extremely</span>\n </div>\n <div class=\"text mt-3\">\n <h6>Can you tell us the reason for your score? Do you have any particular features you want us to build or fix?</h6>\n <label for=\"user-feedback-description\" class=\"visually-hidden\">Reason for your score</label>\n <textarea id=\"user-feedback-description\"\n rows=\"4\"\n name=\"description\"\n placeholder=\"\u201CWhat is the primary reason for your score?\u201D\"\n ngModel\n type=\"text\"\n pInputTextarea\n class=\"form-control\"\n aria-label=\"\u201CWhat is the primary reason for your score?\u201D\">\n </textarea>\n </div>\n <div class=\"mt-3\">\n <button class=\"btn btn-primary d-block mx-auto\"\n (click)=\"onSubmit(question?.id, feedbackForm.value)\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n }\n </div>\n </div>\n }\n}\n", styles: ["::ng-deep .p-radiobutton-checked .p-radiobutton-box{border-color:var(--first)!important;background:var(--first)!important}.feedback-value{justify-content:center}.feedback-value label{color:#000000de;cursor:pointer;font-size:1rem;font-weight:400;letter-spacing:normal;margin-left:10px;margin-right:10px;text-transform:none}.feedback-value .p-field-checkbox{margin:0 10px}\n"], dependencies: [{ kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$2.RadioButton, selector: "p-radioButton, p-radiobutton, p-radio-button", inputs: ["value", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "styleClass", "autofocus", "binary", "variant", "size"], outputs: ["onClick", "onFocus", "onBlur"] }] }); }
|
|
441
|
-
}
|
|
442
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: UserFeedbackComponent, decorators: [{
|
|
443
|
-
type: Component,
|
|
444
|
-
args: [{ selector: 'pw-user-feedback', standalone: false, template: "@if (showSection) {\n @if (questions?.length) {\n <div class=\"mt-4\"\n >\n <div class=\"card pb-1\">\n <h3 class=\"text-end me-3 pt-2 cursor-pointer\"\n (keydown.enter)=\"closeSection()\"\n (click)=\"closeSection()\">×</h3>\n @for (question of questions; track trackByQuestion($index, question); let first = $first) {\n <div class=\"card-content p-0\"\n >\n <div class=\"card-header\">\n <form #feedbackForm=\"ngForm\">\n <div class=\"col-lg-8 p-0 mx-auto\">\n @if (first) {\n <h3 class=\"mb-1\"\n >Your input is valuable to us</h3>\n }\n @if (first) {\n <p class=\"mb-4\"\n >\n Please take a moment to answer these questions\n </p>\n }\n <h6 class=\"fw-bold pb-3 mx-auto\">{{ question?.question }}</h6>\n <div class=\"text-center row p-2 mx-md-2 feedback-value\">\n <span class=\"col-auto me-0\">Not at all</span>\n @for (val of counter(11); track val; let i = $index) {\n <div class=\"p-field-checkbox col-auto ms-0 me-0\">\n <p-radioButton name=\"feedback\" [(ngModel)]=\"selectedValue\" [value]=\"i\" [inputId]=\"i\"></p-radioButton>\n <br />\n <label [for]=\"i\">{{ i }}</label>\n </div>\n }\n <span class=\"col-auto ms-0\">Extremely</span>\n </div>\n <div class=\"text mt-3\">\n <h6>Can you tell us the reason for your score? Do you have any particular features you want us to build or fix?</h6>\n <label for=\"user-feedback-description\" class=\"visually-hidden\">Reason for your score</label>\n <textarea id=\"user-feedback-description\"\n rows=\"4\"\n name=\"description\"\n placeholder=\"\u201CWhat is the primary reason for your score?\u201D\"\n ngModel\n type=\"text\"\n pInputTextarea\n class=\"form-control\"\n aria-label=\"\u201CWhat is the primary reason for your score?\u201D\">\n </textarea>\n </div>\n <div class=\"mt-3\">\n <button class=\"btn btn-primary d-block mx-auto\"\n (click)=\"onSubmit(question?.id, feedbackForm.value)\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n }\n </div>\n </div>\n }\n}\n", styles: ["::ng-deep .p-radiobutton-checked .p-radiobutton-box{border-color:var(--first)!important;background:var(--first)!important}.feedback-value{justify-content:center}.feedback-value label{color:#000000de;cursor:pointer;font-size:1rem;font-weight:400;letter-spacing:normal;margin-left:10px;margin-right:10px;text-transform:none}.feedback-value .p-field-checkbox{margin:0 10px}\n"] }]
|
|
445
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1.CommonService }, { type: i0.ChangeDetectorRef }] });
|
|
446
|
-
|
|
447
|
-
class HomeComponent extends AppBaseComponent {
|
|
448
|
-
constructor(injector, hopscotchService, cdr) {
|
|
449
|
-
super(injector);
|
|
450
|
-
this.hopscotchService = hopscotchService;
|
|
451
|
-
this.cdr = cdr;
|
|
452
|
-
this.componentActive = true;
|
|
453
|
-
}
|
|
454
|
-
sanitizeContent(jsonString) {
|
|
455
|
-
let sanitizedString = jsonString.replaceAll("'", '"');
|
|
456
|
-
sanitizedString = sanitizedString.replace(/<img\s+src="([^"]+)"/g, String.raw `<img src=\"$1\"`);
|
|
457
|
-
sanitizedString = sanitizedString.replace(/,\s*([}\]])/g, '$1');
|
|
458
|
-
return sanitizedString;
|
|
459
|
-
}
|
|
460
|
-
ngOnInit() {
|
|
461
|
-
this.selectedSubscriptionSlug = PermissionService.selectedSubscription?.slug;
|
|
462
|
-
this.subscriptionId = PermissionService.selectedSubscription?.id;
|
|
463
|
-
this.userStore().subscribe(state => {
|
|
464
|
-
if (state) {
|
|
465
|
-
this.userService.getCurrentUserObject('active_tips').subscribe(response => {
|
|
466
|
-
if (response?.length) {
|
|
467
|
-
const welcomeTips = response.find(x => x.name === 'welcome');
|
|
468
|
-
if (welcomeTips) {
|
|
469
|
-
const steps = JSON.parse(this.sanitizeContent(welcomeTips.instructions)).steps;
|
|
470
|
-
try {
|
|
471
|
-
this.hopscotchService.initializeTour('dashboard', steps, {
|
|
472
|
-
tip_id: welcomeTips.id,
|
|
473
|
-
disregarded: true
|
|
474
|
-
}, this.subscriptionId);
|
|
475
|
-
}
|
|
476
|
-
catch (error) {
|
|
477
|
-
console.error('Error parsing JSON:', error);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
this.cdr.markForCheck();
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
this.cdr.markForCheck();
|
|
485
|
-
});
|
|
486
|
-
this.userStore().subscribe({
|
|
487
|
-
next: user => {
|
|
488
|
-
this.user = user;
|
|
489
|
-
if (this.user) {
|
|
490
|
-
this.userSlug = user.slug;
|
|
491
|
-
}
|
|
492
|
-
this.cdr.markForCheck();
|
|
493
|
-
},
|
|
494
|
-
error: error => {
|
|
495
|
-
this.toast.showToast(error);
|
|
496
|
-
this.cdr.markForCheck();
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
ngOnDestroy() {
|
|
501
|
-
this.hopscotchService.endTour();
|
|
502
|
-
super.ngOnDestroy();
|
|
503
|
-
}
|
|
504
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: HomeComponent, deps: [{ token: i0.Injector }, { token: i1.HopscotchService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
505
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: HomeComponent, isStandalone: false, selector: "pw-home", usesInheritance: true, ngImport: i0, template: "<pw-user-feedback></pw-user-feedback>\n<div class=\"row mt-3\">\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <div id=\"cards\"></div>\n <h3 class=\"mb-3\">{{'ManageYourAccount'|transloco}}</h3>\n <p>{{'ManageYourAccountDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/ManageYourAccount.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/account/details\"\n class=\"d-block\">{{'ManageYourAccount'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step2\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'UpdateYourProfile'|transloco}}</h3>\n <p>{{'UpdateYourProfileDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/UpdateYourProfile.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"['/members', userSlug]\"\n class=\"d-block\">{{'UpdateYourProfile'|transloco}}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'CommunicationSettings'|transloco}}</h3>\n <p>\n {{'CommunicationSettingsDescription'|transloco}}\n </p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/CommunicationSettings.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/settings/communication\"\n class=\"d-block\">{{'GotoCommunicationSettings'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step3\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'NeedHelp'|transloco}}</h3>\n <p>{{'NeedHelpDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/NeedHelp.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"'/' + selectedSubscriptionSlug + '/faq'\"\n class=\"d-block\">{{'SeeAllOurFaq'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step4\"></div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["::ng-deep .hopscotch-title{text-align:center!important;margin-bottom:20px!important}::ng-deep .hopscotch-title h2{margin:0}::ng-deep .hopscotch-content{text-align:center;padding:20px;margin:0!important}::ng-deep .hopscotch-content img{width:150px;margin:20px 0}::ng-deep .hopscotch-content p{font-size:16px;color:#555}::ng-deep .hopscotch-step-title{text-align:left;margin-bottom:15px}::ng-deep .hopscotch-step-content{padding:20px;text-align:left!important}::ng-deep .hopscotch-step-content p{font-size:14px;color:#555;margin-bottom:10px;text-align:left!important}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3$1.LazyImgDirective, selector: "img" }, { kind: "component", type: UserFeedbackComponent, selector: "pw-user-feedback" }, { kind: "pipe", type: i7.TranslocoPipe, name: "transloco" }] }); }
|
|
506
|
-
}
|
|
507
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: HomeComponent, decorators: [{
|
|
508
|
-
type: Component,
|
|
509
|
-
args: [{ selector: 'pw-home', standalone: false, template: "<pw-user-feedback></pw-user-feedback>\n<div class=\"row mt-3\">\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <div id=\"cards\"></div>\n <h3 class=\"mb-3\">{{'ManageYourAccount'|transloco}}</h3>\n <p>{{'ManageYourAccountDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/ManageYourAccount.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/account/details\"\n class=\"d-block\">{{'ManageYourAccount'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step2\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'UpdateYourProfile'|transloco}}</h3>\n <p>{{'UpdateYourProfileDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/UpdateYourProfile.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"['/members', userSlug]\"\n class=\"d-block\">{{'UpdateYourProfile'|transloco}}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'CommunicationSettings'|transloco}}</h3>\n <p>\n {{'CommunicationSettingsDescription'|transloco}}\n </p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/CommunicationSettings.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/settings/communication\"\n class=\"d-block\">{{'GotoCommunicationSettings'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step3\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'NeedHelp'|transloco}}</h3>\n <p>{{'NeedHelpDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/NeedHelp.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"'/' + selectedSubscriptionSlug + '/faq'\"\n class=\"d-block\">{{'SeeAllOurFaq'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step4\"></div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["::ng-deep .hopscotch-title{text-align:center!important;margin-bottom:20px!important}::ng-deep .hopscotch-title h2{margin:0}::ng-deep .hopscotch-content{text-align:center;padding:20px;margin:0!important}::ng-deep .hopscotch-content img{width:150px;margin:20px 0}::ng-deep .hopscotch-content p{font-size:16px;color:#555}::ng-deep .hopscotch-step-title{text-align:left;margin-bottom:15px}::ng-deep .hopscotch-step-content{padding:20px;text-align:left!important}::ng-deep .hopscotch-step-content p{font-size:14px;color:#555;margin-bottom:10px;text-align:left!important}\n"] }]
|
|
510
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1.HopscotchService }, { type: i0.ChangeDetectorRef }] });
|
|
511
|
-
|
|
512
|
-
class CurrentNotificationsComponent {
|
|
513
|
-
constructor(notificationService, cdr) {
|
|
514
|
-
this.notificationService = notificationService;
|
|
515
|
-
this.cdr = cdr;
|
|
516
|
-
this.notificationCount = 0;
|
|
517
|
-
this.noNoti = true;
|
|
518
|
-
this.itemsPerPage = 100;
|
|
519
|
-
this.notifications = [];
|
|
520
|
-
this.currentPage = 1;
|
|
521
|
-
this.isLoaded = false;
|
|
522
|
-
this.totalPages = 1;
|
|
523
|
-
this.totalRecords = 0;
|
|
524
|
-
}
|
|
525
|
-
ngOnInit() {
|
|
526
|
-
this.getNotifications();
|
|
527
|
-
}
|
|
528
|
-
getNotifications() {
|
|
529
|
-
this.notificationService
|
|
530
|
-
.getNotifications({ page: this.currentPage, page_size: this.itemsPerPage })
|
|
531
|
-
.subscribe(data => {
|
|
532
|
-
if (Array.isArray(data?.notes) && data?.notes?.length > 0) {
|
|
533
|
-
this.totalRecords = data.unfiltered_count;
|
|
534
|
-
this.notifications = data.notes?.filter(note => !note.dismissed && note.show_on_dashboard);
|
|
535
|
-
this.totalPages = Math.ceil(data.unfiltered_count / this.itemsPerPage);
|
|
536
|
-
this.noNoti = true;
|
|
537
|
-
if (this.notifications?.length) {
|
|
538
|
-
this.noNoti = false;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
this.cdr.markForCheck();
|
|
542
|
-
})
|
|
543
|
-
.add(() => {
|
|
544
|
-
this.isLoaded = true;
|
|
545
|
-
this.cdr.markForCheck();
|
|
546
|
-
});
|
|
547
|
-
}
|
|
548
|
-
nextPage() {
|
|
549
|
-
if (this.currentPage < this.totalPages) {
|
|
550
|
-
this.currentPage++;
|
|
551
|
-
this.getNotifications();
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
previousPage() {
|
|
555
|
-
if (this.currentPage > 1) {
|
|
556
|
-
this.currentPage--;
|
|
557
|
-
this.getNotifications();
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
dismiss(id, e) {
|
|
561
|
-
this.notificationService.dismissNotification(id).subscribe(() => {
|
|
562
|
-
// Remove notification from notification array
|
|
563
|
-
const index = this.notifications.indexOf(e);
|
|
564
|
-
this.notifications.splice(index, 1);
|
|
565
|
-
if (this.notifications.length === 0) {
|
|
566
|
-
this.noNoti = true;
|
|
567
|
-
}
|
|
568
|
-
this.cdr.markForCheck();
|
|
569
|
-
$('#noty').slideUp('slow', () => {
|
|
570
|
-
$('#noty').remove();
|
|
571
|
-
});
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
trackByNotification(_index, item) {
|
|
575
|
-
return item.id;
|
|
576
|
-
}
|
|
577
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: CurrentNotificationsComponent, deps: [{ token: i1.NotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
578
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: CurrentNotificationsComponent, isStandalone: false, selector: "pw-current-notifications", ngImport: i0, template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n }\n </div>\n @if (notifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of notifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You are all caught up\" description=\"You currently do not have any notifications.\">\n </pw-no-data>\n </div>\n}\n</div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"], dependencies: [{ kind: "directive", type: i2$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i4.RecordsSummaryComponent, selector: "pw-records-summary", inputs: ["showing", "total"] }, { kind: "pipe", type: i5$1.SinceAgoPipe, name: "sinceAgo" }] }); }
|
|
579
|
-
}
|
|
580
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: CurrentNotificationsComponent, decorators: [{
|
|
581
|
-
type: Component,
|
|
582
|
-
args: [{ selector: 'pw-current-notifications', standalone: false, template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n }\n </div>\n @if (notifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of notifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You are all caught up\" description=\"You currently do not have any notifications.\">\n </pw-no-data>\n </div>\n}\n</div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"] }]
|
|
583
|
-
}], ctorParameters: () => [{ type: i1.NotificationService }, { type: i0.ChangeDetectorRef }] });
|
|
584
|
-
|
|
585
|
-
class DismissedNotificationsComponent {
|
|
586
|
-
constructor(notificationService, cdr) {
|
|
587
|
-
this.notificationService = notificationService;
|
|
588
|
-
this.cdr = cdr;
|
|
589
|
-
this.notificationCount = 0;
|
|
590
|
-
this.noNoti = true;
|
|
591
|
-
this.dismissedNotifications = [];
|
|
592
|
-
this.isLoaded = false;
|
|
593
|
-
this.itemsPerPage = 100;
|
|
594
|
-
this.currentPage = 1;
|
|
595
|
-
this.totalPages = 1;
|
|
596
|
-
this.totalRecords = 0;
|
|
597
|
-
}
|
|
598
|
-
ngOnInit() {
|
|
599
|
-
this.getNotifications();
|
|
600
|
-
}
|
|
601
|
-
getNotifications() {
|
|
602
|
-
this.notificationService
|
|
603
|
-
.getDismissedNotifications({ page: this.currentPage, page_size: this.itemsPerPage })
|
|
604
|
-
.subscribe(data => {
|
|
605
|
-
if (Array.isArray(data?.notes) && data?.notes?.length > 0) {
|
|
606
|
-
this.noNoti = false;
|
|
607
|
-
this.dismissedNotifications = data?.notes;
|
|
608
|
-
this.totalRecords = data?.unfiltered_count;
|
|
609
|
-
this.totalPages = Math.ceil(data.unfiltered_count / this.itemsPerPage);
|
|
610
|
-
}
|
|
611
|
-
this.cdr.markForCheck();
|
|
612
|
-
})
|
|
613
|
-
.add(() => {
|
|
614
|
-
this.isLoaded = true;
|
|
615
|
-
this.cdr.markForCheck();
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
nextPage() {
|
|
619
|
-
if (this.currentPage < this.totalPages) {
|
|
620
|
-
this.currentPage++;
|
|
621
|
-
this.getNotifications();
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
previousPage() {
|
|
625
|
-
if (this.currentPage > 1) {
|
|
626
|
-
this.currentPage--;
|
|
627
|
-
this.getNotifications();
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
dismiss(id, e) {
|
|
631
|
-
HelperService.raiseDeletePopup().then(res => {
|
|
632
|
-
if (res.value) {
|
|
633
|
-
this.notificationService.deleteNotifications(id).subscribe(() => {
|
|
634
|
-
// Remove notification from notification array
|
|
635
|
-
const index = this.dismissedNotifications.indexOf(e);
|
|
636
|
-
this.dismissedNotifications.splice(index, 1);
|
|
637
|
-
if (this.dismissedNotifications.length === 0) {
|
|
638
|
-
this.noNoti = true;
|
|
639
|
-
}
|
|
640
|
-
this.cdr.markForCheck();
|
|
641
|
-
$('#noty').slideUp('slow', () => {
|
|
642
|
-
$('#noty').remove();
|
|
643
|
-
});
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
restoreNotification(id, e) {
|
|
649
|
-
this.notificationService.reinstateNotification(id).subscribe(() => {
|
|
650
|
-
// Remove notification from dismissed notification array
|
|
651
|
-
const index = this.dismissedNotifications.indexOf(e);
|
|
652
|
-
this.dismissedNotifications.splice(index, 1);
|
|
653
|
-
if (this.dismissedNotifications.length === 0) {
|
|
654
|
-
this.noNoti = true;
|
|
655
|
-
}
|
|
656
|
-
this.cdr.markForCheck();
|
|
657
|
-
$('#noty').slideUp('slow', () => {
|
|
658
|
-
$('#noty').remove();
|
|
659
|
-
});
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
trackByNotification(_index, item) {
|
|
663
|
-
return item.id;
|
|
664
|
-
}
|
|
665
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DismissedNotificationsComponent, deps: [{ token: i1.NotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
666
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: DismissedNotificationsComponent, isStandalone: false, selector: "pw-dismissed-notifications", ngImport: i0, template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n }\n </div>\n @if (dismissedNotifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of dismissedNotifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn float-end\">\n <i\n class=\"fas fa-trash-restore-alt\"\n (click)=\"restoreNotification(item.id, item)\"\n (keydown.enter)=\"restoreNotification(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You currently do not have any dismissed notifications\">\n </pw-no-data>\n </div>\n}\n</div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"], dependencies: [{ kind: "directive", type: i2$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i4.RecordsSummaryComponent, selector: "pw-records-summary", inputs: ["showing", "total"] }, { kind: "pipe", type: i5$1.SinceAgoPipe, name: "sinceAgo" }] }); }
|
|
667
|
-
}
|
|
668
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DismissedNotificationsComponent, decorators: [{
|
|
669
|
-
type: Component,
|
|
670
|
-
args: [{ selector: 'pw-dismissed-notifications', standalone: false, template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n }\n </div>\n @if (dismissedNotifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of dismissedNotifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn float-end\">\n <i\n class=\"fas fa-trash-restore-alt\"\n (click)=\"restoreNotification(item.id, item)\"\n (keydown.enter)=\"restoreNotification(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You currently do not have any dismissed notifications\">\n </pw-no-data>\n </div>\n}\n</div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"] }]
|
|
671
|
-
}], ctorParameters: () => [{ type: i1.NotificationService }, { type: i0.ChangeDetectorRef }] });
|
|
672
|
-
|
|
673
|
-
class NotificationsPageComponent {
|
|
674
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: NotificationsPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
675
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: NotificationsPageComponent, isStandalone: false, selector: "pw-notifications-page", ngImport: i0, template: "<div class=\"row\">\n <div class=\"col-12 col-sm-12 col-md-12 mt-4\">\n <h2 class=\"p-2\">Notifications</h2>\n </div>\n</div>\n\n<ul ngbNav\n #nav=\"ngbNav\"\n class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\">\n <a ngbNavLink>Current Notifications</a>\n <ng-template ngbNavContent>\n <pw-current-notifications></pw-current-notifications>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"2\">\n <a ngbNavLink>Dismissed Notifications</a>\n <ng-template ngbNavContent>\n <pw-dismissed-notifications></pw-dismissed-notifications>\n </ng-template>\n </li>\n</ul>\n\n<div [ngbNavOutlet]=\"nav\"></div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"], dependencies: [{ kind: "directive", type: i1$2.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { kind: "directive", type: i1$2.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i1$2.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i1$2.NgbNavItemRole, selector: "[ngbNavItem]:not(ng-container)" }, { kind: "directive", type: i1$2.NgbNavLink, selector: "a[ngbNavLink]" }, { kind: "directive", type: i1$2.NgbNavLinkBase, selector: "[ngbNavLink]" }, { kind: "component", type: i1$2.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { kind: "component", type: CurrentNotificationsComponent, selector: "pw-current-notifications" }, { kind: "component", type: DismissedNotificationsComponent, selector: "pw-dismissed-notifications" }] }); }
|
|
676
|
-
}
|
|
677
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: NotificationsPageComponent, decorators: [{
|
|
678
|
-
type: Component,
|
|
679
|
-
args: [{ selector: 'pw-notifications-page', standalone: false, template: "<div class=\"row\">\n <div class=\"col-12 col-sm-12 col-md-12 mt-4\">\n <h2 class=\"p-2\">Notifications</h2>\n </div>\n</div>\n\n<ul ngbNav\n #nav=\"ngbNav\"\n class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\">\n <a ngbNavLink>Current Notifications</a>\n <ng-template ngbNavContent>\n <pw-current-notifications></pw-current-notifications>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"2\">\n <a ngbNavLink>Dismissed Notifications</a>\n <ng-template ngbNavContent>\n <pw-dismissed-notifications></pw-dismissed-notifications>\n </ng-template>\n </li>\n</ul>\n\n<div [ngbNavOutlet]=\"nav\"></div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"] }]
|
|
680
|
-
}] });
|
|
681
|
-
|
|
682
|
-
class SearchComponent {
|
|
683
|
-
constructor(route, service, cdr) {
|
|
684
|
-
this.route = route;
|
|
685
|
-
this.service = service;
|
|
686
|
-
this.cdr = cdr;
|
|
687
|
-
this.emptySearchResult = {
|
|
688
|
-
users: [],
|
|
689
|
-
faqs: [],
|
|
690
|
-
recipients: []
|
|
691
|
-
};
|
|
692
|
-
this.isLoaded = false;
|
|
693
|
-
this.objectKeys = Object.keys;
|
|
694
|
-
}
|
|
695
|
-
ngOnInit() {
|
|
696
|
-
this.subscriptionId = PermissionService.selectedSubscription.id;
|
|
697
|
-
this.route.queryParams.subscribe(response => {
|
|
698
|
-
this.keyword = response['keyword'];
|
|
699
|
-
if (this.keyword) {
|
|
700
|
-
this.search();
|
|
701
|
-
}
|
|
702
|
-
this.cdr.markForCheck();
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
search() {
|
|
706
|
-
this.isLoaded = false;
|
|
707
|
-
this.service
|
|
708
|
-
.search(this.keyword, this.subscriptionId)
|
|
709
|
-
.subscribe(response => {
|
|
710
|
-
this.result = {
|
|
711
|
-
...this.emptySearchResult,
|
|
712
|
-
...response
|
|
713
|
-
};
|
|
714
|
-
this.cdr.markForCheck();
|
|
715
|
-
})
|
|
716
|
-
.add(() => {
|
|
717
|
-
this.isLoaded = true;
|
|
718
|
-
this.cdr.markForCheck();
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
|
-
get hasResults() {
|
|
722
|
-
return this.searchGroups.some(group => group.length > 0);
|
|
723
|
-
}
|
|
724
|
-
get searchGroups() {
|
|
725
|
-
return ['users', 'faqs', 'recipients'].map(group => this.getResultGroup(group));
|
|
726
|
-
}
|
|
727
|
-
getResultGroup(group) {
|
|
728
|
-
if (!this.isSearchGroupKey(group)) {
|
|
729
|
-
return [];
|
|
730
|
-
}
|
|
731
|
-
const resultGroup = this.result?.[group];
|
|
732
|
-
if (!Array.isArray(resultGroup)) {
|
|
733
|
-
return [];
|
|
734
|
-
}
|
|
735
|
-
return resultGroup.filter(item => this.isRenderableResult(item));
|
|
736
|
-
}
|
|
737
|
-
isSearchGroupKey(group) {
|
|
738
|
-
return group === 'users' || group === 'faqs' || group === 'recipients';
|
|
739
|
-
}
|
|
740
|
-
isRenderableResult(item) {
|
|
741
|
-
if (item == null) {
|
|
742
|
-
return false;
|
|
743
|
-
}
|
|
744
|
-
if (typeof item !== 'object') {
|
|
745
|
-
return true;
|
|
746
|
-
}
|
|
747
|
-
return Object.values(item).some(value => {
|
|
748
|
-
if (Array.isArray(value)) {
|
|
749
|
-
return value.length > 0;
|
|
750
|
-
}
|
|
751
|
-
return value !== null && value !== undefined && value !== '';
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
handleImageError(event, fallbackPath) {
|
|
755
|
-
HelperService.handleImageFallbackPath(event, fallbackPath);
|
|
756
|
-
}
|
|
757
|
-
trackByUserId(_index, item) {
|
|
758
|
-
return item.id;
|
|
759
|
-
}
|
|
760
|
-
trackByFaqId(_index, item) {
|
|
761
|
-
return item.id;
|
|
762
|
-
}
|
|
763
|
-
trackBySkill(_index, item) {
|
|
764
|
-
return item.id;
|
|
765
|
-
}
|
|
766
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: SearchComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1.DashboardService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
767
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: SearchComponent, isStandalone: false, selector: "pw-search", ngImport: i0, template: "<div class=\"container-fluid dashboard-card overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"row\">\n <div class=\"col-12 my-3 mt-4\">\n <h2>Search Results</h2>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (isLoaded) {\n <div class=\"row faqlist search-result\">\n <div class=\"col-12\">\n <div data-cy=\"faq-list\">\n @if (result) {\n @for (group of objectKeys(result); track group; let idx = $index) {\n <div>\n @switch (group) {\n @case ('users') {\n @if (getResultGroup(group).length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ group }}</h6>\n <div class=\"dashboard\">\n @for (\n user of getResultGroup(group); track trackByUserId($index, user); let idx1 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx1 + idx\"><span>{{\n user.first_name !== null\n ? user.first_name\n : user?.email\n }}</span></a>\n </h5>\n <p class=\"m-0 title-font\">\n @if (user.user_skills?.length > 0) {\n <strong>Skills :\n </strong>\n }\n @for (\n skill of (user.user_skills ?? []); track trackBySkill($index, skill); let isLast = $last) {\n <span class=\"badge bg-success m-1\">\n {{ skill.name\n }}{{ isLast ? '' : ', ' }}</span>\n }\n </p>\n @if (\n user?.user_profile?.headline\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n {{ user?.user_profile?.headline }}\n </p>\n }\n @if (\n user?.user_profile?.country\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n <strong>Location : </strong>{{ user?.user_profile?.country }}\n </p>\n }\n </div>\n <div [id]=\"'collapse' + idx1 + idx\"\n class=\"panel-collapse collapse in p-3\">\n <div class=\"display-block overflow-hidden\">\n <div class=\"row align-items-center\">\n <div class=\"col-sm-3\">\n @if (user?.user_avatar?.length > 0) {\n @for (\n profile_image of user.user_avatar; track profile_image) {\n @if (profile_image.width === 200) {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img class=\"img-fluid\"\n [src]=\"profile_image.url\"\n alt=\"Male Icon\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n </div>\n </div>\n }\n }\n } @else {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img src=\"/assets/img/icons/male.png\"\n alt=\"\"\n class=\"img-fluid\" />\n </div>\n </div>\n }\n </div>\n <div class=\"col-sm-9\">\n <ul class=\"name-fl\">\n <li>\n <strong>First Name:\n </strong>\n <span>{{\n user.first_name !== null\n ? user.first_name\n : 'N/A'\n }}</span>\n </li>\n <li>\n <strong>Last Name:\n </strong>\n <span>{{\n user.last_name !== null\n ? user.last_name\n : 'N/A'\n }}</span>\n </li>\n </ul>\n <p>\n <strong>Email: </strong>\n <span>{{\n user.email !== null\n ? user.email\n : 'N/A'\n }}</span>\n </p>\n <p>\n <strong>Description:\n </strong>\n <span>{{\n user?.user_profile\n ?.description !== null\n ? user?.user_profile\n ?.description\n : 'N/A'\n }}</span>\n </p>\n <div class=\"view-btn text-end\">\n <a class=\"btn btn-outline-primary inline-block\"\n [routerLink]=\"[\n '/members/' +\n user.slug\n ]\">View More</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @case ('faqs') {\n @if (getResultGroup(group).length) {\n <h6>\n {{ group | uppercase }}\n </h6>\n @for (\n faq of getResultGroup(group); track trackByFaqId($index, faq); let idx2 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx2 + idx\">{{ faq.question }}</a>\n </h5>\n </div>\n <div [id]=\"'collapse' + idx2 + idx\"\n class=\"panel-collapse collapse in\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer |safe:'html'\">\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n }\n }\n </div>\n }\n @if (!hasResults) {\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\">\n </pw-no-data>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.faq-search-answer a{color:#144086;display:inline-block;float:right;font-size:14px;margin-right:15px}::ng-deep .ql-snow *{font-size:16px!important}.faq-search-answer a:after{right:-10px}.faq-item{border:1px dashed rgba(0,0,0,.1);background-color:#fff;border-radius:3px;margin:10px 0;transition:all .2s ease-in-out}.faq-item .dashboard-header{background:#fff}.accord-title1 .faq-search-answer a{margin-right:0!important}a.accordion-toggle:after{display:none}.accord-title p.title-font{font-size:.8rem}.panel-collapse.show{border-top:1px dashed rgba(0,0,0,.1);padding-top:20px;padding-bottom:20px}.panel-collapse ul{margin-bottom:1rem}.panel-collapse ul.name-fl li{display:inline-block;padding-right:15px}.view-btn a{display:inline-block}.avatar{width:130px;margin:0 auto;display:block}.accordion-title a{color:var(--sidebar_bg)!important}.card-header h1,.card-header p{color:#fff!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}.card-block p{font-size:16px}.card,h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3$1.LazyImgDirective, selector: "img" }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "pipe", type: i2$2.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i7.TranslocoPipe, name: "transloco" }, { kind: "pipe", type: i5$1.DOMSanitizerPipe, name: "safe" }] }); }
|
|
768
|
-
}
|
|
769
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: SearchComponent, decorators: [{
|
|
770
|
-
type: Component,
|
|
771
|
-
args: [{ selector: 'pw-search', standalone: false, template: "<div class=\"container-fluid dashboard-card overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"row\">\n <div class=\"col-12 my-3 mt-4\">\n <h2>Search Results</h2>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (isLoaded) {\n <div class=\"row faqlist search-result\">\n <div class=\"col-12\">\n <div data-cy=\"faq-list\">\n @if (result) {\n @for (group of objectKeys(result); track group; let idx = $index) {\n <div>\n @switch (group) {\n @case ('users') {\n @if (getResultGroup(group).length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ group }}</h6>\n <div class=\"dashboard\">\n @for (\n user of getResultGroup(group); track trackByUserId($index, user); let idx1 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx1 + idx\"><span>{{\n user.first_name !== null\n ? user.first_name\n : user?.email\n }}</span></a>\n </h5>\n <p class=\"m-0 title-font\">\n @if (user.user_skills?.length > 0) {\n <strong>Skills :\n </strong>\n }\n @for (\n skill of (user.user_skills ?? []); track trackBySkill($index, skill); let isLast = $last) {\n <span class=\"badge bg-success m-1\">\n {{ skill.name\n }}{{ isLast ? '' : ', ' }}</span>\n }\n </p>\n @if (\n user?.user_profile?.headline\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n {{ user?.user_profile?.headline }}\n </p>\n }\n @if (\n user?.user_profile?.country\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n <strong>Location : </strong>{{ user?.user_profile?.country }}\n </p>\n }\n </div>\n <div [id]=\"'collapse' + idx1 + idx\"\n class=\"panel-collapse collapse in p-3\">\n <div class=\"display-block overflow-hidden\">\n <div class=\"row align-items-center\">\n <div class=\"col-sm-3\">\n @if (user?.user_avatar?.length > 0) {\n @for (\n profile_image of user.user_avatar; track profile_image) {\n @if (profile_image.width === 200) {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img class=\"img-fluid\"\n [src]=\"profile_image.url\"\n alt=\"Male Icon\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n </div>\n </div>\n }\n }\n } @else {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img src=\"/assets/img/icons/male.png\"\n alt=\"\"\n class=\"img-fluid\" />\n </div>\n </div>\n }\n </div>\n <div class=\"col-sm-9\">\n <ul class=\"name-fl\">\n <li>\n <strong>First Name:\n </strong>\n <span>{{\n user.first_name !== null\n ? user.first_name\n : 'N/A'\n }}</span>\n </li>\n <li>\n <strong>Last Name:\n </strong>\n <span>{{\n user.last_name !== null\n ? user.last_name\n : 'N/A'\n }}</span>\n </li>\n </ul>\n <p>\n <strong>Email: </strong>\n <span>{{\n user.email !== null\n ? user.email\n : 'N/A'\n }}</span>\n </p>\n <p>\n <strong>Description:\n </strong>\n <span>{{\n user?.user_profile\n ?.description !== null\n ? user?.user_profile\n ?.description\n : 'N/A'\n }}</span>\n </p>\n <div class=\"view-btn text-end\">\n <a class=\"btn btn-outline-primary inline-block\"\n [routerLink]=\"[\n '/members/' +\n user.slug\n ]\">View More</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @case ('faqs') {\n @if (getResultGroup(group).length) {\n <h6>\n {{ group | uppercase }}\n </h6>\n @for (\n faq of getResultGroup(group); track trackByFaqId($index, faq); let idx2 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx2 + idx\">{{ faq.question }}</a>\n </h5>\n </div>\n <div [id]=\"'collapse' + idx2 + idx\"\n class=\"panel-collapse collapse in\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer |safe:'html'\">\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n }\n }\n </div>\n }\n @if (!hasResults) {\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\">\n </pw-no-data>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.faq-search-answer a{color:#144086;display:inline-block;float:right;font-size:14px;margin-right:15px}::ng-deep .ql-snow *{font-size:16px!important}.faq-search-answer a:after{right:-10px}.faq-item{border:1px dashed rgba(0,0,0,.1);background-color:#fff;border-radius:3px;margin:10px 0;transition:all .2s ease-in-out}.faq-item .dashboard-header{background:#fff}.accord-title1 .faq-search-answer a{margin-right:0!important}a.accordion-toggle:after{display:none}.accord-title p.title-font{font-size:.8rem}.panel-collapse.show{border-top:1px dashed rgba(0,0,0,.1);padding-top:20px;padding-bottom:20px}.panel-collapse ul{margin-bottom:1rem}.panel-collapse ul.name-fl li{display:inline-block;padding-right:15px}.view-btn a{display:inline-block}.avatar{width:130px;margin:0 auto;display:block}.accordion-title a{color:var(--sidebar_bg)!important}.card-header h1,.card-header p{color:#fff!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}.card-block p{font-size:16px}.card,h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"] }]
|
|
772
|
-
}], ctorParameters: () => [{ type: i1$1.ActivatedRoute }, { type: i1.DashboardService }, { type: i0.ChangeDetectorRef }] });
|
|
773
|
-
|
|
774
|
-
// Note: CurrentNotificationsComponent and DismissedNotificationsComponent
|
|
775
|
-
// are declared in DashboardLibModule and exported from there
|
|
776
|
-
// They are needed by NotificationsPageComponent but kept in the main dashboard module
|
|
777
|
-
class DashboardContentModule {
|
|
778
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DashboardContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
779
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.19", ngImport: i0, type: DashboardContentModule, declarations: [DocumentationComponent,
|
|
780
|
-
FaqComponent,
|
|
781
|
-
FaqDetailsComponent,
|
|
782
|
-
HomeComponent,
|
|
783
|
-
NotificationsPageComponent,
|
|
784
|
-
CurrentNotificationsComponent,
|
|
785
|
-
NotificationsPageComponent,
|
|
786
|
-
DismissedNotificationsComponent,
|
|
787
|
-
SearchComponent,
|
|
788
|
-
UserFeedbackComponent], imports: [CommonModule,
|
|
789
|
-
FormsModule,
|
|
790
|
-
RouterModule,
|
|
791
|
-
CoreTranslocoModule,
|
|
792
|
-
DirectivesModule,
|
|
793
|
-
PipesModule,
|
|
794
|
-
ProgressSpinnerModule,
|
|
795
|
-
NgbNavModule,
|
|
796
|
-
RadioButtonModule,
|
|
797
|
-
TooltipModule,
|
|
798
|
-
ResourceSharedComponentsModule], exports: [DocumentationComponent,
|
|
799
|
-
FaqComponent,
|
|
800
|
-
FaqDetailsComponent,
|
|
801
|
-
HomeComponent,
|
|
802
|
-
NotificationsPageComponent,
|
|
803
|
-
CurrentNotificationsComponent,
|
|
804
|
-
NotificationsPageComponent,
|
|
805
|
-
DismissedNotificationsComponent,
|
|
806
|
-
SearchComponent,
|
|
807
|
-
RadioButtonModule] }); }
|
|
808
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DashboardContentModule, imports: [CommonModule,
|
|
809
|
-
FormsModule,
|
|
810
|
-
RouterModule,
|
|
811
|
-
CoreTranslocoModule,
|
|
812
|
-
DirectivesModule,
|
|
813
|
-
PipesModule,
|
|
814
|
-
ProgressSpinnerModule,
|
|
815
|
-
NgbNavModule,
|
|
816
|
-
RadioButtonModule,
|
|
817
|
-
TooltipModule,
|
|
818
|
-
ResourceSharedComponentsModule, RadioButtonModule] }); }
|
|
361
|
+
if (!faq) return { ...EMPTY_FAQ_STATUS_BADGES };
|
|
362
|
+
const resolved = categories ?? [];
|
|
363
|
+
const category = faq.category;
|
|
364
|
+
const named = resolved.find((entry) => entry.key === category);
|
|
365
|
+
return {
|
|
366
|
+
isPublic: faq.public === true,
|
|
367
|
+
isHidden: faq.visible === false,
|
|
368
|
+
category,
|
|
369
|
+
categoryLabel: named?.name || category || "",
|
|
370
|
+
categoryKeys: resolved.map((entry) => entry.key),
|
|
371
|
+
featureKeys: Array.isArray(faq.feature_keys) ? faq.feature_keys : []
|
|
372
|
+
};
|
|
819
373
|
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
i0.ɵɵ
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
374
|
+
var FaqDetailsComponent = class FaqDetailsComponent extends AppBaseComponent {
|
|
375
|
+
constructor(commonService, injector, sanitizer, cdr) {
|
|
376
|
+
super(injector);
|
|
377
|
+
this.commonService = commonService;
|
|
378
|
+
this.sanitizer = sanitizer;
|
|
379
|
+
this.cdr = cdr;
|
|
380
|
+
this.isLoading = false;
|
|
381
|
+
this.routers = ADMIN_ROUTERS;
|
|
382
|
+
this.canEditFaq = false;
|
|
383
|
+
this.editFaqId = null;
|
|
384
|
+
this.badges = { ...EMPTY_FAQ_STATUS_BADGES };
|
|
385
|
+
this.hasFaqAdminPermission = false;
|
|
386
|
+
this.faqRef = this.route.snapshot.params["id"];
|
|
387
|
+
this.slug = PermissionService.selectedSubscription?.slug;
|
|
388
|
+
}
|
|
389
|
+
ngOnInit() {
|
|
390
|
+
this.hasFaqAdminPermission = this.permissionService.evaluatePermissions(FAQ_ADMIN_PERMISSION);
|
|
391
|
+
this.getFaq();
|
|
392
|
+
}
|
|
393
|
+
get showStatusBadges() {
|
|
394
|
+
return this.canEditFaq && (this.badges.isPublic || this.badges.isHidden || !!this.badges.categoryLabel);
|
|
395
|
+
}
|
|
396
|
+
getFaq() {
|
|
397
|
+
this.isLoading = true;
|
|
398
|
+
forkJoin({
|
|
399
|
+
faq: this.commonService.getPublicFaqById(this.faqRef),
|
|
400
|
+
categories: this.faqCategories$()
|
|
401
|
+
}).pipe(finalize(() => {
|
|
402
|
+
this.isLoading = false;
|
|
403
|
+
this.cdr.markForCheck();
|
|
404
|
+
})).subscribe(({ faq, categories }) => {
|
|
405
|
+
this.faq = {
|
|
406
|
+
...faq,
|
|
407
|
+
answer: this.sanitizeAnswer(faq)
|
|
408
|
+
};
|
|
409
|
+
const loaded = !!faq?.question;
|
|
410
|
+
this.canEditFaq = loaded && this.hasFaqAdminPermission;
|
|
411
|
+
this.editFaqId = loaded ? this.resolveEditFaqId(faq) : null;
|
|
412
|
+
this.badges = buildStatusBadges(loaded ? faq : null, categories);
|
|
413
|
+
this.cdr.markForCheck();
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
faqCategories$() {
|
|
417
|
+
if (!this.hasFaqAdminPermission) return of(null);
|
|
418
|
+
return this.getUserSubscriptionId().pipe(take(1), map((id) => id ?? PermissionService.selectedSubscription?.id), switchMap((id) => id ? this.commonService.getFaqCategories(id) : of(null)), catchError(() => of(null)));
|
|
419
|
+
}
|
|
420
|
+
sanitizeAnswer(faq) {
|
|
421
|
+
if (!faq?.answer) return;
|
|
422
|
+
const doc = new DOMParser().parseFromString(faq.answer, "text/html");
|
|
423
|
+
doc.querySelectorAll("button").forEach((button) => button.remove());
|
|
424
|
+
return this.sanitizer.bypassSecurityTrustHtml(doc.body.innerHTML);
|
|
425
|
+
}
|
|
426
|
+
resolveEditFaqId(faq) {
|
|
427
|
+
const fromPayload = Number(faq?.id);
|
|
428
|
+
if (Number.isInteger(fromPayload) && fromPayload > 0) return fromPayload;
|
|
429
|
+
const fromRoute = Number(this.faqRef);
|
|
430
|
+
return Number.isInteger(fromRoute) && fromRoute > 0 ? fromRoute : null;
|
|
431
|
+
}
|
|
432
|
+
static {
|
|
433
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
434
|
+
minVersion: "12.0.0",
|
|
435
|
+
version: "22.2.0",
|
|
436
|
+
ngImport: i0,
|
|
437
|
+
type: FaqDetailsComponent,
|
|
438
|
+
deps: [
|
|
439
|
+
{ token: i1$1.CommonService },
|
|
440
|
+
{ token: i0.Injector },
|
|
441
|
+
{ token: i1$2.DomSanitizer },
|
|
442
|
+
{ token: i0.ChangeDetectorRef }
|
|
443
|
+
],
|
|
444
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
static {
|
|
448
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
449
|
+
minVersion: "17.0.0",
|
|
450
|
+
version: "22.2.0",
|
|
451
|
+
type: FaqDetailsComponent,
|
|
452
|
+
isStandalone: false,
|
|
453
|
+
selector: "pw-faq-details",
|
|
454
|
+
usesInheritance: true,
|
|
455
|
+
ngImport: i0,
|
|
456
|
+
template: "@if (!isLoading) {\n <div class=\"content-quill-wrapper overflow-hidden mt-5 p-3\">\n <div class=\"content-quill-box\">\n <h2 [class.mb-3]=\"!showStatusBadges\" [class.mb-2]=\"showStatusBadges\">\n {{faq?.question}}\n @if (canEditFaq && editFaqId) {\n <a class=\"faq-edit-link ms-3\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + editFaqId]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </h2>\n @if (showStatusBadges) {\n <!-- `badge-soft` opts these out of Bootstrap's saturated fills and into\n the platform badge doctrine (admin-list-view §B-1..B-5: light tint +\n dark ink, status dot on success/danger, no dot on a taxonomy value).\n Defined once in @posiwise/core-styles — never restate the hexes. -->\n <div class=\"faq-status-badges d-flex flex-wrap align-items-center gap-2 mb-3\">\n @if (badges.categoryLabel) {\n <span class=\"badge badge-soft\"\n [appDynamicBadge]=\"{ itemsArray: badges.categoryKeys, item: badges.category }\"\n color=\"cyan\"\n [pTooltip]=\"badges.featureKeys.length ? badges.featureKeys.join(', ') : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ badges.categoryLabel }}</span>\n }\n @if (badges.isPublic) {\n <span class=\"badge badge-soft bg-success\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Public' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Public' | transloco }}</span>\n }\n @if (badges.isHidden) {\n <span class=\"badge badge-soft bg-danger\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Hidden' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Hidden' | transloco }}</span>\n }\n </div>\n }\n <ng-container>\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer\">\n </div>\n </div>\n </ng-container>\n </div>\n @if (!faq && !isLoading) {\n <pw-no-data\n message=\"No Faq found\">\n </pw-no-data>\n }\n <div class=\"text-end mt-3\">\n <button class=\"btn btn-outline-primary\"\n [routerLink]=\"['/',slug,'faq']\">See all FAQs</button>\n </div>\n </div>\n}\n@if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n}\n",
|
|
457
|
+
styles: [".ql-container{resize:none!important}.faq-edit-link{text-decoration:none;vertical-align:middle}.faq-edit-link .edit-icon{font-size:16px}\n"],
|
|
458
|
+
dependencies: [
|
|
459
|
+
{
|
|
460
|
+
kind: "directive",
|
|
461
|
+
type: i3$1.RouterLink,
|
|
462
|
+
selector: "[routerLink]",
|
|
463
|
+
inputs: [
|
|
464
|
+
"target",
|
|
465
|
+
"queryParams",
|
|
466
|
+
"fragment",
|
|
467
|
+
"queryParamsHandling",
|
|
468
|
+
"state",
|
|
469
|
+
"info",
|
|
470
|
+
"relativeTo",
|
|
471
|
+
"preserveFragment",
|
|
472
|
+
"skipLocationChange",
|
|
473
|
+
"replaceUrl",
|
|
474
|
+
"browserUrl",
|
|
475
|
+
"routerLink"
|
|
476
|
+
]
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
kind: "directive",
|
|
480
|
+
type: i4.DynamicBadgeDirective,
|
|
481
|
+
selector: "[appDynamicBadge]",
|
|
482
|
+
inputs: [
|
|
483
|
+
"appDynamicBadge",
|
|
484
|
+
"color",
|
|
485
|
+
"colorByName",
|
|
486
|
+
"dataName"
|
|
487
|
+
]
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
kind: "component",
|
|
491
|
+
type: i2$2.ProgressSpinner,
|
|
492
|
+
selector: "p-progress-spinner, p-progressspinner",
|
|
493
|
+
inputs: [
|
|
494
|
+
"value",
|
|
495
|
+
"strokeWidth",
|
|
496
|
+
"animationDuration",
|
|
497
|
+
"min",
|
|
498
|
+
"max",
|
|
499
|
+
"ariaLabel",
|
|
500
|
+
"fill"
|
|
501
|
+
]
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
kind: "directive",
|
|
505
|
+
type: i5$1.Tooltip,
|
|
506
|
+
selector: "[pTooltip]",
|
|
507
|
+
inputs: [
|
|
508
|
+
"tooltipPosition",
|
|
509
|
+
"tooltipEvent",
|
|
510
|
+
"positionStyle",
|
|
511
|
+
"tooltipStyleClass",
|
|
512
|
+
"tooltipZIndex",
|
|
513
|
+
"escape",
|
|
514
|
+
"showDelay",
|
|
515
|
+
"hideDelay",
|
|
516
|
+
"life",
|
|
517
|
+
"positionTop",
|
|
518
|
+
"positionLeft",
|
|
519
|
+
"autoHide",
|
|
520
|
+
"fitContent",
|
|
521
|
+
"hideOnEscape",
|
|
522
|
+
"showOnEllipsis",
|
|
523
|
+
"pTooltip",
|
|
524
|
+
"tooltipDisabled",
|
|
525
|
+
"tooltipOptions",
|
|
526
|
+
"appendTo",
|
|
527
|
+
"pTooltipPT",
|
|
528
|
+
"pTooltipUnstyled"
|
|
529
|
+
]
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
kind: "component",
|
|
533
|
+
type: i6.NoDataComponent,
|
|
534
|
+
selector: "pw-no-data",
|
|
535
|
+
inputs: [
|
|
536
|
+
"message",
|
|
537
|
+
"description",
|
|
538
|
+
"withImage"
|
|
539
|
+
]
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
kind: "pipe",
|
|
543
|
+
type: i7.TranslocoPipe,
|
|
544
|
+
name: "transloco"
|
|
545
|
+
}
|
|
546
|
+
]
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
551
|
+
minVersion: "12.0.0",
|
|
552
|
+
version: "22.2.0",
|
|
553
|
+
ngImport: i0,
|
|
554
|
+
type: FaqDetailsComponent,
|
|
555
|
+
decorators: [{
|
|
556
|
+
type: Component,
|
|
557
|
+
args: [{
|
|
558
|
+
selector: "pw-faq-details",
|
|
559
|
+
standalone: false,
|
|
560
|
+
template: "@if (!isLoading) {\n <div class=\"content-quill-wrapper overflow-hidden mt-5 p-3\">\n <div class=\"content-quill-box\">\n <h2 [class.mb-3]=\"!showStatusBadges\" [class.mb-2]=\"showStatusBadges\">\n {{faq?.question}}\n @if (canEditFaq && editFaqId) {\n <a class=\"faq-edit-link ms-3\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + editFaqId]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </h2>\n @if (showStatusBadges) {\n <!-- `badge-soft` opts these out of Bootstrap's saturated fills and into\n the platform badge doctrine (admin-list-view §B-1..B-5: light tint +\n dark ink, status dot on success/danger, no dot on a taxonomy value).\n Defined once in @posiwise/core-styles — never restate the hexes. -->\n <div class=\"faq-status-badges d-flex flex-wrap align-items-center gap-2 mb-3\">\n @if (badges.categoryLabel) {\n <span class=\"badge badge-soft\"\n [appDynamicBadge]=\"{ itemsArray: badges.categoryKeys, item: badges.category }\"\n color=\"cyan\"\n [pTooltip]=\"badges.featureKeys.length ? badges.featureKeys.join(', ') : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ badges.categoryLabel }}</span>\n }\n @if (badges.isPublic) {\n <span class=\"badge badge-soft bg-success\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Public' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Public' | transloco }}</span>\n }\n @if (badges.isHidden) {\n <span class=\"badge badge-soft bg-danger\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Hidden' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Hidden' | transloco }}</span>\n }\n </div>\n }\n <ng-container>\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer\">\n </div>\n </div>\n </ng-container>\n </div>\n @if (!faq && !isLoading) {\n <pw-no-data\n message=\"No Faq found\">\n </pw-no-data>\n }\n <div class=\"text-end mt-3\">\n <button class=\"btn btn-outline-primary\"\n [routerLink]=\"['/',slug,'faq']\">See all FAQs</button>\n </div>\n </div>\n}\n@if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n}\n",
|
|
561
|
+
styles: [".ql-container{resize:none!important}.faq-edit-link{text-decoration:none;vertical-align:middle}.faq-edit-link .edit-icon{font-size:16px}\n"]
|
|
562
|
+
}]
|
|
563
|
+
}],
|
|
564
|
+
ctorParameters: () => [
|
|
565
|
+
{ type: i1$1.CommonService },
|
|
566
|
+
{ type: i0.Injector },
|
|
567
|
+
{ type: i1$2.DomSanitizer },
|
|
568
|
+
{ type: i0.ChangeDetectorRef }
|
|
569
|
+
]
|
|
570
|
+
});
|
|
571
|
+
var UserFeedbackComponent = class UserFeedbackComponent extends AppBaseComponent {
|
|
572
|
+
constructor(injector, commonService, cdr) {
|
|
573
|
+
super(injector);
|
|
574
|
+
this.commonService = commonService;
|
|
575
|
+
this.cdr = cdr;
|
|
576
|
+
this.rating = 3;
|
|
577
|
+
this.selectedValue = null;
|
|
578
|
+
this.questions = [];
|
|
579
|
+
this.counter = Array;
|
|
580
|
+
this.showSection = true;
|
|
581
|
+
}
|
|
582
|
+
ngOnInit() {
|
|
583
|
+
this.subscriptionId = PermissionService.selectedSubscription?.id;
|
|
584
|
+
this.getFeedbackQuestions();
|
|
585
|
+
this.userService.getUserInfo().subscribe({ next: (user) => {
|
|
586
|
+
this.user = user;
|
|
587
|
+
this.cdr.markForCheck();
|
|
588
|
+
} });
|
|
589
|
+
this.checkFeedBackExpiry();
|
|
590
|
+
}
|
|
591
|
+
checkFeedBackExpiry() {
|
|
592
|
+
const item = localStorage.getItem("showFeedBack");
|
|
593
|
+
if (item) {
|
|
594
|
+
const currentDate = Date.now();
|
|
595
|
+
const expiryDate = new Date(JSON.parse(item)).getTime();
|
|
596
|
+
this.showSection = currentDate > expiryDate;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
closeSection() {
|
|
600
|
+
this.showSection = false;
|
|
601
|
+
const addedTime = moment(/* @__PURE__ */ new Date()).add(7, "days").toDate();
|
|
602
|
+
localStorage.setItem("showFeedBack", JSON.stringify(addedTime));
|
|
603
|
+
}
|
|
604
|
+
getFeedbackQuestions() {
|
|
605
|
+
if (this.subscriptionId) this.commonService.feedbackQuestions(this.subscriptionId).subscribe((res) => {
|
|
606
|
+
this.questions = res;
|
|
607
|
+
this.cdr.markForCheck();
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
onSubmit(questionId, formValue) {
|
|
611
|
+
if (formValue?.feedback) {
|
|
612
|
+
const data = {
|
|
613
|
+
subscription_id: this.subscriptionId,
|
|
614
|
+
feedback_question_id: questionId,
|
|
615
|
+
value: Number(formValue?.feedback),
|
|
616
|
+
comment: formValue?.description
|
|
617
|
+
};
|
|
618
|
+
this.commonService.userFeedbacks(data).subscribe(() => {
|
|
619
|
+
this.getFeedbackQuestions();
|
|
620
|
+
this.cdr.markForCheck();
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
trackByQuestion(_index, item) {
|
|
625
|
+
return item.id;
|
|
626
|
+
}
|
|
627
|
+
static {
|
|
628
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
629
|
+
minVersion: "12.0.0",
|
|
630
|
+
version: "22.2.0",
|
|
631
|
+
ngImport: i0,
|
|
632
|
+
type: UserFeedbackComponent,
|
|
633
|
+
deps: [
|
|
634
|
+
{ token: i0.Injector },
|
|
635
|
+
{ token: i1$1.CommonService },
|
|
636
|
+
{ token: i0.ChangeDetectorRef }
|
|
637
|
+
],
|
|
638
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
static {
|
|
642
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
643
|
+
minVersion: "17.0.0",
|
|
644
|
+
version: "22.2.0",
|
|
645
|
+
type: UserFeedbackComponent,
|
|
646
|
+
isStandalone: false,
|
|
647
|
+
selector: "pw-user-feedback",
|
|
648
|
+
usesInheritance: true,
|
|
649
|
+
ngImport: i0,
|
|
650
|
+
template: "@if (showSection) {\n @if (questions?.length) {\n <div class=\"mt-4\"\n >\n <div class=\"card pb-1\">\n <h3 class=\"text-end me-3 pt-2 cursor-pointer\"\n (keydown.enter)=\"closeSection()\"\n (click)=\"closeSection()\">×</h3>\n @for (question of questions; track trackByQuestion($index, question); let first = $first) {\n <div class=\"card-content p-0\"\n >\n <div class=\"card-header\">\n <form #feedbackForm=\"ngForm\">\n <div class=\"col-lg-8 p-0 mx-auto\">\n @if (first) {\n <h3 class=\"mb-1\"\n >Your input is valuable to us</h3>\n }\n @if (first) {\n <p class=\"mb-4\"\n >\n Please take a moment to answer these questions\n </p>\n }\n <h6 class=\"fw-bold pb-3 mx-auto\">{{ question?.question }}</h6>\n <div class=\"text-center row p-2 mx-md-2 feedback-value\">\n <span class=\"col-auto me-0\">Not at all</span>\n @for (val of counter(11); track val; let i = $index) {\n <div class=\"p-field-checkbox col-auto ms-0 me-0\">\n <p-radio-button name=\"feedback\" [(ngModel)]=\"selectedValue\" [value]=\"i\" [inputId]=\"i\"></p-radio-button>\n <br />\n <label [for]=\"i\">{{ i }}</label>\n </div>\n }\n <span class=\"col-auto ms-0\">Extremely</span>\n </div>\n <div class=\"text mt-3\">\n <h6>Can you tell us the reason for your score? Do you have any particular features you want us to build or fix?</h6>\n <label for=\"user-feedback-description\" class=\"visually-hidden\">Reason for your score</label>\n <textarea id=\"user-feedback-description\"\n rows=\"4\"\n name=\"description\"\n placeholder=\"“What is the primary reason for your score?”\"\n ngModel\n type=\"text\"\n pInputTextarea\n class=\"form-control\"\n aria-label=\"“What is the primary reason for your score?”\">\n </textarea>\n </div>\n <div class=\"mt-3\">\n <button class=\"btn btn-primary d-block mx-auto\"\n (click)=\"onSubmit(question?.id, feedbackForm.value)\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n }\n </div>\n </div>\n }\n}\n",
|
|
651
|
+
styles: ["::ng-deep .p-radiobutton-checked .p-radiobutton-box{border-color:var(--first)!important;background:var(--first)!important}.feedback-value{justify-content:center}.feedback-value label{color:#000000de;cursor:pointer;font-size:1rem;font-weight:400;letter-spacing:normal;margin-left:10px;margin-right:10px;text-transform:none}.feedback-value .p-field-checkbox{margin:0 10px}\n"],
|
|
652
|
+
dependencies: [
|
|
653
|
+
{
|
|
654
|
+
kind: "directive",
|
|
655
|
+
type: i2$1.ɵNgNoValidate,
|
|
656
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
kind: "directive",
|
|
660
|
+
type: i2$1.DefaultValueAccessor,
|
|
661
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
kind: "directive",
|
|
665
|
+
type: i2$1.NgControlStatus,
|
|
666
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
kind: "directive",
|
|
670
|
+
type: i2$1.NgControlStatusGroup,
|
|
671
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
kind: "directive",
|
|
675
|
+
type: i2$1.NgModel,
|
|
676
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
677
|
+
inputs: [
|
|
678
|
+
"name",
|
|
679
|
+
"disabled",
|
|
680
|
+
"ngModel",
|
|
681
|
+
"ngModelOptions"
|
|
682
|
+
],
|
|
683
|
+
outputs: ["ngModelChange"],
|
|
684
|
+
exportAs: ["ngModel"]
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
kind: "directive",
|
|
688
|
+
type: i2$1.NgForm,
|
|
689
|
+
selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
|
|
690
|
+
inputs: ["ngFormOptions"],
|
|
691
|
+
outputs: ["ngSubmit"],
|
|
692
|
+
exportAs: ["ngForm"]
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
kind: "component",
|
|
696
|
+
type: i3.RadioButton,
|
|
697
|
+
selector: "p-radiobutton, p-radio-button",
|
|
698
|
+
inputs: [
|
|
699
|
+
"value",
|
|
700
|
+
"tabindex",
|
|
701
|
+
"inputId",
|
|
702
|
+
"ariaLabelledBy",
|
|
703
|
+
"ariaLabel",
|
|
704
|
+
"autofocus",
|
|
705
|
+
"binary",
|
|
706
|
+
"variant",
|
|
707
|
+
"size"
|
|
708
|
+
],
|
|
709
|
+
outputs: [
|
|
710
|
+
"onClick",
|
|
711
|
+
"onFocus",
|
|
712
|
+
"onBlur"
|
|
713
|
+
]
|
|
714
|
+
}
|
|
715
|
+
]
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
720
|
+
minVersion: "12.0.0",
|
|
721
|
+
version: "22.2.0",
|
|
722
|
+
ngImport: i0,
|
|
723
|
+
type: UserFeedbackComponent,
|
|
724
|
+
decorators: [{
|
|
725
|
+
type: Component,
|
|
726
|
+
args: [{
|
|
727
|
+
selector: "pw-user-feedback",
|
|
728
|
+
standalone: false,
|
|
729
|
+
template: "@if (showSection) {\n @if (questions?.length) {\n <div class=\"mt-4\"\n >\n <div class=\"card pb-1\">\n <h3 class=\"text-end me-3 pt-2 cursor-pointer\"\n (keydown.enter)=\"closeSection()\"\n (click)=\"closeSection()\">×</h3>\n @for (question of questions; track trackByQuestion($index, question); let first = $first) {\n <div class=\"card-content p-0\"\n >\n <div class=\"card-header\">\n <form #feedbackForm=\"ngForm\">\n <div class=\"col-lg-8 p-0 mx-auto\">\n @if (first) {\n <h3 class=\"mb-1\"\n >Your input is valuable to us</h3>\n }\n @if (first) {\n <p class=\"mb-4\"\n >\n Please take a moment to answer these questions\n </p>\n }\n <h6 class=\"fw-bold pb-3 mx-auto\">{{ question?.question }}</h6>\n <div class=\"text-center row p-2 mx-md-2 feedback-value\">\n <span class=\"col-auto me-0\">Not at all</span>\n @for (val of counter(11); track val; let i = $index) {\n <div class=\"p-field-checkbox col-auto ms-0 me-0\">\n <p-radio-button name=\"feedback\" [(ngModel)]=\"selectedValue\" [value]=\"i\" [inputId]=\"i\"></p-radio-button>\n <br />\n <label [for]=\"i\">{{ i }}</label>\n </div>\n }\n <span class=\"col-auto ms-0\">Extremely</span>\n </div>\n <div class=\"text mt-3\">\n <h6>Can you tell us the reason for your score? Do you have any particular features you want us to build or fix?</h6>\n <label for=\"user-feedback-description\" class=\"visually-hidden\">Reason for your score</label>\n <textarea id=\"user-feedback-description\"\n rows=\"4\"\n name=\"description\"\n placeholder=\"“What is the primary reason for your score?”\"\n ngModel\n type=\"text\"\n pInputTextarea\n class=\"form-control\"\n aria-label=\"“What is the primary reason for your score?”\">\n </textarea>\n </div>\n <div class=\"mt-3\">\n <button class=\"btn btn-primary d-block mx-auto\"\n (click)=\"onSubmit(question?.id, feedbackForm.value)\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n }\n </div>\n </div>\n }\n}\n",
|
|
730
|
+
styles: ["::ng-deep .p-radiobutton-checked .p-radiobutton-box{border-color:var(--first)!important;background:var(--first)!important}.feedback-value{justify-content:center}.feedback-value label{color:#000000de;cursor:pointer;font-size:1rem;font-weight:400;letter-spacing:normal;margin-left:10px;margin-right:10px;text-transform:none}.feedback-value .p-field-checkbox{margin:0 10px}\n"]
|
|
731
|
+
}]
|
|
732
|
+
}],
|
|
733
|
+
ctorParameters: () => [
|
|
734
|
+
{ type: i0.Injector },
|
|
735
|
+
{ type: i1$1.CommonService },
|
|
736
|
+
{ type: i0.ChangeDetectorRef }
|
|
737
|
+
]
|
|
738
|
+
});
|
|
739
|
+
var HomeComponent = class HomeComponent extends AppBaseComponent {
|
|
740
|
+
constructor(injector, hopscotchService, cdr) {
|
|
741
|
+
super(injector);
|
|
742
|
+
this.hopscotchService = hopscotchService;
|
|
743
|
+
this.cdr = cdr;
|
|
744
|
+
this.componentActive = true;
|
|
745
|
+
}
|
|
746
|
+
sanitizeContent(jsonString) {
|
|
747
|
+
let sanitizedString = jsonString.replaceAll("'", "\"");
|
|
748
|
+
sanitizedString = sanitizedString.replace(/<img\s+src="([^"]+)"/g, String.raw`<img src=\"$1\"`);
|
|
749
|
+
sanitizedString = sanitizedString.replace(/,\s*([}\]])/g, "$1");
|
|
750
|
+
return sanitizedString;
|
|
751
|
+
}
|
|
752
|
+
ngOnInit() {
|
|
753
|
+
this.selectedSubscriptionSlug = PermissionService.selectedSubscription?.slug;
|
|
754
|
+
this.subscriptionId = PermissionService.selectedSubscription?.id;
|
|
755
|
+
this.userStore().subscribe((state) => {
|
|
756
|
+
if (state) this.userService.getCurrentUserObject("active_tips").subscribe((response) => {
|
|
757
|
+
if (response?.length) {
|
|
758
|
+
const welcomeTips = response.find((x) => x.name === "welcome");
|
|
759
|
+
if (welcomeTips) {
|
|
760
|
+
const steps = JSON.parse(this.sanitizeContent(welcomeTips.instructions)).steps;
|
|
761
|
+
try {
|
|
762
|
+
this.hopscotchService.initializeTour("dashboard", steps, {
|
|
763
|
+
tip_id: welcomeTips.id,
|
|
764
|
+
disregarded: true
|
|
765
|
+
}, this.subscriptionId);
|
|
766
|
+
} catch (error) {
|
|
767
|
+
console.error("Error parsing JSON:", error);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
this.cdr.markForCheck();
|
|
772
|
+
});
|
|
773
|
+
this.cdr.markForCheck();
|
|
774
|
+
});
|
|
775
|
+
this.userStore().subscribe({
|
|
776
|
+
next: (user) => {
|
|
777
|
+
this.user = user;
|
|
778
|
+
if (this.user) this.userSlug = user.slug;
|
|
779
|
+
this.cdr.markForCheck();
|
|
780
|
+
},
|
|
781
|
+
error: (error) => {
|
|
782
|
+
this.toast.showToast(error);
|
|
783
|
+
this.cdr.markForCheck();
|
|
784
|
+
}
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
ngOnDestroy() {
|
|
788
|
+
this.hopscotchService.endTour();
|
|
789
|
+
super.ngOnDestroy();
|
|
790
|
+
}
|
|
791
|
+
static {
|
|
792
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
793
|
+
minVersion: "12.0.0",
|
|
794
|
+
version: "22.2.0",
|
|
795
|
+
ngImport: i0,
|
|
796
|
+
type: HomeComponent,
|
|
797
|
+
deps: [
|
|
798
|
+
{ token: i0.Injector },
|
|
799
|
+
{ token: i1$1.HopscotchService },
|
|
800
|
+
{ token: i0.ChangeDetectorRef }
|
|
801
|
+
],
|
|
802
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
static {
|
|
806
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
807
|
+
minVersion: "14.0.0",
|
|
808
|
+
version: "22.2.0",
|
|
809
|
+
type: HomeComponent,
|
|
810
|
+
isStandalone: false,
|
|
811
|
+
selector: "pw-home",
|
|
812
|
+
usesInheritance: true,
|
|
813
|
+
ngImport: i0,
|
|
814
|
+
template: "<pw-user-feedback></pw-user-feedback>\n<div class=\"row mt-3\">\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <div id=\"cards\"></div>\n <h3 class=\"mb-3\">{{'ManageYourAccount'|transloco}}</h3>\n <p>{{'ManageYourAccountDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/ManageYourAccount.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/account/details\"\n class=\"d-block\">{{'ManageYourAccount'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step2\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'UpdateYourProfile'|transloco}}</h3>\n <p>{{'UpdateYourProfileDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/UpdateYourProfile.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"['/members', userSlug]\"\n class=\"d-block\">{{'UpdateYourProfile'|transloco}}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'CommunicationSettings'|transloco}}</h3>\n <p>\n {{'CommunicationSettingsDescription'|transloco}}\n </p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/CommunicationSettings.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/settings/communication\"\n class=\"d-block\">{{'GotoCommunicationSettings'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step3\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'NeedHelp'|transloco}}</h3>\n <p>{{'NeedHelpDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/NeedHelp.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"'/' + selectedSubscriptionSlug + '/faq'\"\n class=\"d-block\">{{'SeeAllOurFaq'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step4\"></div>\n </div>\n </div>\n </div>\n</div>\n",
|
|
815
|
+
styles: ["::ng-deep .hopscotch-title{text-align:center!important;margin-bottom:20px!important}::ng-deep .hopscotch-title h2{margin:0}::ng-deep .hopscotch-content{text-align:center;padding:20px;margin:0!important}::ng-deep .hopscotch-content img{width:150px;margin:20px 0}::ng-deep .hopscotch-content p{font-size:16px;color:#555}::ng-deep .hopscotch-step-title{text-align:left;margin-bottom:15px}::ng-deep .hopscotch-step-content{padding:20px;text-align:left!important}::ng-deep .hopscotch-step-content p{font-size:14px;color:#555;margin-bottom:10px;text-align:left!important}\n"],
|
|
816
|
+
dependencies: [
|
|
817
|
+
{
|
|
818
|
+
kind: "directive",
|
|
819
|
+
type: i3$1.RouterLink,
|
|
820
|
+
selector: "[routerLink]",
|
|
821
|
+
inputs: [
|
|
822
|
+
"target",
|
|
823
|
+
"queryParams",
|
|
824
|
+
"fragment",
|
|
825
|
+
"queryParamsHandling",
|
|
826
|
+
"state",
|
|
827
|
+
"info",
|
|
828
|
+
"relativeTo",
|
|
829
|
+
"preserveFragment",
|
|
830
|
+
"skipLocationChange",
|
|
831
|
+
"replaceUrl",
|
|
832
|
+
"browserUrl",
|
|
833
|
+
"routerLink"
|
|
834
|
+
]
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
kind: "directive",
|
|
838
|
+
type: i4.LazyImgDirective,
|
|
839
|
+
selector: "img"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
kind: "component",
|
|
843
|
+
type: UserFeedbackComponent,
|
|
844
|
+
selector: "pw-user-feedback"
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
kind: "pipe",
|
|
848
|
+
type: i7.TranslocoPipe,
|
|
849
|
+
name: "transloco"
|
|
850
|
+
}
|
|
851
|
+
]
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
856
|
+
minVersion: "12.0.0",
|
|
857
|
+
version: "22.2.0",
|
|
858
|
+
ngImport: i0,
|
|
859
|
+
type: HomeComponent,
|
|
860
|
+
decorators: [{
|
|
861
|
+
type: Component,
|
|
862
|
+
args: [{
|
|
863
|
+
selector: "pw-home",
|
|
864
|
+
standalone: false,
|
|
865
|
+
template: "<pw-user-feedback></pw-user-feedback>\n<div class=\"row mt-3\">\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <div id=\"cards\"></div>\n <h3 class=\"mb-3\">{{'ManageYourAccount'|transloco}}</h3>\n <p>{{'ManageYourAccountDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/ManageYourAccount.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/account/details\"\n class=\"d-block\">{{'ManageYourAccount'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step2\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'UpdateYourProfile'|transloco}}</h3>\n <p>{{'UpdateYourProfileDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/UpdateYourProfile.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"['/members', userSlug]\"\n class=\"d-block\">{{'UpdateYourProfile'|transloco}}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'CommunicationSettings'|transloco}}</h3>\n <p>\n {{'CommunicationSettingsDescription'|transloco}}\n </p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/CommunicationSettings.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/settings/communication\"\n class=\"d-block\">{{'GotoCommunicationSettings'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step3\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'NeedHelp'|transloco}}</h3>\n <p>{{'NeedHelpDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/NeedHelp.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"'/' + selectedSubscriptionSlug + '/faq'\"\n class=\"d-block\">{{'SeeAllOurFaq'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step4\"></div>\n </div>\n </div>\n </div>\n</div>\n",
|
|
866
|
+
styles: ["::ng-deep .hopscotch-title{text-align:center!important;margin-bottom:20px!important}::ng-deep .hopscotch-title h2{margin:0}::ng-deep .hopscotch-content{text-align:center;padding:20px;margin:0!important}::ng-deep .hopscotch-content img{width:150px;margin:20px 0}::ng-deep .hopscotch-content p{font-size:16px;color:#555}::ng-deep .hopscotch-step-title{text-align:left;margin-bottom:15px}::ng-deep .hopscotch-step-content{padding:20px;text-align:left!important}::ng-deep .hopscotch-step-content p{font-size:14px;color:#555;margin-bottom:10px;text-align:left!important}\n"]
|
|
867
|
+
}]
|
|
868
|
+
}],
|
|
869
|
+
ctorParameters: () => [
|
|
870
|
+
{ type: i0.Injector },
|
|
871
|
+
{ type: i1$1.HopscotchService },
|
|
872
|
+
{ type: i0.ChangeDetectorRef }
|
|
873
|
+
]
|
|
874
|
+
});
|
|
875
|
+
var CurrentNotificationsComponent = class CurrentNotificationsComponent {
|
|
876
|
+
constructor(notificationService, cdr) {
|
|
877
|
+
this.notificationService = notificationService;
|
|
878
|
+
this.cdr = cdr;
|
|
879
|
+
this.notificationCount = 0;
|
|
880
|
+
this.noNoti = true;
|
|
881
|
+
this.itemsPerPage = 100;
|
|
882
|
+
this.notifications = [];
|
|
883
|
+
this.currentPage = 1;
|
|
884
|
+
this.isLoaded = false;
|
|
885
|
+
this.totalPages = 1;
|
|
886
|
+
this.totalRecords = 0;
|
|
887
|
+
}
|
|
888
|
+
ngOnInit() {
|
|
889
|
+
this.getNotifications();
|
|
890
|
+
}
|
|
891
|
+
getNotifications() {
|
|
892
|
+
this.notificationService.getNotifications({
|
|
893
|
+
page: this.currentPage,
|
|
894
|
+
page_size: this.itemsPerPage
|
|
895
|
+
}).subscribe((data) => {
|
|
896
|
+
if (Array.isArray(data?.notes) && data?.notes?.length > 0) {
|
|
897
|
+
this.totalRecords = data.unfiltered_count;
|
|
898
|
+
this.notifications = data.notes?.filter((note) => !note.dismissed && note.show_on_dashboard);
|
|
899
|
+
this.totalPages = Math.ceil(data.unfiltered_count / this.itemsPerPage);
|
|
900
|
+
this.noNoti = true;
|
|
901
|
+
if (this.notifications?.length) this.noNoti = false;
|
|
902
|
+
}
|
|
903
|
+
this.cdr.markForCheck();
|
|
904
|
+
}).add(() => {
|
|
905
|
+
this.isLoaded = true;
|
|
906
|
+
this.cdr.markForCheck();
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
nextPage() {
|
|
910
|
+
if (this.currentPage < this.totalPages) {
|
|
911
|
+
this.currentPage++;
|
|
912
|
+
this.getNotifications();
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
previousPage() {
|
|
916
|
+
if (this.currentPage > 1) {
|
|
917
|
+
this.currentPage--;
|
|
918
|
+
this.getNotifications();
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
dismiss(id, e) {
|
|
922
|
+
this.notificationService.dismissNotification(id).subscribe(() => {
|
|
923
|
+
const index = this.notifications.indexOf(e);
|
|
924
|
+
this.notifications.splice(index, 1);
|
|
925
|
+
if (this.notifications.length === 0) this.noNoti = true;
|
|
926
|
+
this.cdr.markForCheck();
|
|
927
|
+
$("#noty").slideUp("slow", () => {
|
|
928
|
+
$("#noty").remove();
|
|
929
|
+
});
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
trackByNotification(_index, item) {
|
|
933
|
+
return item.id;
|
|
934
|
+
}
|
|
935
|
+
static {
|
|
936
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
937
|
+
minVersion: "12.0.0",
|
|
938
|
+
version: "22.2.0",
|
|
939
|
+
ngImport: i0,
|
|
940
|
+
type: CurrentNotificationsComponent,
|
|
941
|
+
deps: [{ token: i1$1.NotificationService }, { token: i0.ChangeDetectorRef }],
|
|
942
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
static {
|
|
946
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
947
|
+
minVersion: "17.0.0",
|
|
948
|
+
version: "22.2.0",
|
|
949
|
+
type: CurrentNotificationsComponent,
|
|
950
|
+
isStandalone: false,
|
|
951
|
+
selector: "pw-current-notifications",
|
|
952
|
+
ngImport: i0,
|
|
953
|
+
template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n </div>\n @if (notifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of notifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You are all caught up\" description=\"You currently do not have any notifications.\">\n </pw-no-data>\n </div>\n}\n</div>\n",
|
|
954
|
+
styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"],
|
|
955
|
+
dependencies: [
|
|
956
|
+
{
|
|
957
|
+
kind: "directive",
|
|
958
|
+
type: i2.NgClass,
|
|
959
|
+
selector: "[ngClass]",
|
|
960
|
+
inputs: ["class", "ngClass"]
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
kind: "component",
|
|
964
|
+
type: i2$2.ProgressSpinner,
|
|
965
|
+
selector: "p-progress-spinner, p-progressspinner",
|
|
966
|
+
inputs: [
|
|
967
|
+
"value",
|
|
968
|
+
"strokeWidth",
|
|
969
|
+
"animationDuration",
|
|
970
|
+
"min",
|
|
971
|
+
"max",
|
|
972
|
+
"ariaLabel",
|
|
973
|
+
"fill"
|
|
974
|
+
]
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
kind: "component",
|
|
978
|
+
type: i6.NoDataComponent,
|
|
979
|
+
selector: "pw-no-data",
|
|
980
|
+
inputs: [
|
|
981
|
+
"message",
|
|
982
|
+
"description",
|
|
983
|
+
"withImage"
|
|
984
|
+
]
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
kind: "component",
|
|
988
|
+
type: i6.RecordsSummaryComponent,
|
|
989
|
+
selector: "pw-records-summary",
|
|
990
|
+
inputs: ["showing", "total"]
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
kind: "pipe",
|
|
994
|
+
type: i5.SinceAgoPipe,
|
|
995
|
+
name: "sinceAgo"
|
|
996
|
+
}
|
|
997
|
+
]
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1002
|
+
minVersion: "12.0.0",
|
|
1003
|
+
version: "22.2.0",
|
|
1004
|
+
ngImport: i0,
|
|
1005
|
+
type: CurrentNotificationsComponent,
|
|
1006
|
+
decorators: [{
|
|
1007
|
+
type: Component,
|
|
1008
|
+
args: [{
|
|
1009
|
+
selector: "pw-current-notifications",
|
|
1010
|
+
standalone: false,
|
|
1011
|
+
template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n </div>\n @if (notifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of notifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You are all caught up\" description=\"You currently do not have any notifications.\">\n </pw-no-data>\n </div>\n}\n</div>\n",
|
|
1012
|
+
styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"]
|
|
1013
|
+
}]
|
|
1014
|
+
}],
|
|
1015
|
+
ctorParameters: () => [{ type: i1$1.NotificationService }, { type: i0.ChangeDetectorRef }]
|
|
1016
|
+
});
|
|
1017
|
+
var DismissedNotificationsComponent = class DismissedNotificationsComponent {
|
|
1018
|
+
constructor(notificationService, cdr) {
|
|
1019
|
+
this.notificationService = notificationService;
|
|
1020
|
+
this.cdr = cdr;
|
|
1021
|
+
this.notificationCount = 0;
|
|
1022
|
+
this.noNoti = true;
|
|
1023
|
+
this.dismissedNotifications = [];
|
|
1024
|
+
this.isLoaded = false;
|
|
1025
|
+
this.itemsPerPage = 100;
|
|
1026
|
+
this.currentPage = 1;
|
|
1027
|
+
this.totalPages = 1;
|
|
1028
|
+
this.totalRecords = 0;
|
|
1029
|
+
}
|
|
1030
|
+
ngOnInit() {
|
|
1031
|
+
this.getNotifications();
|
|
1032
|
+
}
|
|
1033
|
+
getNotifications() {
|
|
1034
|
+
this.notificationService.getDismissedNotifications({
|
|
1035
|
+
page: this.currentPage,
|
|
1036
|
+
page_size: this.itemsPerPage
|
|
1037
|
+
}).subscribe((data) => {
|
|
1038
|
+
if (Array.isArray(data?.notes) && data?.notes?.length > 0) {
|
|
1039
|
+
this.noNoti = false;
|
|
1040
|
+
this.dismissedNotifications = data?.notes;
|
|
1041
|
+
this.totalRecords = data?.unfiltered_count;
|
|
1042
|
+
this.totalPages = Math.ceil(data.unfiltered_count / this.itemsPerPage);
|
|
1043
|
+
}
|
|
1044
|
+
this.cdr.markForCheck();
|
|
1045
|
+
}).add(() => {
|
|
1046
|
+
this.isLoaded = true;
|
|
1047
|
+
this.cdr.markForCheck();
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
nextPage() {
|
|
1051
|
+
if (this.currentPage < this.totalPages) {
|
|
1052
|
+
this.currentPage++;
|
|
1053
|
+
this.getNotifications();
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
previousPage() {
|
|
1057
|
+
if (this.currentPage > 1) {
|
|
1058
|
+
this.currentPage--;
|
|
1059
|
+
this.getNotifications();
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
dismiss(id, e) {
|
|
1063
|
+
HelperService.raiseDeletePopup().then((res) => {
|
|
1064
|
+
if (res.value) this.notificationService.deleteNotifications(id).subscribe(() => {
|
|
1065
|
+
const index = this.dismissedNotifications.indexOf(e);
|
|
1066
|
+
this.dismissedNotifications.splice(index, 1);
|
|
1067
|
+
if (this.dismissedNotifications.length === 0) this.noNoti = true;
|
|
1068
|
+
this.cdr.markForCheck();
|
|
1069
|
+
$("#noty").slideUp("slow", () => {
|
|
1070
|
+
$("#noty").remove();
|
|
1071
|
+
});
|
|
1072
|
+
});
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
restoreNotification(id, e) {
|
|
1076
|
+
this.notificationService.reinstateNotification(id).subscribe(() => {
|
|
1077
|
+
const index = this.dismissedNotifications.indexOf(e);
|
|
1078
|
+
this.dismissedNotifications.splice(index, 1);
|
|
1079
|
+
if (this.dismissedNotifications.length === 0) this.noNoti = true;
|
|
1080
|
+
this.cdr.markForCheck();
|
|
1081
|
+
$("#noty").slideUp("slow", () => {
|
|
1082
|
+
$("#noty").remove();
|
|
1083
|
+
});
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
trackByNotification(_index, item) {
|
|
1087
|
+
return item.id;
|
|
1088
|
+
}
|
|
1089
|
+
static {
|
|
1090
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1091
|
+
minVersion: "12.0.0",
|
|
1092
|
+
version: "22.2.0",
|
|
1093
|
+
ngImport: i0,
|
|
1094
|
+
type: DismissedNotificationsComponent,
|
|
1095
|
+
deps: [{ token: i1$1.NotificationService }, { token: i0.ChangeDetectorRef }],
|
|
1096
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
static {
|
|
1100
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1101
|
+
minVersion: "17.0.0",
|
|
1102
|
+
version: "22.2.0",
|
|
1103
|
+
type: DismissedNotificationsComponent,
|
|
1104
|
+
isStandalone: false,
|
|
1105
|
+
selector: "pw-dismissed-notifications",
|
|
1106
|
+
ngImport: i0,
|
|
1107
|
+
template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n </div>\n @if (dismissedNotifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of dismissedNotifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn float-end\">\n <i\n class=\"fas fa-trash-restore-alt\"\n (click)=\"restoreNotification(item.id, item)\"\n (keydown.enter)=\"restoreNotification(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You currently do not have any dismissed notifications\">\n </pw-no-data>\n </div>\n}\n</div>\n",
|
|
1108
|
+
styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"],
|
|
1109
|
+
dependencies: [
|
|
1110
|
+
{
|
|
1111
|
+
kind: "directive",
|
|
1112
|
+
type: i2.NgClass,
|
|
1113
|
+
selector: "[ngClass]",
|
|
1114
|
+
inputs: ["class", "ngClass"]
|
|
1115
|
+
},
|
|
1116
|
+
{
|
|
1117
|
+
kind: "component",
|
|
1118
|
+
type: i2$2.ProgressSpinner,
|
|
1119
|
+
selector: "p-progress-spinner, p-progressspinner",
|
|
1120
|
+
inputs: [
|
|
1121
|
+
"value",
|
|
1122
|
+
"strokeWidth",
|
|
1123
|
+
"animationDuration",
|
|
1124
|
+
"min",
|
|
1125
|
+
"max",
|
|
1126
|
+
"ariaLabel",
|
|
1127
|
+
"fill"
|
|
1128
|
+
]
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
kind: "component",
|
|
1132
|
+
type: i6.NoDataComponent,
|
|
1133
|
+
selector: "pw-no-data",
|
|
1134
|
+
inputs: [
|
|
1135
|
+
"message",
|
|
1136
|
+
"description",
|
|
1137
|
+
"withImage"
|
|
1138
|
+
]
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
kind: "component",
|
|
1142
|
+
type: i6.RecordsSummaryComponent,
|
|
1143
|
+
selector: "pw-records-summary",
|
|
1144
|
+
inputs: ["showing", "total"]
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
kind: "pipe",
|
|
1148
|
+
type: i5.SinceAgoPipe,
|
|
1149
|
+
name: "sinceAgo"
|
|
1150
|
+
}
|
|
1151
|
+
]
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
};
|
|
1155
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1156
|
+
minVersion: "12.0.0",
|
|
1157
|
+
version: "22.2.0",
|
|
1158
|
+
ngImport: i0,
|
|
1159
|
+
type: DismissedNotificationsComponent,
|
|
1160
|
+
decorators: [{
|
|
1161
|
+
type: Component,
|
|
1162
|
+
args: [{
|
|
1163
|
+
selector: "pw-dismissed-notifications",
|
|
1164
|
+
standalone: false,
|
|
1165
|
+
template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n </div>\n @if (dismissedNotifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of dismissedNotifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn float-end\">\n <i\n class=\"fas fa-trash-restore-alt\"\n (click)=\"restoreNotification(item.id, item)\"\n (keydown.enter)=\"restoreNotification(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You currently do not have any dismissed notifications\">\n </pw-no-data>\n </div>\n}\n</div>\n",
|
|
1166
|
+
styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"]
|
|
1167
|
+
}]
|
|
1168
|
+
}],
|
|
1169
|
+
ctorParameters: () => [{ type: i1$1.NotificationService }, { type: i0.ChangeDetectorRef }]
|
|
1170
|
+
});
|
|
1171
|
+
var NotificationsPageComponent = class NotificationsPageComponent {
|
|
1172
|
+
static {
|
|
1173
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1174
|
+
minVersion: "12.0.0",
|
|
1175
|
+
version: "22.2.0",
|
|
1176
|
+
ngImport: i0,
|
|
1177
|
+
type: NotificationsPageComponent,
|
|
1178
|
+
deps: [],
|
|
1179
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
static {
|
|
1183
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1184
|
+
minVersion: "14.0.0",
|
|
1185
|
+
version: "22.2.0",
|
|
1186
|
+
type: NotificationsPageComponent,
|
|
1187
|
+
isStandalone: false,
|
|
1188
|
+
selector: "pw-notifications-page",
|
|
1189
|
+
ngImport: i0,
|
|
1190
|
+
template: "<div class=\"row\">\n <div class=\"col-12 col-sm-12 col-md-12 mt-4\">\n <h2 class=\"p-2\">Notifications</h2>\n </div>\n</div>\n\n<ul ngbNav\n #nav=\"ngbNav\"\n class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\">\n <a ngbNavLink>Current Notifications</a>\n <ng-template ngbNavContent>\n <pw-current-notifications></pw-current-notifications>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"2\">\n <a ngbNavLink>Dismissed Notifications</a>\n <ng-template ngbNavContent>\n <pw-dismissed-notifications></pw-dismissed-notifications>\n </ng-template>\n </li>\n</ul>\n\n<div [ngbNavOutlet]=\"nav\"></div>\n",
|
|
1191
|
+
styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"],
|
|
1192
|
+
dependencies: [
|
|
1193
|
+
{
|
|
1194
|
+
kind: "directive",
|
|
1195
|
+
type: i1.NgbNavContent,
|
|
1196
|
+
selector: "ng-template[ngbNavContent]"
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
kind: "directive",
|
|
1200
|
+
type: i1.NgbNav,
|
|
1201
|
+
selector: "[ngbNav]",
|
|
1202
|
+
inputs: [
|
|
1203
|
+
"activeId",
|
|
1204
|
+
"animation",
|
|
1205
|
+
"destroyOnHide",
|
|
1206
|
+
"orientation",
|
|
1207
|
+
"roles",
|
|
1208
|
+
"keyboard"
|
|
1209
|
+
],
|
|
1210
|
+
outputs: [
|
|
1211
|
+
"activeIdChange",
|
|
1212
|
+
"shown",
|
|
1213
|
+
"hidden",
|
|
1214
|
+
"navChange"
|
|
1215
|
+
],
|
|
1216
|
+
exportAs: ["ngbNav"]
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
kind: "directive",
|
|
1220
|
+
type: i1.NgbNavItem,
|
|
1221
|
+
selector: "[ngbNavItem]",
|
|
1222
|
+
inputs: [
|
|
1223
|
+
"destroyOnHide",
|
|
1224
|
+
"disabled",
|
|
1225
|
+
"domId",
|
|
1226
|
+
"ngbNavItem"
|
|
1227
|
+
],
|
|
1228
|
+
outputs: ["shown", "hidden"],
|
|
1229
|
+
exportAs: ["ngbNavItem"]
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
kind: "directive",
|
|
1233
|
+
type: i1.NgbNavItemRole,
|
|
1234
|
+
selector: "[ngbNavItem]:not(ng-container)"
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
kind: "directive",
|
|
1238
|
+
type: i1.NgbNavLink,
|
|
1239
|
+
selector: "a[ngbNavLink]"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
kind: "directive",
|
|
1243
|
+
type: i1.NgbNavLinkBase,
|
|
1244
|
+
selector: "[ngbNavLink]"
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
kind: "component",
|
|
1248
|
+
type: i1.NgbNavOutlet,
|
|
1249
|
+
selector: "[ngbNavOutlet]",
|
|
1250
|
+
inputs: ["paneRole", "ngbNavOutlet"]
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
kind: "component",
|
|
1254
|
+
type: CurrentNotificationsComponent,
|
|
1255
|
+
selector: "pw-current-notifications"
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
kind: "component",
|
|
1259
|
+
type: DismissedNotificationsComponent,
|
|
1260
|
+
selector: "pw-dismissed-notifications"
|
|
1261
|
+
}
|
|
1262
|
+
]
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1267
|
+
minVersion: "12.0.0",
|
|
1268
|
+
version: "22.2.0",
|
|
1269
|
+
ngImport: i0,
|
|
1270
|
+
type: NotificationsPageComponent,
|
|
1271
|
+
decorators: [{
|
|
1272
|
+
type: Component,
|
|
1273
|
+
args: [{
|
|
1274
|
+
selector: "pw-notifications-page",
|
|
1275
|
+
standalone: false,
|
|
1276
|
+
template: "<div class=\"row\">\n <div class=\"col-12 col-sm-12 col-md-12 mt-4\">\n <h2 class=\"p-2\">Notifications</h2>\n </div>\n</div>\n\n<ul ngbNav\n #nav=\"ngbNav\"\n class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\">\n <a ngbNavLink>Current Notifications</a>\n <ng-template ngbNavContent>\n <pw-current-notifications></pw-current-notifications>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"2\">\n <a ngbNavLink>Dismissed Notifications</a>\n <ng-template ngbNavContent>\n <pw-dismissed-notifications></pw-dismissed-notifications>\n </ng-template>\n </li>\n</ul>\n\n<div [ngbNavOutlet]=\"nav\"></div>\n",
|
|
1277
|
+
styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"]
|
|
1278
|
+
}]
|
|
1279
|
+
}]
|
|
1280
|
+
});
|
|
1281
|
+
var SearchComponent = class SearchComponent {
|
|
1282
|
+
constructor(route, service, cdr) {
|
|
1283
|
+
this.route = route;
|
|
1284
|
+
this.service = service;
|
|
1285
|
+
this.cdr = cdr;
|
|
1286
|
+
this.emptySearchResult = {
|
|
1287
|
+
users: [],
|
|
1288
|
+
faqs: [],
|
|
1289
|
+
recipients: []
|
|
1290
|
+
};
|
|
1291
|
+
this.isLoaded = false;
|
|
1292
|
+
this.objectKeys = Object.keys;
|
|
1293
|
+
}
|
|
1294
|
+
ngOnInit() {
|
|
1295
|
+
this.subscriptionId = PermissionService.selectedSubscription.id;
|
|
1296
|
+
this.route.queryParams.subscribe((response) => {
|
|
1297
|
+
this.keyword = response["keyword"];
|
|
1298
|
+
if (this.keyword) this.search();
|
|
1299
|
+
this.cdr.markForCheck();
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
search() {
|
|
1303
|
+
this.isLoaded = false;
|
|
1304
|
+
this.service.search(this.keyword, this.subscriptionId).subscribe((response) => {
|
|
1305
|
+
this.result = {
|
|
1306
|
+
...this.emptySearchResult,
|
|
1307
|
+
...response
|
|
1308
|
+
};
|
|
1309
|
+
this.cdr.markForCheck();
|
|
1310
|
+
}).add(() => {
|
|
1311
|
+
this.isLoaded = true;
|
|
1312
|
+
this.cdr.markForCheck();
|
|
1313
|
+
});
|
|
1314
|
+
}
|
|
1315
|
+
get hasResults() {
|
|
1316
|
+
return this.searchGroups.some((group) => group.length > 0);
|
|
1317
|
+
}
|
|
1318
|
+
get searchGroups() {
|
|
1319
|
+
return [
|
|
1320
|
+
"users",
|
|
1321
|
+
"faqs",
|
|
1322
|
+
"recipients"
|
|
1323
|
+
].map((group) => this.getResultGroup(group));
|
|
1324
|
+
}
|
|
1325
|
+
getResultGroup(group) {
|
|
1326
|
+
if (!this.isSearchGroupKey(group)) return [];
|
|
1327
|
+
const resultGroup = this.result?.[group];
|
|
1328
|
+
if (!Array.isArray(resultGroup)) return [];
|
|
1329
|
+
return resultGroup.filter((item) => this.isRenderableResult(item));
|
|
1330
|
+
}
|
|
1331
|
+
isSearchGroupKey(group) {
|
|
1332
|
+
return group === "users" || group === "faqs" || group === "recipients";
|
|
1333
|
+
}
|
|
1334
|
+
isRenderableResult(item) {
|
|
1335
|
+
if (item == null) return false;
|
|
1336
|
+
if (typeof item !== "object") return true;
|
|
1337
|
+
return Object.values(item).some((value) => {
|
|
1338
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
1339
|
+
return value !== null && value !== void 0 && value !== "";
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
handleImageError(event, fallbackPath) {
|
|
1343
|
+
HelperService.handleImageFallbackPath(event, fallbackPath);
|
|
1344
|
+
}
|
|
1345
|
+
trackByUserId(_index, item) {
|
|
1346
|
+
return item.id;
|
|
1347
|
+
}
|
|
1348
|
+
trackByFaqId(_index, item) {
|
|
1349
|
+
return item.id;
|
|
1350
|
+
}
|
|
1351
|
+
trackBySkill(_index, item) {
|
|
1352
|
+
return item.id;
|
|
1353
|
+
}
|
|
1354
|
+
static {
|
|
1355
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1356
|
+
minVersion: "12.0.0",
|
|
1357
|
+
version: "22.2.0",
|
|
1358
|
+
ngImport: i0,
|
|
1359
|
+
type: SearchComponent,
|
|
1360
|
+
deps: [
|
|
1361
|
+
{ token: i3$1.ActivatedRoute },
|
|
1362
|
+
{ token: i1$1.DashboardService },
|
|
1363
|
+
{ token: i0.ChangeDetectorRef }
|
|
1364
|
+
],
|
|
1365
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
static {
|
|
1369
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1370
|
+
minVersion: "17.0.0",
|
|
1371
|
+
version: "22.2.0",
|
|
1372
|
+
type: SearchComponent,
|
|
1373
|
+
isStandalone: false,
|
|
1374
|
+
selector: "pw-search",
|
|
1375
|
+
ngImport: i0,
|
|
1376
|
+
template: "<div class=\"container-fluid dashboard-card overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"row\">\n <div class=\"col-12 my-3 mt-4\">\n <h2>Search Results</h2>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (isLoaded) {\n <div class=\"row faqlist search-result\">\n <div class=\"col-12\">\n <div data-cy=\"faq-list\">\n @if (result) {\n @for (group of objectKeys(result); track group; let idx = $index) {\n <div>\n @switch (group) {\n @case ('users') {\n @if (getResultGroup(group).length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ group }}</h6>\n <div class=\"dashboard\">\n @for (\n user of getResultGroup(group); track trackByUserId($index, user); let idx1 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx1 + idx\"><span>{{\n user.first_name !== null\n ? user.first_name\n : user?.email\n }}</span></a>\n </h5>\n <p class=\"m-0 title-font\">\n @if (user.user_skills?.length > 0) {\n <strong>Skills :\n </strong>\n }\n @for (\n skill of (user.user_skills ?? []); track trackBySkill($index, skill); let isLast = $last) {\n <span class=\"badge bg-success m-1\">\n {{ skill.name\n }}{{ isLast ? '' : ', ' }}</span>\n }\n </p>\n @if (\n user?.user_profile?.headline\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n {{ user?.user_profile?.headline }}\n </p>\n }\n @if (\n user?.user_profile?.country\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n <strong>Location : </strong>{{ user?.user_profile?.country }}\n </p>\n }\n </div>\n <div [id]=\"'collapse' + idx1 + idx\"\n class=\"panel-collapse collapse in p-3\">\n <div class=\"display-block overflow-hidden\">\n <div class=\"row align-items-center\">\n <div class=\"col-sm-3\">\n @if (user?.user_avatar?.length > 0) {\n @for (\n profile_image of user.user_avatar; track profile_image) {\n @if (profile_image.width === 200) {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img class=\"img-fluid\"\n [src]=\"profile_image.url\"\n alt=\"Male Icon\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n </div>\n </div>\n }\n }\n } @else {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img src=\"/assets/img/icons/male.png\"\n alt=\"\"\n class=\"img-fluid\" />\n </div>\n </div>\n }\n </div>\n <div class=\"col-sm-9\">\n <ul class=\"name-fl\">\n <li>\n <strong>First Name:\n </strong>\n <span>{{\n user.first_name !== null\n ? user.first_name\n : 'N/A'\n }}</span>\n </li>\n <li>\n <strong>Last Name:\n </strong>\n <span>{{\n user.last_name !== null\n ? user.last_name\n : 'N/A'\n }}</span>\n </li>\n </ul>\n <p>\n <strong>Email: </strong>\n <span>{{\n user.email !== null\n ? user.email\n : 'N/A'\n }}</span>\n </p>\n <p>\n <strong>Description:\n </strong>\n <span>{{\n user?.user_profile\n ?.description !== null\n ? user?.user_profile\n ?.description\n : 'N/A'\n }}</span>\n </p>\n <div class=\"view-btn text-end\">\n <a class=\"btn btn-outline-primary inline-block\"\n [routerLink]=\"[\n '/members/' +\n user.slug\n ]\">View More</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @case ('faqs') {\n @if (getResultGroup(group).length) {\n <h6>\n {{ group | uppercase }}\n </h6>\n @for (\n faq of getResultGroup(group); track trackByFaqId($index, faq); let idx2 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx2 + idx\">{{ faq.question }}</a>\n </h5>\n </div>\n <div [id]=\"'collapse' + idx2 + idx\"\n class=\"panel-collapse collapse in\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer |safe:'html'\">\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n }\n }\n </div>\n }\n @if (!hasResults) {\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\">\n </pw-no-data>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n",
|
|
1377
|
+
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.faq-search-answer a{color:#144086;display:inline-block;float:right;font-size:14px;margin-right:15px}::ng-deep .ql-snow *{font-size:16px!important}.faq-search-answer a:after{right:-10px}.faq-item{border:1px dashed rgba(0,0,0,.1);background-color:#fff;border-radius:3px;margin:10px 0;transition:all .2s ease-in-out}.faq-item .dashboard-header{background:#fff}.accord-title1 .faq-search-answer a{margin-right:0!important}a.accordion-toggle:after{display:none}.accord-title p.title-font{font-size:.8rem}.panel-collapse.show{border-top:1px dashed rgba(0,0,0,.1);padding-top:20px;padding-bottom:20px}.panel-collapse ul{margin-bottom:1rem}.panel-collapse ul.name-fl li{display:inline-block;padding-right:15px}.view-btn a{display:inline-block}.avatar{width:130px;margin:0 auto;display:block}.accordion-title a{color:var(--sidebar_bg)!important}.card-header h1,.card-header p{color:#fff!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}.card-block p{font-size:16px}.card,h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"],
|
|
1378
|
+
dependencies: [
|
|
1379
|
+
{
|
|
1380
|
+
kind: "directive",
|
|
1381
|
+
type: i3$1.RouterLink,
|
|
1382
|
+
selector: "[routerLink]",
|
|
1383
|
+
inputs: [
|
|
1384
|
+
"target",
|
|
1385
|
+
"queryParams",
|
|
1386
|
+
"fragment",
|
|
1387
|
+
"queryParamsHandling",
|
|
1388
|
+
"state",
|
|
1389
|
+
"info",
|
|
1390
|
+
"relativeTo",
|
|
1391
|
+
"preserveFragment",
|
|
1392
|
+
"skipLocationChange",
|
|
1393
|
+
"replaceUrl",
|
|
1394
|
+
"browserUrl",
|
|
1395
|
+
"routerLink"
|
|
1396
|
+
]
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
kind: "directive",
|
|
1400
|
+
type: i4.LazyImgDirective,
|
|
1401
|
+
selector: "img"
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
kind: "component",
|
|
1405
|
+
type: i2$2.ProgressSpinner,
|
|
1406
|
+
selector: "p-progress-spinner, p-progressspinner",
|
|
1407
|
+
inputs: [
|
|
1408
|
+
"value",
|
|
1409
|
+
"strokeWidth",
|
|
1410
|
+
"animationDuration",
|
|
1411
|
+
"min",
|
|
1412
|
+
"max",
|
|
1413
|
+
"ariaLabel",
|
|
1414
|
+
"fill"
|
|
1415
|
+
]
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
kind: "component",
|
|
1419
|
+
type: i6.NoDataComponent,
|
|
1420
|
+
selector: "pw-no-data",
|
|
1421
|
+
inputs: [
|
|
1422
|
+
"message",
|
|
1423
|
+
"description",
|
|
1424
|
+
"withImage"
|
|
1425
|
+
]
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
kind: "pipe",
|
|
1429
|
+
type: i2.UpperCasePipe,
|
|
1430
|
+
name: "uppercase"
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
kind: "pipe",
|
|
1434
|
+
type: i7.TranslocoPipe,
|
|
1435
|
+
name: "transloco"
|
|
1436
|
+
},
|
|
1437
|
+
{
|
|
1438
|
+
kind: "pipe",
|
|
1439
|
+
type: i5.DOMSanitizerPipe,
|
|
1440
|
+
name: "safe"
|
|
1441
|
+
}
|
|
1442
|
+
]
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1447
|
+
minVersion: "12.0.0",
|
|
1448
|
+
version: "22.2.0",
|
|
1449
|
+
ngImport: i0,
|
|
1450
|
+
type: SearchComponent,
|
|
1451
|
+
decorators: [{
|
|
1452
|
+
type: Component,
|
|
1453
|
+
args: [{
|
|
1454
|
+
selector: "pw-search",
|
|
1455
|
+
standalone: false,
|
|
1456
|
+
template: "<div class=\"container-fluid dashboard-card overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"row\">\n <div class=\"col-12 my-3 mt-4\">\n <h2>Search Results</h2>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (isLoaded) {\n <div class=\"row faqlist search-result\">\n <div class=\"col-12\">\n <div data-cy=\"faq-list\">\n @if (result) {\n @for (group of objectKeys(result); track group; let idx = $index) {\n <div>\n @switch (group) {\n @case ('users') {\n @if (getResultGroup(group).length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ group }}</h6>\n <div class=\"dashboard\">\n @for (\n user of getResultGroup(group); track trackByUserId($index, user); let idx1 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx1 + idx\"><span>{{\n user.first_name !== null\n ? user.first_name\n : user?.email\n }}</span></a>\n </h5>\n <p class=\"m-0 title-font\">\n @if (user.user_skills?.length > 0) {\n <strong>Skills :\n </strong>\n }\n @for (\n skill of (user.user_skills ?? []); track trackBySkill($index, skill); let isLast = $last) {\n <span class=\"badge bg-success m-1\">\n {{ skill.name\n }}{{ isLast ? '' : ', ' }}</span>\n }\n </p>\n @if (\n user?.user_profile?.headline\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n {{ user?.user_profile?.headline }}\n </p>\n }\n @if (\n user?.user_profile?.country\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n <strong>Location : </strong>{{ user?.user_profile?.country }}\n </p>\n }\n </div>\n <div [id]=\"'collapse' + idx1 + idx\"\n class=\"panel-collapse collapse in p-3\">\n <div class=\"display-block overflow-hidden\">\n <div class=\"row align-items-center\">\n <div class=\"col-sm-3\">\n @if (user?.user_avatar?.length > 0) {\n @for (\n profile_image of user.user_avatar; track profile_image) {\n @if (profile_image.width === 200) {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img class=\"img-fluid\"\n [src]=\"profile_image.url\"\n alt=\"Male Icon\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n </div>\n </div>\n }\n }\n } @else {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img src=\"/assets/img/icons/male.png\"\n alt=\"\"\n class=\"img-fluid\" />\n </div>\n </div>\n }\n </div>\n <div class=\"col-sm-9\">\n <ul class=\"name-fl\">\n <li>\n <strong>First Name:\n </strong>\n <span>{{\n user.first_name !== null\n ? user.first_name\n : 'N/A'\n }}</span>\n </li>\n <li>\n <strong>Last Name:\n </strong>\n <span>{{\n user.last_name !== null\n ? user.last_name\n : 'N/A'\n }}</span>\n </li>\n </ul>\n <p>\n <strong>Email: </strong>\n <span>{{\n user.email !== null\n ? user.email\n : 'N/A'\n }}</span>\n </p>\n <p>\n <strong>Description:\n </strong>\n <span>{{\n user?.user_profile\n ?.description !== null\n ? user?.user_profile\n ?.description\n : 'N/A'\n }}</span>\n </p>\n <div class=\"view-btn text-end\">\n <a class=\"btn btn-outline-primary inline-block\"\n [routerLink]=\"[\n '/members/' +\n user.slug\n ]\">View More</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @case ('faqs') {\n @if (getResultGroup(group).length) {\n <h6>\n {{ group | uppercase }}\n </h6>\n @for (\n faq of getResultGroup(group); track trackByFaqId($index, faq); let idx2 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx2 + idx\">{{ faq.question }}</a>\n </h5>\n </div>\n <div [id]=\"'collapse' + idx2 + idx\"\n class=\"panel-collapse collapse in\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer |safe:'html'\">\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n }\n }\n </div>\n }\n @if (!hasResults) {\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\">\n </pw-no-data>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n",
|
|
1457
|
+
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.faq-search-answer a{color:#144086;display:inline-block;float:right;font-size:14px;margin-right:15px}::ng-deep .ql-snow *{font-size:16px!important}.faq-search-answer a:after{right:-10px}.faq-item{border:1px dashed rgba(0,0,0,.1);background-color:#fff;border-radius:3px;margin:10px 0;transition:all .2s ease-in-out}.faq-item .dashboard-header{background:#fff}.accord-title1 .faq-search-answer a{margin-right:0!important}a.accordion-toggle:after{display:none}.accord-title p.title-font{font-size:.8rem}.panel-collapse.show{border-top:1px dashed rgba(0,0,0,.1);padding-top:20px;padding-bottom:20px}.panel-collapse ul{margin-bottom:1rem}.panel-collapse ul.name-fl li{display:inline-block;padding-right:15px}.view-btn a{display:inline-block}.avatar{width:130px;margin:0 auto;display:block}.accordion-title a{color:var(--sidebar_bg)!important}.card-header h1,.card-header p{color:#fff!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}.card-block p{font-size:16px}.card,h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"]
|
|
1458
|
+
}]
|
|
1459
|
+
}],
|
|
1460
|
+
ctorParameters: () => [
|
|
1461
|
+
{ type: i3$1.ActivatedRoute },
|
|
1462
|
+
{ type: i1$1.DashboardService },
|
|
1463
|
+
{ type: i0.ChangeDetectorRef }
|
|
1464
|
+
]
|
|
1465
|
+
});
|
|
1466
|
+
var DashboardContentModule = class DashboardContentModule {
|
|
1467
|
+
static {
|
|
1468
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1469
|
+
minVersion: "12.0.0",
|
|
1470
|
+
version: "22.2.0",
|
|
1471
|
+
ngImport: i0,
|
|
1472
|
+
type: DashboardContentModule,
|
|
1473
|
+
deps: [],
|
|
1474
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1477
|
+
static {
|
|
1478
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1479
|
+
minVersion: "14.0.0",
|
|
1480
|
+
version: "22.2.0",
|
|
1481
|
+
ngImport: i0,
|
|
1482
|
+
type: DashboardContentModule,
|
|
1483
|
+
declarations: [
|
|
1484
|
+
DocumentationComponent,
|
|
1485
|
+
FaqComponent,
|
|
1486
|
+
FaqDetailsComponent,
|
|
1487
|
+
HomeComponent,
|
|
1488
|
+
NotificationsPageComponent,
|
|
1489
|
+
CurrentNotificationsComponent,
|
|
1490
|
+
NotificationsPageComponent,
|
|
1491
|
+
DismissedNotificationsComponent,
|
|
1492
|
+
SearchComponent,
|
|
1493
|
+
UserFeedbackComponent
|
|
1494
|
+
],
|
|
1495
|
+
imports: [
|
|
1496
|
+
CommonModule,
|
|
1497
|
+
FormsModule,
|
|
1498
|
+
RouterModule,
|
|
1499
|
+
CoreTranslocoModule,
|
|
1500
|
+
DirectivesModule,
|
|
1501
|
+
PipesModule,
|
|
1502
|
+
ProgressSpinnerModule,
|
|
1503
|
+
NgbNavModule,
|
|
1504
|
+
RadioButtonModule,
|
|
1505
|
+
TooltipModule,
|
|
1506
|
+
ResourceSharedComponentsModule
|
|
1507
|
+
],
|
|
1508
|
+
exports: [
|
|
1509
|
+
DocumentationComponent,
|
|
1510
|
+
FaqComponent,
|
|
1511
|
+
FaqDetailsComponent,
|
|
1512
|
+
HomeComponent,
|
|
1513
|
+
NotificationsPageComponent,
|
|
1514
|
+
CurrentNotificationsComponent,
|
|
1515
|
+
NotificationsPageComponent,
|
|
1516
|
+
DismissedNotificationsComponent,
|
|
1517
|
+
SearchComponent,
|
|
1518
|
+
RadioButtonModule
|
|
1519
|
+
]
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
static {
|
|
1523
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
1524
|
+
minVersion: "12.0.0",
|
|
1525
|
+
version: "22.2.0",
|
|
1526
|
+
ngImport: i0,
|
|
1527
|
+
type: DashboardContentModule,
|
|
1528
|
+
imports: [
|
|
1529
|
+
CommonModule,
|
|
1530
|
+
FormsModule,
|
|
1531
|
+
RouterModule,
|
|
1532
|
+
CoreTranslocoModule,
|
|
1533
|
+
DirectivesModule,
|
|
1534
|
+
PipesModule,
|
|
1535
|
+
ProgressSpinnerModule,
|
|
1536
|
+
NgbNavModule,
|
|
1537
|
+
RadioButtonModule,
|
|
1538
|
+
TooltipModule,
|
|
1539
|
+
ResourceSharedComponentsModule,
|
|
1540
|
+
RadioButtonModule
|
|
1541
|
+
]
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
};
|
|
1545
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1546
|
+
minVersion: "12.0.0",
|
|
1547
|
+
version: "22.2.0",
|
|
1548
|
+
ngImport: i0,
|
|
1549
|
+
type: DashboardContentModule,
|
|
1550
|
+
decorators: [{
|
|
1551
|
+
type: NgModule,
|
|
1552
|
+
args: [{
|
|
1553
|
+
imports: [
|
|
1554
|
+
CommonModule,
|
|
1555
|
+
FormsModule,
|
|
1556
|
+
RouterModule,
|
|
1557
|
+
CoreTranslocoModule,
|
|
1558
|
+
DirectivesModule,
|
|
1559
|
+
PipesModule,
|
|
1560
|
+
ProgressSpinnerModule,
|
|
1561
|
+
NgbNavModule,
|
|
1562
|
+
RadioButtonModule,
|
|
1563
|
+
TooltipModule,
|
|
1564
|
+
ResourceSharedComponentsModule
|
|
1565
|
+
],
|
|
1566
|
+
declarations: [
|
|
1567
|
+
DocumentationComponent,
|
|
1568
|
+
FaqComponent,
|
|
1569
|
+
FaqDetailsComponent,
|
|
1570
|
+
HomeComponent,
|
|
1571
|
+
NotificationsPageComponent,
|
|
1572
|
+
CurrentNotificationsComponent,
|
|
1573
|
+
NotificationsPageComponent,
|
|
1574
|
+
DismissedNotificationsComponent,
|
|
1575
|
+
SearchComponent,
|
|
1576
|
+
UserFeedbackComponent
|
|
1577
|
+
],
|
|
1578
|
+
exports: [
|
|
1579
|
+
DocumentationComponent,
|
|
1580
|
+
FaqComponent,
|
|
1581
|
+
FaqDetailsComponent,
|
|
1582
|
+
HomeComponent,
|
|
1583
|
+
NotificationsPageComponent,
|
|
1584
|
+
CurrentNotificationsComponent,
|
|
1585
|
+
NotificationsPageComponent,
|
|
1586
|
+
DismissedNotificationsComponent,
|
|
1587
|
+
SearchComponent,
|
|
1588
|
+
RadioButtonModule
|
|
1589
|
+
],
|
|
1590
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
1591
|
+
}]
|
|
1592
|
+
}]
|
|
1593
|
+
});
|
|
1594
|
+
var DashboardLibModule = class DashboardLibModule {
|
|
1595
|
+
static {
|
|
1596
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1597
|
+
minVersion: "12.0.0",
|
|
1598
|
+
version: "22.2.0",
|
|
1599
|
+
ngImport: i0,
|
|
1600
|
+
type: DashboardLibModule,
|
|
1601
|
+
deps: [],
|
|
1602
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
static {
|
|
1606
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1607
|
+
minVersion: "14.0.0",
|
|
1608
|
+
version: "22.2.0",
|
|
1609
|
+
ngImport: i0,
|
|
1610
|
+
type: DashboardLibModule,
|
|
1611
|
+
imports: [
|
|
1612
|
+
CommonModule,
|
|
1613
|
+
FormsModule,
|
|
1614
|
+
PipesModule,
|
|
1615
|
+
SelectModule,
|
|
1616
|
+
DirectivesModule,
|
|
1617
|
+
ReactiveFormsModule,
|
|
1618
|
+
CoreTranslocoModule,
|
|
1619
|
+
NgbNavModule,
|
|
1620
|
+
NgbDropdownModule,
|
|
1621
|
+
UserModuleModule,
|
|
1622
|
+
RadioButtonModule,
|
|
1623
|
+
ProgressSpinnerModule,
|
|
1624
|
+
DashboardContentModule
|
|
1625
|
+
]
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
static {
|
|
1629
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
1630
|
+
minVersion: "12.0.0",
|
|
1631
|
+
version: "22.2.0",
|
|
1632
|
+
ngImport: i0,
|
|
1633
|
+
type: DashboardLibModule,
|
|
1634
|
+
providers: [SubscriptionService],
|
|
1635
|
+
imports: [
|
|
1636
|
+
CommonModule,
|
|
1637
|
+
FormsModule,
|
|
1638
|
+
PipesModule,
|
|
1639
|
+
SelectModule,
|
|
1640
|
+
DirectivesModule,
|
|
1641
|
+
ReactiveFormsModule,
|
|
1642
|
+
CoreTranslocoModule,
|
|
1643
|
+
NgbNavModule,
|
|
1644
|
+
NgbDropdownModule,
|
|
1645
|
+
UserModuleModule,
|
|
1646
|
+
RadioButtonModule,
|
|
1647
|
+
ProgressSpinnerModule,
|
|
1648
|
+
DashboardContentModule
|
|
1649
|
+
]
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1653
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1654
|
+
minVersion: "12.0.0",
|
|
1655
|
+
version: "22.2.0",
|
|
1656
|
+
ngImport: i0,
|
|
1657
|
+
type: DashboardLibModule,
|
|
1658
|
+
decorators: [{
|
|
1659
|
+
type: NgModule,
|
|
1660
|
+
args: [{
|
|
1661
|
+
imports: [
|
|
1662
|
+
CommonModule,
|
|
1663
|
+
FormsModule,
|
|
1664
|
+
PipesModule,
|
|
1665
|
+
SelectModule,
|
|
1666
|
+
DirectivesModule,
|
|
1667
|
+
ReactiveFormsModule,
|
|
1668
|
+
CoreTranslocoModule,
|
|
1669
|
+
NgbNavModule,
|
|
1670
|
+
NgbDropdownModule,
|
|
1671
|
+
UserModuleModule,
|
|
1672
|
+
RadioButtonModule,
|
|
1673
|
+
ProgressSpinnerModule,
|
|
1674
|
+
DashboardContentModule
|
|
1675
|
+
],
|
|
1676
|
+
declarations: [],
|
|
1677
|
+
providers: [SubscriptionService],
|
|
1678
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
1679
|
+
}]
|
|
1680
|
+
}]
|
|
1681
|
+
});
|
|
1682
|
+
const filterMenusByFeatureFlag = (menus, isEnabled) => (menus ?? []).filter((menu) => !menu.featureFlag || isEnabled(menu.featureFlag));
|
|
936
1683
|
const createMenuItem = (overrides) => ({
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1684
|
+
permission: "",
|
|
1685
|
+
path: "",
|
|
1686
|
+
title: "",
|
|
1687
|
+
icon: "",
|
|
1688
|
+
class: "",
|
|
1689
|
+
badge: "",
|
|
1690
|
+
badgeClass: "",
|
|
1691
|
+
isExternalLink: false,
|
|
1692
|
+
submenu: [],
|
|
1693
|
+
visible: true,
|
|
1694
|
+
order: 0,
|
|
1695
|
+
...overrides
|
|
949
1696
|
});
|
|
950
|
-
/**
|
|
951
|
-
* Helper function to create submenu items with default values
|
|
952
|
-
* @param overrides - Partial RouteInfo object with overrides
|
|
953
|
-
* @returns RouteInfo object with defaults applied
|
|
954
|
-
*/
|
|
955
1697
|
const createSubMenuItem = (overrides) => ({
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1698
|
+
permission: "",
|
|
1699
|
+
path: "",
|
|
1700
|
+
title: "",
|
|
1701
|
+
icon: "",
|
|
1702
|
+
class: "",
|
|
1703
|
+
badge: "",
|
|
1704
|
+
badgeClass: "",
|
|
1705
|
+
isExternalLink: false,
|
|
1706
|
+
submenu: [],
|
|
1707
|
+
visible: true,
|
|
1708
|
+
...overrides
|
|
967
1709
|
});
|
|
968
|
-
/**
|
|
969
|
-
* Common menu items that can be reused across modules
|
|
970
|
-
*/
|
|
971
1710
|
const COMMON_MENUS = {
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1711
|
+
FAQ_Menu: createMenuItem({
|
|
1712
|
+
permission: "Pages.Product.{permission_key}.{feature_key}.FAQ",
|
|
1713
|
+
path: "/faq",
|
|
1714
|
+
title: "FAQ",
|
|
1715
|
+
icon: "ft-info",
|
|
1716
|
+
order: 999
|
|
1717
|
+
}),
|
|
1718
|
+
ENTERPRISE_MENU: createMenuItem({
|
|
1719
|
+
permission: "Pages.Product.{permission_key}.{feature_key}.Enterprise",
|
|
1720
|
+
path: "/enterprise",
|
|
1721
|
+
title: "Enterprise",
|
|
1722
|
+
icon: "ft-package",
|
|
1723
|
+
class: "has-sub",
|
|
1724
|
+
badgeClass: "badge rounded-pill bg-danger float-end mt-1",
|
|
1725
|
+
order: 5,
|
|
1726
|
+
submenu: [
|
|
1727
|
+
createSubMenuItem({
|
|
1728
|
+
path: ":slug/enterprise/members",
|
|
1729
|
+
title: "Members",
|
|
1730
|
+
icon: "far fa-users"
|
|
1731
|
+
}),
|
|
1732
|
+
createSubMenuItem({
|
|
1733
|
+
permission: "Pages.Alpha",
|
|
1734
|
+
path: ":slug/enterprise/partners",
|
|
1735
|
+
title: "Partners",
|
|
1736
|
+
icon: "far fa-users"
|
|
1737
|
+
}),
|
|
1738
|
+
createSubMenuItem({
|
|
1739
|
+
permission: "Pages.Beta",
|
|
1740
|
+
path: ":slug/enterprise/groups",
|
|
1741
|
+
title: "Teams",
|
|
1742
|
+
icon: "far fa-users-class"
|
|
1743
|
+
}),
|
|
1744
|
+
createSubMenuItem({
|
|
1745
|
+
permission: "Pages.Beta",
|
|
1746
|
+
path: ":slug/enterprise/communications",
|
|
1747
|
+
title: "Communications",
|
|
1748
|
+
icon: "fas fa-comments"
|
|
1749
|
+
}),
|
|
1750
|
+
createSubMenuItem({
|
|
1751
|
+
permission: "Pages.Beta",
|
|
1752
|
+
path: ":slug/enterprise/wiki",
|
|
1753
|
+
title: "Documentation",
|
|
1754
|
+
icon: "fab fa-wikipedia-w"
|
|
1755
|
+
}),
|
|
1756
|
+
createSubMenuItem({
|
|
1757
|
+
permission: "Pages.Beta",
|
|
1758
|
+
path: ":slug/enterprise/insights",
|
|
1759
|
+
title: "Insights",
|
|
1760
|
+
icon: "far fa-tag"
|
|
1761
|
+
})
|
|
1762
|
+
]
|
|
1763
|
+
}),
|
|
1764
|
+
CHAT_MENU: createMenuItem({
|
|
1765
|
+
permission: "Pages.Product.{permission_key}.{feature_key}.Chat",
|
|
1766
|
+
path: "/message",
|
|
1767
|
+
title: "Chat",
|
|
1768
|
+
icon: "ft-message-square",
|
|
1769
|
+
badgeClass: "badge rounded-pill bg-danger float-end mt-1",
|
|
1770
|
+
order: 2
|
|
1771
|
+
}),
|
|
1772
|
+
BLOG_MENU: createMenuItem({
|
|
1773
|
+
permission: "Pages.Product.{permission_key}.{feature_key}.Blog || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
|
|
1774
|
+
path: "/posts/list",
|
|
1775
|
+
title: "Blog",
|
|
1776
|
+
icon: "far fa-blog"
|
|
1777
|
+
})
|
|
1039
1778
|
};
|
|
1040
|
-
|
|
1041
|
-
// Centralized admin permissions
|
|
1042
1779
|
const ADMIN_PERMISSIONS = {
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1780
|
+
GENERIC: "Pages.Admin",
|
|
1781
|
+
DOMAIN_CONFIG: "Pages.Admin.DomainConfig || Pages.Role.MarketingManager",
|
|
1782
|
+
USERS: "Pages.Admin.Users",
|
|
1783
|
+
SUBSCRIPTION: "Pages.Admin.Subscription",
|
|
1784
|
+
PRODUCT: "Pages.Admin.Product",
|
|
1785
|
+
LOGIN_NOTIFICATION: "Pages.Admin.LoginNotification || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
|
|
1786
|
+
NEWSLETTER: "Pages.Admin.Newsletter || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
|
|
1787
|
+
MAILER: "Pages.Admin.Mailer",
|
|
1788
|
+
BLOG: "Pages.Admin.Blog || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
|
|
1789
|
+
FEATURE_FLAGS: "Pages.Admin.FeatureFlags",
|
|
1790
|
+
FAQ: "Pages.Admin.FAQ || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
|
|
1791
|
+
INCIDENT: "Pages.Admin.Incident",
|
|
1792
|
+
CONTACT_US: "Pages.Admin.ContactUs",
|
|
1793
|
+
TIPS: "Pages.Admin.Tips",
|
|
1794
|
+
TAGS: "Pages.Admin.Tags",
|
|
1795
|
+
ROLES: "Pages.Admin.Roles",
|
|
1796
|
+
TOS: "Pages.Admin.Tos",
|
|
1797
|
+
CREDENTIAL: "Pages.Admin.Credential",
|
|
1798
|
+
OAUTH_CLIENTS: "Pages.Admin.Oauth",
|
|
1799
|
+
AMBASSADOR_PAYOUTS: "Pages.Admin.AmbassadorPayouts",
|
|
1800
|
+
TRACKING: "Pages.Admin.Tracking",
|
|
1801
|
+
GLOBAL_CONFIG: "Pages.Admin.Global-Config"
|
|
1065
1802
|
};
|
|
1066
|
-
// Centralized admin paths
|
|
1067
1803
|
const ADMIN_PATHS = {
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
// /admin/ambassador-payouts/:id detail route — keeps the menu item
|
|
1091
|
-
// highlighted when a payout is opened or deep-linked. Same reason as TOS.
|
|
1092
|
-
AMBASSADOR_PAYOUTS: '/admin/ambassador-payouts',
|
|
1093
|
-
TRACKING: '/admin/tracking',
|
|
1094
|
-
GLOBAL_CONFIG: '/admin/global-config'
|
|
1804
|
+
GENERIC: "/admin/generic",
|
|
1805
|
+
DOMAIN_CONFIG: "/admin/domain-config/list",
|
|
1806
|
+
USERS: "/admin/users",
|
|
1807
|
+
SUBSCRIPTION: "/admin/subscriptions",
|
|
1808
|
+
PRODUCT: "/admin/products",
|
|
1809
|
+
LOGIN_NOTIFICATION: "/admin/login-notifications/list",
|
|
1810
|
+
NEWSLETTER: "/admin/newsletter",
|
|
1811
|
+
MAILER: "/admin/mailers",
|
|
1812
|
+
BLOG: "/admin/resources",
|
|
1813
|
+
FEATURE_FLAGS: "/admin/feature-flags/list",
|
|
1814
|
+
FAQ: "/admin/faq/list",
|
|
1815
|
+
INCIDENT: "/admin/incident/list",
|
|
1816
|
+
CONTACT_US: "/admin/contact-us/list",
|
|
1817
|
+
TIPS: "/admin/tips/list",
|
|
1818
|
+
TAGS: "/admin/tags",
|
|
1819
|
+
ROLES: "/admin/permissions",
|
|
1820
|
+
TOS: "/admin/tos",
|
|
1821
|
+
CREDENTIAL: "/admin/credentials",
|
|
1822
|
+
OAUTH_CLIENTS: "/admin/oauth-clients",
|
|
1823
|
+
AMBASSADOR_PAYOUTS: "/admin/ambassador-payouts",
|
|
1824
|
+
TRACKING: "/admin/tracking",
|
|
1825
|
+
GLOBAL_CONFIG: "/admin/global-config"
|
|
1095
1826
|
};
|
|
1096
|
-
// Centralized admin menu data
|
|
1097
1827
|
const ADMIN_MENU_DATA = [
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1828
|
+
{
|
|
1829
|
+
key: "GENERIC",
|
|
1830
|
+
title: "Generic",
|
|
1831
|
+
icon: "far fa-book"
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
key: "DOMAIN_CONFIG",
|
|
1835
|
+
title: "Domains",
|
|
1836
|
+
icon: "fa fa-fw fa-cog"
|
|
1837
|
+
},
|
|
1838
|
+
{
|
|
1839
|
+
key: "USERS",
|
|
1840
|
+
title: "Users",
|
|
1841
|
+
icon: "far fa-user-cog"
|
|
1842
|
+
},
|
|
1843
|
+
{
|
|
1844
|
+
key: "SUBSCRIPTION",
|
|
1845
|
+
title: "Subscriptions",
|
|
1846
|
+
icon: "ft-box"
|
|
1847
|
+
},
|
|
1848
|
+
{
|
|
1849
|
+
key: "PRODUCT",
|
|
1850
|
+
title: "Products",
|
|
1851
|
+
icon: "far fa-parking"
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
key: "LOGIN_NOTIFICATION",
|
|
1855
|
+
title: "Notifications",
|
|
1856
|
+
icon: "fa fa-fw fa-bell"
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
key: "NEWSLETTER",
|
|
1860
|
+
title: "Newsletters",
|
|
1861
|
+
icon: "far fa-newspaper"
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
key: "MAILER",
|
|
1865
|
+
title: "Mailers",
|
|
1866
|
+
icon: "far fa-envelope"
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
key: "BLOG",
|
|
1870
|
+
title: "Resources",
|
|
1871
|
+
icon: "far fa-blog"
|
|
1872
|
+
},
|
|
1873
|
+
{
|
|
1874
|
+
key: "FEATURE_FLAGS",
|
|
1875
|
+
title: "Feature Flags",
|
|
1876
|
+
icon: "fa fa-fw fa-toggle-on"
|
|
1877
|
+
},
|
|
1878
|
+
{
|
|
1879
|
+
key: "FAQ",
|
|
1880
|
+
title: "FAQs",
|
|
1881
|
+
icon: "fa fa-question"
|
|
1882
|
+
},
|
|
1883
|
+
{
|
|
1884
|
+
key: "INCIDENT",
|
|
1885
|
+
title: "Incidents",
|
|
1886
|
+
icon: "fa fa-solid fa-triangle-exclamation"
|
|
1887
|
+
},
|
|
1888
|
+
{
|
|
1889
|
+
key: "CONTACT_US",
|
|
1890
|
+
title: "Contact Us",
|
|
1891
|
+
icon: "fa fa-address-book"
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
key: "TIPS",
|
|
1895
|
+
title: "Tours",
|
|
1896
|
+
icon: "far fa-lightbulb"
|
|
1897
|
+
},
|
|
1898
|
+
{
|
|
1899
|
+
key: "TAGS",
|
|
1900
|
+
title: "Tags",
|
|
1901
|
+
icon: "far fa-tags"
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
key: "ROLES",
|
|
1905
|
+
title: "Permissions",
|
|
1906
|
+
icon: "fas fa-key"
|
|
1907
|
+
},
|
|
1908
|
+
{
|
|
1909
|
+
key: "TOS",
|
|
1910
|
+
title: "Privacy & TOS",
|
|
1911
|
+
icon: "fas fa-sticky-note"
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
key: "CREDENTIAL",
|
|
1915
|
+
title: "Credentials",
|
|
1916
|
+
icon: "fas fa-file-signature"
|
|
1917
|
+
},
|
|
1918
|
+
{
|
|
1919
|
+
key: "OAUTH_CLIENTS",
|
|
1920
|
+
title: "MCP OAuth Clients",
|
|
1921
|
+
icon: "fas fa-robot"
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
key: "AMBASSADOR_PAYOUTS",
|
|
1925
|
+
title: "Ambassador Payouts",
|
|
1926
|
+
icon: "fa fa-handshake"
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
key: "TRACKING",
|
|
1930
|
+
title: "Tracking",
|
|
1931
|
+
icon: "fa fa-map-marker"
|
|
1932
|
+
},
|
|
1933
|
+
{
|
|
1934
|
+
key: "GLOBAL_CONFIG",
|
|
1935
|
+
title: "Global Configs",
|
|
1936
|
+
icon: "fa fa-fw fa-cog"
|
|
1937
|
+
}
|
|
1121
1938
|
];
|
|
1122
|
-
// Helper function to create admin submenu items
|
|
1123
1939
|
const createAdminSubMenuItem = (menuKey) => createSubMenuItem({
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1940
|
+
permission: ADMIN_PERMISSIONS[menuKey],
|
|
1941
|
+
path: ADMIN_PATHS[menuKey],
|
|
1942
|
+
title: ADMIN_MENU_DATA.find((item) => item.key === menuKey)?.title || "",
|
|
1943
|
+
icon: ADMIN_MENU_DATA.find((item) => item.key === menuKey)?.icon || ""
|
|
1128
1944
|
});
|
|
1129
|
-
|
|
1130
|
-
const
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
class: 'has-sub',
|
|
1146
|
-
order: 3,
|
|
1147
|
-
submenu: generateAdminSubmenu()
|
|
1148
|
-
})
|
|
1149
|
-
];
|
|
1150
|
-
// Export common menus from shared utilities
|
|
1945
|
+
const generateAdminSubmenu = () => ADMIN_MENU_DATA.map((item) => createAdminSubMenuItem(item.key));
|
|
1946
|
+
const ROUTES = [createMenuItem({
|
|
1947
|
+
permission: "Pages.Dashboard",
|
|
1948
|
+
path: "/home",
|
|
1949
|
+
title: "Home",
|
|
1950
|
+
icon: "ft-home",
|
|
1951
|
+
order: 1
|
|
1952
|
+
}), createMenuItem({
|
|
1953
|
+
permission: "Pages.Admin",
|
|
1954
|
+
path: null,
|
|
1955
|
+
title: "Admin",
|
|
1956
|
+
icon: "ft-user",
|
|
1957
|
+
class: "has-sub",
|
|
1958
|
+
order: 3,
|
|
1959
|
+
submenu: generateAdminSubmenu()
|
|
1960
|
+
})];
|
|
1151
1961
|
const { FAQ_Menu, ENTERPRISE_MENU, CHAT_MENU, BLOG_MENU } = COMMON_MENUS;
|
|
1152
|
-
|
|
1153
|
-
/**
|
|
1154
|
-
* Generated bundle index. Do not edit.
|
|
1155
|
-
*/
|
|
1156
|
-
|
|
1157
1962
|
export { BLOG_MENU, CHAT_MENU, CurrentNotificationsComponent, DashboardContentModule, DashboardLibModule, DismissedNotificationsComponent, DocumentationComponent, ENTERPRISE_MENU, FAQ_Menu, FaqComponent, FaqDetailsComponent, HomeComponent, NotificationsPageComponent, ROUTES, SearchComponent, UserFeedbackComponent, filterMenusByFeatureFlag };
|
|
1158
|
-
|
|
1963
|
+
|
|
1964
|
+
//# sourceMappingURL=posiwise-dashboard-module.mjs.map
|