@c8y/ngx-components 1021.22.38 → 1021.22.40
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/context-dashboard/context-dashboard.model.d.ts +1 -0
- package/context-dashboard/context-dashboard.model.d.ts.map +1 -1
- package/core/docs/help-and-support-outlet/help-and-support-outlet.component.d.ts +5 -1
- package/core/docs/help-and-support-outlet/help-and-support-outlet.component.d.ts.map +1 -1
- package/core/docs/legal-notices-outlet/legal-notices-outlet.component.d.ts +5 -1
- package/core/docs/legal-notices-outlet/legal-notices-outlet.component.d.ts.map +1 -1
- package/core/docs/support-outlet/support-outlet.component.d.ts +5 -1
- package/core/docs/support-outlet/support-outlet.component.d.ts.map +1 -1
- package/core/shared/core.model.d.ts +5 -1
- package/core/shared/core.model.d.ts.map +1 -1
- package/ecosystem/application-plugins/application-plugins.component.d.ts +4 -0
- package/ecosystem/application-plugins/application-plugins.component.d.ts.map +1 -1
- package/ecosystem/application-plugins/plugin-list.component.d.ts.map +1 -1
- package/ecosystem/packages/package-details/package-details.component.d.ts +3 -2
- package/ecosystem/packages/package-details/package-details.component.d.ts.map +1 -1
- package/ecosystem/shared/ecosystem.model.d.ts +3 -0
- package/ecosystem/shared/ecosystem.model.d.ts.map +1 -1
- package/esm2022/context-dashboard/context-dashboard.model.mjs +3 -2
- package/esm2022/core/docs/support-outlet/support-outlet.component.mjs +3 -3
- package/esm2022/core/shared/core.model.mjs +6 -2
- package/esm2022/ecosystem/application-plugins/application-plugins.component.mjs +36 -38
- package/esm2022/ecosystem/application-plugins/plugin-list.component.mjs +9 -12
- package/esm2022/ecosystem/packages/package-details/package-details.component.mjs +11 -6
- package/esm2022/ecosystem/shared/ecosystem.model.mjs +6 -3
- package/esm2022/report-dashboard/report-dashboard-list.component.mjs +4 -3
- package/esm2022/translation-editor/data/translation-store.service.mjs +4 -3
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +2 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs +43 -48
- package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs +5 -2
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs +51 -51
- package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-report-dashboard.mjs +3 -2
- package/fesm2022/c8y-ngx-components-report-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-translation-editor-data.mjs +3 -2
- package/fesm2022/c8y-ngx-components-translation-editor-data.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +7 -3
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/report-dashboard/report-dashboard-list.component.d.ts +29 -0
- package/report-dashboard/report-dashboard-list.component.d.ts.map +1 -1
- package/translation-editor/data/translation-store.service.d.ts.map +1 -1
|
@@ -128,6 +128,7 @@ class ReportDashboardListComponent {
|
|
|
128
128
|
this.reportDashboardService = reportDashboardService;
|
|
129
129
|
this.permissions = permissions;
|
|
130
130
|
this.gainsightService = gainsightService;
|
|
131
|
+
this.PRODUCT_EXPERIENCE = PRODUCT_EXPERIENCE;
|
|
131
132
|
this.textFilter$ = new BehaviorSubject('');
|
|
132
133
|
this.reload$ = new BehaviorSubject(null);
|
|
133
134
|
this.reloading = false;
|
|
@@ -196,11 +197,11 @@ class ReportDashboardListComponent {
|
|
|
196
197
|
: this.reportDashboardService.removeNavigatorNode(report);
|
|
197
198
|
}
|
|
198
199
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ReportDashboardListComponent, deps: [{ token: i1$1.InventoryService }, { token: i1.ContextDashboardService }, { token: i3.TranslateService }, { token: i4.ModalService }, { token: i4.AlertService }, { token: ReportDashboardService }, { token: i4.Permissions }, { token: i4.GainsightService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
199
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: ReportDashboardListComponent, selector: "c8y-report-dashboard-list", viewQueries: [{ propertyName: "filter", first: true, predicate: FilterInputComponent, descendants: true }], ngImport: i0, template: "<c8y-title>\n {{ 'Reports' | translate }}\n</c8y-title>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"navbar-form\"\n>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n [attr.aria-label]=\"'Filter' | translate\"\n placeholder=\"{{ 'Filter\u2026' | translate }}\"\n type=\"search\"\n [ngModel]=\"textFilter$ | async\"\n (ngModelChange)=\"textFilter$.next($event)\"\n />\n <span class=\"input-group-addon\">\n <i\n c8yIcon=\"search\"\n *ngIf=\"(textFilter$ | async).length === 0\"\n ></i>\n <i\n class=\"text-muted\"\n c8yIcon=\"times\"\n *ngIf=\"(textFilter$ | async).length > 0\"\n (click)=\"textFilter$.next('')\"\n px-event=\"Clear filtering reports\"\n ></i>\n </span>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-action-bar-button'\"\n routerLink=\"/report/new-report\"\n [disabled]=\"!canAddReport\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add report' | translate }}\n </button>\n <button\n class=\"btn btn-dot m-r-16\"\n aria-label=\"{{ 'Info' | translate }}\"\n popover=\"{{ 'You don\\'t have permission to add reports' | translate }}\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!canAddReport\"\n >\n <i\n class=\"text-primary\"\n [c8yIcon]=\"'info-circle'\"\n ></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Reload' | translate }}\"\n type=\"button\"\n (click)=\"loadReports()\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': reloading }\"\n ></i>\n {{ 'Reload' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-help src=\"/docs/cockpit/working-with-reports/#working-with-reports\"></c8y-help>\n\n<c8y-list-group>\n <c8y-li\n class=\"page-sticky-header hidden-xs hidden-sm\"\n *ngIf=\"(reports$ | async)?.data.length > 0\"\n >\n <c8y-li-icon>\n <i class=\"p-l-24\"></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n {{ 'Report' | translate }}\n </div>\n <div class=\"col-6\">\n {{ 'Description' | translate }}\n </div>\n <div class=\"col-2\">\n {{ 'Show in navigator' | translate }}\n </div>\n </c8y-li-body>\n </c8y-li>\n\n <c8y-li *c8yFor=\"let report of reports$; let i = index; loadMore: 'auto'\">\n <c8y-li-icon [icon]=\"report.icon\"></c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n <button\n class=\"btn-clean\"\n title=\"{{ report.name }}\"\n type=\"button\"\n routerLink=\"/reports/{{ report.id }}\"\n >\n <span class=\"text-truncate\">\n {{ report.name }}\n </span>\n </button>\n </div>\n <div class=\"col-6\">\n <p class=\"small text-truncate-wrap\">\n <em\n class=\"text-muted\"\n *ngIf=\"!report.description; else showDescription\"\n >\n {{ 'No description available' | translate }}\n </em>\n <ng-template #showDescription>\n {{ report.description }}\n </ng-template>\n </p>\n </div>\n <div class=\"col-2 fit-h-20 m-t-xs-8\">\n <label\n class=\"c8y-switch c8y-switch--inline\"\n title=\"{{ 'Show in navigator' | translate }}\"\n >\n <input\n type=\"checkbox\"\n [ngModel]=\"!!report.c8y_IsNavigatorNode\" (ngModelChange)=\"report.c8y_IsNavigatorNode = $event\"\n (change)=\"update(report)\"\n />\n <span></span>\n <span class=\"visible-xs\">\n {{ 'Show in navigator' | translate }}\n </span>\n </label>\n </div>\n <div class=\"col-1 hidden-xs\">\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto d-flex\"\n [attr.aria-label]=\"'Remove report' | translate\"\n tooltip=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n <div class=\"visible-xs p-t-8 text-right\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"delete\"></i>\n {{ 'Remove report' | translate }}\n </button>\n </div>\n </c8y-li-body>\n </c8y-li>\n</c8y-list-group>\n\n<c8y-ui-empty-state\n [icon]=\"'c8y-reports'\"\n [title]=\"'There are no reports defined.' | translate\"\n [subtitle]=\"'Add a report first.' | translate\"\n *ngIf=\"(reports$ | async)?.data.length === 0\"\n>\n <p>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-empty-state-button'\"\n [disabled]=\"!canAddReport\"\n routerLink=\"/report/new-report\"\n >\n {{ 'Add report' | translate }}\n </button>\n </p>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-reports\">user documentation</a>\n .\n </small>\n </p>\n</c8y-ui-empty-state>\n", dependencies: [{ kind: "component", type: i4.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "component", type: i4.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i4.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i4.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "component", type: i4.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "directive", type: i7.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: i7.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "component", type: i4.GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "component", type: i4.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i4.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i4.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i4.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "component", type: i4.HelpComponent, selector: "c8y-help", inputs: ["src", "isCollapsed", "priority", "icon"] }, { kind: "directive", type: i8.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "directive", type: i9.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i10.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "pipe", type: i4.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }] }); }
|
|
200
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: ReportDashboardListComponent, selector: "c8y-report-dashboard-list", viewQueries: [{ propertyName: "filter", first: true, predicate: FilterInputComponent, descendants: true }], ngImport: i0, template: "<c8y-title>\n {{ 'Reports' | translate }}\n</c8y-title>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"navbar-form\"\n>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n [attr.aria-label]=\"'Filter' | translate\"\n placeholder=\"{{ 'Filter\u2026' | translate }}\"\n type=\"search\"\n [ngModel]=\"textFilter$ | async\"\n (ngModelChange)=\"textFilter$.next($event)\"\n />\n <span class=\"input-group-addon\">\n <i\n c8yIcon=\"search\"\n *ngIf=\"(textFilter$ | async).length === 0\"\n ></i>\n <i\n class=\"text-muted\"\n c8yIcon=\"times\"\n *ngIf=\"(textFilter$ | async).length > 0\"\n (click)=\"textFilter$.next('')\"\n px-event=\"Clear filtering reports\"\n ></i>\n </span>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-action-bar-button'\"\n routerLink=\"/report/new-report\"\n [disabled]=\"!canAddReport\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add report' | translate }}\n </button>\n <button\n class=\"btn btn-dot m-r-16\"\n aria-label=\"{{ 'Info' | translate }}\"\n popover=\"{{ 'You don\\'t have permission to add reports' | translate }}\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!canAddReport\"\n >\n <i\n class=\"text-primary\"\n [c8yIcon]=\"'info-circle'\"\n ></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Reload' | translate }}\"\n type=\"button\"\n (click)=\"loadReports()\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': reloading }\"\n ></i>\n {{ 'Reload' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-help src=\"/docs/cockpit/working-with-reports/#working-with-reports\"></c8y-help>\n\n<c8y-list-group>\n <c8y-li\n class=\"page-sticky-header hidden-xs hidden-sm\"\n *ngIf=\"(reports$ | async)?.data.length > 0\"\n >\n <c8y-li-icon>\n <i class=\"p-l-24\"></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n {{ 'Report' | translate }}\n </div>\n <div class=\"col-6\">\n {{ 'Description' | translate }}\n </div>\n <div class=\"col-2\">\n {{ 'Show in navigator' | translate }}\n </div>\n </c8y-li-body>\n </c8y-li>\n\n <c8y-li *c8yFor=\"let report of reports$; let i = index; loadMore: 'auto'\">\n <c8y-li-icon [icon]=\"report.icon\"></c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n <button\n class=\"btn-clean\"\n title=\"{{ report.name }}\"\n type=\"button\"\n routerLink=\"/reports/{{ report.id }}\"\n >\n <span class=\"text-truncate\">\n {{ report.name }}\n </span>\n </button>\n </div>\n <div class=\"col-6\">\n <p class=\"small text-truncate-wrap\">\n <em\n class=\"text-muted\"\n *ngIf=\"!report.description; else showDescription\"\n >\n {{ 'No description available' | translate }}\n </em>\n <ng-template #showDescription>\n {{ report.description }}\n </ng-template>\n </p>\n </div>\n <div class=\"col-2 fit-h-20 m-t-xs-8\">\n <label\n class=\"c8y-switch c8y-switch--inline\"\n title=\"{{ 'Show in navigator' | translate }}\"\n >\n <input\n type=\"checkbox\"\n [ngModel]=\"!!report.c8y_IsNavigatorNode\" (ngModelChange)=\"report.c8y_IsNavigatorNode = $event\"\n (change)=\"update(report)\"\n />\n <span></span>\n <span class=\"visible-xs\">\n {{ 'Show in navigator' | translate }}\n </span>\n </label>\n </div>\n <div class=\"col-1 hidden-xs\">\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto d-flex\"\n [attr.aria-label]=\"'Remove report' | translate\"\n tooltip=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n <div class=\"visible-xs p-t-8 text-right\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"delete\"></i>\n {{ 'Remove report' | translate }}\n </button>\n </div>\n </c8y-li-body>\n </c8y-li>\n</c8y-list-group>\n\n<c8y-ui-empty-state\n [icon]=\"'c8y-reports'\"\n [title]=\"'There are no reports defined.' | translate\"\n [subtitle]=\"'Add a report first.' | translate\"\n *ngIf=\"(reports$ | async)?.data.length === 0\"\n>\n <p>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-empty-state-button'\"\n [disabled]=\"!canAddReport\"\n routerLink=\"/report/new-report\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.DASHBOARD.EVENTS.REPORTS\"\n [actionData]=\"{ action: PRODUCT_EXPERIENCE.DASHBOARD.ACTIONS.ADD_REPORT }\"\n >\n {{ 'Add report' | translate }}\n </button>\n </p>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-reports\">user documentation</a>\n .\n </small>\n </p>\n</c8y-ui-empty-state>\n", dependencies: [{ kind: "component", type: i4.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "component", type: i4.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i4.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i4.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "component", type: i4.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "directive", type: i7.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: i7.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "component", type: i4.GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "component", type: i4.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i4.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i4.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i4.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "directive", type: i4.ProductExperienceDirective, selector: "[c8yProductExperience]", inputs: ["actionName", "actionData", "inherit", "suppressDataOverriding"] }, { kind: "component", type: i4.HelpComponent, selector: "c8y-help", inputs: ["src", "isCollapsed", "priority", "icon"] }, { kind: "directive", type: i8.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "directive", type: i9.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i10.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "pipe", type: i4.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }] }); }
|
|
200
201
|
}
|
|
201
202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ReportDashboardListComponent, decorators: [{
|
|
202
203
|
type: Component,
|
|
203
|
-
args: [{ selector: 'c8y-report-dashboard-list', template: "<c8y-title>\n {{ 'Reports' | translate }}\n</c8y-title>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"navbar-form\"\n>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n [attr.aria-label]=\"'Filter' | translate\"\n placeholder=\"{{ 'Filter\u2026' | translate }}\"\n type=\"search\"\n [ngModel]=\"textFilter$ | async\"\n (ngModelChange)=\"textFilter$.next($event)\"\n />\n <span class=\"input-group-addon\">\n <i\n c8yIcon=\"search\"\n *ngIf=\"(textFilter$ | async).length === 0\"\n ></i>\n <i\n class=\"text-muted\"\n c8yIcon=\"times\"\n *ngIf=\"(textFilter$ | async).length > 0\"\n (click)=\"textFilter$.next('')\"\n px-event=\"Clear filtering reports\"\n ></i>\n </span>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-action-bar-button'\"\n routerLink=\"/report/new-report\"\n [disabled]=\"!canAddReport\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add report' | translate }}\n </button>\n <button\n class=\"btn btn-dot m-r-16\"\n aria-label=\"{{ 'Info' | translate }}\"\n popover=\"{{ 'You don\\'t have permission to add reports' | translate }}\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!canAddReport\"\n >\n <i\n class=\"text-primary\"\n [c8yIcon]=\"'info-circle'\"\n ></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Reload' | translate }}\"\n type=\"button\"\n (click)=\"loadReports()\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': reloading }\"\n ></i>\n {{ 'Reload' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-help src=\"/docs/cockpit/working-with-reports/#working-with-reports\"></c8y-help>\n\n<c8y-list-group>\n <c8y-li\n class=\"page-sticky-header hidden-xs hidden-sm\"\n *ngIf=\"(reports$ | async)?.data.length > 0\"\n >\n <c8y-li-icon>\n <i class=\"p-l-24\"></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n {{ 'Report' | translate }}\n </div>\n <div class=\"col-6\">\n {{ 'Description' | translate }}\n </div>\n <div class=\"col-2\">\n {{ 'Show in navigator' | translate }}\n </div>\n </c8y-li-body>\n </c8y-li>\n\n <c8y-li *c8yFor=\"let report of reports$; let i = index; loadMore: 'auto'\">\n <c8y-li-icon [icon]=\"report.icon\"></c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n <button\n class=\"btn-clean\"\n title=\"{{ report.name }}\"\n type=\"button\"\n routerLink=\"/reports/{{ report.id }}\"\n >\n <span class=\"text-truncate\">\n {{ report.name }}\n </span>\n </button>\n </div>\n <div class=\"col-6\">\n <p class=\"small text-truncate-wrap\">\n <em\n class=\"text-muted\"\n *ngIf=\"!report.description; else showDescription\"\n >\n {{ 'No description available' | translate }}\n </em>\n <ng-template #showDescription>\n {{ report.description }}\n </ng-template>\n </p>\n </div>\n <div class=\"col-2 fit-h-20 m-t-xs-8\">\n <label\n class=\"c8y-switch c8y-switch--inline\"\n title=\"{{ 'Show in navigator' | translate }}\"\n >\n <input\n type=\"checkbox\"\n [ngModel]=\"!!report.c8y_IsNavigatorNode\" (ngModelChange)=\"report.c8y_IsNavigatorNode = $event\"\n (change)=\"update(report)\"\n />\n <span></span>\n <span class=\"visible-xs\">\n {{ 'Show in navigator' | translate }}\n </span>\n </label>\n </div>\n <div class=\"col-1 hidden-xs\">\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto d-flex\"\n [attr.aria-label]=\"'Remove report' | translate\"\n tooltip=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n <div class=\"visible-xs p-t-8 text-right\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"delete\"></i>\n {{ 'Remove report' | translate }}\n </button>\n </div>\n </c8y-li-body>\n </c8y-li>\n</c8y-list-group>\n\n<c8y-ui-empty-state\n [icon]=\"'c8y-reports'\"\n [title]=\"'There are no reports defined.' | translate\"\n [subtitle]=\"'Add a report first.' | translate\"\n *ngIf=\"(reports$ | async)?.data.length === 0\"\n>\n <p>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-empty-state-button'\"\n [disabled]=\"!canAddReport\"\n routerLink=\"/report/new-report\"\n >\n {{ 'Add report' | translate }}\n </button>\n </p>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-reports\">user documentation</a>\n .\n </small>\n </p>\n</c8y-ui-empty-state>\n" }]
|
|
204
|
+
args: [{ selector: 'c8y-report-dashboard-list', template: "<c8y-title>\n {{ 'Reports' | translate }}\n</c8y-title>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"navbar-form\"\n>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n [attr.aria-label]=\"'Filter' | translate\"\n placeholder=\"{{ 'Filter\u2026' | translate }}\"\n type=\"search\"\n [ngModel]=\"textFilter$ | async\"\n (ngModelChange)=\"textFilter$.next($event)\"\n />\n <span class=\"input-group-addon\">\n <i\n c8yIcon=\"search\"\n *ngIf=\"(textFilter$ | async).length === 0\"\n ></i>\n <i\n class=\"text-muted\"\n c8yIcon=\"times\"\n *ngIf=\"(textFilter$ | async).length > 0\"\n (click)=\"textFilter$.next('')\"\n px-event=\"Clear filtering reports\"\n ></i>\n </span>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-action-bar-button'\"\n routerLink=\"/report/new-report\"\n [disabled]=\"!canAddReport\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add report' | translate }}\n </button>\n <button\n class=\"btn btn-dot m-r-16\"\n aria-label=\"{{ 'Info' | translate }}\"\n popover=\"{{ 'You don\\'t have permission to add reports' | translate }}\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!canAddReport\"\n >\n <i\n class=\"text-primary\"\n [c8yIcon]=\"'info-circle'\"\n ></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Reload' | translate }}\"\n type=\"button\"\n (click)=\"loadReports()\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': reloading }\"\n ></i>\n {{ 'Reload' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-help src=\"/docs/cockpit/working-with-reports/#working-with-reports\"></c8y-help>\n\n<c8y-list-group>\n <c8y-li\n class=\"page-sticky-header hidden-xs hidden-sm\"\n *ngIf=\"(reports$ | async)?.data.length > 0\"\n >\n <c8y-li-icon>\n <i class=\"p-l-24\"></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n {{ 'Report' | translate }}\n </div>\n <div class=\"col-6\">\n {{ 'Description' | translate }}\n </div>\n <div class=\"col-2\">\n {{ 'Show in navigator' | translate }}\n </div>\n </c8y-li-body>\n </c8y-li>\n\n <c8y-li *c8yFor=\"let report of reports$; let i = index; loadMore: 'auto'\">\n <c8y-li-icon [icon]=\"report.icon\"></c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n <button\n class=\"btn-clean\"\n title=\"{{ report.name }}\"\n type=\"button\"\n routerLink=\"/reports/{{ report.id }}\"\n >\n <span class=\"text-truncate\">\n {{ report.name }}\n </span>\n </button>\n </div>\n <div class=\"col-6\">\n <p class=\"small text-truncate-wrap\">\n <em\n class=\"text-muted\"\n *ngIf=\"!report.description; else showDescription\"\n >\n {{ 'No description available' | translate }}\n </em>\n <ng-template #showDescription>\n {{ report.description }}\n </ng-template>\n </p>\n </div>\n <div class=\"col-2 fit-h-20 m-t-xs-8\">\n <label\n class=\"c8y-switch c8y-switch--inline\"\n title=\"{{ 'Show in navigator' | translate }}\"\n >\n <input\n type=\"checkbox\"\n [ngModel]=\"!!report.c8y_IsNavigatorNode\" (ngModelChange)=\"report.c8y_IsNavigatorNode = $event\"\n (change)=\"update(report)\"\n />\n <span></span>\n <span class=\"visible-xs\">\n {{ 'Show in navigator' | translate }}\n </span>\n </label>\n </div>\n <div class=\"col-1 hidden-xs\">\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto d-flex\"\n [attr.aria-label]=\"'Remove report' | translate\"\n tooltip=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n <div class=\"visible-xs p-t-8 text-right\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"delete\"></i>\n {{ 'Remove report' | translate }}\n </button>\n </div>\n </c8y-li-body>\n </c8y-li>\n</c8y-list-group>\n\n<c8y-ui-empty-state\n [icon]=\"'c8y-reports'\"\n [title]=\"'There are no reports defined.' | translate\"\n [subtitle]=\"'Add a report first.' | translate\"\n *ngIf=\"(reports$ | async)?.data.length === 0\"\n>\n <p>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-empty-state-button'\"\n [disabled]=\"!canAddReport\"\n routerLink=\"/report/new-report\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.DASHBOARD.EVENTS.REPORTS\"\n [actionData]=\"{ action: PRODUCT_EXPERIENCE.DASHBOARD.ACTIONS.ADD_REPORT }\"\n >\n {{ 'Add report' | translate }}\n </button>\n </p>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-reports\">user documentation</a>\n .\n </small>\n </p>\n</c8y-ui-empty-state>\n" }]
|
|
204
205
|
}], ctorParameters: () => [{ type: i1$1.InventoryService }, { type: i1.ContextDashboardService }, { type: i3.TranslateService }, { type: i4.ModalService }, { type: i4.AlertService }, { type: ReportDashboardService }, { type: i4.Permissions }, { type: i4.GainsightService }], propDecorators: { filter: [{
|
|
205
206
|
type: ViewChild,
|
|
206
207
|
args: [FilterInputComponent, { static: false }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-report-dashboard.mjs","sources":["../../report-dashboard/report-dashboard.guard.ts","../../report-dashboard/report-dashboard.service.ts","../../report-dashboard/report-dashboard-navigation.factory.ts","../../report-dashboard/report-dashboard-list.component.ts","../../report-dashboard/report-dashboard-list.component.html","../../report-dashboard/report-dashboard.module.ts","../../report-dashboard/c8y-ngx-components-report-dashboard.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport {\n ContextDashboardService,\n ContextDashboardType\n} from '@c8y/ngx-components/context-dashboard';\nimport { tap } from 'rxjs/operators';\nimport { from, Observable, of } from 'rxjs';\nimport { Tab } from '@c8y/ngx-components';\n\n@Injectable({ providedIn: 'root' })\nexport class ReportDashboardGuard {\n constructor(private contextDashboardService: ContextDashboardService) {}\n\n canActivate(route: ActivatedRouteSnapshot): Observable<boolean | Tab[]> {\n const reportId = route.data.contextData && route.data.contextData.id;\n return from(\n this.contextDashboardService.activateDashboards(route, [ContextDashboardType.Named])\n ).pipe(\n tap(res => {\n return Array.isArray(res) && res.length === 0\n ? this.createDashboardIfNotExist(reportId)\n : of(true);\n })\n );\n }\n\n createDashboardIfNotExist(reportId) {\n const dashboardCfg = {};\n return this.contextDashboardService\n .create(dashboardCfg, undefined, `report_${reportId}`)\n .then(() => true);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { IManagedObject, InventoryService, QueriesUtil } from '@c8y/client';\nimport { NavigatorService } from '@c8y/ngx-components';\n\n@Injectable()\nexport class ReportDashboardService {\n private queriesUtil: QueriesUtil;\n constructor(\n private inventoryService: InventoryService,\n private navigatorService: NavigatorService\n ) {\n this.queriesUtil = new QueriesUtil();\n }\n\n listReports(options: { filter?: any; pageSize?: number } = {}) {\n let query = { __has: 'c8y_Report' };\n if (options.filter) {\n query = this.queriesUtil.addAndFilter(query, options.filter);\n }\n const filters = {\n query: this.queriesUtil.buildQuery(query),\n pageSize: options.pageSize || 50,\n withTotalPages: true\n };\n return this.inventoryService.list(filters);\n }\n\n removeNavigatorNode(report: IManagedObject) {\n this.navigatorService.state.forEach(node => {\n if (node.path === `reports/${report.id}`) {\n this.navigatorService.remove(node);\n return;\n }\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { IManagedObject } from '@c8y/client';\nimport { NavigatorNode, NavigatorService, gettext } from '@c8y/ngx-components';\nimport { ReportDashboardService } from './report-dashboard.service';\n\nconst REPORTS_NAVIGATOR_NODE_PRIORITY = 40;\n\n@Injectable({ providedIn: 'root' })\nexport class ReportDashboardNavigationFactory {\n loaded = false;\n\n constructor(\n private navigatorService: NavigatorService,\n private reportDashboardService: ReportDashboardService\n ) {}\n\n async get() {\n if (!this.loaded) {\n this.loaded = true;\n\n this.navigatorService.add(\n new NavigatorNode({\n label: gettext('Reports'),\n path: 'reports',\n icon: 'c8y-reports',\n featureId: 'reports',\n priority: REPORTS_NAVIGATOR_NODE_PRIORITY\n })\n );\n\n const reports: IManagedObject[] = (\n await this.reportDashboardService.listReports({\n filter: { __has: 'c8y_IsNavigatorNode' },\n pageSize: 2000\n })\n ).data;\n reports.forEach(report => {\n const node = new NavigatorNode({\n label: report.name,\n path: `reports/${report.id}`,\n icon: report.icon,\n priority: report.priority,\n routerLinkExact: false\n });\n this.navigatorService.add(node);\n });\n }\n }\n}\n","import { Component, OnInit, ViewChild } from '@angular/core';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport { IManagedObject, InventoryService, IResultList } from '@c8y/client';\nimport { debounceTime, distinctUntilChanged, shareReplay, switchMap, tap } from 'rxjs/operators';\nimport {\n AlertService,\n FilterInputComponent,\n GainsightService,\n gettext,\n ModalService,\n Permissions,\n Status\n} from '@c8y/ngx-components';\nimport {\n ContextDashboardType,\n ContextDashboardService,\n PRODUCT_EXPERIENCE\n} from '@c8y/ngx-components/context-dashboard';\nimport { TranslateService } from '@ngx-translate/core';\nimport { ReportDashboardService } from './report-dashboard.service';\n\n@Component({\n selector: 'c8y-report-dashboard-list',\n templateUrl: './report-dashboard-list.component.html'\n})\nexport class ReportDashboardListComponent implements OnInit {\n @ViewChild(FilterInputComponent, { static: false }) filter: FilterInputComponent;\n textFilter$: BehaviorSubject<string> = new BehaviorSubject('');\n reload$: BehaviorSubject<void> = new BehaviorSubject(null);\n reloading = false;\n reports$: Observable<IResultList<IManagedObject>> = combineLatest(\n this.textFilter$.pipe(debounceTime(400), distinctUntilChanged()),\n this.reload$\n ).pipe(\n tap(() => {\n this.reloading = true;\n }),\n switchMap(([text]) => this.loadReports(text)),\n tap(() => {\n this.reloading = false;\n }),\n shareReplay(1)\n );\n canAddReport = false;\n private readonly DELETED_SUCCESS_MSG = gettext('Report deleted.');\n\n constructor(\n private inventoryService: InventoryService,\n private contextDashboardService: ContextDashboardService,\n private translateService: TranslateService,\n private modal: ModalService,\n private alertService: AlertService,\n private reportDashboardService: ReportDashboardService,\n private permissions: Permissions,\n private gainsightService: GainsightService\n ) {}\n\n ngOnInit() {\n this.canAddReport = this.permissions.hasAnyRole([\n Permissions.ROLE_INVENTORY_CREATE,\n Permissions.ROLE_INVENTORY_ADMIN,\n Permissions.ROLE_MANAGED_OBJECT_ADMIN,\n Permissions.ROLE_MANAGED_OBJECT_CREATE\n ]);\n }\n\n async loadReports(partialName?: string) {\n return partialName\n ? this.reportDashboardService.listReports({ filter: { name: `*${partialName}*` } })\n : this.reportDashboardService.listReports();\n }\n\n async delete(report: IManagedObject) {\n try {\n const dashboard = await this.contextDashboardService\n .getDashboard$(`report_${report.id}`, [ContextDashboardType.Named])\n .toPromise();\n const isDashboardFrozen = !!dashboard?.c8y_Dashboard?.isFrozen;\n\n const msg = isDashboardFrozen\n ? gettext(\n `You are about to delete the report \"{{ reportName }}\". Be aware that the report has a locked dashboard assigned. Do you want to proceed?`\n )\n : gettext(`You are about to delete the report \"{{ reportName }}\". Do you want to proceed?`);\n\n await this.modal.confirm(\n gettext('Delete report'),\n this.translateService.instant(msg, {\n reportName: report.name\n }),\n Status.DANGER,\n {\n ok: gettext('Delete'),\n cancel: gettext('Cancel')\n }\n );\n\n await this.contextDashboardService.delete(dashboard, false);\n await this.inventoryService.delete(report.id);\n this.alertService.success(this.DELETED_SUCCESS_MSG);\n if (report.c8y_IsNavigatorNode) {\n this.reportDashboardService.removeNavigatorNode(report);\n }\n this.reload$.next();\n this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.DASHBOARD.EVENTS.REPORTS, {\n component: PRODUCT_EXPERIENCE.DASHBOARD.COMPONENTS.REPORTS_LIST,\n action: PRODUCT_EXPERIENCE.DASHBOARD.ACTIONS.DELETE,\n name: report.name,\n id: report.id,\n context: PRODUCT_EXPERIENCE.DASHBOARD.CONTEXT.REPORT\n });\n } catch (ex) {\n if (ex) {\n throw new Error(`Something went wrong: ${ex}`);\n }\n }\n }\n\n async update(report: IManagedObject) {\n report.c8y_IsNavigatorNode = report.c8y_IsNavigatorNode ? {} : null;\n await this.inventoryService.update(report);\n report.c8y_IsNavigatorNode\n ? this.contextDashboardService.addReportNavigatorNode(report)\n : this.reportDashboardService.removeNavigatorNode(report);\n }\n}\n","<c8y-title>\n {{ 'Reports' | translate }}\n</c8y-title>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"navbar-form\"\n>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n [attr.aria-label]=\"'Filter' | translate\"\n placeholder=\"{{ 'Filter…' | translate }}\"\n type=\"search\"\n [ngModel]=\"textFilter$ | async\"\n (ngModelChange)=\"textFilter$.next($event)\"\n />\n <span class=\"input-group-addon\">\n <i\n c8yIcon=\"search\"\n *ngIf=\"(textFilter$ | async).length === 0\"\n ></i>\n <i\n class=\"text-muted\"\n c8yIcon=\"times\"\n *ngIf=\"(textFilter$ | async).length > 0\"\n (click)=\"textFilter$.next('')\"\n px-event=\"Clear filtering reports\"\n ></i>\n </span>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-action-bar-button'\"\n routerLink=\"/report/new-report\"\n [disabled]=\"!canAddReport\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add report' | translate }}\n </button>\n <button\n class=\"btn btn-dot m-r-16\"\n aria-label=\"{{ 'Info' | translate }}\"\n popover=\"{{ 'You don\\'t have permission to add reports' | translate }}\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!canAddReport\"\n >\n <i\n class=\"text-primary\"\n [c8yIcon]=\"'info-circle'\"\n ></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Reload' | translate }}\"\n type=\"button\"\n (click)=\"loadReports()\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': reloading }\"\n ></i>\n {{ 'Reload' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-help src=\"/docs/cockpit/working-with-reports/#working-with-reports\"></c8y-help>\n\n<c8y-list-group>\n <c8y-li\n class=\"page-sticky-header hidden-xs hidden-sm\"\n *ngIf=\"(reports$ | async)?.data.length > 0\"\n >\n <c8y-li-icon>\n <i class=\"p-l-24\"></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n {{ 'Report' | translate }}\n </div>\n <div class=\"col-6\">\n {{ 'Description' | translate }}\n </div>\n <div class=\"col-2\">\n {{ 'Show in navigator' | translate }}\n </div>\n </c8y-li-body>\n </c8y-li>\n\n <c8y-li *c8yFor=\"let report of reports$; let i = index; loadMore: 'auto'\">\n <c8y-li-icon [icon]=\"report.icon\"></c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n <button\n class=\"btn-clean\"\n title=\"{{ report.name }}\"\n type=\"button\"\n routerLink=\"/reports/{{ report.id }}\"\n >\n <span class=\"text-truncate\">\n {{ report.name }}\n </span>\n </button>\n </div>\n <div class=\"col-6\">\n <p class=\"small text-truncate-wrap\">\n <em\n class=\"text-muted\"\n *ngIf=\"!report.description; else showDescription\"\n >\n {{ 'No description available' | translate }}\n </em>\n <ng-template #showDescription>\n {{ report.description }}\n </ng-template>\n </p>\n </div>\n <div class=\"col-2 fit-h-20 m-t-xs-8\">\n <label\n class=\"c8y-switch c8y-switch--inline\"\n title=\"{{ 'Show in navigator' | translate }}\"\n >\n <input\n type=\"checkbox\"\n [ngModel]=\"!!report.c8y_IsNavigatorNode\" (ngModelChange)=\"report.c8y_IsNavigatorNode = $event\"\n (change)=\"update(report)\"\n />\n <span></span>\n <span class=\"visible-xs\">\n {{ 'Show in navigator' | translate }}\n </span>\n </label>\n </div>\n <div class=\"col-1 hidden-xs\">\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto d-flex\"\n [attr.aria-label]=\"'Remove report' | translate\"\n tooltip=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n <div class=\"visible-xs p-t-8 text-right\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"delete\"></i>\n {{ 'Remove report' | translate }}\n </button>\n </div>\n </c8y-li-body>\n </c8y-li>\n</c8y-list-group>\n\n<c8y-ui-empty-state\n [icon]=\"'c8y-reports'\"\n [title]=\"'There are no reports defined.' | translate\"\n [subtitle]=\"'Add a report first.' | translate\"\n *ngIf=\"(reports$ | async)?.data.length === 0\"\n>\n <p>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-empty-state-button'\"\n [disabled]=\"!canAddReport\"\n routerLink=\"/report/new-report\"\n >\n {{ 'Add report' | translate }}\n </button>\n </p>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-reports\">user documentation</a>\n .\n </small>\n </p>\n</c8y-ui-empty-state>\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CoreModule, hookNavigator, hookRoute, ViewContext } from '@c8y/ngx-components';\nimport {\n ContextDashboardComponent,\n ContextDashboardModule,\n CanDeactivateComponent,\n ContextDashboardManagedObject\n} from '@c8y/ngx-components/context-dashboard';\nimport { ReportDashboardGuard } from './report-dashboard.guard';\nimport { ReportDashboardNavigationFactory } from './report-dashboard-navigation.factory';\nimport { ReportDashboardListComponent } from './report-dashboard-list.component';\nimport { ReportDashboardService } from './report-dashboard.service';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\n\n@NgModule({\n declarations: [ReportDashboardListComponent],\n imports: [\n CoreModule,\n ContextDashboardModule,\n TooltipModule.forRoot(),\n RouterModule.forChild([\n {\n path: 'reports',\n component: ReportDashboardListComponent\n },\n {\n path: 'report/new-report',\n component: ContextDashboardComponent,\n canDeactivate: [(component: CanDeactivateComponent) => component.canDeactivate()],\n data: {\n dashboard: {\n c8y_Dashboard: null\n } as ContextDashboardManagedObject,\n isReport: true\n }\n }\n ]),\n PopoverModule\n ],\n providers: [\n ReportDashboardGuard,\n ReportDashboardService,\n hookRoute({\n path: 'dashboard/:dashboardId',\n component: ContextDashboardComponent,\n canActivate: [ReportDashboardGuard],\n canDeactivate: [(component: CanDeactivateComponent) => component.canDeactivate()],\n context: ViewContext.Report\n }),\n hookNavigator(ReportDashboardNavigationFactory)\n ]\n})\nexport class ReportDashboardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i2.ReportDashboardService","i5.ReportDashboardService"],"mappings":";;;;;;;;;;;;;;;;;;;;MAWa,oBAAoB,CAAA;AAC/B,IAAA,WAAA,CAAoB,uBAAgD,EAAA;QAAhD,IAAuB,CAAA,uBAAA,GAAvB,uBAAuB,CAAyB;KAAI;AAExE,IAAA,WAAW,CAAC,KAA6B,EAAA;AACvC,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACrE,OAAO,IAAI,CACT,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CACrF,CAAC,IAAI,CACJ,GAAG,CAAC,GAAG,IAAG;YACR,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;AAC3C,kBAAE,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC;AAC1C,kBAAE,EAAE,CAAC,IAAI,CAAC,CAAC;SACd,CAAC,CACH,CAAC;KACH;AAED,IAAA,yBAAyB,CAAC,QAAQ,EAAA;QAChC,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,uBAAuB;aAChC,MAAM,CAAC,YAAY,EAAE,SAAS,EAAE,CAAU,OAAA,EAAA,QAAQ,EAAE,CAAC;AACrD,aAAA,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;KACrB;8GArBU,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,uBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,q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;AACtB,wBAAA,SAAS,CAAC;AACR,4BAAA,IAAI,EAAE,wBAAwB;AAC9B,4BAAA,SAAS,EAAE,yBAAyB;4BACpC,WAAW,EAAE,CAAC,oBAAoB,CAAC;4BACnC,aAAa,EAAE,CAAC,CAAC,SAAiC,KAAK,SAAS,CAAC,aAAa,EAAE,CAAC;4BACjF,OAAO,EAAE,WAAW,CAAC,MAAM;yBAC5B,CAAC;wBACF,aAAa,CAAC,gCAAgC,CAAC;AAChD,qBAAA;AACF,iBAAA,CAAA;;;ACrDD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-report-dashboard.mjs","sources":["../../report-dashboard/report-dashboard.guard.ts","../../report-dashboard/report-dashboard.service.ts","../../report-dashboard/report-dashboard-navigation.factory.ts","../../report-dashboard/report-dashboard-list.component.ts","../../report-dashboard/report-dashboard-list.component.html","../../report-dashboard/report-dashboard.module.ts","../../report-dashboard/c8y-ngx-components-report-dashboard.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport {\n ContextDashboardService,\n ContextDashboardType\n} from '@c8y/ngx-components/context-dashboard';\nimport { tap } from 'rxjs/operators';\nimport { from, Observable, of } from 'rxjs';\nimport { Tab } from '@c8y/ngx-components';\n\n@Injectable({ providedIn: 'root' })\nexport class ReportDashboardGuard {\n constructor(private contextDashboardService: ContextDashboardService) {}\n\n canActivate(route: ActivatedRouteSnapshot): Observable<boolean | Tab[]> {\n const reportId = route.data.contextData && route.data.contextData.id;\n return from(\n this.contextDashboardService.activateDashboards(route, [ContextDashboardType.Named])\n ).pipe(\n tap(res => {\n return Array.isArray(res) && res.length === 0\n ? this.createDashboardIfNotExist(reportId)\n : of(true);\n })\n );\n }\n\n createDashboardIfNotExist(reportId) {\n const dashboardCfg = {};\n return this.contextDashboardService\n .create(dashboardCfg, undefined, `report_${reportId}`)\n .then(() => true);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { IManagedObject, InventoryService, QueriesUtil } from '@c8y/client';\nimport { NavigatorService } from '@c8y/ngx-components';\n\n@Injectable()\nexport class ReportDashboardService {\n private queriesUtil: QueriesUtil;\n constructor(\n private inventoryService: InventoryService,\n private navigatorService: NavigatorService\n ) {\n this.queriesUtil = new QueriesUtil();\n }\n\n listReports(options: { filter?: any; pageSize?: number } = {}) {\n let query = { __has: 'c8y_Report' };\n if (options.filter) {\n query = this.queriesUtil.addAndFilter(query, options.filter);\n }\n const filters = {\n query: this.queriesUtil.buildQuery(query),\n pageSize: options.pageSize || 50,\n withTotalPages: true\n };\n return this.inventoryService.list(filters);\n }\n\n removeNavigatorNode(report: IManagedObject) {\n this.navigatorService.state.forEach(node => {\n if (node.path === `reports/${report.id}`) {\n this.navigatorService.remove(node);\n return;\n }\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { IManagedObject } from '@c8y/client';\nimport { NavigatorNode, NavigatorService, gettext } from '@c8y/ngx-components';\nimport { ReportDashboardService } from './report-dashboard.service';\n\nconst REPORTS_NAVIGATOR_NODE_PRIORITY = 40;\n\n@Injectable({ providedIn: 'root' })\nexport class ReportDashboardNavigationFactory {\n loaded = false;\n\n constructor(\n private navigatorService: NavigatorService,\n private reportDashboardService: ReportDashboardService\n ) {}\n\n async get() {\n if (!this.loaded) {\n this.loaded = true;\n\n this.navigatorService.add(\n new NavigatorNode({\n label: gettext('Reports'),\n path: 'reports',\n icon: 'c8y-reports',\n featureId: 'reports',\n priority: REPORTS_NAVIGATOR_NODE_PRIORITY\n })\n );\n\n const reports: IManagedObject[] = (\n await this.reportDashboardService.listReports({\n filter: { __has: 'c8y_IsNavigatorNode' },\n pageSize: 2000\n })\n ).data;\n reports.forEach(report => {\n const node = new NavigatorNode({\n label: report.name,\n path: `reports/${report.id}`,\n icon: report.icon,\n priority: report.priority,\n routerLinkExact: false\n });\n this.navigatorService.add(node);\n });\n }\n }\n}\n","import { Component, OnInit, ViewChild } from '@angular/core';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport { IManagedObject, InventoryService, IResultList } from '@c8y/client';\nimport { debounceTime, distinctUntilChanged, shareReplay, switchMap, tap } from 'rxjs/operators';\nimport {\n AlertService,\n FilterInputComponent,\n GainsightService,\n gettext,\n ModalService,\n Permissions,\n Status\n} from '@c8y/ngx-components';\nimport {\n ContextDashboardType,\n ContextDashboardService,\n PRODUCT_EXPERIENCE\n} from '@c8y/ngx-components/context-dashboard';\nimport { TranslateService } from '@ngx-translate/core';\nimport { ReportDashboardService } from './report-dashboard.service';\n\n@Component({\n selector: 'c8y-report-dashboard-list',\n templateUrl: './report-dashboard-list.component.html'\n})\nexport class ReportDashboardListComponent implements OnInit {\n PRODUCT_EXPERIENCE = PRODUCT_EXPERIENCE;\n\n @ViewChild(FilterInputComponent, { static: false }) filter: FilterInputComponent;\n textFilter$: BehaviorSubject<string> = new BehaviorSubject('');\n reload$: BehaviorSubject<void> = new BehaviorSubject(null);\n reloading = false;\n reports$: Observable<IResultList<IManagedObject>> = combineLatest(\n this.textFilter$.pipe(debounceTime(400), distinctUntilChanged()),\n this.reload$\n ).pipe(\n tap(() => {\n this.reloading = true;\n }),\n switchMap(([text]) => this.loadReports(text)),\n tap(() => {\n this.reloading = false;\n }),\n shareReplay(1)\n );\n canAddReport = false;\n private readonly DELETED_SUCCESS_MSG = gettext('Report deleted.');\n\n constructor(\n private inventoryService: InventoryService,\n private contextDashboardService: ContextDashboardService,\n private translateService: TranslateService,\n private modal: ModalService,\n private alertService: AlertService,\n private reportDashboardService: ReportDashboardService,\n private permissions: Permissions,\n private gainsightService: GainsightService\n ) {}\n\n ngOnInit() {\n this.canAddReport = this.permissions.hasAnyRole([\n Permissions.ROLE_INVENTORY_CREATE,\n Permissions.ROLE_INVENTORY_ADMIN,\n Permissions.ROLE_MANAGED_OBJECT_ADMIN,\n Permissions.ROLE_MANAGED_OBJECT_CREATE\n ]);\n }\n\n async loadReports(partialName?: string) {\n return partialName\n ? this.reportDashboardService.listReports({ filter: { name: `*${partialName}*` } })\n : this.reportDashboardService.listReports();\n }\n\n async delete(report: IManagedObject) {\n try {\n const dashboard = await this.contextDashboardService\n .getDashboard$(`report_${report.id}`, [ContextDashboardType.Named])\n .toPromise();\n const isDashboardFrozen = !!dashboard?.c8y_Dashboard?.isFrozen;\n\n const msg = isDashboardFrozen\n ? gettext(\n `You are about to delete the report \"{{ reportName }}\". Be aware that the report has a locked dashboard assigned. Do you want to proceed?`\n )\n : gettext(`You are about to delete the report \"{{ reportName }}\". Do you want to proceed?`);\n\n await this.modal.confirm(\n gettext('Delete report'),\n this.translateService.instant(msg, {\n reportName: report.name\n }),\n Status.DANGER,\n {\n ok: gettext('Delete'),\n cancel: gettext('Cancel')\n }\n );\n\n await this.contextDashboardService.delete(dashboard, false);\n await this.inventoryService.delete(report.id);\n this.alertService.success(this.DELETED_SUCCESS_MSG);\n if (report.c8y_IsNavigatorNode) {\n this.reportDashboardService.removeNavigatorNode(report);\n }\n this.reload$.next();\n this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.DASHBOARD.EVENTS.REPORTS, {\n component: PRODUCT_EXPERIENCE.DASHBOARD.COMPONENTS.REPORTS_LIST,\n action: PRODUCT_EXPERIENCE.DASHBOARD.ACTIONS.DELETE,\n name: report.name,\n id: report.id,\n context: PRODUCT_EXPERIENCE.DASHBOARD.CONTEXT.REPORT\n });\n } catch (ex) {\n if (ex) {\n throw new Error(`Something went wrong: ${ex}`);\n }\n }\n }\n\n async update(report: IManagedObject) {\n report.c8y_IsNavigatorNode = report.c8y_IsNavigatorNode ? {} : null;\n await this.inventoryService.update(report);\n report.c8y_IsNavigatorNode\n ? this.contextDashboardService.addReportNavigatorNode(report)\n : this.reportDashboardService.removeNavigatorNode(report);\n }\n}\n","<c8y-title>\n {{ 'Reports' | translate }}\n</c8y-title>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"navbar-form\"\n>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n [attr.aria-label]=\"'Filter' | translate\"\n placeholder=\"{{ 'Filter…' | translate }}\"\n type=\"search\"\n [ngModel]=\"textFilter$ | async\"\n (ngModelChange)=\"textFilter$.next($event)\"\n />\n <span class=\"input-group-addon\">\n <i\n c8yIcon=\"search\"\n *ngIf=\"(textFilter$ | async).length === 0\"\n ></i>\n <i\n class=\"text-muted\"\n c8yIcon=\"times\"\n *ngIf=\"(textFilter$ | async).length > 0\"\n (click)=\"textFilter$.next('')\"\n px-event=\"Clear filtering reports\"\n ></i>\n </span>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-action-bar-button'\"\n routerLink=\"/report/new-report\"\n [disabled]=\"!canAddReport\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add report' | translate }}\n </button>\n <button\n class=\"btn btn-dot m-r-16\"\n aria-label=\"{{ 'Info' | translate }}\"\n popover=\"{{ 'You don\\'t have permission to add reports' | translate }}\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!canAddReport\"\n >\n <i\n class=\"text-primary\"\n [c8yIcon]=\"'info-circle'\"\n ></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Reload' | translate }}\"\n type=\"button\"\n (click)=\"loadReports()\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': reloading }\"\n ></i>\n {{ 'Reload' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-help src=\"/docs/cockpit/working-with-reports/#working-with-reports\"></c8y-help>\n\n<c8y-list-group>\n <c8y-li\n class=\"page-sticky-header hidden-xs hidden-sm\"\n *ngIf=\"(reports$ | async)?.data.length > 0\"\n >\n <c8y-li-icon>\n <i class=\"p-l-24\"></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n {{ 'Report' | translate }}\n </div>\n <div class=\"col-6\">\n {{ 'Description' | translate }}\n </div>\n <div class=\"col-2\">\n {{ 'Show in navigator' | translate }}\n </div>\n </c8y-li-body>\n </c8y-li>\n\n <c8y-li *c8yFor=\"let report of reports$; let i = index; loadMore: 'auto'\">\n <c8y-li-icon [icon]=\"report.icon\"></c8y-li-icon>\n <c8y-li-body class=\"content-flex-60\">\n <div class=\"col-3\">\n <button\n class=\"btn-clean\"\n title=\"{{ report.name }}\"\n type=\"button\"\n routerLink=\"/reports/{{ report.id }}\"\n >\n <span class=\"text-truncate\">\n {{ report.name }}\n </span>\n </button>\n </div>\n <div class=\"col-6\">\n <p class=\"small text-truncate-wrap\">\n <em\n class=\"text-muted\"\n *ngIf=\"!report.description; else showDescription\"\n >\n {{ 'No description available' | translate }}\n </em>\n <ng-template #showDescription>\n {{ report.description }}\n </ng-template>\n </p>\n </div>\n <div class=\"col-2 fit-h-20 m-t-xs-8\">\n <label\n class=\"c8y-switch c8y-switch--inline\"\n title=\"{{ 'Show in navigator' | translate }}\"\n >\n <input\n type=\"checkbox\"\n [ngModel]=\"!!report.c8y_IsNavigatorNode\" (ngModelChange)=\"report.c8y_IsNavigatorNode = $event\"\n (change)=\"update(report)\"\n />\n <span></span>\n <span class=\"visible-xs\">\n {{ 'Show in navigator' | translate }}\n </span>\n </label>\n </div>\n <div class=\"col-1 hidden-xs\">\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto d-flex\"\n [attr.aria-label]=\"'Remove report' | translate\"\n tooltip=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n <div class=\"visible-xs p-t-8 text-right\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Remove report' | translate }}\"\n type=\"button\"\n (click)=\"delete(report)\"\n >\n <i c8yIcon=\"delete\"></i>\n {{ 'Remove report' | translate }}\n </button>\n </div>\n </c8y-li-body>\n </c8y-li>\n</c8y-list-group>\n\n<c8y-ui-empty-state\n [icon]=\"'c8y-reports'\"\n [title]=\"'There are no reports defined.' | translate\"\n [subtitle]=\"'Add a report first.' | translate\"\n *ngIf=\"(reports$ | async)?.data.length === 0\"\n>\n <p>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Add report' | translate }}\"\n type=\"button\"\n [attr.data-cy]=\"'reports-add-report-empty-state-button'\"\n [disabled]=\"!canAddReport\"\n routerLink=\"/report/new-report\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.DASHBOARD.EVENTS.REPORTS\"\n [actionData]=\"{ action: PRODUCT_EXPERIENCE.DASHBOARD.ACTIONS.ADD_REPORT }\"\n >\n {{ 'Add report' | translate }}\n </button>\n </p>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-reports\">user documentation</a>\n .\n </small>\n </p>\n</c8y-ui-empty-state>\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CoreModule, hookNavigator, hookRoute, ViewContext } from '@c8y/ngx-components';\nimport {\n ContextDashboardComponent,\n ContextDashboardModule,\n CanDeactivateComponent,\n ContextDashboardManagedObject\n} from '@c8y/ngx-components/context-dashboard';\nimport { ReportDashboardGuard } from './report-dashboard.guard';\nimport { ReportDashboardNavigationFactory } from './report-dashboard-navigation.factory';\nimport { ReportDashboardListComponent } from './report-dashboard-list.component';\nimport { ReportDashboardService } from './report-dashboard.service';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\n\n@NgModule({\n declarations: [ReportDashboardListComponent],\n imports: [\n CoreModule,\n ContextDashboardModule,\n TooltipModule.forRoot(),\n RouterModule.forChild([\n {\n path: 'reports',\n component: ReportDashboardListComponent\n },\n {\n path: 'report/new-report',\n component: ContextDashboardComponent,\n canDeactivate: [(component: CanDeactivateComponent) => component.canDeactivate()],\n data: {\n dashboard: {\n c8y_Dashboard: null\n } as ContextDashboardManagedObject,\n isReport: true\n }\n }\n ]),\n PopoverModule\n ],\n providers: [\n ReportDashboardGuard,\n ReportDashboardService,\n hookRoute({\n path: 'dashboard/:dashboardId',\n component: ContextDashboardComponent,\n canActivate: [ReportDashboardGuard],\n canDeactivate: [(component: CanDeactivateComponent) => component.canDeactivate()],\n context: ViewContext.Report\n }),\n hookNavigator(ReportDashboardNavigationFactory)\n ]\n})\nexport class ReportDashboardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i2.ReportDashboardService","i5.ReportDashboardService"],"mappings":";;;;;;;;;;;;;;;;;;;;MAWa,oBAAoB,CAAA;AAC/B,IAAA,WAAA,CAAoB,uBAAgD,EAAA;QAAhD,IAAuB,CAAA,uBAAA,GAAvB,uBAAuB,CAAyB;KAAI;AAExE,IAAA,WAAW,CAAC,KAA6B,EAAA;AACvC,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACrE,OAAO,IAAI,CACT,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CACrF,CAAC,IAAI,CACJ,GAAG,CAAC,GAAG,IAAG;YACR,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;AAC3C,kBAAE,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC;AAC1C,kBAAE,EAAE,CAAC,IAAI,CAAC,CAAC;SACd,CAAC,CACH,CAAC;KACH;AAED,IAAA,yBAAyB,CAAC,QAAQ,EAAA;QAChC,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,uBAAuB;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ACP,UAAU;wBACV,sBAAsB;wBACtB,aAAa,CAAC,OAAO,EAAE;wBACvB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA;AACE,gCAAA,IAAI,EAAE,SAAS;AACf,gCAAA,SAAS,EAAE,4BAA4B;AACxC,6BAAA;AACD,4BAAA;AACE,gCAAA,IAAI,EAAE,mBAAmB;AACzB,gCAAA,SAAS,EAAE,yBAAyB;gCACpC,aAAa,EAAE,CAAC,CAAC,SAAiC,KAAK,SAAS,CAAC,aAAa,EAAE,CAAC;AACjF,gCAAA,IAAI,EAAE;AACJ,oCAAA,SAAS,EAAE;AACT,wCAAA,aAAa,EAAE,IAAI;AACa,qCAAA;AAClC,oCAAA,QAAQ,EAAE,IAAI;AACf,iCAAA;AACF,6BAAA;yBACF,CAAC;wBACF,aAAa;AACd,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,oBAAoB;wBACpB,sBAAsB;AACtB,wBAAA,SAAS,CAAC;AACR,4BAAA,IAAI,EAAE,wBAAwB;AAC9B,4BAAA,SAAS,EAAE,yBAAyB;4BACpC,WAAW,EAAE,CAAC,oBAAoB,CAAC;4BACnC,aAAa,EAAE,CAAC,CAAC,SAAiC,KAAK,SAAS,CAAC,aAAa,EAAE,CAAC;4BACjF,OAAO,EAAE,WAAW,CAAC,MAAM;yBAC5B,CAAC;wBACF,aAAa,CAAC,gCAAgC,CAAC;AAChD,qBAAA;AACF,iBAAA,CAAA;;;ACrDD;;AAEG;;;;"}
|
|
@@ -110,11 +110,12 @@ class TranslationStoreService {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
const langs = this.appState.state.langs;
|
|
114
|
+
for (const locale of langs) {
|
|
114
115
|
const fileName = `${locale}.json`;
|
|
115
116
|
filesToUpload.push({
|
|
116
117
|
path: fileName,
|
|
117
|
-
contents: new File([JSON.stringify({ [locale]: translationsPerLocale[locale] })], fileName)
|
|
118
|
+
contents: new File([JSON.stringify({ [locale]: translationsPerLocale[locale] || {} })], fileName)
|
|
118
119
|
});
|
|
119
120
|
}
|
|
120
121
|
const app = await this.getOrCreateTranslationApp();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-translation-editor-data.mjs","sources":["../../translation-editor/data/translation-store.service.ts","../../translation-editor/data/c8y-ngx-components-translation-editor-data.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n ApplicationAvailability,\n ApplicationService,\n ApplicationType,\n IApplication\n} from '@c8y/client';\nimport { AppStateService, ZipService } from '@c8y/ngx-components';\nimport { uniq } from 'lodash-es';\n\nexport interface TranslationLocale {\n label: string;\n locale: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TranslationStoreService {\n protected readonly translationAppName = 'User defined translations';\n protected readonly translationAppContextPath = 'user-defined-translations';\n\n constructor(\n private appService: ApplicationService,\n private appState: AppStateService,\n private zip: ZipService\n ) {}\n\n /**\n * Retrieves a list of available translations for the given locales from all the hosted apps available on the tenant.\n */\n async getAvailableTranslations(locales: string[]) {\n const { data: hostedApps } = await this.appService.list({\n tenant: this.appState.currentTenant.value.name,\n type: 'HOSTED',\n pageSize: 2000\n });\n\n const uniqueContextPaths = uniq(\n hostedApps\n .filter(app => app.contextPath && app.manifest?.webSdkVersion)\n .map(app => app.contextPath)\n );\n\n const translations: { [key: string]: { [locale: string]: string } } = {};\n for (const contextPath of uniqueContextPaths) {\n for (const locale of locales) {\n try {\n const translationsForLanguageAndApp = await this.getFileFromPath(\n `/apps/${contextPath}/${locale}.json`\n );\n for (const key of Object.keys(translationsForLanguageAndApp)) {\n if (!translations[key]) {\n translations[key] = {};\n }\n translations[key][locale] = translationsForLanguageAndApp[key];\n }\n } catch (e) {\n continue;\n }\n }\n }\n\n return translations;\n }\n\n /**\n * Retrieves the translations for the given locale from the translation app.\n */\n async getTranslationsForLocale<T extends string>(locale: T): Promise<{ [key: string]: string }> {\n try {\n const translations = await this.getFileFromTranslationApp(`${locale}.json`);\n if (translations[locale]) {\n return translations[locale];\n }\n } catch (e) {\n // do nothing.\n }\n return {};\n }\n\n /**\n * Retrieves the translations for the given locales from the translation app.\n */\n async loadTranslationsForLocales(locales: string[]): Promise<{\n [key: string]: {\n [key: string]: string;\n };\n }> {\n const translations: {\n [key: string]: { [key: string]: string };\n } = {};\n\n const loadAndAddLocale = async (locale: string) => {\n translations[locale] = await this.getTranslationsForLocale(locale);\n };\n\n await Promise.all(locales.map(loadAndAddLocale));\n\n return translations;\n }\n\n /**\n * Retrieves a combined list of translations for all the provided locales.\n * The locales are combined into a single object per key and an array of these objects is returned.\n */\n async getCombinedListOfTranslationsForPerKey(\n locales: string[]\n ): Promise<{ key: string; [locale: string]: string }[]> {\n const translations = await this.loadTranslationsForLocales(locales);\n const translationMap: { [key: string]: { [locale: string]: string } } = {};\n\n for (const locale of Object.keys(translations)) {\n for (const key of Object.keys(translations[locale])) {\n let translationsForKey = translationMap[key];\n if (!translationsForKey) {\n translationsForKey = {};\n translationMap[key] = translationsForKey;\n }\n\n translationsForKey[locale] = translations[locale][key];\n }\n }\n\n const keys = Object.keys(translationMap).sort((a, b) => a.localeCompare(b));\n\n return keys.map(key => Object.assign({ key }, translationMap[key]));\n }\n\n /**\n * Updates the files of the translation application with the provided translations.\n */\n async updateTranslations(\n translations: { key: string; [locale: string]: string }[]\n ): Promise<void> {\n const filesToUpload = new Array<{ path: string; contents: File }>();\n const translationsPerLocale: { [locale: string]: { [key: string]: string } } = {};\n for (const entry of translations) {\n const key = entry.key;\n for (const locale of Object.keys(entry)) {\n if (locale === 'key') {\n continue;\n }\n if (!translationsPerLocale[locale]) {\n translationsPerLocale[locale] = {};\n }\n\n if (entry[locale]) {\n translationsPerLocale[locale][key] = entry[locale];\n }\n }\n }\n\n for (const locale of Object.keys(translationsPerLocale)) {\n const fileName = `${locale}.json`;\n filesToUpload.push({\n path: fileName,\n contents: new File([JSON.stringify({ [locale]: translationsPerLocale[locale] })], fileName)\n });\n }\n const app = await this.getOrCreateTranslationApp();\n await this.appService.binary(app).updateFiles(filesToUpload);\n }\n\n /**\n * @returns The translation app for the current tenant. If it does not exist, it will be created.\n */\n async getOrCreateTranslationApp(): Promise<IApplication> {\n const { data: apps } = await this.appService.listByName(this.translationAppName);\n const ownApp = apps.find(\n app =>\n app.contextPath === this.translationAppContextPath &&\n app.owner.tenant.id === this.appState.currentTenant.value.name\n );\n if (ownApp) {\n return ownApp;\n }\n\n const { data: app } = await this.appService.create({\n name: this.translationAppName,\n contextPath: this.translationAppContextPath,\n key: `${this.translationAppContextPath}-app-key`,\n type: ApplicationType.HOSTED,\n availability: ApplicationAvailability.MARKET,\n config: {\n icon: {\n class: 'language1'\n }\n },\n noAppSwitcher: true,\n description: 'Providing user defined translations'\n });\n const zip = await this.zip.createZip([]);\n\n const { data: binary } = await this.appService.binary(app).upload(zip, 'translations.zip');\n const { data: updatedApp } = await this.appService.update({\n id: app.id,\n activeVersionId: binary.id as string\n });\n return updatedApp;\n }\n\n private async getFileFromTranslationApp(file: string) {\n return this.getFileFromPath(`/apps/public/${this.translationAppContextPath}/${file}`);\n }\n\n private async getFileFromPath(path: string) {\n const finalPath = `${path}?nocache=${Date.now()}`;\n const response = await fetch(finalPath);\n\n if (response.status !== 200) {\n throw new Error(`Failed to fetch file from ${path}`);\n }\n\n return response.json();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAkBa,uBAAuB,CAAA;AAIlC,IAAA,WAAA,CACU,UAA8B,EAC9B,QAAyB,EACzB,GAAe,EAAA;QAFf,IAAU,CAAA,UAAA,GAAV,UAAU,CAAoB;QAC9B,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAiB;QACzB,IAAG,CAAA,GAAA,GAAH,GAAG,CAAY;QANN,IAAkB,CAAA,kBAAA,GAAG,2BAA2B,CAAC;QACjD,IAAyB,CAAA,yBAAA,GAAG,2BAA2B,CAAC;KAMvE;AAEJ;;AAEG;IACH,M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EAAA,KAAA,EAAA,EAAA,CAAA,eAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cAFtB,MAAM,EAAA,CAAA,CAAA,EAAA;;2FAEP,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-translation-editor-data.mjs","sources":["../../translation-editor/data/translation-store.service.ts","../../translation-editor/data/c8y-ngx-components-translation-editor-data.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n ApplicationAvailability,\n ApplicationService,\n ApplicationType,\n IApplication\n} from '@c8y/client';\nimport { AppStateService, ZipService } from '@c8y/ngx-components';\nimport { uniq } from 'lodash-es';\n\nexport interface TranslationLocale {\n label: string;\n locale: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TranslationStoreService {\n protected readonly translationAppName = 'User defined translations';\n protected readonly translationAppContextPath = 'user-defined-translations';\n\n constructor(\n private appService: ApplicationService,\n private appState: AppStateService,\n private zip: ZipService\n ) {}\n\n /**\n * Retrieves a list of available translations for the given locales from all the hosted apps available on the tenant.\n */\n async getAvailableTranslations(locales: string[]) {\n const { data: hostedApps } = await this.appService.list({\n tenant: this.appState.currentTenant.value.name,\n type: 'HOSTED',\n pageSize: 2000\n });\n\n const uniqueContextPaths = uniq(\n hostedApps\n .filter(app => app.contextPath && app.manifest?.webSdkVersion)\n .map(app => app.contextPath)\n );\n\n const translations: { [key: string]: { [locale: string]: string } } = {};\n for (const contextPath of uniqueContextPaths) {\n for (const locale of locales) {\n try {\n const translationsForLanguageAndApp = await this.getFileFromPath(\n `/apps/${contextPath}/${locale}.json`\n );\n for (const key of Object.keys(translationsForLanguageAndApp)) {\n if (!translations[key]) {\n translations[key] = {};\n }\n translations[key][locale] = translationsForLanguageAndApp[key];\n }\n } catch (e) {\n continue;\n }\n }\n }\n\n return translations;\n }\n\n /**\n * Retrieves the translations for the given locale from the translation app.\n */\n async getTranslationsForLocale<T extends string>(locale: T): Promise<{ [key: string]: string }> {\n try {\n const translations = await this.getFileFromTranslationApp(`${locale}.json`);\n if (translations[locale]) {\n return translations[locale];\n }\n } catch (e) {\n // do nothing.\n }\n return {};\n }\n\n /**\n * Retrieves the translations for the given locales from the translation app.\n */\n async loadTranslationsForLocales(locales: string[]): Promise<{\n [key: string]: {\n [key: string]: string;\n };\n }> {\n const translations: {\n [key: string]: { [key: string]: string };\n } = {};\n\n const loadAndAddLocale = async (locale: string) => {\n translations[locale] = await this.getTranslationsForLocale(locale);\n };\n\n await Promise.all(locales.map(loadAndAddLocale));\n\n return translations;\n }\n\n /**\n * Retrieves a combined list of translations for all the provided locales.\n * The locales are combined into a single object per key and an array of these objects is returned.\n */\n async getCombinedListOfTranslationsForPerKey(\n locales: string[]\n ): Promise<{ key: string; [locale: string]: string }[]> {\n const translations = await this.loadTranslationsForLocales(locales);\n const translationMap: { [key: string]: { [locale: string]: string } } = {};\n\n for (const locale of Object.keys(translations)) {\n for (const key of Object.keys(translations[locale])) {\n let translationsForKey = translationMap[key];\n if (!translationsForKey) {\n translationsForKey = {};\n translationMap[key] = translationsForKey;\n }\n\n translationsForKey[locale] = translations[locale][key];\n }\n }\n\n const keys = Object.keys(translationMap).sort((a, b) => a.localeCompare(b));\n\n return keys.map(key => Object.assign({ key }, translationMap[key]));\n }\n\n /**\n * Updates the files of the translation application with the provided translations.\n */\n async updateTranslations(\n translations: { key: string; [locale: string]: string }[]\n ): Promise<void> {\n const filesToUpload = new Array<{ path: string; contents: File }>();\n const translationsPerLocale: { [locale: string]: { [key: string]: string } } = {};\n for (const entry of translations) {\n const key = entry.key;\n for (const locale of Object.keys(entry)) {\n if (locale === 'key') {\n continue;\n }\n if (!translationsPerLocale[locale]) {\n translationsPerLocale[locale] = {};\n }\n\n if (entry[locale]) {\n translationsPerLocale[locale][key] = entry[locale];\n }\n }\n }\n\n const langs = this.appState.state.langs as string[];\n\n for (const locale of langs) {\n const fileName = `${locale}.json`;\n filesToUpload.push({\n path: fileName,\n contents: new File(\n [JSON.stringify({ [locale]: translationsPerLocale[locale] || {} })],\n fileName\n )\n });\n }\n const app = await this.getOrCreateTranslationApp();\n await this.appService.binary(app).updateFiles(filesToUpload);\n }\n\n /**\n * @returns The translation app for the current tenant. If it does not exist, it will be created.\n */\n async getOrCreateTranslationApp(): Promise<IApplication> {\n const { data: apps } = await this.appService.listByName(this.translationAppName);\n const ownApp = apps.find(\n app =>\n app.contextPath === this.translationAppContextPath &&\n app.owner.tenant.id === this.appState.currentTenant.value.name\n );\n if (ownApp) {\n return ownApp;\n }\n\n const { data: app } = await this.appService.create({\n name: this.translationAppName,\n contextPath: this.translationAppContextPath,\n key: `${this.translationAppContextPath}-app-key`,\n type: ApplicationType.HOSTED,\n availability: ApplicationAvailability.MARKET,\n config: {\n icon: {\n class: 'language1'\n }\n },\n noAppSwitcher: true,\n description: 'Providing user defined translations'\n });\n const zip = await this.zip.createZip([]);\n\n const { data: binary } = await this.appService.binary(app).upload(zip, 'translations.zip');\n const { data: updatedApp } = await this.appService.update({\n id: app.id,\n activeVersionId: binary.id as string\n });\n return updatedApp;\n }\n\n private async getFileFromTranslationApp(file: string) {\n return this.getFileFromPath(`/apps/public/${this.translationAppContextPath}/${file}`);\n }\n\n private async getFileFromPath(path: string) {\n const finalPath = `${path}?nocache=${Date.now()}`;\n const response = await fetch(finalPath);\n\n if (response.status !== 200) {\n throw new Error(`Failed to fetch file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ENT: 'right-drawer' },
|
|
10864
|
-
ACTIONS: {
|
|
10864
|
+
ACTIONS: {
|
|
10865
|
+
ACTIVATE_SUPPORT_ACCESS: 'activateSupportAccess',
|
|
10866
|
+
DEACTIVATE_SUPPORT_ACCESS: 'deactivateSupportAccess',
|
|
10867
|
+
OPEN_SUPPORT_LINK: 'openSupportLink'
|
|
10868
|
+
},
|
|
10865
10869
|
RESULTS: {}
|
|
10866
10870
|
}
|
|
10867
10871
|
};
|
|
@@ -25273,11 +25277,11 @@ class SupportOutletComponent {
|
|
|
25273
25277
|
this.ui.currentUser.next(currentUserResult.data);
|
|
25274
25278
|
}
|
|
25275
25279
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: SupportOutletComponent, deps: [{ token: AppStateService }, { token: OptionsService }, { token: ModalService }, { token: i1$1.TranslateService }, { token: i1.TenantService }, { token: AlertService }, { token: i1.UserService }, { token: HeaderService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
25276
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: SupportOutletComponent, selector: "c8y-support-outlet", ngImport: i0, template: "<button\n class=\"c8y-right-drawer__link sticky-top\"\n [tabindex]=\"tabIndex$ | async\"\n type=\"button\"\n (click)=\"isCollapsed = !isCollapsed\"\n *ngIf=\"isCollapsible\"\n>\n <i c8yIcon=\"c8y-c8y-support\"></i>\n <span class=\"text-bold\">{{ 'Support' | translate }}</span>\n <i\n class=\"m-l-auto\"\n c8yIcon=\"angle-up\"\n [ngClass]=\"{ 'icon-rotate-180': isCollapsed }\"\n ></i>\n</button>\n<div\n class=\"collapse\"\n id=\"collapseSupport\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"true\"\n>\n <button\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Activate support access' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n *ngIf=\"!(supportUserEnabled$ | async) && userSupportAvailable\"\n (click)=\"activateSupportAccess()\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Activate support access' | translate }}\"\n >\n {{ 'Activate support access' | translate }}\n </span>\n </button>\n <button\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Deactivate support access' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n *ngIf=\"(supportUserEnabled$ | async) && userSupportAvailable\"\n (click)=\"deactivateSupportAccess()\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Deactivate support access' | translate }}\"\n >\n {{ 'Deactivate support access' | translate }}\n </span>\n </button>\n <a\n class=\"c8y-right-drawer__link\"\n
|
|
25280
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: SupportOutletComponent, selector: "c8y-support-outlet", ngImport: i0, template: "<button\n class=\"c8y-right-drawer__link sticky-top\"\n [tabindex]=\"tabIndex$ | async\"\n type=\"button\"\n (click)=\"isCollapsed = !isCollapsed\"\n *ngIf=\"isCollapsible\"\n>\n <i c8yIcon=\"c8y-c8y-support\"></i>\n <span class=\"text-bold\">{{ 'Support' | translate }}</span>\n <i\n class=\"m-l-auto\"\n c8yIcon=\"angle-up\"\n [ngClass]=\"{ 'icon-rotate-180': isCollapsed }\"\n ></i>\n</button>\n<div\n class=\"collapse\"\n id=\"collapseSupport\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"true\"\n>\n <button\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Activate support access' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n *ngIf=\"!(supportUserEnabled$ | async) && userSupportAvailable\"\n (click)=\"activateSupportAccess()\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n [actionData]=\"{ action: PRODUCT_EXPERIENCE.QUICK_LINKS.ACTIONS.ACTIVATE_SUPPORT_ACCESS }\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Activate support access' | translate }}\"\n >\n {{ 'Activate support access' | translate }}\n </span>\n </button>\n <button\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Deactivate support access' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n *ngIf=\"(supportUserEnabled$ | async) && userSupportAvailable\"\n (click)=\"deactivateSupportAccess()\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n [actionData]=\"{ action: PRODUCT_EXPERIENCE.QUICK_LINKS.ACTIONS.DEACTIVATE_SUPPORT_ACCESS }\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Deactivate support access' | translate }}\"\n >\n {{ 'Deactivate support access' | translate }}\n </span>\n </button>\n <a\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Request support' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n role=\"button\"\n target=\"_blank\"\n [ngClass]=\"{ 'separator-top': !isCollapsible }\"\n *ngIf=\"supportUrl\"\n rel=\"noopener noreferrer\"\n [href]=\"supportUrl\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n [actionData]=\"{ action: PRODUCT_EXPERIENCE.QUICK_LINKS.ACTIONS.OPEN_SUPPORT_LINK }\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Request support' | translate }}\"\n >\n {{ 'Request support' | translate }}\n </span>\n </a>\n</div>\n", dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$6.CollapseDirective, selector: "[collapse]", inputs: ["display", "isAnimated", "collapse"], outputs: ["collapsed", "collapses", "expanded", "expands"], exportAs: ["bs-collapse"] }, { kind: "directive", type: ProductExperienceDirective, selector: "[c8yProductExperience]", inputs: ["actionName", "actionData", "inherit", "suppressDataOverriding"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] }); }
|
|
25277
25281
|
}
|
|
25278
25282
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: SupportOutletComponent, decorators: [{
|
|
25279
25283
|
type: Component,
|
|
25280
|
-
args: [{ selector: 'c8y-support-outlet', template: "<button\n class=\"c8y-right-drawer__link sticky-top\"\n [tabindex]=\"tabIndex$ | async\"\n type=\"button\"\n (click)=\"isCollapsed = !isCollapsed\"\n *ngIf=\"isCollapsible\"\n>\n <i c8yIcon=\"c8y-c8y-support\"></i>\n <span class=\"text-bold\">{{ 'Support' | translate }}</span>\n <i\n class=\"m-l-auto\"\n c8yIcon=\"angle-up\"\n [ngClass]=\"{ 'icon-rotate-180': isCollapsed }\"\n ></i>\n</button>\n<div\n class=\"collapse\"\n id=\"collapseSupport\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"true\"\n>\n <button\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Activate support access' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n *ngIf=\"!(supportUserEnabled$ | async) && userSupportAvailable\"\n (click)=\"activateSupportAccess()\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Activate support access' | translate }}\"\n >\n {{ 'Activate support access' | translate }}\n </span>\n </button>\n <button\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Deactivate support access' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n *ngIf=\"(supportUserEnabled$ | async) && userSupportAvailable\"\n (click)=\"deactivateSupportAccess()\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Deactivate support access' | translate }}\"\n >\n {{ 'Deactivate support access' | translate }}\n </span>\n </button>\n <a\n class=\"c8y-right-drawer__link\"\n
|
|
25284
|
+
args: [{ selector: 'c8y-support-outlet', template: "<button\n class=\"c8y-right-drawer__link sticky-top\"\n [tabindex]=\"tabIndex$ | async\"\n type=\"button\"\n (click)=\"isCollapsed = !isCollapsed\"\n *ngIf=\"isCollapsible\"\n>\n <i c8yIcon=\"c8y-c8y-support\"></i>\n <span class=\"text-bold\">{{ 'Support' | translate }}</span>\n <i\n class=\"m-l-auto\"\n c8yIcon=\"angle-up\"\n [ngClass]=\"{ 'icon-rotate-180': isCollapsed }\"\n ></i>\n</button>\n<div\n class=\"collapse\"\n id=\"collapseSupport\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"true\"\n>\n <button\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Activate support access' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n *ngIf=\"!(supportUserEnabled$ | async) && userSupportAvailable\"\n (click)=\"activateSupportAccess()\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n [actionData]=\"{ action: PRODUCT_EXPERIENCE.QUICK_LINKS.ACTIONS.ACTIVATE_SUPPORT_ACCESS }\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Activate support access' | translate }}\"\n >\n {{ 'Activate support access' | translate }}\n </span>\n </button>\n <button\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Deactivate support access' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n *ngIf=\"(supportUserEnabled$ | async) && userSupportAvailable\"\n (click)=\"deactivateSupportAccess()\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n [actionData]=\"{ action: PRODUCT_EXPERIENCE.QUICK_LINKS.ACTIONS.DEACTIVATE_SUPPORT_ACCESS }\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Deactivate support access' | translate }}\"\n >\n {{ 'Deactivate support access' | translate }}\n </span>\n </button>\n <a\n class=\"c8y-right-drawer__link\"\n title=\"{{ 'Request support' | translate }}\"\n [tabindex]=\"tabIndex$ | async\"\n role=\"button\"\n target=\"_blank\"\n [ngClass]=\"{ 'separator-top': !isCollapsible }\"\n *ngIf=\"supportUrl\"\n rel=\"noopener noreferrer\"\n [href]=\"supportUrl\"\n c8yProductExperience\n [actionName]=\"PRODUCT_EXPERIENCE.QUICK_LINKS.EVENTS.QUICK_LINK_RIGHT_DRAWER\"\n [actionData]=\"{ action: PRODUCT_EXPERIENCE.QUICK_LINKS.ACTIONS.OPEN_SUPPORT_LINK }\"\n >\n <i\n c8yIcon=\"c8y-c8y-support\"\n *ngIf=\"!isCollapsible\"\n ></i>\n <span\n [class]=\"textClass\"\n title=\"{{ 'Request support' | translate }}\"\n >\n {{ 'Request support' | translate }}\n </span>\n </a>\n</div>\n" }]
|
|
25281
25285
|
}], ctorParameters: () => [{ type: AppStateService }, { type: OptionsService }, { type: ModalService }, { type: i1$1.TranslateService }, { type: i1.TenantService }, { type: AlertService }, { type: i1.UserService }, { type: HeaderService }] });
|
|
25282
25286
|
|
|
25283
25287
|
class SupportOutletModule {
|