@c8y/ngx-components 1017.0.146 → 1017.0.148

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -440,11 +440,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
440
440
  }], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: i2.InventoryService }, { type: i1.AppStateService }, { type: i2.UserService }, { type: i5.AssetNodeService }, { type: i2.SmartGroupsService }, { type: i2.SmartRulesService }, { type: i1.AlertService }, { type: i1.Permissions }, { type: i1.AssetTypesService }, { type: i1.UserPreferencesService }]; } });
441
441
 
442
442
  class AddGroupComponent {
443
- constructor(fb, addGroupService, alert, subAssetsService) {
443
+ constructor(fb, addGroupService, alert, subAssetsService, permissionsService) {
444
444
  this.fb = fb;
445
445
  this.addGroupService = addGroupService;
446
446
  this.alert = alert;
447
447
  this.subAssetsService = subAssetsService;
448
+ this.permissionsService = permissionsService;
448
449
  this.refresh = new EventEmitter();
449
450
  this.onDeviceQueryStringChange = new EventEmitter();
450
451
  this.onCancel = new EventEmitter();
@@ -478,7 +479,12 @@ class AddGroupComponent {
478
479
  description: ['']
479
480
  });
480
481
  this.subscription = this.onCancel.subscribe(() => this.resetStepper());
481
- this.canCreateGroup = this.subAssetsService.canCreateGroup();
482
+ this.canCreateGroup =
483
+ this.subAssetsService.canCreateGroup() ||
484
+ (yield this.permissionsService.canEdit([], { id: this.currentGroupId }, {
485
+ skipOwnerCheck: true,
486
+ skipRolesCheck: true
487
+ }));
482
488
  this.canAssignDevice = yield this.subAssetsService.canAssignDevice({
483
489
  id: this.currentGroupId
484
490
  });
@@ -528,12 +534,12 @@ class AddGroupComponent {
528
534
  }
529
535
  }
530
536
  }
531
- AddGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AddGroupComponent, deps: [{ token: i1$2.FormBuilder }, { token: AddGroupService }, { token: i1.AlertService }, { token: SubAssetsService }], target: i0.ɵɵFactoryTarget.Component });
537
+ AddGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AddGroupComponent, deps: [{ token: i1$2.FormBuilder }, { token: AddGroupService }, { token: i1.AlertService }, { token: SubAssetsService }, { token: i1.Permissions }], target: i0.ɵɵFactoryTarget.Component });
532
538
  AddGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: AddGroupComponent, selector: "c8y-add-group", inputs: { currentGroupId: "currentGroupId", refresh: "refresh" }, outputs: { onDeviceQueryStringChange: "onDeviceQueryStringChange", onCancel: "onCancel" }, host: { listeners: { "document:keydown.enter": "onEnterKeyDown($event)", "document:keydown.escape": "onEscapeKeyDown($event)" } }, viewQueries: [{ propertyName: "stepper", first: true, predicate: C8yStepper, descendants: true }, { propertyName: "nameInputRef", first: true, predicate: ["nameRef"], descendants: true }], ngImport: i0, template: "<c8y-title *ngIf=\"!currentGroupId\">\n {{ 'Add group' | translate }}\n</c8y-title>\n\n<div class=\"d-contents\" *ngIf=\"!currentGroupId; else stepper\">\n <ng-container [ngTemplateOutlet]=\"stepper\"></ng-container>\n</div>\n\n<ng-template #stepper>\n <c8y-stepper\n class=\"d-col flex-nowrap no-align-items fit-h c8y-stepper--no-btns\"\n [disableDefaultIcons]=\"{ edit: true, done: false }\"\n [customClasses]=\"['col-md-6', 'col-md-offset-3', 'm-t-24', 'm-b-40', 'p-0', 'flex-no-shrink']\"\n linear\n >\n <cdk-step [stepControl]=\"formGroupStepOne\" [label]=\"'New group' | translate\">\n <div class=\"p-16 p-t-0 flex-no-shrink separator-bottom col-xs-12\">\n <div class=\"row\">\n <div class=\"col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4\">\n <div class=\"h4 text-center text-medium\">\n {{ 'New group' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 flex-grow no-gutter\">\n <div class=\"card-inner-scroll fit-h\">\n <div class=\"card-block p-b-0\">\n <div class=\"row\">\n <div class=\"col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4\">\n <c8y-form-group [novalidation]=\"true\">\n <div [formGroup]=\"formGroupStepOne\">\n <c8y-form-group>\n <label translate>Name</label>\n <input\n class=\"form-control\"\n type=\"text\"\n formControlName=\"name\"\n placeholder=\"{{ 'e.g. First floor' | translate }} \"\n maxlength=\"254\"\n #nameRef\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Description</label>\n <input\n class=\"form-control\"\n type=\"text\"\n formControlName=\"description\"\n placeholder=\"{{ 'e.g. first floor devices' | translate }}\"\n />\n </c8y-form-group>\n </div>\n </c8y-form-group>\n <c8y-form-group>\n <div [formGroup]=\"formGroupStepOne\"></div>\n </c8y-form-group>\n <div class=\"alert alert-info max-width-100\" translate *ngIf=\"!canAssignDevice\">\n You don't have permission to assign devices.\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <c8y-stepper-buttons\n class=\"d-block card-footer p-24 separator\"\n (onCancel)=\"onCancel.emit()\"\n (onCustom)=\"createGroup()\"\n [disabled]=\"!canCreateGroup\"\n [labels]=\"\n canAssignDevice\n ? { next: btnLabels.next, cancel: btnLabels.cancel }\n : { custom: btnLabels.create, cancel: btnLabels.cancel }\n \"\n [showButtons]=\"\n canAssignDevice ? { next: true, cancel: true } : { custom: true, cancel: true }\n \"\n ></c8y-stepper-buttons>\n </cdk-step>\n <cdk-step [label]=\"'Assign devices' | translate\">\n <div class=\"p-16 p-t-0 flex-no-shrink separator-bottom col-xs-12\">\n <div class=\"row\">\n <div class=\"col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4\">\n <div class=\"h4 text-center text-medium\">\n {{ 'Assign devices' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 no-gutter flex-grow\">\n <c8y-device-grid\n [title]=\"'Select target devices' | translate\"\n [actionControls]=\"[]\"\n [infiniteScroll]=\"'auto'\"\n [selectable]=\"true\"\n [pagination]=\"pagination\"\n (itemsSelect)=\"onSelected($event)\"\n [refresh]=\"refresh\"\n c8yProductExperience\n [actionName]=\"'subAssetsAddGroup'\"\n ></c8y-device-grid>\n </div>\n <c8y-stepper-buttons\n class=\"d-block card-footer p-24 separator\"\n (onCancel)=\"onCancel.emit()\"\n (onCustom)=\"createGroup()\"\n [labels]=\"{ custom: btnLabels.create }\"\n [disabled]=\"!canAssignDevice\"\n [pending]=\"pendingStatus\"\n ></c8y-stepper-buttons>\n </cdk-step>\n </c8y-stepper>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i1.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "directive", type: i1$2.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: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "component", type: i1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: i1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "component", type: i1.C8yStepper, selector: "c8y-stepper", inputs: ["disableDefaultIcons", "disableProgressButtons", "customClasses", "hideStepProgress", "useStepLabelsAsTitlesOnly"], outputs: ["onStepChange"] }, { kind: "component", type: i6.CdkStep, selector: "cdk-step", inputs: ["stepControl", "label", "errorMessage", "aria-label", "aria-labelledby", "state", "editable", "optional", "completed", "hasError"], outputs: ["interacted"], exportAs: ["cdkStep"] }, { kind: "component", type: i1.C8yStepperButtons, selector: "c8y-stepper-buttons", inputs: ["labels", "pending", "disabled", "showButtons"], outputs: ["onCancel", "onNext", "onBack", "onCustom"] }, { kind: "directive", type: i1.ProductExperienceDirective, selector: "[c8yProductExperience]", inputs: ["actionName", "actionData", "inherit"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4$1.DeviceGridComponent, selector: "c8y-device-grid", inputs: ["dataCallback", "refresh", "title", "loadMoreItemsLabel", "loadingItemsLabel", "legacyConfigKey", "legacyFilterKey", "columns", "pagination", "infiniteScroll", "actionControls", "selectable", "baseQuery", "bulkActionControls", "headerActionControls", "childDeviceGrid", "parentDeviceId", "withChildren", "showSearch"], outputs: ["onColumnsChange", "onFilterChange", "onDeviceQueryStringChange", "itemsSelect"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }] });
533
539
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AddGroupComponent, decorators: [{
534
540
  type: Component,
535
541
  args: [{ selector: 'c8y-add-group', template: "<c8y-title *ngIf=\"!currentGroupId\">\n {{ 'Add group' | translate }}\n</c8y-title>\n\n<div class=\"d-contents\" *ngIf=\"!currentGroupId; else stepper\">\n <ng-container [ngTemplateOutlet]=\"stepper\"></ng-container>\n</div>\n\n<ng-template #stepper>\n <c8y-stepper\n class=\"d-col flex-nowrap no-align-items fit-h c8y-stepper--no-btns\"\n [disableDefaultIcons]=\"{ edit: true, done: false }\"\n [customClasses]=\"['col-md-6', 'col-md-offset-3', 'm-t-24', 'm-b-40', 'p-0', 'flex-no-shrink']\"\n linear\n >\n <cdk-step [stepControl]=\"formGroupStepOne\" [label]=\"'New group' | translate\">\n <div class=\"p-16 p-t-0 flex-no-shrink separator-bottom col-xs-12\">\n <div class=\"row\">\n <div class=\"col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4\">\n <div class=\"h4 text-center text-medium\">\n {{ 'New group' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 flex-grow no-gutter\">\n <div class=\"card-inner-scroll fit-h\">\n <div class=\"card-block p-b-0\">\n <div class=\"row\">\n <div class=\"col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4\">\n <c8y-form-group [novalidation]=\"true\">\n <div [formGroup]=\"formGroupStepOne\">\n <c8y-form-group>\n <label translate>Name</label>\n <input\n class=\"form-control\"\n type=\"text\"\n formControlName=\"name\"\n placeholder=\"{{ 'e.g. First floor' | translate }} \"\n maxlength=\"254\"\n #nameRef\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Description</label>\n <input\n class=\"form-control\"\n type=\"text\"\n formControlName=\"description\"\n placeholder=\"{{ 'e.g. first floor devices' | translate }}\"\n />\n </c8y-form-group>\n </div>\n </c8y-form-group>\n <c8y-form-group>\n <div [formGroup]=\"formGroupStepOne\"></div>\n </c8y-form-group>\n <div class=\"alert alert-info max-width-100\" translate *ngIf=\"!canAssignDevice\">\n You don't have permission to assign devices.\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <c8y-stepper-buttons\n class=\"d-block card-footer p-24 separator\"\n (onCancel)=\"onCancel.emit()\"\n (onCustom)=\"createGroup()\"\n [disabled]=\"!canCreateGroup\"\n [labels]=\"\n canAssignDevice\n ? { next: btnLabels.next, cancel: btnLabels.cancel }\n : { custom: btnLabels.create, cancel: btnLabels.cancel }\n \"\n [showButtons]=\"\n canAssignDevice ? { next: true, cancel: true } : { custom: true, cancel: true }\n \"\n ></c8y-stepper-buttons>\n </cdk-step>\n <cdk-step [label]=\"'Assign devices' | translate\">\n <div class=\"p-16 p-t-0 flex-no-shrink separator-bottom col-xs-12\">\n <div class=\"row\">\n <div class=\"col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4\">\n <div class=\"h4 text-center text-medium\">\n {{ 'Assign devices' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 no-gutter flex-grow\">\n <c8y-device-grid\n [title]=\"'Select target devices' | translate\"\n [actionControls]=\"[]\"\n [infiniteScroll]=\"'auto'\"\n [selectable]=\"true\"\n [pagination]=\"pagination\"\n (itemsSelect)=\"onSelected($event)\"\n [refresh]=\"refresh\"\n c8yProductExperience\n [actionName]=\"'subAssetsAddGroup'\"\n ></c8y-device-grid>\n </div>\n <c8y-stepper-buttons\n class=\"d-block card-footer p-24 separator\"\n (onCancel)=\"onCancel.emit()\"\n (onCustom)=\"createGroup()\"\n [labels]=\"{ custom: btnLabels.create }\"\n [disabled]=\"!canAssignDevice\"\n [pending]=\"pendingStatus\"\n ></c8y-stepper-buttons>\n </cdk-step>\n </c8y-stepper>\n</ng-template>\n" }]
536
- }], ctorParameters: function () { return [{ type: i1$2.FormBuilder }, { type: AddGroupService }, { type: i1.AlertService }, { type: SubAssetsService }]; }, propDecorators: { currentGroupId: [{
542
+ }], ctorParameters: function () { return [{ type: i1$2.FormBuilder }, { type: AddGroupService }, { type: i1.AlertService }, { type: SubAssetsService }, { type: i1.Permissions }]; }, propDecorators: { currentGroupId: [{
537
543
  type: Input
538
544
  }], refresh: [{
539
545
  type: Input
@@ -1638,10 +1644,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
1638
1644
  }], ctorParameters: function () { return [{ type: i1.Permissions }, { type: SubAssetsService }]; } });
1639
1645
 
1640
1646
  class SubAssetsComponent {
1641
- constructor(route, subAssetsService, contextRouteService) {
1647
+ constructor(route, subAssetsService, contextRouteService, permissionsService) {
1642
1648
  this.route = route;
1643
1649
  this.subAssetsService = subAssetsService;
1644
1650
  this.contextRouteService = contextRouteService;
1651
+ this.permissionsService = permissionsService;
1645
1652
  this.toggle = false;
1646
1653
  this.showAddGroup = false;
1647
1654
  this.showAssignDevices = false;
@@ -1671,7 +1678,10 @@ class SubAssetsComponent {
1671
1678
  this.group = Object.assign({}, contextData);
1672
1679
  this.title = this.group.name;
1673
1680
  this.currentGroupId = this.group.id;
1674
- this.shouldDisableAddGroup = !this.subAssetsService.canCreateGroup();
1681
+ this.shouldDisableAddGroup = !(yield this.permissionsService.canEdit([], this.group, {
1682
+ skipOwnerCheck: true,
1683
+ skipRolesCheck: true
1684
+ }));
1675
1685
  this.shouldDisableAssignDevices = !(yield this.subAssetsService.canAssignDevice(this.group));
1676
1686
  this.customProperties = yield this.subAssetsService.getCustomProperties(this.group);
1677
1687
  this.shouldShowAssetsProperties = this.customProperties.length > 0;
@@ -1693,12 +1703,12 @@ class SubAssetsComponent {
1693
1703
  }
1694
1704
  }
1695
1705
  }
1696
- SubAssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubAssetsComponent, deps: [{ token: i3$1.ActivatedRoute }, { token: SubAssetsService }, { token: i1.ContextRouteService }], target: i0.ɵɵFactoryTarget.Component });
1706
+ SubAssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubAssetsComponent, deps: [{ token: i3$1.ActivatedRoute }, { token: SubAssetsService }, { token: i1.ContextRouteService }, { token: i1.Permissions }], target: i0.ɵɵFactoryTarget.Component });
1697
1707
  SubAssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SubAssetsComponent, selector: "c8y-sub-assets", ngImport: i0, template: "<c8y-title>\n {{ title }}\n</c8y-title>\n\n<c8y-action-bar-item [placement]=\"'right'\" *ngIf=\"!isSmartGroup()\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Add group' | translate }}\"\n (click)=\"showAddGroup = !showAddGroup\"\n [disabled]=\"shouldDisableAddGroup\"\n >\n <i c8yIcon=\"plus-circle\" class=\"m-r-4\"></i>\n <span translate>Add group</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\" *ngIf=\"!isSmartGroup()\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Assign devices' | translate }}\"\n (click)=\"showAssignDevices = !showAssignDevices\"\n [disabled]=\"shouldDisableAssignDevices\"\n >\n <i c8yIcon=\"plus-circle\" class=\"m-r-4\"></i>\n <span translate>Assign devices</span>\n </button>\n</c8y-action-bar-item>\n\n<div\n class=\"card content-fullpage\"\n [ngClass]=\"{\n 'card--grid grid__col--8-4--md grid__row--fit-auto': shouldShowAssetsProperties,\n 'd-flex d-col': !shouldShowAssetsProperties\n }\"\n>\n <c8y-group-info\n [group]=\"group\"\n (groupChange)=\"groupChange($event)\"\n class=\"grid__col--fullspan\"\n ></c8y-group-info>\n <c8y-sub-assets-grid\n [refresh]=\"refresh\"\n [parent-group]=\"group\"\n [filterable]=\"filterable\"\n [displayOptions]=\"displayOptions\"\n [columnsConfigKey]=\"'sub-assets-grid'\"\n class=\"d-contents\"\n ></c8y-sub-assets-grid>\n <div class=\"inner-scroll bg-level-1\" *ngIf=\"shouldShowAssetsProperties\">\n <c8y-asset-properties\n [properties]=\"customProperties\"\n [asset]=\"group\"\n (assetChange)=\"groupChange($event)\"\n class=\"d-contents\"\n ></c8y-asset-properties>\n </div>\n</div>\n\n<div [ngClass]=\"{ drawerOpen: showAddGroup }\">\n <div class=\"bottom-drawer\">\n <c8y-add-group\n [currentGroupId]=\"currentGroupId\"\n [refresh]=\"refresh\"\n (onCancel)=\"showAddGroup = false\"\n *ngIf=\"showAddGroup\"\n ></c8y-add-group>\n </div>\n</div>\n\n<div [ngClass]=\"{ drawerOpen: showAssignDevices }\">\n <div class=\"bottom-drawer\">\n <div class=\"d-flex d-col no-align-items fit-h\">\n <c8y-assign-devices\n class=\"d-contents\"\n (onCancel)=\"showAssignDevices = false\"\n [refresh]=\"refresh\"\n [currentGroupId]=\"currentGroupId\"\n (onShowChildDevices)=\"showAssignChildDevices = $event\"\n (selectedDevice)=\"showChildrenForDevice = $event\"\n *ngIf=\"showAssignDevices\"\n ></c8y-assign-devices>\n </div>\n </div>\n</div>\n\n<div [ngClass]=\"{ drawerOpen: showAssignChildDevices }\">\n <div class=\"bottom-drawer m-t-40\">\n <div class=\"d-flex d-col no-align-items fit-h\">\n <c8y-assign-child-devices\n *ngIf=\"showAssignChildDevices\"\n class=\"d-contents\"\n (onCancel)=\"showAssignChildDevices = false\"\n [refresh]=\"refresh\"\n [currentGroupId]=\"currentGroupId\"\n [parentDevice]=\"showChildrenForDevice\"\n ></c8y-assign-child-devices>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i1.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId"] }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "component", type: AddGroupComponent, selector: "c8y-add-group", inputs: ["currentGroupId", "refresh"], outputs: ["onDeviceQueryStringChange", "onCancel"] }, { kind: "component", type: SubAssetsGridComponent, selector: "c8y-sub-assets-grid", inputs: ["parent-group", "refresh", "title", "emptyStateText", "loadingItemsLabel", "columnsConfigKey", "columns", "pagination", "actionControls", "selectable", "baseQuery", "bulkActionControls", "filterable", "sortable", "displayOptions"], outputs: ["onColumnsChange", "itemsSelect"] }, { kind: "component", type: GroupInfoComponent, selector: "c8y-group-info", inputs: ["group"], outputs: ["groupChange"] }, { kind: "component", type: AssignDevicesComponent, selector: "c8y-assign-devices", inputs: ["currentGroupId", "refresh"], outputs: ["onCancel", "onShowChildDevices", "selectedDevice"] }, { kind: "component", type: AssignChildDevicesComponent, selector: "c8y-assign-child-devices", inputs: ["currentGroupId", "parentDevice", "refresh"], outputs: ["onCancel"] }, { kind: "component", type: AssetPropertiesComponent, selector: "c8y-asset-properties", inputs: ["asset", "properties"], outputs: ["assetChange"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }] });
1698
1708
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubAssetsComponent, decorators: [{
1699
1709
  type: Component,
1700
1710
  args: [{ selector: 'c8y-sub-assets', template: "<c8y-title>\n {{ title }}\n</c8y-title>\n\n<c8y-action-bar-item [placement]=\"'right'\" *ngIf=\"!isSmartGroup()\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Add group' | translate }}\"\n (click)=\"showAddGroup = !showAddGroup\"\n [disabled]=\"shouldDisableAddGroup\"\n >\n <i c8yIcon=\"plus-circle\" class=\"m-r-4\"></i>\n <span translate>Add group</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]=\"'right'\" *ngIf=\"!isSmartGroup()\">\n <button\n class=\"btn btn-link\"\n title=\"{{ 'Assign devices' | translate }}\"\n (click)=\"showAssignDevices = !showAssignDevices\"\n [disabled]=\"shouldDisableAssignDevices\"\n >\n <i c8yIcon=\"plus-circle\" class=\"m-r-4\"></i>\n <span translate>Assign devices</span>\n </button>\n</c8y-action-bar-item>\n\n<div\n class=\"card content-fullpage\"\n [ngClass]=\"{\n 'card--grid grid__col--8-4--md grid__row--fit-auto': shouldShowAssetsProperties,\n 'd-flex d-col': !shouldShowAssetsProperties\n }\"\n>\n <c8y-group-info\n [group]=\"group\"\n (groupChange)=\"groupChange($event)\"\n class=\"grid__col--fullspan\"\n ></c8y-group-info>\n <c8y-sub-assets-grid\n [refresh]=\"refresh\"\n [parent-group]=\"group\"\n [filterable]=\"filterable\"\n [displayOptions]=\"displayOptions\"\n [columnsConfigKey]=\"'sub-assets-grid'\"\n class=\"d-contents\"\n ></c8y-sub-assets-grid>\n <div class=\"inner-scroll bg-level-1\" *ngIf=\"shouldShowAssetsProperties\">\n <c8y-asset-properties\n [properties]=\"customProperties\"\n [asset]=\"group\"\n (assetChange)=\"groupChange($event)\"\n class=\"d-contents\"\n ></c8y-asset-properties>\n </div>\n</div>\n\n<div [ngClass]=\"{ drawerOpen: showAddGroup }\">\n <div class=\"bottom-drawer\">\n <c8y-add-group\n [currentGroupId]=\"currentGroupId\"\n [refresh]=\"refresh\"\n (onCancel)=\"showAddGroup = false\"\n *ngIf=\"showAddGroup\"\n ></c8y-add-group>\n </div>\n</div>\n\n<div [ngClass]=\"{ drawerOpen: showAssignDevices }\">\n <div class=\"bottom-drawer\">\n <div class=\"d-flex d-col no-align-items fit-h\">\n <c8y-assign-devices\n class=\"d-contents\"\n (onCancel)=\"showAssignDevices = false\"\n [refresh]=\"refresh\"\n [currentGroupId]=\"currentGroupId\"\n (onShowChildDevices)=\"showAssignChildDevices = $event\"\n (selectedDevice)=\"showChildrenForDevice = $event\"\n *ngIf=\"showAssignDevices\"\n ></c8y-assign-devices>\n </div>\n </div>\n</div>\n\n<div [ngClass]=\"{ drawerOpen: showAssignChildDevices }\">\n <div class=\"bottom-drawer m-t-40\">\n <div class=\"d-flex d-col no-align-items fit-h\">\n <c8y-assign-child-devices\n *ngIf=\"showAssignChildDevices\"\n class=\"d-contents\"\n (onCancel)=\"showAssignChildDevices = false\"\n [refresh]=\"refresh\"\n [currentGroupId]=\"currentGroupId\"\n [parentDevice]=\"showChildrenForDevice\"\n ></c8y-assign-child-devices>\n </div>\n </div>\n</div>\n" }]
1701
- }], ctorParameters: function () { return [{ type: i3$1.ActivatedRoute }, { type: SubAssetsService }, { type: i1.ContextRouteService }]; } });
1711
+ }], ctorParameters: function () { return [{ type: i3$1.ActivatedRoute }, { type: SubAssetsService }, { type: i1.ContextRouteService }, { type: i1.Permissions }]; } });
1702
1712
 
1703
1713
  class SubAssetsModule {
1704
1714
  }