@c8y/ngx-components 1021.31.3 → 1021.34.1
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/alarms/alarms-date-filter.component.d.ts +1 -0
- package/alarms/alarms-date-filter.component.d.ts.map +1 -1
- package/core/common/ui-state.service.d.ts +0 -1
- package/core/common/ui-state.service.d.ts.map +1 -1
- package/core/dynamic-component/dynamic-component.component.d.ts +5 -0
- package/core/dynamic-component/dynamic-component.component.d.ts.map +1 -1
- package/core/plugins/plugins.service.d.ts +3 -0
- package/core/plugins/plugins.service.d.ts.map +1 -1
- package/core/router/router-tabs.resolver.d.ts +2 -2
- package/core/router/router-tabs.resolver.d.ts.map +1 -1
- package/esm2022/alarms/alarms-date-filter.component.mjs +5 -3
- package/esm2022/alarms/alarms-type-filter.component.mjs +3 -3
- package/esm2022/core/common/ui-state.service.mjs +1 -19
- package/esm2022/core/dynamic-component/dynamic-component.component.mjs +23 -3
- package/esm2022/core/plugins/plugins.service.mjs +7 -1
- package/esm2022/core/router/router-tabs.resolver.mjs +22 -8
- package/esm2022/ecosystem/application-plugins/application-plugins.component.mjs +2 -2
- package/esm2022/protocol-lwm2m/ng1/plugin-checker.service.mjs +5 -1
- package/esm2022/services/services-device-tab/service-command.service.mjs +113 -0
- package/esm2022/services/services-device-tab/service-device-tab.model.mjs +1 -1
- package/esm2022/services/services-device-tab/services-device-tab.component.mjs +13 -7
- package/esm2022/widgets/definitions/asset-notes/c8y-ngx-components-widgets-definitions-asset-notes.mjs +5 -0
- package/esm2022/widgets/definitions/asset-notes/index.mjs +29 -0
- package/esm2022/widgets/definitions/index.mjs +2 -1
- package/esm2022/widgets/implementations/asset-notes/asset-notes-widget.component.mjs +67 -0
- package/esm2022/widgets/implementations/asset-notes/c8y-ngx-components-widgets-implementations-asset-notes.mjs +5 -0
- package/esm2022/widgets/implementations/asset-notes/index.mjs +2 -0
- package/fesm2022/c8y-ngx-components-alarms.mjs +5 -4
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-protocol-lwm2m.mjs +4 -0
- package/fesm2022/c8y-ngx-components-protocol-lwm2m.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-services.mjs +116 -5
- package/fesm2022/c8y-ngx-components-services.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-asset-notes.mjs +36 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions-asset-notes.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs +1 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-asset-notes.mjs +74 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-asset-notes.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components.mjs +49 -26
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/de.po +20 -11
- package/locales/es.po +18 -9
- package/locales/fr.po +18 -9
- package/locales/ja_JP.po +18 -9
- package/locales/ko.po +18 -9
- package/locales/locales.pot +19 -7
- package/locales/nl.po +18 -9
- package/locales/pl.po +21 -12
- package/locales/pt_BR.po +18 -9
- package/locales/zh_CN.po +18 -9
- package/locales/zh_TW.po +18 -9
- package/package.json +1 -1
- package/protocol-lwm2m/ng1/plugin-checker.service.d.ts +4 -0
- package/protocol-lwm2m/ng1/plugin-checker.service.d.ts.map +1 -1
- package/services/services-device-tab/service-command.service.d.ts +59 -0
- package/services/services-device-tab/service-command.service.d.ts.map +1 -0
- package/services/services-device-tab/service-device-tab.model.d.ts +9 -0
- package/services/services-device-tab/service-device-tab.model.d.ts.map +1 -1
- package/services/services-device-tab/services-device-tab.component.d.ts +5 -2
- package/services/services-device-tab/services-device-tab.component.d.ts.map +1 -1
- package/widgets/definitions/asset-notes/c8y-ngx-components-widgets-definitions-asset-notes.d.ts.map +1 -0
- package/widgets/definitions/asset-notes/index.d.ts +16 -0
- package/widgets/definitions/asset-notes/index.d.ts.map +1 -0
- package/widgets/definitions/index.d.ts +1 -0
- package/widgets/definitions/index.d.ts.map +1 -1
- package/widgets/implementations/asset-notes/asset-notes-widget.component.d.ts +33 -0
- package/widgets/implementations/asset-notes/asset-notes-widget.component.d.ts.map +1 -0
- package/widgets/implementations/asset-notes/c8y-ngx-components-widgets-implementations-asset-notes.d.ts.map +1 -0
- package/widgets/implementations/asset-notes/index.d.ts +2 -0
- package/widgets/implementations/asset-notes/index.d.ts.map +1 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as i2 from '@angular/common';
|
|
2
|
+
import { CommonModule as CommonModule$1 } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, input, signal, computed, Component } from '@angular/core';
|
|
5
|
+
import * as i3 from '@angular/forms';
|
|
6
|
+
import { FormsModule } from '@angular/forms';
|
|
7
|
+
import { InventoryService } from '@c8y/client';
|
|
8
|
+
import * as i1 from '@c8y/ngx-components';
|
|
9
|
+
import { AppStateService, AlertService, DatePipe, gettext, CommonModule, CoreModule, FormsModule as FormsModule$1 } from '@c8y/ngx-components';
|
|
10
|
+
|
|
11
|
+
class AssetNotesWidgetComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.inventory = inject(InventoryService);
|
|
14
|
+
this.appState = inject(AppStateService);
|
|
15
|
+
this.alertService = inject(AlertService);
|
|
16
|
+
this.datePipe = inject(DatePipe);
|
|
17
|
+
this.config = input();
|
|
18
|
+
this.notes = signal(null);
|
|
19
|
+
this.editable = signal(false);
|
|
20
|
+
this.isLoading = computed(() => this.notes()?.htmlContent === undefined);
|
|
21
|
+
this.FRAGMENT = 'c8y_ComponentConfig!assetNotes';
|
|
22
|
+
this.ngNonBindableTranslate = computed(() => ({
|
|
23
|
+
lastUpdated: this.datePipe.transform(this.notes()?.lastUpdated),
|
|
24
|
+
user: this.notes()?.user
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
async ngOnInit() {
|
|
28
|
+
await this.loadNotes();
|
|
29
|
+
}
|
|
30
|
+
toggleEdit() {
|
|
31
|
+
this.editable.set(!this.editable());
|
|
32
|
+
}
|
|
33
|
+
async save() {
|
|
34
|
+
try {
|
|
35
|
+
const updatedNotes = {
|
|
36
|
+
...this.notes(),
|
|
37
|
+
user: this.appState.currentUser.value.id,
|
|
38
|
+
lastUpdated: new Date().toISOString()
|
|
39
|
+
};
|
|
40
|
+
await this.inventory.update({
|
|
41
|
+
id: this.config().device.id,
|
|
42
|
+
[this.FRAGMENT]: updatedNotes
|
|
43
|
+
});
|
|
44
|
+
this.notes.set(updatedNotes);
|
|
45
|
+
this.editable.set(false);
|
|
46
|
+
this.alertService.success(gettext('Notes saved.'));
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
this.alertService.addServerFailure(error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async loadNotes() {
|
|
53
|
+
try {
|
|
54
|
+
const device = await this.inventory.detail(this.config().device.id);
|
|
55
|
+
this.notes.set(device.data[this.FRAGMENT] || { htmlContent: '' });
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
this.alertService.addServerFailure(error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AssetNotesWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
62
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.9", type: AssetNotesWidgetComponent, isStandalone: true, selector: "c8y-asset-notes", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"fit-h d-flex flex-wrap a-i-stretch\">\n <i\n class=\"c8y-icon c8y-icon-duocolor asset-notes-icon\"\n [c8yIcon]=\"'c8y-notification'\"\n ></i>\n\n @if (!editable()) {\n <div class=\"asset-notes-content\">\n <c8y-loading *ngIf=\"isLoading()\"></c8y-loading>\n <div class=\"text-break-word asset-notes-body\">\n @if (notes()?.htmlContent && !isLoading()) {\n <span\n class=\"markdown-content d-inline-block\"\n [innerHTML]=\"notes()?.htmlContent | markdownToHtml | async\"\n ></span>\n } @else if (!notes()?.htmlContent) {\n <span>\n {{ 'No notes yet.' | translate }}\n </span>\n }\n\n <button\n class=\"btn btn-link btn-sm\"\n title=\"{{ 'Edit' | translate }}\"\n type=\"button\"\n (click)=\"toggleEdit()\"\n >\n <i c8yIcon=\"pencil\"></i>\n {{ 'Edit' | translate }}\n </button>\n </div>\n </div>\n <div class=\"asset-notes-footer m-t-8\">\n <small class=\"text-muted\">\n <em\n *ngIf=\"notes()?.lastUpdated\"\n ngNonBindable\n translate\n [translateParams]=\"ngNonBindableTranslate()\"\n >\n {{ lastUpdated }} by {{ user }}\n </em>\n </small>\n </div>\n } @else {\n <div class=\"fit-h flex-grow\">\n <div class=\"d-flex a-i-stretch fit-h\">\n <textarea\n class=\"form-control fit-h text-monospace\"\n [attr.aria-label]=\"'Notes' | translate\"\n rows=\"5\"\n [(ngModel)]=\"notes().htmlContent\"\n c8y-code-editor\n ></textarea>\n <div class=\"input-group-btn a-s-center\">\n <button\n class=\"btn btn-dot\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n (click)=\"save()\"\n >\n <i c8yIcon=\"check\"></i>\n </button>\n </div>\n <div class=\"input-group-btn a-s-center\">\n <button\n class=\"btn btn-dot\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n (click)=\"toggleEdit()\"\n >\n <i c8yIcon=\"times\"></i>\n </button>\n </div>\n </div>\n </div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "component", type: i1.LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "pipe", type: i1.MarkdownToHtmlPipe, name: "markdownToHtml" }, { kind: "ngmodule", type: CommonModule$1 }, { kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: FormsModule$1 }] }); }
|
|
63
|
+
}
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AssetNotesWidgetComponent, decorators: [{
|
|
65
|
+
type: Component,
|
|
66
|
+
args: [{ selector: 'c8y-asset-notes', standalone: true, imports: [CommonModule, CommonModule$1, CoreModule, FormsModule, FormsModule$1, DatePipe], template: "<div class=\"fit-h d-flex flex-wrap a-i-stretch\">\n <i\n class=\"c8y-icon c8y-icon-duocolor asset-notes-icon\"\n [c8yIcon]=\"'c8y-notification'\"\n ></i>\n\n @if (!editable()) {\n <div class=\"asset-notes-content\">\n <c8y-loading *ngIf=\"isLoading()\"></c8y-loading>\n <div class=\"text-break-word asset-notes-body\">\n @if (notes()?.htmlContent && !isLoading()) {\n <span\n class=\"markdown-content d-inline-block\"\n [innerHTML]=\"notes()?.htmlContent | markdownToHtml | async\"\n ></span>\n } @else if (!notes()?.htmlContent) {\n <span>\n {{ 'No notes yet.' | translate }}\n </span>\n }\n\n <button\n class=\"btn btn-link btn-sm\"\n title=\"{{ 'Edit' | translate }}\"\n type=\"button\"\n (click)=\"toggleEdit()\"\n >\n <i c8yIcon=\"pencil\"></i>\n {{ 'Edit' | translate }}\n </button>\n </div>\n </div>\n <div class=\"asset-notes-footer m-t-8\">\n <small class=\"text-muted\">\n <em\n *ngIf=\"notes()?.lastUpdated\"\n ngNonBindable\n translate\n [translateParams]=\"ngNonBindableTranslate()\"\n >\n {{ lastUpdated }} by {{ user }}\n </em>\n </small>\n </div>\n } @else {\n <div class=\"fit-h flex-grow\">\n <div class=\"d-flex a-i-stretch fit-h\">\n <textarea\n class=\"form-control fit-h text-monospace\"\n [attr.aria-label]=\"'Notes' | translate\"\n rows=\"5\"\n [(ngModel)]=\"notes().htmlContent\"\n c8y-code-editor\n ></textarea>\n <div class=\"input-group-btn a-s-center\">\n <button\n class=\"btn btn-dot\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n (click)=\"save()\"\n >\n <i c8yIcon=\"check\"></i>\n </button>\n </div>\n <div class=\"input-group-btn a-s-center\">\n <button\n class=\"btn btn-dot\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n (click)=\"toggleEdit()\"\n >\n <i c8yIcon=\"times\"></i>\n </button>\n </div>\n </div>\n </div>\n }\n</div>\n" }]
|
|
67
|
+
}] });
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Generated bundle index. Do not edit.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
export { AssetNotesWidgetComponent };
|
|
74
|
+
//# sourceMappingURL=c8y-ngx-components-widgets-implementations-asset-notes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-widgets-implementations-asset-notes.mjs","sources":["../../widgets/implementations/asset-notes/asset-notes-widget.component.ts","../../widgets/implementations/asset-notes/asset-notes-widget.component.html","../../widgets/implementations/asset-notes/c8y-ngx-components-widgets-implementations-asset-notes.ts"],"sourcesContent":["import { CommonModule as NgCommonModule } from '@angular/common';\nimport { Component, computed, inject, input, InputSignal, OnInit, signal } from '@angular/core';\nimport { FormsModule as NgFormsModule } from '@angular/forms';\nimport { IManagedObject, InventoryService } from '@c8y/client';\nimport {\n AlertService,\n AppStateService,\n CommonModule,\n CoreModule,\n DatePipe,\n FormsModule,\n gettext\n} from '@c8y/ngx-components';\n\ninterface AssetNotes {\n user: string;\n lastUpdated: string;\n htmlContent: string;\n}\n\n@Component({\n selector: 'c8y-asset-notes',\n templateUrl: './asset-notes-widget.component.html',\n standalone: true,\n imports: [CommonModule, NgCommonModule, CoreModule, NgFormsModule, FormsModule, DatePipe]\n})\nexport class AssetNotesWidgetComponent implements OnInit {\n private inventory = inject(InventoryService);\n private appState = inject(AppStateService);\n private alertService = inject(AlertService);\n private datePipe = inject(DatePipe);\n\n config: InputSignal<{ device: Partial<IManagedObject> }> = input();\n\n notes = signal<AssetNotes | null>(null);\n editable = signal(false);\n isLoading = computed(() => this.notes()?.htmlContent === undefined);\n\n private readonly FRAGMENT = 'c8y_ComponentConfig!assetNotes';\n ngNonBindableTranslate = computed(() => ({\n lastUpdated: this.datePipe.transform(this.notes()?.lastUpdated),\n user: this.notes()?.user\n }));\n\n async ngOnInit() {\n await this.loadNotes();\n }\n\n toggleEdit() {\n this.editable.set(!this.editable());\n }\n\n async save() {\n try {\n const updatedNotes = {\n ...this.notes(),\n user: this.appState.currentUser.value.id,\n lastUpdated: new Date().toISOString()\n };\n\n await this.inventory.update({\n id: this.config().device.id,\n [this.FRAGMENT]: updatedNotes\n });\n\n this.notes.set(updatedNotes);\n this.editable.set(false);\n this.alertService.success(gettext('Notes saved.'));\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n }\n\n private async loadNotes() {\n try {\n const device = await this.inventory.detail(this.config().device.id);\n this.notes.set(device.data[this.FRAGMENT] || { htmlContent: '' });\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n }\n}\n","<div class=\"fit-h d-flex flex-wrap a-i-stretch\">\n <i\n class=\"c8y-icon c8y-icon-duocolor asset-notes-icon\"\n [c8yIcon]=\"'c8y-notification'\"\n ></i>\n\n @if (!editable()) {\n <div class=\"asset-notes-content\">\n <c8y-loading *ngIf=\"isLoading()\"></c8y-loading>\n <div class=\"text-break-word asset-notes-body\">\n @if (notes()?.htmlContent && !isLoading()) {\n <span\n class=\"markdown-content d-inline-block\"\n [innerHTML]=\"notes()?.htmlContent | markdownToHtml | async\"\n ></span>\n } @else if (!notes()?.htmlContent) {\n <span>\n {{ 'No notes yet.' | translate }}\n </span>\n }\n\n <button\n class=\"btn btn-link btn-sm\"\n title=\"{{ 'Edit' | translate }}\"\n type=\"button\"\n (click)=\"toggleEdit()\"\n >\n <i c8yIcon=\"pencil\"></i>\n {{ 'Edit' | translate }}\n </button>\n </div>\n </div>\n <div class=\"asset-notes-footer m-t-8\">\n <small class=\"text-muted\">\n <em\n *ngIf=\"notes()?.lastUpdated\"\n ngNonBindable\n translate\n [translateParams]=\"ngNonBindableTranslate()\"\n >\n {{ lastUpdated }} by {{ user }}\n </em>\n </small>\n </div>\n } @else {\n <div class=\"fit-h flex-grow\">\n <div class=\"d-flex a-i-stretch fit-h\">\n <textarea\n class=\"form-control fit-h text-monospace\"\n [attr.aria-label]=\"'Notes' | translate\"\n rows=\"5\"\n [(ngModel)]=\"notes().htmlContent\"\n c8y-code-editor\n ></textarea>\n <div class=\"input-group-btn a-s-center\">\n <button\n class=\"btn btn-dot\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n (click)=\"save()\"\n >\n <i c8yIcon=\"check\"></i>\n </button>\n </div>\n <div class=\"input-group-btn a-s-center\">\n <button\n class=\"btn btn-dot\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n (click)=\"toggleEdit()\"\n >\n <i c8yIcon=\"times\"></i>\n </button>\n </div>\n </div>\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["NgCommonModule","NgFormsModule","FormsModule"],"mappings":";;;;;;;;;;MA0Ba,yBAAyB,CAAA;AANtC,IAAA,WAAA,GAAA;AAOU,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACrC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AACnC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AACpC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEpC,IAAM,CAAA,MAAA,GAAqD,KAAK,EAAE,CAAC;AAEnE,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;AACxC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AACzB,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC;QAEnD,IAAQ,CAAA,QAAA,GAAG,gCAAgC,CAAC;AAC7D,QAAA,IAAA,CAAA,sBAAsB,GAAG,QAAQ,CAAC,OAAO;AACvC,YAAA,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,WAAW,CAAC;AAC/D,YAAA,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI;AACzB,SAAA,CAAC,CAAC,CAAC;AAuCL,KAAA;AArCC,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,IAAI,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 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, Injector, InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Pipe, EventEmitter, NgModule, LOCALE_ID, EnvironmentInjector, HostListener, NgModuleRef, createNgModule, Component, Output, HostBinding, forwardRef, SecurityContext, TemplateRef, APP_INITIALIZER, runInInjectionContext, effect, Self, SkipSelf, ViewChild, Attribute, ContentChild, ViewContainerRef, ContentChildren, ElementRef, ViewChildren, createComponent, importProvidersFrom, ChangeDetectionStrategy, SimpleChange, signal, Type, DestroyRef } from '@angular/core';
|
|
2
|
+
import { Directive, Input, Injector, InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Pipe, EventEmitter, NgModule, LOCALE_ID, EnvironmentInjector, HostListener, NgModuleRef, createNgModule, Component, Output, HostBinding, forwardRef, SecurityContext, TemplateRef, APP_INITIALIZER, runInInjectionContext, effect, Self, SkipSelf, ViewChild, Attribute, ContentChild, ViewContainerRef, ContentChildren, ElementRef, ViewChildren, createComponent, importProvidersFrom, ChangeDetectionStrategy, SimpleChange, reflectComponentType, signal, Type, DestroyRef } from '@angular/core';
|
|
3
3
|
import * as i2$2 from 'ngx-bootstrap/dropdown';
|
|
4
4
|
import { BsDropdownModule, BsDropdownDirective } from 'ngx-bootstrap/dropdown';
|
|
5
5
|
import * as i3$1 from '@angular/cdk/a11y';
|
|
@@ -14,7 +14,6 @@ import * as i1$3 from '@angular/router';
|
|
|
14
14
|
import { NavigationEnd, RouterModule as RouterModule$1, ActivationEnd, NavigationStart, PRIMARY_OUTLET, ActivatedRoute, ActivationStart, ChildActivationEnd, ROUTES, Router, NavigationCancel, NavigationError } from '@angular/router';
|
|
15
15
|
import * as i4 from '@c8y/ngx-components/api';
|
|
16
16
|
import { DataModule } from '@c8y/ngx-components/api';
|
|
17
|
-
import { satisfies, compare, coerce } from 'semver';
|
|
18
17
|
import { coerceNumberProperty } from '@angular/cdk/coercion';
|
|
19
18
|
import * as i2$1 from '@angular/cdk/scrolling';
|
|
20
19
|
import { VIRTUAL_SCROLL_STRATEGY, ScrollingModule } from '@angular/cdk/scrolling';
|
|
@@ -30,6 +29,7 @@ export * from '@c8y/ngx-components/gettext';
|
|
|
30
29
|
import * as i3 from 'ngx-bootstrap/datepicker';
|
|
31
30
|
import { BsDatepickerModule, BsDatepickerDirective } from 'ngx-bootstrap/datepicker';
|
|
32
31
|
import { defineLocale, enGbLocale, zhCnLocale, ptBrLocale, plLocale, nlLocale, koLocale, jaLocale, frLocale, esLocale, deLocale } from 'ngx-bootstrap/chronos';
|
|
32
|
+
import { compare, coerce } from 'semver';
|
|
33
33
|
import saveAs$1, { saveAs } from 'file-saver';
|
|
34
34
|
import * as i1$2 from '@angular/platform-browser';
|
|
35
35
|
import { BlobReader, ZipReader, BlobWriter, ZipWriter } from '@zip.js/zip.js';
|
|
@@ -897,25 +897,8 @@ class AppStateService extends StateService {
|
|
|
897
897
|
this.state.supportUrl = await this.options.getSupportUrl();
|
|
898
898
|
this.state.activateSupportUserAvailable = await this.options.getActivateSupportUser();
|
|
899
899
|
this.state.versions.backend = await this.options.getSystemOption('system', 'version');
|
|
900
|
-
try {
|
|
901
|
-
this.showIncompatibleVersionsError();
|
|
902
|
-
}
|
|
903
|
-
catch (ex) {
|
|
904
|
-
// ignore this
|
|
905
|
-
}
|
|
906
900
|
this.emitNewState();
|
|
907
901
|
}
|
|
908
|
-
showIncompatibleVersionsError() {
|
|
909
|
-
if (this.options.noVersionWarning) {
|
|
910
|
-
return;
|
|
911
|
-
}
|
|
912
|
-
const uiVersion = this.state.versions.ui.ngx;
|
|
913
|
-
const backendVersion = this.state.versions.backend;
|
|
914
|
-
if (!satisfies(uiVersion, `<=${backendVersion} || ~${backendVersion}`)) {
|
|
915
|
-
const errorContent = `You are running version ${uiVersion} of the UI and version ${backendVersion} of backend!`;
|
|
916
|
-
console.log('%c ' + errorContent, 'font-weight: bold; font-size: 30px; color: red;');
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
902
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AppStateService, deps: [{ token: i1.ApplicationService }, { token: i4.ApiService }, { token: OptionsService }, { token: i1.FetchClient }, { token: i1.TenantLoginOptionsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
920
903
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AppStateService, providedIn: 'root' }); }
|
|
921
904
|
}
|
|
@@ -4918,6 +4901,12 @@ class PluginsService {
|
|
|
4918
4901
|
return undefined;
|
|
4919
4902
|
}
|
|
4920
4903
|
}
|
|
4904
|
+
async resetRemotes(application) {
|
|
4905
|
+
return await this.applicationService.updateApplicationConfig(application, {
|
|
4906
|
+
remotes: undefined,
|
|
4907
|
+
excludedRemotes: undefined
|
|
4908
|
+
});
|
|
4909
|
+
}
|
|
4921
4910
|
sortVersions(source, order) {
|
|
4922
4911
|
const sourceCopy = cloneDeep(source);
|
|
4923
4912
|
if (source.list && source.path) {
|
|
@@ -24198,12 +24187,13 @@ class RouterTabsResolver {
|
|
|
24198
24187
|
resolve(currentRoute) {
|
|
24199
24188
|
const routeConfig = currentRoute.routeConfig;
|
|
24200
24189
|
const latestChildren = this.getLatestChildRoutes(routeConfig.rootContext);
|
|
24201
|
-
return from(latestChildren || []).pipe(mergeMap((child) => from(this.getGuards(child)).pipe(map(
|
|
24190
|
+
return from(latestChildren || []).pipe(mergeMap((child) => from(this.getGuards(child)).pipe(map(canActivate => canActivate(currentRoute, this.routerStateSnapshot)), mergeMap((result) => {
|
|
24202
24191
|
if (isObservable(result)) {
|
|
24203
24192
|
return result;
|
|
24204
24193
|
}
|
|
24205
|
-
|
|
24206
|
-
|
|
24194
|
+
const resultAsPromise = result;
|
|
24195
|
+
if (resultAsPromise && typeof resultAsPromise.then === 'function') {
|
|
24196
|
+
return from(resultAsPromise);
|
|
24207
24197
|
}
|
|
24208
24198
|
return of(result);
|
|
24209
24199
|
}), tap(result => {
|
|
@@ -24254,11 +24244,24 @@ class RouterTabsResolver {
|
|
|
24254
24244
|
return null;
|
|
24255
24245
|
}
|
|
24256
24246
|
getGuards(child) {
|
|
24257
|
-
const
|
|
24258
|
-
|
|
24247
|
+
const injector = child._injector || this.injector;
|
|
24248
|
+
const canActivates = child.canActivate || [];
|
|
24249
|
+
const guards = canActivates.map(guard => {
|
|
24250
|
+
return ((route, state) => {
|
|
24251
|
+
// for legacy CanActivate guards
|
|
24252
|
+
const instance = this.injector.get(guard, null);
|
|
24253
|
+
if (instance) {
|
|
24254
|
+
return instance.canActivate(route, state);
|
|
24255
|
+
}
|
|
24256
|
+
// for current CanActivateFn guards
|
|
24257
|
+
const canActivate = guard;
|
|
24258
|
+
return runInInjectionContext(injector, () => {
|
|
24259
|
+
return canActivate(route, state);
|
|
24260
|
+
});
|
|
24261
|
+
});
|
|
24259
24262
|
});
|
|
24260
24263
|
if (child.data && child.data.showIf) {
|
|
24261
|
-
guards.push(
|
|
24264
|
+
guards.push((route, state) => child.data.showIf(route, state));
|
|
24262
24265
|
}
|
|
24263
24266
|
return guards;
|
|
24264
24267
|
}
|
|
@@ -27267,7 +27270,14 @@ class DynamicComponentComponent {
|
|
|
27267
27270
|
environmentInjector: (dynamicComponent.injector || this.injector)
|
|
27268
27271
|
});
|
|
27269
27272
|
this.componentInstance = this.componentRef.instance;
|
|
27270
|
-
|
|
27273
|
+
const componentMetadata = this.safeReflectComponentType(componentType);
|
|
27274
|
+
const hasConfigInput = componentMetadata?.inputs.some(input => input.propName === 'config');
|
|
27275
|
+
if (hasConfigInput) {
|
|
27276
|
+
this.componentRef.setInput('config', this.config);
|
|
27277
|
+
}
|
|
27278
|
+
else {
|
|
27279
|
+
this.componentInstance.config = this.config;
|
|
27280
|
+
}
|
|
27271
27281
|
this.componentInstance.alerts = new DynamicComponentAlertAggregator(errors);
|
|
27272
27282
|
this.subscribeForOverlayChange();
|
|
27273
27283
|
}
|
|
@@ -27276,6 +27286,19 @@ class DynamicComponentComponent {
|
|
|
27276
27286
|
console.warn(ex);
|
|
27277
27287
|
}
|
|
27278
27288
|
}
|
|
27289
|
+
/**
|
|
27290
|
+
* Safely reflects the component metadata.
|
|
27291
|
+
* If reflection fails, it returns a default object with an empty inputs array.
|
|
27292
|
+
*/
|
|
27293
|
+
safeReflectComponentType(componentType) {
|
|
27294
|
+
try {
|
|
27295
|
+
return reflectComponentType(componentType);
|
|
27296
|
+
}
|
|
27297
|
+
catch (error) {
|
|
27298
|
+
console.warn('Failed to reflect component metadata:', error);
|
|
27299
|
+
return { inputs: [] };
|
|
27300
|
+
}
|
|
27301
|
+
}
|
|
27279
27302
|
async getComponentType(dynamicComponent) {
|
|
27280
27303
|
if (isLazyDynamicComponents(dynamicComponent)) {
|
|
27281
27304
|
const componentPromiseFunction = this.mode === 'component'
|