ets-fe-ng-sdk 20.3.37 → 20.3.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ets-fe-ng-sdk.mjs +66 -51
- package/fesm2022/ets-fe-ng-sdk.mjs.map +1 -1
- package/index.d.ts +14 -11
- package/package.json +1 -1
|
@@ -3064,6 +3064,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImpor
|
|
|
3064
3064
|
* @template TEnvironment - The type of environment configuration to use, defaults to SDKEnvironment
|
|
3065
3065
|
*/
|
|
3066
3066
|
class UtilityService {
|
|
3067
|
+
static { this.canUseServiceworkers = computed(() => !isDevMode(), ...(ngDevMode ? [{ debugName: "canUseServiceworkers" }] : [])); }
|
|
3067
3068
|
constructor() {
|
|
3068
3069
|
/** Angular Material Dialog service for managing dialogs */
|
|
3069
3070
|
this.dialog = inject(MatDialog);
|
|
@@ -3113,6 +3114,7 @@ class UtilityService {
|
|
|
3113
3114
|
this.pbid = EETSPageBtnID;
|
|
3114
3115
|
/** Emits true if the device is mobile */
|
|
3115
3116
|
this.mobileQueryChanged = new ReplaySubject();
|
|
3117
|
+
this.canUseServiceworkers = computed(() => UtilityService.canUseServiceworkers(), ...(ngDevMode ? [{ debugName: "canUseServiceworkers" }] : []));
|
|
3116
3118
|
/** Signal that emits true when the device is a mobile handset */
|
|
3117
3119
|
this.isMobileSignal = toSignal(this.responsive.observe([Breakpoints.Handset]).pipe(map(({ matches }) => matches), tap((r) => {
|
|
3118
3120
|
this.isMobile = r;
|
|
@@ -7585,7 +7587,6 @@ class InputService {
|
|
|
7585
7587
|
for (const item of this.dateInputChunks) {
|
|
7586
7588
|
item.placeholder = '-'.repeat(item.length);
|
|
7587
7589
|
}
|
|
7588
|
-
const startTime = Date.now();
|
|
7589
7590
|
// Refactored time initialization using local variables
|
|
7590
7591
|
const hoursArray = ['12'];
|
|
7591
7592
|
const hours24Array = ['00'];
|
|
@@ -7624,7 +7625,6 @@ class InputService {
|
|
|
7624
7625
|
this.time24Hours.set(hours24Array);
|
|
7625
7626
|
this.timeMinutes.set(minutesArray);
|
|
7626
7627
|
this.timeSeconds.set(secondsArray);
|
|
7627
|
-
console.log('time taken', (Date.now() - startTime) / 1000);
|
|
7628
7628
|
const labeller = this.labeller;
|
|
7629
7629
|
this.optionLabellerFunctions = {
|
|
7630
7630
|
acd: (option) => labeller(option?.accountNo, option?.description),
|
|
@@ -11675,11 +11675,11 @@ class DocumentsNameDisplayComponent {
|
|
|
11675
11675
|
return valid ? { refCat, refNo, docSubCat, title } : null;
|
|
11676
11676
|
}
|
|
11677
11677
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: DocumentsNameDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11678
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", type: DocumentsNameDisplayComponent, isStandalone: true, selector: "
|
|
11678
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", type: DocumentsNameDisplayComponent, isStandalone: true, selector: "ets-documents-name-display", inputs: { files: "files", fileNameFormat: "fileNameFormat" }, outputs: { valid: "valid", error: "error" }, usesOnChanges: true, ngImport: i0, template: "<div>\n <div class=\"row justify-content-center\">\n <div class=\"col-md-auto p-3 mt-4 text-center\">\n <span class=\"text-muted\">{{'Upload files named in this format: '|appTranslate|async}}</span>\n <span>{{fileFormats[fileNameFormat]}}</span>\n </div>\n </div>\n <div class=\"row justify-content-center\">\n @if (errors?.length) {\n<div class=\"col-md-auto text-danger border border-danger light-red-bg rounded text-center mt-2 mb-4\">\n <p>{{'The following files are not in the right format: '}}</p>\n @for (error of errors; track error) {\n <span class=\"me-5\">{{error}}</span>\n}\n </div>\n}\n </div>\n @if (files?.length) {\n<div class=\"table-responsive\">\n <table class=\"table table-striped col-md-auto\">\n@switch (fileNameFormat) {\n @case ('NON_POLICY_DOCUMENT') {\n \n <thead>\n <th>{{'Ref Cat'|appTranslate|async}}</th>\n <th>{{'Ref No'|appTranslate|async}}</th>\n <th>{{'Doc SubCat'|appTranslate|async}}</th>\n <th>{{'Title'|appTranslate|async}}</th>\n </thead>\n <tbody>\n @for (file of fileNames; track file) {\n <tr>\n <td>{{file.refCat}}</td>\n <td>{{file.refNo}}</td>\n <td>{{file.docSubCat}}</td>\n <td>{{file.title}}</td>\n </tr>\n}\n </tbody>\n \n}\n @case ('POLICY_DOCUMENT') {\n \n <thead>\n <th>{{'Ref Cat'|appTranslate|async}}</th>\n <th>{{'Policy No'|appTranslate|async}}</th>\n <th>{{'Policy Code'|appTranslate|async}}</th>\n <th>{{'Doc SubCat'|appTranslate|async}}</th>\n <th>{{'Title'|appTranslate|async}}</th>\n </thead>\n <tbody>\n @for (file of fileNames; track file) {\n <tr>\n <td>{{file.refCat}}</td>\n <td>{{file.policyNo}}</td>\n <td>{{file.policyCode}}</td>\n <td>{{file.docSubCat}}</td>\n <td>{{file.title}}</td>\n </tr>\n}\n </tbody>\n \n}\n @case ('POLICY_DOCUMENT_SUFFIX') {\n \n <thead>\n <th>{{'Ref Cat'|appTranslate|async}}</th>\n <th>{{'Policy No'|appTranslate|async}}</th>\n <th>{{'Policy Code'|appTranslate|async}}</th>\n <th>{{'Policy No Suffix'|appTranslate|async}}</th>\n <th>{{'Doc SubCat'|appTranslate|async}}</th>\n <th>{{'Title'|appTranslate|async}}</th>\n </thead>\n <tbody>\n @for (file of fileNames; track file) {\n <tr>\n <td>{{file.refCat}}</td>\n <td>{{file.policyNo}}</td>\n <td>{{file.policyCode}}</td>\n <td>{{file.policyNoSuffix}}</td>\n <td>{{file.docSubCat}}</td>\n <td>{{file.title}}</td>\n </tr>\n}\n </tbody>\n \n}\n }\n</table>\n\n </div>\n}\n</div>", styles: [".light-red-bg{background-color:#ff000009}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: SDKTranslatePipe, name: "appTranslate" }] }); }
|
|
11679
11679
|
}
|
|
11680
11680
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: DocumentsNameDisplayComponent, decorators: [{
|
|
11681
11681
|
type: Component,
|
|
11682
|
-
args: [{ selector: '
|
|
11682
|
+
args: [{ selector: 'ets-documents-name-display', imports: [AsyncPipe, SDKTranslatePipe], template: "<div>\n <div class=\"row justify-content-center\">\n <div class=\"col-md-auto p-3 mt-4 text-center\">\n <span class=\"text-muted\">{{'Upload files named in this format: '|appTranslate|async}}</span>\n <span>{{fileFormats[fileNameFormat]}}</span>\n </div>\n </div>\n <div class=\"row justify-content-center\">\n @if (errors?.length) {\n<div class=\"col-md-auto text-danger border border-danger light-red-bg rounded text-center mt-2 mb-4\">\n <p>{{'The following files are not in the right format: '}}</p>\n @for (error of errors; track error) {\n <span class=\"me-5\">{{error}}</span>\n}\n </div>\n}\n </div>\n @if (files?.length) {\n<div class=\"table-responsive\">\n <table class=\"table table-striped col-md-auto\">\n@switch (fileNameFormat) {\n @case ('NON_POLICY_DOCUMENT') {\n \n <thead>\n <th>{{'Ref Cat'|appTranslate|async}}</th>\n <th>{{'Ref No'|appTranslate|async}}</th>\n <th>{{'Doc SubCat'|appTranslate|async}}</th>\n <th>{{'Title'|appTranslate|async}}</th>\n </thead>\n <tbody>\n @for (file of fileNames; track file) {\n <tr>\n <td>{{file.refCat}}</td>\n <td>{{file.refNo}}</td>\n <td>{{file.docSubCat}}</td>\n <td>{{file.title}}</td>\n </tr>\n}\n </tbody>\n \n}\n @case ('POLICY_DOCUMENT') {\n \n <thead>\n <th>{{'Ref Cat'|appTranslate|async}}</th>\n <th>{{'Policy No'|appTranslate|async}}</th>\n <th>{{'Policy Code'|appTranslate|async}}</th>\n <th>{{'Doc SubCat'|appTranslate|async}}</th>\n <th>{{'Title'|appTranslate|async}}</th>\n </thead>\n <tbody>\n @for (file of fileNames; track file) {\n <tr>\n <td>{{file.refCat}}</td>\n <td>{{file.policyNo}}</td>\n <td>{{file.policyCode}}</td>\n <td>{{file.docSubCat}}</td>\n <td>{{file.title}}</td>\n </tr>\n}\n </tbody>\n \n}\n @case ('POLICY_DOCUMENT_SUFFIX') {\n \n <thead>\n <th>{{'Ref Cat'|appTranslate|async}}</th>\n <th>{{'Policy No'|appTranslate|async}}</th>\n <th>{{'Policy Code'|appTranslate|async}}</th>\n <th>{{'Policy No Suffix'|appTranslate|async}}</th>\n <th>{{'Doc SubCat'|appTranslate|async}}</th>\n <th>{{'Title'|appTranslate|async}}</th>\n </thead>\n <tbody>\n @for (file of fileNames; track file) {\n <tr>\n <td>{{file.refCat}}</td>\n <td>{{file.policyNo}}</td>\n <td>{{file.policyCode}}</td>\n <td>{{file.policyNoSuffix}}</td>\n <td>{{file.docSubCat}}</td>\n <td>{{file.title}}</td>\n </tr>\n}\n </tbody>\n \n}\n }\n</table>\n\n </div>\n}\n</div>", styles: [".light-red-bg{background-color:#ff000009}\n"] }]
|
|
11683
11683
|
}], ctorParameters: () => [], propDecorators: { files: [{
|
|
11684
11684
|
type: Input
|
|
11685
11685
|
}], fileNameFormat: [{
|
|
@@ -17709,11 +17709,11 @@ class FormLinkComponent {
|
|
|
17709
17709
|
*/
|
|
17710
17710
|
ngOnInit() { }
|
|
17711
17711
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: FormLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
17712
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.2", type: FormLinkComponent, isStandalone: true, selector: "form-link", inputs: { cqueryParams: "cqueryParams", crouterLink: "crouterLink", value: "value", options: "options", labelField: "labelField", valueField: "valueField" }, ngImport: i0, template: "<a class=\"form-link link form-control control-bg-gray\" readonly routerLink=\"{{crouterLink}}\"\n [queryParams]=\"cqueryParams\">\n {{value|getValueLabel:options:labelField:valueField}}\n</a>\n", styles: [".form-link{color:var(--primary)}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: GetValueLabel, name: "getValueLabel" }] }); }
|
|
17712
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.2", type: FormLinkComponent, isStandalone: true, selector: "ets-form-link", inputs: { cqueryParams: "cqueryParams", crouterLink: "crouterLink", value: "value", options: "options", labelField: "labelField", valueField: "valueField" }, ngImport: i0, template: "<a class=\"form-link link form-control control-bg-gray\" readonly routerLink=\"{{crouterLink}}\"\n [queryParams]=\"cqueryParams\">\n {{value|getValueLabel:options:labelField:valueField}}\n</a>\n", styles: [".form-link{color:var(--primary)}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: GetValueLabel, name: "getValueLabel" }] }); }
|
|
17713
17713
|
}
|
|
17714
17714
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: FormLinkComponent, decorators: [{
|
|
17715
17715
|
type: Component,
|
|
17716
|
-
args: [{ selector: 'form-link', imports: [RouterLink, GetValueLabel], template: "<a class=\"form-link link form-control control-bg-gray\" readonly routerLink=\"{{crouterLink}}\"\n [queryParams]=\"cqueryParams\">\n {{value|getValueLabel:options:labelField:valueField}}\n</a>\n", styles: [".form-link{color:var(--primary)}\n"] }]
|
|
17716
|
+
args: [{ selector: 'ets-form-link', imports: [RouterLink, GetValueLabel], template: "<a class=\"form-link link form-control control-bg-gray\" readonly routerLink=\"{{crouterLink}}\"\n [queryParams]=\"cqueryParams\">\n {{value|getValueLabel:options:labelField:valueField}}\n</a>\n", styles: [".form-link{color:var(--primary)}\n"] }]
|
|
17717
17717
|
}], ctorParameters: () => [], propDecorators: { cqueryParams: [{
|
|
17718
17718
|
type: Input
|
|
17719
17719
|
}], crouterLink: [{
|
|
@@ -17740,11 +17740,11 @@ class FormTabHeadersComponent {
|
|
|
17740
17740
|
this.selectedIndexChange.emit(index);
|
|
17741
17741
|
}
|
|
17742
17742
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: FormTabHeadersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
17743
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", type: FormTabHeadersComponent, isStandalone: true, selector: "
|
|
17743
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", type: FormTabHeadersComponent, isStandalone: true, selector: "ets-form-tabs-header", inputs: { selectedIndex: "selectedIndex", tabs: "tabs" }, outputs: { selectedIndexChange: "selectedIndexChange" }, ngImport: i0, template: "<nav class=\"\">\n <div class=\"nav nav-pills nav-justified d-flex justify-content-center border-0\" id=\"nav-tab\" role=\"tablist\">\n @for (tab of tabs; track tab; let index = $index) {\n <button class=\"nav-link border-0\"\n [ngClass]=\"selectedIndex == index? 'active' : ''\" (click)=\"changeTab(index)\" type=\"button\" role=\"tab\"\n aria-controls=\"nav-home\">{{tab.label|appTranslate|async}}\n </button>\n}\n </div>\n</nav>\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: SDKTranslatePipe, name: "appTranslate" }] }); }
|
|
17744
17744
|
}
|
|
17745
17745
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: FormTabHeadersComponent, decorators: [{
|
|
17746
17746
|
type: Component,
|
|
17747
|
-
args: [{ selector: '
|
|
17747
|
+
args: [{ selector: 'ets-form-tabs-header', imports: [NgClass, AsyncPipe, SDKTranslatePipe], template: "<nav class=\"\">\n <div class=\"nav nav-pills nav-justified d-flex justify-content-center border-0\" id=\"nav-tab\" role=\"tablist\">\n @for (tab of tabs; track tab; let index = $index) {\n <button class=\"nav-link border-0\"\n [ngClass]=\"selectedIndex == index? 'active' : ''\" (click)=\"changeTab(index)\" type=\"button\" role=\"tab\"\n aria-controls=\"nav-home\">{{tab.label|appTranslate|async}}\n </button>\n}\n </div>\n</nav>\n" }]
|
|
17748
17748
|
}], ctorParameters: () => [], propDecorators: { selectedIndex: [{
|
|
17749
17749
|
type: Input
|
|
17750
17750
|
}], tabs: [{
|
|
@@ -18137,6 +18137,14 @@ class DayHourMinInputComponent extends InputBasicComponent {
|
|
|
18137
18137
|
this.sub3 = this.subForm?.valueChanges.subscribe((r) => {
|
|
18138
18138
|
if (this.debug())
|
|
18139
18139
|
debugger;
|
|
18140
|
+
if (r?.days < 0 || r?.hours < 0 || r?.mins < 0) {
|
|
18141
|
+
this.subForm.patchValue({
|
|
18142
|
+
days: r?.days < 0 ? Math.abs(r.days) : r?.days,
|
|
18143
|
+
hours: r?.hours < 0 ? Math.abs(r.hours) : r?.hours,
|
|
18144
|
+
mins: r?.mins < 0 ? Math.abs(r.mins) : r?.mins
|
|
18145
|
+
});
|
|
18146
|
+
return;
|
|
18147
|
+
}
|
|
18140
18148
|
if (this.control()?.pristine)
|
|
18141
18149
|
this.control()?.markAsDirty();
|
|
18142
18150
|
if (!this.control()?.disabled) {
|
|
@@ -19252,13 +19260,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImpor
|
|
|
19252
19260
|
*/
|
|
19253
19261
|
class PageModal {
|
|
19254
19262
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: PageModal, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
19255
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.2", type: PageModal, isStandalone: false, selector: "
|
|
19263
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.2", type: PageModal, isStandalone: false, selector: "ets-page-modal", inputs: { isModal: "isModal", modelData: "modelData", modalOnComplete: "modalOnComplete" }, ngImport: i0, template: ``, isInline: true }); }
|
|
19256
19264
|
}
|
|
19257
19265
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: PageModal, decorators: [{
|
|
19258
19266
|
type: Component,
|
|
19259
19267
|
args: [{
|
|
19260
19268
|
template: ``,
|
|
19261
|
-
standalone: false
|
|
19269
|
+
standalone: false,
|
|
19270
|
+
selector: 'ets-page-modal',
|
|
19262
19271
|
}]
|
|
19263
19272
|
}], propDecorators: { isModal: [{
|
|
19264
19273
|
type: Input
|
|
@@ -19614,11 +19623,11 @@ class SvgIconComponent {
|
|
|
19614
19623
|
this.iconRef.nativeElement.innerHTML = this.icon;
|
|
19615
19624
|
}
|
|
19616
19625
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: SvgIconComponent, deps: [{ token: SvgIconService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
19617
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.2", type: SvgIconComponent, isStandalone: true, selector: "svg-icon", inputs: { class: "class", _icon: ["icon", "_icon"] }, viewQueries: [{ propertyName: "iconRef", first: true, predicate: ["iconTag"], descendants: true }], ngImport: i0, template: "<span class=\"{{class}} svg-icon\" #iconTag>\n <!-- {{icon}} -->\n <!-- <img class=\"svg-icon\" src=\"{{icon}}\"> -->\n</span>", styles: ["span{color:inherit}\n"] }); }
|
|
19626
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.2", type: SvgIconComponent, isStandalone: true, selector: "ets-svg-icon", inputs: { class: "class", _icon: ["icon", "_icon"] }, viewQueries: [{ propertyName: "iconRef", first: true, predicate: ["iconTag"], descendants: true }], ngImport: i0, template: "<span class=\"{{class}} svg-icon\" #iconTag>\n <!-- {{icon}} -->\n <!-- <img class=\"svg-icon\" src=\"{{icon}}\"> -->\n</span>", styles: ["span{color:inherit}\n"] }); }
|
|
19618
19627
|
}
|
|
19619
19628
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: SvgIconComponent, decorators: [{
|
|
19620
19629
|
type: Component,
|
|
19621
|
-
args: [{ selector: 'svg-icon', standalone: true, template: "<span class=\"{{class}} svg-icon\" #iconTag>\n <!-- {{icon}} -->\n <!-- <img class=\"svg-icon\" src=\"{{icon}}\"> -->\n</span>", styles: ["span{color:inherit}\n"] }]
|
|
19630
|
+
args: [{ selector: 'ets-svg-icon', standalone: true, template: "<span class=\"{{class}} svg-icon\" #iconTag>\n <!-- {{icon}} -->\n <!-- <img class=\"svg-icon\" src=\"{{icon}}\"> -->\n</span>", styles: ["span{color:inherit}\n"] }]
|
|
19622
19631
|
}], ctorParameters: () => [{ type: SvgIconService }], propDecorators: { class: [{
|
|
19623
19632
|
type: Input
|
|
19624
19633
|
}], _icon: [{
|
|
@@ -23540,11 +23549,12 @@ class ETSPromptUpdateService {
|
|
|
23540
23549
|
* Indicates whether the confirmation prompt dialog is currently open
|
|
23541
23550
|
*/
|
|
23542
23551
|
this.isOpen = false;
|
|
23543
|
-
|
|
23544
|
-
.
|
|
23545
|
-
|
|
23546
|
-
|
|
23547
|
-
|
|
23552
|
+
if (UtilityService.canUseServiceworkers())
|
|
23553
|
+
swUpdate.versionUpdates
|
|
23554
|
+
.pipe(filter$1((evt) => evt.type === 'VERSION_READY'))
|
|
23555
|
+
.subscribe((evt) => {
|
|
23556
|
+
this.prompter();
|
|
23557
|
+
});
|
|
23548
23558
|
}
|
|
23549
23559
|
/**
|
|
23550
23560
|
* Displays a prompt to the user asking to reload the application.
|
|
@@ -23590,31 +23600,32 @@ class ETSLogUpdateService {
|
|
|
23590
23600
|
* @param uS - Utility service for notifications and common operations
|
|
23591
23601
|
*/
|
|
23592
23602
|
constructor(updates, uS) {
|
|
23593
|
-
// console.log('logging');
|
|
23594
23603
|
this.uS = uS;
|
|
23595
|
-
|
|
23596
|
-
|
|
23597
|
-
|
|
23598
|
-
|
|
23599
|
-
|
|
23600
|
-
|
|
23601
|
-
|
|
23602
|
-
|
|
23603
|
-
|
|
23604
|
-
|
|
23605
|
-
|
|
23606
|
-
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
|
|
23610
|
-
|
|
23611
|
-
|
|
23612
|
-
|
|
23613
|
-
|
|
23614
|
-
|
|
23615
|
-
|
|
23616
|
-
|
|
23617
|
-
|
|
23604
|
+
// console.log('logging');
|
|
23605
|
+
if (uS.canUseServiceworkers())
|
|
23606
|
+
updates.versionUpdates.subscribe((evt) => {
|
|
23607
|
+
let message;
|
|
23608
|
+
switch (evt.type) {
|
|
23609
|
+
case 'VERSION_DETECTED':
|
|
23610
|
+
message = `Downloading a new version`;
|
|
23611
|
+
console.log(`${message}: ${evt.version.hash}`);
|
|
23612
|
+
this.uS.notify(message, 2);
|
|
23613
|
+
break;
|
|
23614
|
+
case 'VERSION_READY':
|
|
23615
|
+
message = `New app version ready for use`;
|
|
23616
|
+
console.log(`Current app version: ${evt.currentVersion.hash}`);
|
|
23617
|
+
console.log(`${message}: ${evt.latestVersion.hash}`);
|
|
23618
|
+
// this.uS.notify(message, 1);
|
|
23619
|
+
break;
|
|
23620
|
+
case 'VERSION_INSTALLATION_FAILED':
|
|
23621
|
+
message = `Failed to install app version`;
|
|
23622
|
+
debugger;
|
|
23623
|
+
console.log(`${message} '${evt.version.hash}': ${evt.error}`);
|
|
23624
|
+
// location.reload();
|
|
23625
|
+
// this.uS.notify(message, 0);
|
|
23626
|
+
break;
|
|
23627
|
+
}
|
|
23628
|
+
});
|
|
23618
23629
|
}
|
|
23619
23630
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: ETSLogUpdateService, deps: [{ token: i1$9.SwUpdate }, { token: UtilityService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
23620
23631
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: ETSLogUpdateService, providedIn: 'root' }); }
|
|
@@ -23643,11 +23654,12 @@ class ETSHandleUnrecoverableStateService {
|
|
|
23643
23654
|
constructor(updates, uS, puS) {
|
|
23644
23655
|
this.uS = uS;
|
|
23645
23656
|
this.puS = puS;
|
|
23646
|
-
|
|
23647
|
-
|
|
23648
|
-
|
|
23649
|
-
|
|
23650
|
-
|
|
23657
|
+
if (uS.canUseServiceworkers())
|
|
23658
|
+
updates.unrecoverable.subscribe((event) => {
|
|
23659
|
+
console.log(event.reason);
|
|
23660
|
+
alert(event.reason);
|
|
23661
|
+
this.puS.prompter('An error occurred that we cannot recover from:\n' + event.reason);
|
|
23662
|
+
});
|
|
23651
23663
|
}
|
|
23652
23664
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: ETSHandleUnrecoverableStateService, deps: [{ token: i1$9.SwUpdate }, { token: UtilityService }, { token: ETSPromptUpdateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
23653
23665
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: ETSHandleUnrecoverableStateService, providedIn: 'root' }); }
|
|
@@ -23676,7 +23688,8 @@ class ETSCheckForUpdateService {
|
|
|
23676
23688
|
this.updates = updates;
|
|
23677
23689
|
this.sS = sS;
|
|
23678
23690
|
this.puS = puS;
|
|
23679
|
-
|
|
23691
|
+
if (UtilityService.canUseServiceworkers())
|
|
23692
|
+
this.init();
|
|
23680
23693
|
}
|
|
23681
23694
|
/**
|
|
23682
23695
|
* Initializes the update checking mechanism.
|
|
@@ -23748,6 +23761,7 @@ class ETSServiceWorkerService {
|
|
|
23748
23761
|
this.cfuS = cfuS;
|
|
23749
23762
|
this.sS = sS;
|
|
23750
23763
|
this.iS = iS;
|
|
23764
|
+
this.allowedToWork = computed(() => UtilityService.canUseServiceworkers(), ...(ngDevMode ? [{ debugName: "allowedToWork" }] : []));
|
|
23751
23765
|
}
|
|
23752
23766
|
/**
|
|
23753
23767
|
* Manually checks for application updates.
|
|
@@ -23757,15 +23771,16 @@ class ETSServiceWorkerService {
|
|
|
23757
23771
|
* @param cb - Optional callback function to execute after the update check completes
|
|
23758
23772
|
*/
|
|
23759
23773
|
async getUpdates(cb) {
|
|
23760
|
-
|
|
23774
|
+
if (!this.allowedToWork()) {
|
|
23775
|
+
if (cb)
|
|
23776
|
+
cb();
|
|
23777
|
+
return;
|
|
23778
|
+
}
|
|
23761
23779
|
const appIsStable$ = this.cfuS.appRef.isStable.pipe(first$1((isStable) => {
|
|
23762
|
-
console.log('checking for stability ', isStable);
|
|
23763
23780
|
return isStable === true;
|
|
23764
23781
|
}));
|
|
23765
|
-
console.log('checking update 2');
|
|
23766
23782
|
// appIsStable$.subscribe(async () => {
|
|
23767
23783
|
try {
|
|
23768
|
-
console.log('checking update 3');
|
|
23769
23784
|
const updateFound = await this.cfuS.updates.checkForUpdate();
|
|
23770
23785
|
this.sS.saveItem(environment.lastUpdateCheckTimeStorageKey, Date.now());
|
|
23771
23786
|
if (updateFound) {
|