@c8y/ngx-components 1024.18.1 → 1024.18.9

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.
Files changed (87) hide show
  1. package/fesm2022/c8y-ngx-components-actility-device-registration.mjs +1 -1
  2. package/fesm2022/c8y-ngx-components-actility-device-registration.mjs.map +1 -1
  3. package/fesm2022/c8y-ngx-components-asset-properties.mjs +67 -20
  4. package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
  5. package/fesm2022/c8y-ngx-components-assets-navigator.mjs +75 -13
  6. package/fesm2022/c8y-ngx-components-assets-navigator.mjs.map +1 -1
  7. package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs +2 -4
  8. package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs.map +1 -1
  9. package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs +6 -8
  10. package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs.map +1 -1
  11. package/fesm2022/c8y-ngx-components-context-dashboard.mjs +98 -19
  12. package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
  13. package/fesm2022/c8y-ngx-components-dashboard-manager.mjs +4 -4
  14. package/fesm2022/c8y-ngx-components-dashboard-manager.mjs.map +1 -1
  15. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +7 -7
  16. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
  17. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +5 -3
  18. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
  19. package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
  20. package/fesm2022/c8y-ngx-components-echart.mjs +52 -7
  21. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
  22. package/fesm2022/c8y-ngx-components-ecosystem.mjs +1 -1
  23. package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
  24. package/fesm2022/c8y-ngx-components-file-preview.mjs +2 -2
  25. package/fesm2022/c8y-ngx-components-file-preview.mjs.map +1 -1
  26. package/fesm2022/c8y-ngx-components-icon-selector.mjs +6 -6
  27. package/fesm2022/c8y-ngx-components-icon-selector.mjs.map +1 -1
  28. package/fesm2022/c8y-ngx-components-loriot-device-registration.mjs +1 -1
  29. package/fesm2022/c8y-ngx-components-loriot-device-registration.mjs.map +1 -1
  30. package/fesm2022/c8y-ngx-components-operation-picker.mjs +2 -2
  31. package/fesm2022/c8y-ngx-components-operation-picker.mjs.map +1 -1
  32. package/fesm2022/c8y-ngx-components-register-device.mjs +4 -4
  33. package/fesm2022/c8y-ngx-components-register-device.mjs.map +1 -1
  34. package/fesm2022/c8y-ngx-components-remote-access-configurations.mjs +2 -3
  35. package/fesm2022/c8y-ngx-components-remote-access-configurations.mjs.map +1 -1
  36. package/fesm2022/c8y-ngx-components-remote-access-shared.mjs +2 -2
  37. package/fesm2022/c8y-ngx-components-remote-access-shared.mjs.map +1 -1
  38. package/fesm2022/c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs +2 -2
  39. package/fesm2022/c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs.map +1 -1
  40. package/fesm2022/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.mjs +2 -4
  41. package/fesm2022/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.mjs.map +1 -1
  42. package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs +2 -3
  43. package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs.map +1 -1
  44. package/fesm2022/c8y-ngx-components-sigfox-device-registration.mjs +1 -1
  45. package/fesm2022/c8y-ngx-components-sigfox-device-registration.mjs.map +1 -1
  46. package/fesm2022/c8y-ngx-components-static-assets-modal.mjs +2 -2
  47. package/fesm2022/c8y-ngx-components-static-assets-modal.mjs.map +1 -1
  48. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs +3 -4
  49. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs.map +1 -1
  50. package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs +10 -1
  51. package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs.map +1 -1
  52. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs +4 -4
  53. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs.map +1 -1
  54. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +18 -3
  55. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
  56. package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs +1 -1
  57. package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs.map +1 -1
  58. package/fesm2022/c8y-ngx-components.mjs +59 -19
  59. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  60. package/locales/de.po +3 -2
  61. package/locales/es.po +3 -3
  62. package/locales/fr.po +3 -3
  63. package/locales/ja_JP.po +2 -2
  64. package/locales/ko.po +3 -3
  65. package/locales/locales.pot +1 -1
  66. package/locales/nl.po +3 -3
  67. package/locales/pl.po +2 -3
  68. package/locales/pt_BR.po +2 -3
  69. package/locales/zh_CN.po +2 -2
  70. package/locales/zh_TW.po +3 -3
  71. package/package.json +1 -1
  72. package/types/c8y-ngx-components-asset-properties.d.ts +9 -1
  73. package/types/c8y-ngx-components-asset-properties.d.ts.map +1 -1
  74. package/types/c8y-ngx-components-assets-navigator.d.ts +30 -3
  75. package/types/c8y-ngx-components-assets-navigator.d.ts.map +1 -1
  76. package/types/c8y-ngx-components-branding-shared-lazy-add-branding-modal.d.ts.map +1 -1
  77. package/types/c8y-ngx-components-context-dashboard.d.ts +44 -1
  78. package/types/c8y-ngx-components-context-dashboard.d.ts.map +1 -1
  79. package/types/c8y-ngx-components-echart-models.d.ts +9 -0
  80. package/types/c8y-ngx-components-echart-models.d.ts.map +1 -1
  81. package/types/c8y-ngx-components-echart.d.ts +32 -5
  82. package/types/c8y-ngx-components-echart.d.ts.map +1 -1
  83. package/types/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.d.ts.map +1 -1
  84. package/types/c8y-ngx-components-widgets-implementations-datapoints-graph.d.ts +6 -0
  85. package/types/c8y-ngx-components-widgets-implementations-datapoints-graph.d.ts.map +1 -1
  86. package/types/c8y-ngx-components.d.ts +50 -2
  87. package/types/c8y-ngx-components.d.ts.map +1 -1
@@ -369,7 +369,7 @@ class LoriotDeviceRegistrationComponent {
369
369
  this.unsubscribe$.complete();
370
370
  }
371
371
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: LoriotDeviceRegistrationComponent, deps: [{ token: i1$1.BsModalRef }, { token: LoriotProviderService }, { token: i3.GainsightService }], target: i0.ɵɵFactoryTarget.Component }); }
372
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: LoriotDeviceRegistrationComponent, isStandalone: true, selector: "c8y-loriot-registration", ngImport: i0, template: "<c8y-modal\n [title]=\"'LORIOT registration' | translate\"\n [headerClasses]=\"'dialog-header'\"\n [customFooter]=\"true\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'c8y-device-connect'\"></span>\n </ng-container>\n <ng-container *ngIf=\"state === 'loadPending'; else registrationForm\">\n <div class=\"p-16 text-center\">\n <c8y-loading></c8y-loading>\n </div>\n </ng-container>\n\n <ng-template #registrationForm>\n <c8y-stepper\n [hideStepProgress]=\"true\"\n linear\n c8y-modal-body\n *ngIf=\"(errorMessages$ | async).length === 0; else errorMessagesPresent\"\n >\n <cdk-step [stepControl]=\"form\">\n <div class=\"p-b-16\">\n <p class=\"modal-subtitle sticky-top\">\n {{ 'Register a single LORIOT device' | translate }}\n </p>\n <formly-form\n class=\"d-block p-l-24 p-r-24 p-t-16\"\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n ></formly-form>\n </div>\n <c8y-stepper-buttons\n class=\"modal-footer d-block sticky-bottom separator-top bg-component\"\n [labels]=\"registrationStepLabels\"\n (onNext)=\"create($event)\"\n (onCancel)=\"bsModalRef.hide()\"\n [showButtons]=\"{ cancel: true, next: true }\"\n [pending]=\"state === 'registrationPending'\"\n [disabled]=\"!form.valid\"\n ></c8y-stepper-buttons>\n </cdk-step>\n <cdk-step state=\"final\">\n <div\n class=\"p-16 text-center\"\n *ngIf=\"state === 'registrationPending'\"\n >\n <c8y-loading></c8y-loading>\n </div>\n <div class=\"m-24\">\n <c8y-operation-result\n class=\"lead m-b-0\"\n type=\"success\"\n *ngIf=\"state === 'registrationSuccess'\"\n text=\"{{ 'Device registered' | translate }}\"\n [size]=\"84\"\n [vertical]=\"true\"\n ></c8y-operation-result>\n </div>\n\n <c8y-stepper-buttons\n class=\"sticky-bottom d-block p-t-16 p-b-16 separator-top bg-component\"\n (onCustom)=\"bsModalRef.hide()\"\n [showButtons]=\"{ custom: true }\"\n [labels]=\"finalStepLabels\"\n ></c8y-stepper-buttons>\n </cdk-step>\n </c8y-stepper>\n </ng-template>\n\n <ng-template #errorMessagesPresent>\n <div class=\"m-24\">\n <c8y-operation-result\n class=\"lead\"\n type=\"error\"\n *ngIf=\"state === 'registrationError'\"\n text=\"{{ 'Failed to register' | translate }}\"\n [size]=\"84\"\n [vertical]=\"true\"\n ></c8y-operation-result>\n <div\n class=\"m-b-8\"\n *ngFor=\"let msg of errorMessages$ | async\"\n data-cy=\"loriot-device-registration.component--registration-error\"\n [ngClass]=\"{\n 'text-center': state === 'registrationError',\n 'alert alert-danger': state === 'loadError'\n }\"\n >\n <span [innerHTML]=\"msg | translate\"></span>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Close' | translate }}\"\n type=\"button\"\n (click)=\"bsModalRef.hide()\"\n >\n {{ 'Close' | translate }}\n </button>\n </div>\n </ng-template>\n</c8y-modal>\n", dependencies: [{ kind: "component", type: ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "progressLabel", "message"] }, { kind: "component", type: C8yStepper, selector: "c8y-stepper", inputs: ["disableDefaultIcons", "disableProgressButtons", "customClasses", "hideStepProgress", "useStepLabelsAsTitlesOnly"], outputs: ["onStepChange"] }, { kind: "component", type: CdkStep, selector: "cdk-step", inputs: ["stepControl", "label", "errorMessage", "aria-label", "aria-labelledby", "state", "editable", "optional", "completed", "hasError"], outputs: ["interacted"], exportAs: ["cdkStep"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i4.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "component", type: C8yStepperButtons, selector: "c8y-stepper-buttons", inputs: ["labels", "pending", "disabled", "showButtons"], outputs: ["onCancel", "onNext", "onBack", "onCustom"] }, { kind: "component", type: OperationResultComponent, selector: "c8y-operation-result", inputs: ["text", "vertical", "size", "type"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
372
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: LoriotDeviceRegistrationComponent, isStandalone: true, selector: "c8y-loriot-registration", ngImport: i0, template: "<c8y-modal\n [title]=\"'LORIOT registration' | translate\"\n [headerClasses]=\"'dialog-header'\"\n [customFooter]=\"true\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'c8y-device-connect'\"></span>\n </ng-container>\n <ng-container *ngIf=\"state === 'loadPending'; else registrationForm\">\n <div class=\"p-16 text-center\">\n <c8y-loading></c8y-loading>\n </div>\n </ng-container>\n\n <ng-template #registrationForm>\n <c8y-stepper\n [hideStepProgress]=\"true\"\n linear\n c8y-modal-body\n *ngIf=\"(errorMessages$ | async).length === 0; else errorMessagesPresent\"\n >\n <cdk-step [stepControl]=\"form\">\n <div class=\"p-b-16\">\n <p class=\"modal-subtitle sticky-top\">\n {{ 'Register a single LORIOT device' | translate }}\n </p>\n <formly-form\n class=\"d-block p-l-24 p-r-24 p-t-16\"\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n ></formly-form>\n </div>\n <c8y-stepper-buttons\n class=\"modal-footer d-block sticky-bottom separator-top bg-component\"\n [labels]=\"registrationStepLabels\"\n (onNext)=\"create($event)\"\n (onCancel)=\"bsModalRef.hide()\"\n [showButtons]=\"{ cancel: true, next: true }\"\n [pending]=\"state === 'registrationPending'\"\n [disabled]=\"!form.valid\"\n ></c8y-stepper-buttons>\n </cdk-step>\n <cdk-step state=\"final\">\n <div\n class=\"p-16 text-center\"\n *ngIf=\"state === 'registrationPending'\"\n >\n <c8y-loading></c8y-loading>\n </div>\n <div class=\"m-24\">\n <c8y-operation-result\n class=\"lead m-b-0\"\n type=\"success\"\n *ngIf=\"state === 'registrationSuccess'\"\n text=\"{{ 'Device registered' | translate }}\"\n [size]=\"84\"\n [vertical]=\"true\"\n ></c8y-operation-result>\n </div>\n\n <c8y-stepper-buttons\n class=\"sticky-bottom d-block p-t-16 p-b-16 separator-top bg-component\"\n (onCustom)=\"bsModalRef.hide()\"\n [showButtons]=\"{ custom: true }\"\n [labels]=\"finalStepLabels\"\n ></c8y-stepper-buttons>\n </cdk-step>\n </c8y-stepper>\n </ng-template>\n\n <ng-template #errorMessagesPresent>\n <div class=\"m-24\">\n <c8y-operation-result\n class=\"lead\"\n type=\"error\"\n *ngIf=\"state === 'registrationError'\"\n text=\"{{ 'Failed to register' | translate }}\"\n [size]=\"84\"\n [vertical]=\"true\"\n ></c8y-operation-result>\n <div\n class=\"m-b-8\"\n *ngFor=\"let msg of errorMessages$ | async\"\n data-cy=\"loriot-device-registration.component--registration-error\"\n [ngClass]=\"{\n 'text-center': state === 'registrationError',\n 'alert alert-danger': state === 'loadError'\n }\"\n >\n <span [innerHTML]=\"msg | translate\"></span>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Close' | translate }}\"\n type=\"button\"\n (click)=\"bsModalRef.hide()\"\n >\n {{ 'Close' | translate }}\n </button>\n </div>\n </ng-template>\n</c8y-modal>\n", dependencies: [{ kind: "component", type: ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "flushBody", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "progressLabel", "message"] }, { kind: "component", type: C8yStepper, selector: "c8y-stepper", inputs: ["disableDefaultIcons", "disableProgressButtons", "customClasses", "hideStepProgress", "useStepLabelsAsTitlesOnly"], outputs: ["onStepChange"] }, { kind: "component", type: CdkStep, selector: "cdk-step", inputs: ["stepControl", "label", "errorMessage", "aria-label", "aria-labelledby", "state", "editable", "optional", "completed", "hasError"], outputs: ["interacted"], exportAs: ["cdkStep"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i4.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "component", type: C8yStepperButtons, selector: "c8y-stepper-buttons", inputs: ["labels", "pending", "disabled", "showButtons"], outputs: ["onCancel", "onNext", "onBack", "onCustom"] }, { kind: "component", type: OperationResultComponent, selector: "c8y-operation-result", inputs: ["text", "vertical", "size", "type"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
373
373
  }
374
374
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: LoriotDeviceRegistrationComponent, decorators: [{
375
375
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"c8y-ngx-components-loriot-device-registration.mjs","sources":["../../loriot-device-registration/loriot-device-registration.model.ts","../../loriot-device-registration/loriot-provider.service.ts","../../loriot-device-registration/loriot-device-registration.component.ts","../../loriot-device-registration/loriot-device-registration.component.html","../../loriot-device-registration/loriot-device-registration-button.component.ts","../../loriot-device-registration/loriot-device-registration-button.component.html","../../loriot-device-registration/loriot-device-registration.factory.ts","../../loriot-device-registration/loriot-device-registration.module.ts","../../loriot-device-registration/c8y-ngx-components-loriot-device-registration.ts"],"sourcesContent":["import { IManagedObject } from '@c8y/client';\n\nexport interface LoriotDevice {\n title: string;\n deveui: string;\n appeui: string;\n appkey: string;\n appid: string;\n deviceType: IManagedObject;\n error?: string;\n lnsConnectionName: string;\n}\n\nexport interface Application {\n deviceLimit: number;\n devices: number;\n hexId: string;\n name: string;\n outputs: Array<any>;\n}\n\nexport interface LoriotDeviceFormly extends LoriotDevice {\n connection: {\n name: string;\n description: string;\n baseUrl: string;\n username: string;\n password: string;\n };\n application: Application;\n}\n\nexport const PRODUCT_EXPERIENCE_LORIOT_REGISTRATION = {\n EVENT: 'deviceRegistration',\n COMPONENT: 'loriot-registration',\n RESULT: { SUCCESS: 'registrationSuccess', FAILURE: 'registrationFailure' }\n} as const;\n","import { Injectable } from '@angular/core';\nimport {\n FetchClient,\n IFetchOptions,\n IManagedObject,\n InventoryService,\n IResult,\n IResultList\n} from '@c8y/client';\nimport { TranslateService } from '@ngx-translate/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { AppStateService } from '@c8y/ngx-components';\nimport { Application, LoriotDevice } from './loriot-device-registration.model';\n\nexport enum LoriotErrorName {\n NoDeviceProtocolsError = 'NoDeviceProtocolsError',\n NoConnectivitySettingsError = 'NoConnectivitySettingsError',\n ConnectivitySettingsError = 'ConnectivitySettingsError',\n RegistrationError = 'RegistrationError',\n DeviceProtocolsFetchError = 'DeviceProtocolsFetchError',\n ApplicationError = 'ApplicationError'\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LoriotProviderService {\n private readonly baseUrl: string = '/service/loriot/';\n private readonly registrationUrl: string = `${this.baseUrl}newDeviceRequest`;\n private readonly header: any = { 'Content-Type': 'application/json' };\n private readonly applicationsUrl: string = `${this.baseUrl}applications`;\n constructor(\n private client: FetchClient,\n private inventoryService: InventoryService,\n private translateService: TranslateService,\n private appState: AppStateService\n ) {}\n async getConnections() {\n const options: IFetchOptions = {\n method: 'GET',\n headers: this.header\n };\n const res = await this.client.fetch(`${this.baseUrl}lns-connection`, options);\n const data = await res.json();\n\n if (res.status === 200) {\n if (data.length === 0) {\n await this.throwNoConnectivitySettingsError();\n }\n } else {\n await this.throwConnectivitySettingsError(data);\n }\n return { res, data };\n }\n\n async createDevice(device: LoriotDevice): Promise<IResult<LoriotDevice>> {\n const options: IFetchOptions = {\n method: 'POST',\n headers: this.header,\n body: JSON.stringify(device)\n };\n const res = await this.client.fetch(this.registrationUrl, options);\n const data = await res.json();\n\n if (res.status !== 201) {\n this.throwRegistrationError(data);\n }\n return { res, data };\n }\n\n async getAvailableProtocols(\n filter: object = { withTotalPages: true }\n ): Promise<IResultList<IManagedObject>> {\n const query = {\n __filter: {\n __and: [\n { __has: 'c8y_IsDeviceType' },\n {\n type: { __in: ['c8y_LoraDeviceType', 'c8y_LpwanDeviceType'] }\n }\n ]\n },\n __orderby: [{ name: 1 }]\n };\n const deviceProtocolsList = await this.inventoryService.listQuery(query, filter);\n const { res, data } = deviceProtocolsList;\n if (res.status === 200) {\n if (data.length === 0) {\n this.throwNoDeviceProtocolsError();\n }\n } else {\n this.throwDeviceProtocolsFetchError();\n }\n\n return deviceProtocolsList;\n }\n\n async getApplications(connectionName: string): Promise<IResultList<Application>> {\n const options: IFetchOptions = {\n method: 'GET',\n headers: this.header,\n params: {\n loriotConnectionName: connectionName\n }\n };\n const res = await this.client.fetch(this.applicationsUrl, options);\n\n const data = await res.json();\n /* Every connection will have atleast 1 application,\n so having check for this enpoint returning empty result is not needed*/\n if (res.status !== 200) {\n this.throwApplicationError(data);\n }\n return { res, data };\n }\n\n private async throwNoConnectivitySettingsError() {\n const error = new Error();\n error.name = LoriotErrorName.NoConnectivitySettingsError;\n const hasAdminRight = await this.appState.isApplicationAvailable('administration');\n if (hasAdminRight) {\n error.message = this.translateService.instant(\n gettext(\n `Connectivity settings are not configured. Configure them in the Administration application under <a href=\"{{ link }}\">Settings</a>.`\n ),\n {\n link: '/apps/administration/index.html#/connectivitySettings/multiple_lns_connectors_loriot'\n }\n );\n } else {\n error.message = gettext(\n 'Connectivity settings are not configured. Contact the administrator.'\n );\n }\n\n throw error;\n }\n\n private throwConnectivitySettingsError(data: { message: string }) {\n const error = new Error();\n error.name = LoriotErrorName.ConnectivitySettingsError;\n error.message = data.message;\n throw error;\n }\n\n private throwRegistrationError(data: { message: string }) {\n const error = new Error();\n error.name = LoriotErrorName.RegistrationError;\n error.message = data.message;\n throw error;\n }\n\n private throwDeviceProtocolsFetchError() {\n const error = new Error();\n error.name = LoriotErrorName.DeviceProtocolsFetchError;\n error.message = gettext('Could not load device protocols.');\n throw error;\n }\n\n private throwNoDeviceProtocolsError() {\n const error = new Error();\n error.name = LoriotErrorName.NoDeviceProtocolsError;\n error.message = this.translateService.instant(\n gettext(\n `No device protocols configured. Create a LoRa device protocol in <a href=\"{{ link }}\">Device protocols</a>.`\n ),\n {\n link: '/apps/devicemanagement/#/deviceprotocols'\n }\n );\n throw error;\n }\n\n private throwApplicationError(data: { message: string }) {\n const error = new Error();\n error.name = LoriotErrorName.ApplicationError;\n error.message = data.message;\n throw error;\n }\n}\n","import { CdkStep } from '@angular/cdk/stepper';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { AbstractControl, FormGroup } from '@angular/forms';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport {\n C8yStepper,\n GainsightService,\n ModalComponent,\n IconDirective,\n LoadingComponent,\n C8yStepperButtons,\n OperationResultComponent,\n C8yTranslatePipe\n} from '@c8y/ngx-components';\nimport { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core';\nimport { cloneDeep, uniq } from 'lodash-es';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { BehaviorSubject, defer, forkJoin, from, of, Subject, throwError } from 'rxjs';\nimport { catchError, map, mergeMap, shareReplay, switchMap, takeUntil } from 'rxjs/operators';\nimport {\n LoriotDevice,\n LoriotDeviceFormly,\n PRODUCT_EXPERIENCE_LORIOT_REGISTRATION\n} from './loriot-device-registration.model';\nimport { LoriotErrorName, LoriotProviderService } from './loriot-provider.service';\nimport { NgIf, NgFor, NgClass, AsyncPipe } from '@angular/common';\n\ntype LoriotState =\n | 'loadPending'\n | 'loadSuccess'\n | 'loadError'\n | 'registrationPending'\n | 'registrationSuccess'\n | 'registrationError';\n\n@Component({\n selector: 'c8y-loriot-registration',\n templateUrl: 'loriot-device-registration.component.html',\n imports: [\n ModalComponent,\n IconDirective,\n NgIf,\n LoadingComponent,\n C8yStepper,\n CdkStep,\n FormlyModule,\n C8yStepperButtons,\n OperationResultComponent,\n NgFor,\n NgClass,\n C8yTranslatePipe,\n AsyncPipe\n ],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class LoriotDeviceRegistrationComponent {\n stepper: C8yStepper;\n readonly PAGING: object = {\n withTotalPages: true,\n pageSize: 10\n };\n\n form = new FormGroup({});\n model: LoriotDeviceFormly = {} as any;\n protocols$ = this.getProtocols$();\n connections$ = this.getConnections$();\n unsubscribe$: Subject<void> = new Subject();\n\n load$ = this.connections$.pipe(\n catchError((error: Error) => of(error)),\n switchMap(connections => {\n if (\n connections instanceof Error &&\n connections.name === LoriotErrorName.NoConnectivitySettingsError\n ) {\n return of([connections]);\n }\n return forkJoin([\n of(connections),\n this.protocols$.pipe(catchError((error: Error) => of(error)))\n ]);\n }),\n map(results => {\n return results.filter(result => {\n return result instanceof Error;\n });\n }),\n switchMap(errors => {\n return errors.length === 0 ? of([]) : throwError(errors);\n })\n );\n\n fields: FormlyFieldConfig[] = [\n {\n key: 'title',\n type: 'string',\n templateOptions: {\n placeholder: gettext('LORIOT LoRa'),\n label: gettext('Title'),\n required: true\n }\n },\n {\n key: 'deveui',\n type: 'string',\n templateOptions: {\n placeholder: 'FEDCBA9876543210',\n label: gettext('Device EUI'),\n required: true,\n pattern: '^([A-F0-9]{16})$'\n },\n validation: {\n messages: {\n pattern: gettext('Must be a valid 16 digit uppercase hexadecimal number.')\n }\n }\n },\n {\n key: 'appeui',\n type: 'string',\n templateOptions: {\n placeholder: 'FEDCBA9876543210',\n label: gettext('Application EUI'),\n required: true,\n pattern: '^([a-fA-F0-9]{16})$'\n },\n validation: {\n messages: {\n pattern: gettext('Must be a valid 16 digit hexadecimal number.')\n }\n }\n },\n {\n key: 'appkey',\n type: 'string',\n templateOptions: {\n placeholder: 'FEDCBA9876543210FEDCBA9876543210',\n label: gettext('Application key'),\n required: true,\n pattern: '^([a-fA-F0-9]{32})$'\n },\n validation: {\n messages: {\n pattern: gettext('Must be a valid 32 digit hexadecimal number.')\n }\n }\n },\n {\n key: 'connection',\n type: 'typeahead',\n templateOptions: {\n label: gettext('Connection'),\n required: true,\n c8yForOptions: this.connections$,\n displayProperty: 'name',\n valueProperties: ['name']\n }\n },\n {\n key: 'application',\n type: 'typeahead',\n templateOptions: {\n label: gettext('Application name'),\n required: true,\n placeholder: gettext('LORIOT application'),\n displayProperty: 'name',\n valueProperties: ['hexId']\n },\n hooks: {\n onInit: field => {\n const connectionControl = field.form.get('connection');\n connectionControl.valueChanges\n .pipe(\n takeUntil(this.unsubscribe$),\n mergeMap(({ name }) => this.getApplications$(name))\n )\n .subscribe(\n apps => {\n field.templateOptions.c8yForOptions = of(apps);\n field.formControl.setValue(null);\n },\n error => {\n field.form.get('application').setErrors({ application: true });\n field.validators.application.message = error.message;\n }\n );\n }\n },\n validators: {\n application: {\n expression: (control: AbstractControl) => {\n return control.status === 'VALID';\n },\n message: () => ''\n }\n }\n },\n {\n key: 'deviceType',\n type: 'typeahead',\n templateOptions: {\n label: gettext('Device protocol'),\n required: true,\n c8yForOptions: this.protocols$,\n displayProperty: 'name',\n valueProperties: ['id', 'name']\n }\n }\n ];\n\n registrationStepLabels = {\n next: gettext('Register')\n };\n finalStepLabels = {\n back: gettext('Close')\n };\n\n state: LoriotState = 'loadPending';\n errors$ = new BehaviorSubject<Error[]>([]);\n errorMessages$ = this.errors$.pipe(\n map(errors => errors.map(error => error.message)),\n map(messages => uniq(messages))\n );\n constructor(\n public bsModalRef: BsModalRef,\n private loriotService: LoriotProviderService,\n private gainsightService: GainsightService\n ) {\n this.load$.subscribe(\n () => {\n this.state = 'loadSuccess';\n },\n errors => {\n this.state = 'loadError';\n this.errors$.next(errors);\n }\n );\n }\n\n async create(event: { stepper: C8yStepper; step: CdkStep }) {\n this.state = 'registrationPending';\n const loriotDevice = this.getLoriotDeviceToSend();\n try {\n await this.loriotService.createDevice(loriotDevice);\n this.state = 'registrationSuccess';\n this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.EVENT, {\n result: PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.RESULT.SUCCESS,\n component: PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.COMPONENT\n });\n } catch (error) {\n this.state = 'registrationError';\n this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.EVENT, {\n result: PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.RESULT.FAILURE,\n component: PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.COMPONENT\n });\n this.errors$.next([error]);\n }\n\n event.stepper.next();\n }\n\n getLoriotDeviceToSend() {\n const loriotDevice: LoriotDevice = cloneDeep(this.model);\n loriotDevice.lnsConnectionName = this.model.connection.name;\n delete (loriotDevice as any).connection;\n loriotDevice.appid = this.model.application.hexId;\n delete (loriotDevice as any).application;\n return loriotDevice;\n }\n\n getProtocols$() {\n return defer(() => from(this.loriotService.getAvailableProtocols())).pipe(shareReplay(1));\n }\n\n getConnections$() {\n return defer(() => from(this.loriotService.getConnections())).pipe(shareReplay(1));\n }\n\n getApplications$(name) {\n return defer(() => from(this.loriotService.getApplications(name))).pipe(shareReplay(1));\n }\n\n ngOnDestroy(): void {\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n}\n","<c8y-modal\n [title]=\"'LORIOT registration' | translate\"\n [headerClasses]=\"'dialog-header'\"\n [customFooter]=\"true\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'c8y-device-connect'\"></span>\n </ng-container>\n <ng-container *ngIf=\"state === 'loadPending'; else registrationForm\">\n <div class=\"p-16 text-center\">\n <c8y-loading></c8y-loading>\n </div>\n </ng-container>\n\n <ng-template #registrationForm>\n <c8y-stepper\n [hideStepProgress]=\"true\"\n linear\n c8y-modal-body\n *ngIf=\"(errorMessages$ | async).length === 0; else errorMessagesPresent\"\n >\n <cdk-step [stepControl]=\"form\">\n <div class=\"p-b-16\">\n <p class=\"modal-subtitle sticky-top\">\n {{ 'Register a single LORIOT device' | translate }}\n </p>\n <formly-form\n class=\"d-block p-l-24 p-r-24 p-t-16\"\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n ></formly-form>\n </div>\n <c8y-stepper-buttons\n class=\"modal-footer d-block sticky-bottom separator-top bg-component\"\n [labels]=\"registrationStepLabels\"\n (onNext)=\"create($event)\"\n (onCancel)=\"bsModalRef.hide()\"\n [showButtons]=\"{ cancel: true, next: true }\"\n [pending]=\"state === 'registrationPending'\"\n [disabled]=\"!form.valid\"\n ></c8y-stepper-buttons>\n </cdk-step>\n <cdk-step state=\"final\">\n <div\n class=\"p-16 text-center\"\n *ngIf=\"state === 'registrationPending'\"\n >\n <c8y-loading></c8y-loading>\n </div>\n <div class=\"m-24\">\n <c8y-operation-result\n class=\"lead m-b-0\"\n type=\"success\"\n *ngIf=\"state === 'registrationSuccess'\"\n text=\"{{ 'Device registered' | translate }}\"\n [size]=\"84\"\n [vertical]=\"true\"\n ></c8y-operation-result>\n </div>\n\n <c8y-stepper-buttons\n class=\"sticky-bottom d-block p-t-16 p-b-16 separator-top bg-component\"\n (onCustom)=\"bsModalRef.hide()\"\n [showButtons]=\"{ custom: true }\"\n [labels]=\"finalStepLabels\"\n ></c8y-stepper-buttons>\n </cdk-step>\n </c8y-stepper>\n </ng-template>\n\n <ng-template #errorMessagesPresent>\n <div class=\"m-24\">\n <c8y-operation-result\n class=\"lead\"\n type=\"error\"\n *ngIf=\"state === 'registrationError'\"\n text=\"{{ 'Failed to register' | translate }}\"\n [size]=\"84\"\n [vertical]=\"true\"\n ></c8y-operation-result>\n <div\n class=\"m-b-8\"\n *ngFor=\"let msg of errorMessages$ | async\"\n data-cy=\"loriot-device-registration.component--registration-error\"\n [ngClass]=\"{\n 'text-center': state === 'registrationError',\n 'alert alert-danger': state === 'loadError'\n }\"\n >\n <span [innerHTML]=\"msg | translate\"></span>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Close' | translate }}\"\n type=\"button\"\n (click)=\"bsModalRef.hide()\"\n >\n {{ 'Close' | translate }}\n </button>\n </div>\n </ng-template>\n</c8y-modal>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { LoriotDeviceRegistrationComponent } from './loriot-device-registration.component';\nimport { IconDirective, C8yTranslatePipe } from '@c8y/ngx-components';\n\n@Component({\n selector: 'c8y-loriot-registration',\n templateUrl: 'loriot-device-registration-button.component.html',\n imports: [IconDirective, C8yTranslatePipe],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class LoriotDeviceRegistrationButtonComponent {\n constructor(private modalService: BsModalService) {}\n\n open() {\n this.modalService.show(LoriotDeviceRegistrationComponent, {\n class: 'modal-sm',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title',\n ignoreBackdropClick: true\n });\n }\n}\n","<button (click)=\"open()\"><i c8yIcon=\"c8y-device-connect\"></i> {{ 'LORIOT LoRa' | translate }} </button>","import { Injectable } from '@angular/core';\nimport { TenantUiService } from '@c8y/ngx-components';\nimport { LoriotDeviceRegistrationButtonComponent } from './loriot-device-registration-button.component';\nimport { RegisterDeviceFactory, RegisterDeviceItem } from '@c8y/ngx-components/register-device';\n@Injectable({\n providedIn: 'root'\n})\nexport class LoriotDeviceRegistrationFactory implements RegisterDeviceFactory {\n constructor(private tenantService: TenantUiService) {}\n\n get() {\n const items: RegisterDeviceItem[] = [];\n if (this.tenantService.isMicroserviceSubscribedInCurrentTenant('loriot')) {\n items.push({\n template: LoriotDeviceRegistrationButtonComponent,\n priority: 97,\n category: 'single'\n } as RegisterDeviceItem);\n }\n return items;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule, CoreModule } from '@c8y/ngx-components';\nimport { hookDeviceRegistration } from '@c8y/ngx-components/register-device';\nimport { LoriotDeviceRegistrationButtonComponent } from './loriot-device-registration-button.component';\nimport { LoriotDeviceRegistrationComponent } from './loriot-device-registration.component';\nimport { LoriotDeviceRegistrationFactory } from './loriot-device-registration.factory';\nimport { LoriotProviderService } from './loriot-provider.service';\n\n@NgModule({\n imports: [\n CoreModule,\n CommonModule,\n LoriotDeviceRegistrationButtonComponent,\n LoriotDeviceRegistrationComponent\n ],\n providers: [hookDeviceRegistration(LoriotDeviceRegistrationFactory), LoriotProviderService]\n})\nexport class LoriotDeviceRegistrationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2.LoriotProviderService"],"mappings":";;;;;;;;;;;;;;;;;;AAgCO,MAAM,sCAAsC,GAAG;AACpD,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,SAAS,EAAE,qBAAqB;IAChC,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,qBAAqB;CAChE;;ACtBV,IAAY,eAOX;AAPD,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,wBAAA,CAAA,GAAA,wBAAiD;AACjD,IAAA,eAAA,CAAA,6BAAA,CAAA,GAAA,6BAA2D;AAC3D,IAAA,eAAA,CAAA,2BAAA,CAAA,GAAA,2BAAuD;AACvD,IAAA,eAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,eAAA,CAAA,2BAAA,CAAA,GAAA,2BAAuD;AACvD,IAAA,eAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACvC,CAAC,EAPW,eAAe,KAAf,eAAe,GAAA,EAAA,CAAA,CAAA;MAYd,qBAAqB,CAAA;AAKhC,IAAA,WAAA,CACU,MAAmB,EACnB,gBAAkC,EAClC,gBAAkC,EAClC,QAAyB,EAAA;QAHzB,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAChB,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAChB,IAAA,CAAA,QAAQ,GAAR,QAAQ;QARD,IAAA,CAAA,OAAO,GAAW,kBAAkB;AACpC,QAAA,IAAA,CAAA,eAAe,GAAW,CAAA,EAAG,IAAI,CAAC,OAAO,kBAAkB;AAC3D,QAAA,IAAA,CAAA,MAAM,GAAQ,EAAE,cAAc,EAAE,kBAAkB,EAAE;AACpD,QAAA,IAAA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,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAPvC,UAAU;YACV,YAAY;YACZ,uCAAuC;YACvC,iCAAiC,CAAA,EAAA,CAAA,CAAA;gHAIxB,8BAA8B,EAAA,SAAA,EAF9B,CAAC,sBAAsB,CAAC,+BAA+B,CAAC,EAAE,qBAAqB,CAAC,EAAA,OAAA,EAAA,CALzF,UAAU;YACV,YAAY;YAEZ,iCAAiC,CAAA,EAAA,CAAA,CAAA;;4FAIxB,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAT1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,UAAU;wBACV,YAAY;wBACZ,uCAAuC;wBACvC;AACD,qBAAA;oBACD,SAAS,EAAE,CAAC,sBAAsB,CAAC,+BAA+B,CAAC,EAAE,qBAAqB;AAC3F,iBAAA;;;AChBD;;AAEG;;;;"}
1
+ {"version":3,"file":"c8y-ngx-components-loriot-device-registration.mjs","sources":["../../loriot-device-registration/loriot-device-registration.model.ts","../../loriot-device-registration/loriot-provider.service.ts","../../loriot-device-registration/loriot-device-registration.component.ts","../../loriot-device-registration/loriot-device-registration.component.html","../../loriot-device-registration/loriot-device-registration-button.component.ts","../../loriot-device-registration/loriot-device-registration-button.component.html","../../loriot-device-registration/loriot-device-registration.factory.ts","../../loriot-device-registration/loriot-device-registration.module.ts","../../loriot-device-registration/c8y-ngx-components-loriot-device-registration.ts"],"sourcesContent":["import { IManagedObject } from '@c8y/client';\n\nexport interface LoriotDevice {\n title: string;\n deveui: string;\n appeui: string;\n appkey: string;\n appid: string;\n deviceType: IManagedObject;\n error?: string;\n lnsConnectionName: string;\n}\n\nexport interface Application {\n deviceLimit: number;\n devices: number;\n hexId: string;\n name: string;\n outputs: Array<any>;\n}\n\nexport interface LoriotDeviceFormly extends LoriotDevice {\n connection: {\n name: string;\n description: string;\n baseUrl: string;\n username: string;\n password: string;\n };\n application: Application;\n}\n\nexport const PRODUCT_EXPERIENCE_LORIOT_REGISTRATION = {\n EVENT: 'deviceRegistration',\n COMPONENT: 'loriot-registration',\n RESULT: { SUCCESS: 'registrationSuccess', FAILURE: 'registrationFailure' }\n} as const;\n","import { Injectable } from '@angular/core';\nimport {\n FetchClient,\n IFetchOptions,\n IManagedObject,\n InventoryService,\n IResult,\n IResultList\n} from '@c8y/client';\nimport { TranslateService } from '@ngx-translate/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { AppStateService } from '@c8y/ngx-components';\nimport { Application, LoriotDevice } from './loriot-device-registration.model';\n\nexport enum LoriotErrorName {\n NoDeviceProtocolsError = 'NoDeviceProtocolsError',\n NoConnectivitySettingsError = 'NoConnectivitySettingsError',\n ConnectivitySettingsError = 'ConnectivitySettingsError',\n RegistrationError = 'RegistrationError',\n DeviceProtocolsFetchError = 'DeviceProtocolsFetchError',\n ApplicationError = 'ApplicationError'\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LoriotProviderService {\n private readonly baseUrl: string = '/service/loriot/';\n private readonly registrationUrl: string = `${this.baseUrl}newDeviceRequest`;\n private readonly header: any = { 'Content-Type': 'application/json' };\n private readonly applicationsUrl: string = `${this.baseUrl}applications`;\n constructor(\n private client: FetchClient,\n private inventoryService: InventoryService,\n private translateService: TranslateService,\n private appState: AppStateService\n ) {}\n async getConnections() {\n const options: IFetchOptions = {\n method: 'GET',\n headers: this.header\n };\n const res = await this.client.fetch(`${this.baseUrl}lns-connection`, options);\n const data = await res.json();\n\n if (res.status === 200) {\n if (data.length === 0) {\n await this.throwNoConnectivitySettingsError();\n }\n } else {\n await this.throwConnectivitySettingsError(data);\n }\n return { res, data };\n }\n\n async createDevice(device: LoriotDevice): Promise<IResult<LoriotDevice>> {\n const options: IFetchOptions = {\n method: 'POST',\n headers: this.header,\n body: JSON.stringify(device)\n };\n const res = await this.client.fetch(this.registrationUrl, options);\n const data = await res.json();\n\n if (res.status !== 201) {\n this.throwRegistrationError(data);\n }\n return { res, data };\n }\n\n async getAvailableProtocols(\n filter: object = { withTotalPages: true }\n ): Promise<IResultList<IManagedObject>> {\n const query = {\n __filter: {\n __and: [\n { __has: 'c8y_IsDeviceType' },\n {\n type: { __in: ['c8y_LoraDeviceType', 'c8y_LpwanDeviceType'] }\n }\n ]\n },\n __orderby: [{ name: 1 }]\n };\n const deviceProtocolsList = await this.inventoryService.listQuery(query, filter);\n const { res, data } = deviceProtocolsList;\n if (res.status === 200) {\n if (data.length === 0) {\n this.throwNoDeviceProtocolsError();\n }\n } else {\n this.throwDeviceProtocolsFetchError();\n }\n\n return deviceProtocolsList;\n }\n\n async getApplications(connectionName: string): Promise<IResultList<Application>> {\n const options: IFetchOptions = {\n method: 'GET',\n headers: this.header,\n params: {\n loriotConnectionName: connectionName\n }\n };\n const res = await this.client.fetch(this.applicationsUrl, options);\n\n const data = await res.json();\n /* Every connection will have atleast 1 application,\n so having check for this enpoint returning empty result is not needed*/\n if (res.status !== 200) {\n this.throwApplicationError(data);\n }\n return { res, data };\n }\n\n private async throwNoConnectivitySettingsError() {\n const error = new Error();\n error.name = LoriotErrorName.NoConnectivitySettingsError;\n const hasAdminRight = await this.appState.isApplicationAvailable('administration');\n if (hasAdminRight) {\n error.message = this.translateService.instant(\n gettext(\n `Connectivity settings are not configured. Configure them in the Administration application under <a href=\"{{ link }}\">Settings</a>.`\n ),\n {\n link: '/apps/administration/index.html#/connectivitySettings/multiple_lns_connectors_loriot'\n }\n );\n } else {\n error.message = gettext(\n 'Connectivity settings are not configured. Contact the administrator.'\n );\n }\n\n throw error;\n }\n\n private throwConnectivitySettingsError(data: { message: string }) {\n const error = new Error();\n error.name = LoriotErrorName.ConnectivitySettingsError;\n error.message = data.message;\n throw error;\n }\n\n private throwRegistrationError(data: { message: string }) {\n const error = new Error();\n error.name = LoriotErrorName.RegistrationError;\n error.message = data.message;\n throw error;\n }\n\n private throwDeviceProtocolsFetchError() {\n const error = new Error();\n error.name = LoriotErrorName.DeviceProtocolsFetchError;\n error.message = gettext('Could not load device protocols.');\n throw error;\n }\n\n private throwNoDeviceProtocolsError() {\n const error = new Error();\n error.name = LoriotErrorName.NoDeviceProtocolsError;\n error.message = this.translateService.instant(\n gettext(\n `No device protocols configured. Create a LoRa device protocol in <a href=\"{{ link }}\">Device protocols</a>.`\n ),\n {\n link: '/apps/devicemanagement/#/deviceprotocols'\n }\n );\n throw error;\n }\n\n private throwApplicationError(data: { message: string }) {\n const error = new Error();\n error.name = LoriotErrorName.ApplicationError;\n error.message = data.message;\n throw error;\n }\n}\n","import { CdkStep } from '@angular/cdk/stepper';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { AbstractControl, FormGroup } from '@angular/forms';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport {\n C8yStepper,\n GainsightService,\n ModalComponent,\n IconDirective,\n LoadingComponent,\n C8yStepperButtons,\n OperationResultComponent,\n C8yTranslatePipe\n} from '@c8y/ngx-components';\nimport { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core';\nimport { cloneDeep, uniq } from 'lodash-es';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { BehaviorSubject, defer, forkJoin, from, of, Subject, throwError } from 'rxjs';\nimport { catchError, map, mergeMap, shareReplay, switchMap, takeUntil } from 'rxjs/operators';\nimport {\n LoriotDevice,\n LoriotDeviceFormly,\n PRODUCT_EXPERIENCE_LORIOT_REGISTRATION\n} from './loriot-device-registration.model';\nimport { LoriotErrorName, LoriotProviderService } from './loriot-provider.service';\nimport { NgIf, NgFor, NgClass, AsyncPipe } from '@angular/common';\n\ntype LoriotState =\n | 'loadPending'\n | 'loadSuccess'\n | 'loadError'\n | 'registrationPending'\n | 'registrationSuccess'\n | 'registrationError';\n\n@Component({\n selector: 'c8y-loriot-registration',\n templateUrl: 'loriot-device-registration.component.html',\n imports: [\n ModalComponent,\n IconDirective,\n NgIf,\n LoadingComponent,\n C8yStepper,\n CdkStep,\n FormlyModule,\n C8yStepperButtons,\n OperationResultComponent,\n NgFor,\n NgClass,\n C8yTranslatePipe,\n AsyncPipe\n ],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class LoriotDeviceRegistrationComponent {\n stepper: C8yStepper;\n readonly PAGING: object = {\n withTotalPages: true,\n pageSize: 10\n };\n\n form = new FormGroup({});\n model: LoriotDeviceFormly = {} as any;\n protocols$ = this.getProtocols$();\n connections$ = this.getConnections$();\n unsubscribe$: Subject<void> = new Subject();\n\n load$ = this.connections$.pipe(\n catchError((error: Error) => of(error)),\n switchMap(connections => {\n if (\n connections instanceof Error &&\n connections.name === LoriotErrorName.NoConnectivitySettingsError\n ) {\n return of([connections]);\n }\n return forkJoin([\n of(connections),\n this.protocols$.pipe(catchError((error: Error) => of(error)))\n ]);\n }),\n map(results => {\n return results.filter(result => {\n return result instanceof Error;\n });\n }),\n switchMap(errors => {\n return errors.length === 0 ? of([]) : throwError(errors);\n })\n );\n\n fields: FormlyFieldConfig[] = [\n {\n key: 'title',\n type: 'string',\n templateOptions: {\n placeholder: gettext('LORIOT LoRa'),\n label: gettext('Title'),\n required: true\n }\n },\n {\n key: 'deveui',\n type: 'string',\n templateOptions: {\n placeholder: 'FEDCBA9876543210',\n label: gettext('Device EUI'),\n required: true,\n pattern: '^([A-F0-9]{16})$'\n },\n validation: {\n messages: {\n pattern: gettext('Must be a valid 16 digit uppercase hexadecimal number.')\n }\n }\n },\n {\n key: 'appeui',\n type: 'string',\n templateOptions: {\n placeholder: 'FEDCBA9876543210',\n label: gettext('Application EUI'),\n required: true,\n pattern: '^([a-fA-F0-9]{16})$'\n },\n validation: {\n messages: {\n pattern: gettext('Must be a valid 16 digit hexadecimal number.')\n }\n }\n },\n {\n key: 'appkey',\n type: 'string',\n templateOptions: {\n placeholder: 'FEDCBA9876543210FEDCBA9876543210',\n label: gettext('Application key'),\n required: true,\n pattern: '^([a-fA-F0-9]{32})$'\n },\n validation: {\n messages: {\n pattern: gettext('Must be a valid 32 digit hexadecimal number.')\n }\n }\n },\n {\n key: 'connection',\n type: 'typeahead',\n templateOptions: {\n label: gettext('Connection'),\n required: true,\n c8yForOptions: this.connections$,\n displayProperty: 'name',\n valueProperties: ['name']\n }\n },\n {\n key: 'application',\n type: 'typeahead',\n templateOptions: {\n label: gettext('Application name'),\n required: true,\n placeholder: gettext('LORIOT application'),\n displayProperty: 'name',\n valueProperties: ['hexId']\n },\n hooks: {\n onInit: field => {\n const connectionControl = field.form.get('connection');\n connectionControl.valueChanges\n .pipe(\n takeUntil(this.unsubscribe$),\n mergeMap(({ name }) => this.getApplications$(name))\n )\n .subscribe(\n apps => {\n field.templateOptions.c8yForOptions = of(apps);\n field.formControl.setValue(null);\n },\n error => {\n field.form.get('application').setErrors({ application: true });\n field.validators.application.message = error.message;\n }\n );\n }\n },\n validators: {\n application: {\n expression: (control: AbstractControl) => {\n return control.status === 'VALID';\n },\n message: () => ''\n }\n }\n },\n {\n key: 'deviceType',\n type: 'typeahead',\n templateOptions: {\n label: gettext('Device protocol'),\n required: true,\n c8yForOptions: this.protocols$,\n displayProperty: 'name',\n valueProperties: ['id', 'name']\n }\n }\n ];\n\n registrationStepLabels = {\n next: gettext('Register')\n };\n finalStepLabels = {\n back: gettext('Close')\n };\n\n state: LoriotState = 'loadPending';\n errors$ = new BehaviorSubject<Error[]>([]);\n errorMessages$ = this.errors$.pipe(\n map(errors => errors.map(error => error.message)),\n map(messages => uniq(messages))\n );\n constructor(\n public bsModalRef: BsModalRef,\n private loriotService: LoriotProviderService,\n private gainsightService: GainsightService\n ) {\n this.load$.subscribe(\n () => {\n this.state = 'loadSuccess';\n },\n errors => {\n this.state = 'loadError';\n this.errors$.next(errors);\n }\n );\n }\n\n async create(event: { stepper: C8yStepper; step: CdkStep }) {\n this.state = 'registrationPending';\n const loriotDevice = this.getLoriotDeviceToSend();\n try {\n await this.loriotService.createDevice(loriotDevice);\n this.state = 'registrationSuccess';\n this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.EVENT, {\n result: PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.RESULT.SUCCESS,\n component: PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.COMPONENT\n });\n } catch (error) {\n this.state = 'registrationError';\n this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.EVENT, {\n result: PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.RESULT.FAILURE,\n component: PRODUCT_EXPERIENCE_LORIOT_REGISTRATION.COMPONENT\n });\n this.errors$.next([error]);\n }\n\n event.stepper.next();\n }\n\n getLoriotDeviceToSend() {\n const loriotDevice: LoriotDevice = cloneDeep(this.model);\n loriotDevice.lnsConnectionName = this.model.connection.name;\n delete (loriotDevice as any).connection;\n loriotDevice.appid = this.model.application.hexId;\n delete (loriotDevice as any).application;\n return loriotDevice;\n }\n\n getProtocols$() {\n return defer(() => from(this.loriotService.getAvailableProtocols())).pipe(shareReplay(1));\n }\n\n getConnections$() {\n return defer(() => from(this.loriotService.getConnections())).pipe(shareReplay(1));\n }\n\n getApplications$(name) {\n return defer(() => from(this.loriotService.getApplications(name))).pipe(shareReplay(1));\n }\n\n ngOnDestroy(): void {\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n}\n","<c8y-modal\n [title]=\"'LORIOT registration' | translate\"\n [headerClasses]=\"'dialog-header'\"\n [customFooter]=\"true\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'c8y-device-connect'\"></span>\n </ng-container>\n <ng-container *ngIf=\"state === 'loadPending'; else registrationForm\">\n <div class=\"p-16 text-center\">\n <c8y-loading></c8y-loading>\n </div>\n </ng-container>\n\n <ng-template #registrationForm>\n <c8y-stepper\n [hideStepProgress]=\"true\"\n linear\n c8y-modal-body\n *ngIf=\"(errorMessages$ | async).length === 0; else errorMessagesPresent\"\n >\n <cdk-step [stepControl]=\"form\">\n <div class=\"p-b-16\">\n <p class=\"modal-subtitle sticky-top\">\n {{ 'Register a single LORIOT device' | translate }}\n </p>\n <formly-form\n class=\"d-block p-l-24 p-r-24 p-t-16\"\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n ></formly-form>\n </div>\n <c8y-stepper-buttons\n class=\"modal-footer d-block sticky-bottom separator-top bg-component\"\n [labels]=\"registrationStepLabels\"\n (onNext)=\"create($event)\"\n (onCancel)=\"bsModalRef.hide()\"\n [showButtons]=\"{ cancel: true, next: true }\"\n [pending]=\"state === 'registrationPending'\"\n [disabled]=\"!form.valid\"\n ></c8y-stepper-buttons>\n </cdk-step>\n <cdk-step state=\"final\">\n <div\n class=\"p-16 text-center\"\n *ngIf=\"state === 'registrationPending'\"\n >\n <c8y-loading></c8y-loading>\n </div>\n <div class=\"m-24\">\n <c8y-operation-result\n class=\"lead m-b-0\"\n type=\"success\"\n *ngIf=\"state === 'registrationSuccess'\"\n text=\"{{ 'Device registered' | translate }}\"\n [size]=\"84\"\n [vertical]=\"true\"\n ></c8y-operation-result>\n </div>\n\n <c8y-stepper-buttons\n class=\"sticky-bottom d-block p-t-16 p-b-16 separator-top bg-component\"\n (onCustom)=\"bsModalRef.hide()\"\n [showButtons]=\"{ custom: true }\"\n [labels]=\"finalStepLabels\"\n ></c8y-stepper-buttons>\n </cdk-step>\n </c8y-stepper>\n </ng-template>\n\n <ng-template #errorMessagesPresent>\n <div class=\"m-24\">\n <c8y-operation-result\n class=\"lead\"\n type=\"error\"\n *ngIf=\"state === 'registrationError'\"\n text=\"{{ 'Failed to register' | translate }}\"\n [size]=\"84\"\n [vertical]=\"true\"\n ></c8y-operation-result>\n <div\n class=\"m-b-8\"\n *ngFor=\"let msg of errorMessages$ | async\"\n data-cy=\"loriot-device-registration.component--registration-error\"\n [ngClass]=\"{\n 'text-center': state === 'registrationError',\n 'alert alert-danger': state === 'loadError'\n }\"\n >\n <span [innerHTML]=\"msg | translate\"></span>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Close' | translate }}\"\n type=\"button\"\n (click)=\"bsModalRef.hide()\"\n >\n {{ 'Close' | translate }}\n </button>\n </div>\n </ng-template>\n</c8y-modal>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { LoriotDeviceRegistrationComponent } from './loriot-device-registration.component';\nimport { IconDirective, C8yTranslatePipe } from '@c8y/ngx-components';\n\n@Component({\n selector: 'c8y-loriot-registration',\n templateUrl: 'loriot-device-registration-button.component.html',\n imports: [IconDirective, C8yTranslatePipe],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class LoriotDeviceRegistrationButtonComponent {\n constructor(private modalService: BsModalService) {}\n\n open() {\n this.modalService.show(LoriotDeviceRegistrationComponent, {\n class: 'modal-sm',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title',\n ignoreBackdropClick: true\n });\n }\n}\n","<button (click)=\"open()\"><i c8yIcon=\"c8y-device-connect\"></i> {{ 'LORIOT LoRa' | translate }} </button>","import { Injectable } from '@angular/core';\nimport { TenantUiService } from '@c8y/ngx-components';\nimport { LoriotDeviceRegistrationButtonComponent } from './loriot-device-registration-button.component';\nimport { RegisterDeviceFactory, RegisterDeviceItem } from '@c8y/ngx-components/register-device';\n@Injectable({\n providedIn: 'root'\n})\nexport class LoriotDeviceRegistrationFactory implements RegisterDeviceFactory {\n constructor(private tenantService: TenantUiService) {}\n\n get() {\n const items: RegisterDeviceItem[] = [];\n if (this.tenantService.isMicroserviceSubscribedInCurrentTenant('loriot')) {\n items.push({\n template: LoriotDeviceRegistrationButtonComponent,\n priority: 97,\n category: 'single'\n } as RegisterDeviceItem);\n }\n return items;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule, CoreModule } from '@c8y/ngx-components';\nimport { hookDeviceRegistration } from '@c8y/ngx-components/register-device';\nimport { LoriotDeviceRegistrationButtonComponent } from './loriot-device-registration-button.component';\nimport { LoriotDeviceRegistrationComponent } from './loriot-device-registration.component';\nimport { LoriotDeviceRegistrationFactory } from './loriot-device-registration.factory';\nimport { LoriotProviderService } from './loriot-provider.service';\n\n@NgModule({\n imports: [\n CoreModule,\n CommonModule,\n LoriotDeviceRegistrationButtonComponent,\n LoriotDeviceRegistrationComponent\n ],\n providers: [hookDeviceRegistration(LoriotDeviceRegistrationFactory), LoriotProviderService]\n})\nexport class LoriotDeviceRegistrationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2.LoriotProviderService"],"mappings":";;;;;;;;;;;;;;;;;;AAgCO,MAAM,sCAAsC,GAAG;AACpD,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,SAAS,EAAE,qBAAqB;IAChC,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,qBAAqB;CAChE;;ACtBV,IAAY,eAOX;AAPD,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,wBAAA,CAAA,GAAA,wBAAiD;AACjD,IAAA,eAAA,CAAA,6BAAA,CAAA,GAAA,6BAA2D;AAC3D,IAAA,eAAA,CAAA,2BAAA,CAAA,GAAA,2BAAuD;AACvD,IAAA,eAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,eAAA,CAAA,2BAAA,CAAA,GAAA,2BAAuD;AACvD,IAAA,eAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACvC,CAAC,EAPW,eAAe,KAAf,eAAe,GAAA,EAAA,CAAA,CAAA;MAYd,qBAAqB,CAAA;AAKhC,IAAA,WAAA,CACU,MAAmB,EACnB,gBAAkC,EAClC,gBAAkC,EAClC,QAAyB,EAAA;QAHzB,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAChB,I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,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,cAF9B,MAAM,EAAA,CAAA,CAAA;;4FAEP,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAH3C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;MCWY,8BAA8B,CAAA;+GAA9B,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAPvC,UAAU;YACV,YAAY;YACZ,uCAAuC;YACvC,iCAAiC,CAAA,EAAA,CAAA,CAAA;gHAIxB,8BAA8B,EAAA,SAAA,EAF9B,CAAC,sBAAsB,CAAC,+BAA+B,CAAC,EAAE,qBAAqB,CAAC,EAAA,OAAA,EAAA,CALzF,UAAU;YACV,YAAY;YAEZ,iCAAiC,CAAA,EAAA,CAAA,CAAA;;4FAIxB,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAT1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,UAAU;wBACV,YAAY;wBACZ,uCAAuC;wBACvC;AACD,qBAAA;oBACD,SAAS,EAAE,CAAC,sBAAsB,CAAC,+BAA+B,CAAC,EAAE,qBAAqB;AAC3F,iBAAA;;;AChBD;;AAEG;;;;"}
@@ -161,7 +161,7 @@ class OperationModalComponent {
161
161
  this._cancel();
162
162
  }
163
163
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: OperationModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
164
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: OperationModalComponent, isStandalone: true, selector: "c8y-operation-render-type-modal", providers: [DeviceShellService], ngImport: i0, template: "<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: ModalModule }, { kind: "component", type: i1.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: C8yTranslateModule }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i1.TextareaAutoresizeDirective, selector: "[c8y-textarea-autoresize]" }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: i1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
164
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: OperationModalComponent, isStandalone: true, selector: "c8y-operation-render-type-modal", providers: [DeviceShellService], ngImport: i0, template: "<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form [formGroup]=\"form\">\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: ModalModule }, { kind: "component", type: i1.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "flushBody", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: C8yTranslateModule }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i1.TextareaAutoresizeDirective, selector: "[c8y-textarea-autoresize]" }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: i1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
165
165
  }
166
166
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: OperationModalComponent, decorators: [{
167
167
  type: Component,
@@ -172,7 +172,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImpo
172
172
  C8yTranslateModule,
173
173
  CommonModule,
174
174
  CoreModule
175
- ], providers: [DeviceShellService], changeDetection: ChangeDetectionStrategy.Eager, template: "<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n" }]
175
+ ], providers: [DeviceShellService], changeDetection: ChangeDetectionStrategy.Eager, template: "<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form [formGroup]=\"form\">\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n" }]
176
176
  }] });
177
177
 
178
178
  class OperationPickerService {
@@ -1 +1 @@
1
- {"version":3,"file":"c8y-ngx-components-operation-picker.mjs","sources":["../../operation-picker/operation-template.hook.ts","../../operation-picker/operation-template.service.ts","../../operation-picker/modal/operation-modal.component.ts","../../operation-picker/modal/operation-modal.component.html","../../operation-picker/operation-picker.service.ts","../../operation-picker/c8y-ngx-components-operation-picker.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { GenericHookOptions, GenericHookType, hookGeneric } from '@c8y/ngx-components';\n\n/**\n * Represents a predefined operation template that can be registered\n * and selected in the operation render type modal.\n */\nexport interface OperationTemplate {\n /** Display name shown in the dropdown. */\n name: string;\n /** The operation command object that will be serialized as JSON into the command field.\n * The command object must contain a `description` property, which will be used as the description of the operation in the UI.\n * The rest of the properties can be defined based on the requirements of the specific operation.\n * For example, a restart operation might look like this:\n * ```\n * {\n * description: 'Restart device',\n * c8y_Restart: {}\n * }\n * ```\n * Or a more complex command with parameters:\n * ```\n * {\n * description: 'Set relay status to OPEN',\n * c8y_Relay: {\n * relayState: 'OPEN'\n * }\n * }\n * ```\n */\n command: Record<string, unknown>;\n}\n\n/**\n * Injection token for registering additional operation templates.\n *\n * Use the `hookOperationTemplate` helper to register templates from a plugin:\n *\n * ```typescript\n * // Provide a single template\n * hookOperationTemplate({ name: 'Restart device', command: { c8y_Restart: {} } })\n *\n * // Provide multiple templates\n * hookOperationTemplate([\n * { name: 'Restart device', command: { c8y_Restart: {} } },\n * { name: 'Set relay OPEN', command: { c8y_Relay: { relayState: 'OPEN' } } }\n * ])\n * ```\n */\nexport const HOOK_OPERATION_TEMPLATE = new InjectionToken<OperationTemplate[]>(\n 'HOOK_OPERATION_TEMPLATE'\n);\n\n/**\n * Registers one or more operation templates to be shown in the operation modal selector.\n *\n * @example\n * ```typescript\n * \\@NgModule({\n * providers: [\n * hookOperationTemplate({ name: 'Restart device', command: { c8y_Restart: {} } })\n * ]\n * })\n * export class MyPlugin {}\n * ```\n */\nexport function hookOperationTemplate(\n template: GenericHookType<OperationTemplate>,\n options?: Partial<GenericHookOptions>\n) {\n return hookGeneric<OperationTemplate>(template, HOOK_OPERATION_TEMPLATE, options);\n}\n","import { Injectable, Injector } from '@angular/core';\nimport {\n ExtensionPointForPlugins,\n fromTriggerOnce,\n getInjectedHooks,\n PluginsResolveService\n} from '@c8y/ngx-components';\nimport { distinctUntilChanged, Observable, shareReplay } from 'rxjs';\nimport { HOOK_OPERATION_TEMPLATE, OperationTemplate } from './operation-template.hook';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OperationTemplateService extends ExtensionPointForPlugins<OperationTemplate> {\n items$: Observable<OperationTemplate[]>;\n\n constructor(rootInjector: Injector, pluginService: PluginsResolveService) {\n super(rootInjector, pluginService);\n this.items$ = this.setupItemsObservable();\n }\n\n get state() {\n return this.state$.value;\n }\n\n protected setupItemsObservable(): Observable<OperationTemplate[]> {\n return fromTriggerOnce<OperationTemplate>(undefined, this.refresh$, [\n getInjectedHooks<OperationTemplate>(HOOK_OPERATION_TEMPLATE, this.injectors),\n () => this.factories\n ]).pipe(distinctUntilChanged(), shareReplay(1));\n }\n}\n","import { Component, DestroyRef, inject, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport {\n FormBuilder,\n FormControl,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\nimport {\n CommonModule,\n CoreModule,\n ModalModule,\n ModalLabels,\n C8yTranslateModule\n} from '@c8y/ngx-components';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { TranslateService } from '@ngx-translate/core';\nimport { DeviceShellService, DeviceShellTemplate } from '@c8y/ngx-components/device-shell';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Observable, startWith, withLatestFrom } from 'rxjs';\nimport { OperationTemplate } from '../operation-template.hook';\nimport { OperationTemplateService } from '../operation-template.service';\nimport { OperationModalInitialConfig } from '../operation-picker.model';\n\ninterface OperationRenderForm {\n buttonLabel: FormControl<string>;\n operation: FormControl<string | null>;\n command: FormControl<string>;\n}\n\ninterface OperationRenderFormValue {\n buttonLabel: string;\n operation: string | null;\n command: string;\n}\n\ninterface PredefinedOperation {\n name: string;\n command: Record<string, unknown>;\n}\n\n@Component({\n selector: 'c8y-operation-render-type-modal',\n templateUrl: './operation-modal.component.html',\n standalone: true,\n imports: [\n ModalModule,\n FormsModule,\n ReactiveFormsModule,\n C8yTranslateModule,\n CommonModule,\n CoreModule\n ],\n providers: [DeviceShellService],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class OperationModalComponent implements OnInit {\n showButtonLabelOnly = false;\n initialConfig: OperationModalInitialConfig = {};\n deviceTypes: string[] = [];\n templates: DeviceShellTemplate[] = [];\n pluginTemplates$!: Observable<OperationTemplate[]>;\n predefinedOperations: PredefinedOperation[] = [\n {\n name: gettext('Restart device'),\n command: { description: gettext('Restart device'), c8y_Restart: {} }\n },\n {\n name: gettext('Change relay status to OPEN'),\n command: {\n description: gettext('Change relay status to OPEN.'),\n c8y_Relay: { relayState: 'OPEN' }\n }\n },\n {\n name: gettext('Change relay status to CLOSED'),\n command: {\n description: gettext('Change relay status to CLOSED.'),\n c8y_Relay: { relayState: 'CLOSED' }\n }\n }\n ];\n\n labels: ModalLabels = { ok: gettext('Save'), cancel: gettext('Cancel') };\n form!: FormGroup<OperationRenderForm>;\n\n result: Promise<OperationRenderFormValue> = new Promise((resolve, reject) => {\n this._save = resolve;\n this._cancel = reject;\n });\n\n get modalTitle(): string {\n if (this.showButtonLabelOnly) {\n return this.translate.instant(gettext('Maintenance mode'));\n }\n const buttonLabel = this.form?.get('buttonLabel')?.value;\n return buttonLabel\n ? this.translate.instant(gettext('Edit operation'))\n : this.translate.instant(gettext('Create operation'));\n }\n\n private _save!: (value: OperationRenderFormValue) => void;\n private _cancel!: () => void;\n\n private readonly fb = inject(FormBuilder);\n private readonly translate = inject(TranslateService);\n private readonly deviceShellService = inject(DeviceShellService);\n private readonly operationTemplateService = inject(OperationTemplateService);\n private readonly destroyRef = inject(DestroyRef);\n\n async ngOnInit(): Promise<void> {\n const defaultCommand = JSON.stringify(\n { description: 'Command description', c8y_Command: { text: '<command>' } },\n null,\n 2\n );\n\n this.form = this.fb.group<OperationRenderForm>({\n buttonLabel: new FormControl(this.initialConfig?.buttonLabel ?? '', {\n validators: [Validators.required]\n }),\n operation: new FormControl<string | null>(this.initialConfig?.operationType ?? null),\n command: new FormControl(this.initialConfig?.command ?? defaultCommand, {\n validators: [Validators.required]\n })\n });\n\n if (this.deviceTypes?.length) {\n const loadedTemplates = await this.deviceShellService.getCommandTemplatesForDeviceType(\n this.deviceTypes\n );\n this.templates = loadedTemplates.map(t => ({\n name: t.name,\n text: t.text,\n category: t.category\n }));\n }\n\n this.pluginTemplates$ = this.operationTemplateService.items$;\n\n this.form\n .get('operation')\n ?.valueChanges.pipe(\n withLatestFrom(this.pluginTemplates$.pipe(startWith([] as OperationTemplate[]))),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(([selectedName, pluginTemplates]) => {\n const predefined = [...this.predefinedOperations, ...pluginTemplates].find(\n p => p.name === selectedName\n );\n if (predefined) {\n this.form.get('command')?.setValue(JSON.stringify(predefined.command, null, 2));\n return;\n }\n\n const template = this.templates.find(t => t.name === selectedName);\n if (template) {\n const cmd = JSON.stringify(\n { description: template.name, c8y_Command: { text: template.text } },\n null,\n 2\n );\n this.form.get('command')?.setValue(cmd);\n }\n });\n }\n\n onClose(_: unknown) {\n if (this.form.valid) {\n this._save(this.form.getRawValue());\n }\n }\n\n onDismiss(_: unknown) {\n this._cancel();\n }\n}\n","<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n","import { inject, Injectable } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { OperationModalInitialConfig, OperationModalResult } from './operation-picker.model';\nimport { OperationModalComponent } from './modal/operation-modal.component';\n\n@Injectable({ providedIn: 'root' })\nexport class OperationPickerService {\n private readonly modalService = inject(BsModalService);\n\n /**\n *\n * @param options Modal configuration options\n * `showButtonLabelOnly` - if `true`, only button label will be shown in the modal, otherwise user will be able to select both operation and command. This is useful when you want to allow users to select only predefined operations (e.g. restart, shutdown) without showing them the underlying operation types and commands.\n * `deviceTypes` - list of device types to filter available operations. Only operations applicable to the provided device types will be shown in the modal.\n * `initialConfig` - initial configuration for the modal form. This is useful when you want to edit existing configuration, so you can prefill the form with existing values.\n * @returns\n */\n async openModal(options: {\n showButtonLabelOnly: boolean;\n deviceTypes: string[];\n initialConfig?: Partial<OperationModalInitialConfig>;\n }): Promise<OperationModalResult> {\n const modal = this.modalService.show(OperationModalComponent, {\n class: 'modal-sm',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title',\n ignoreBackdropClick: true,\n initialState: {\n initialConfig: options.initialConfig ?? {},\n showButtonLabelOnly: options.showButtonLabelOnly,\n deviceTypes: options.deviceTypes\n }\n }).content;\n\n return modal.result;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,uBAAuB,GAAG,IAAI,cAAc,CACvD,yBAAyB,CAC1B;AAED;;;;;;;;;;;;AAYG;AACG,SAAU,qBAAqB,CACnC,QAA4C,EAC5C,OAAqC,EAAA;IAErC,OAAO,WAAW,CAAoB,QAAQ,EAAE,uBAAuB,EAAE,OAAO,CAAC;AACnF;;AC1DM,MAAO,wBAAyB,SAAQ,wBAA2C,CAAA;IAGvF,WAAA,CAAY,YAAsB,EAAE,aAAoC,EAAA;AACtE,QAAA,KAAK,CAAC,YAAY,EAAE,aAAa,CAAC;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,oBAAoB,EAAE;IAC3C;AAEA,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;IAC1B;IAEU,oBAAoB,GAAA;AAC5B,QAAA,OAAO,eAAe,CAAoB,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE;AAClE,YAAA,gBAAgB,CAAoB,uBAAuB,EAAE,IAAI,CAAC,SAAS,CAAC;AAC5E,YAAA,MAAM,IAAI,CA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,cAAc,CAAC;AA6BvD,IAAA;AA3BC;;;;;;;AAOG;IACH,MAAM,SAAS,CAAC,OAIf,EAAA;QACC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE;AAC5D,YAAA,KAAK,EAAE,UAAU;AACjB,YAAA,eAAe,EAAE,YAAY;AAC7B,YAAA,cAAc,EAAE,aAAa;AAC7B,YAAA,mBAAmB,EAAE,IAAI;AACzB,YAAA,YAAY,EAAE;AACZ,gBAAA,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,EAAE;gBAC1C,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;gBAChD,WAAW,EAAE,OAAO,CAAC;AACtB;SACF,CAAC,CAAC,OAAO;QAEV,OAAO,KAAK,CAAC,MAAM;IACrB;+GA7BW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;;4FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACLlC;;AAEG;;;;"}
1
+ {"version":3,"file":"c8y-ngx-components-operation-picker.mjs","sources":["../../operation-picker/operation-template.hook.ts","../../operation-picker/operation-template.service.ts","../../operation-picker/modal/operation-modal.component.ts","../../operation-picker/modal/operation-modal.component.html","../../operation-picker/operation-picker.service.ts","../../operation-picker/c8y-ngx-components-operation-picker.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { GenericHookOptions, GenericHookType, hookGeneric } from '@c8y/ngx-components';\n\n/**\n * Represents a predefined operation template that can be registered\n * and selected in the operation render type modal.\n */\nexport interface OperationTemplate {\n /** Display name shown in the dropdown. */\n name: string;\n /** The operation command object that will be serialized as JSON into the command field.\n * The command object must contain a `description` property, which will be used as the description of the operation in the UI.\n * The rest of the properties can be defined based on the requirements of the specific operation.\n * For example, a restart operation might look like this:\n * ```\n * {\n * description: 'Restart device',\n * c8y_Restart: {}\n * }\n * ```\n * Or a more complex command with parameters:\n * ```\n * {\n * description: 'Set relay status to OPEN',\n * c8y_Relay: {\n * relayState: 'OPEN'\n * }\n * }\n * ```\n */\n command: Record<string, unknown>;\n}\n\n/**\n * Injection token for registering additional operation templates.\n *\n * Use the `hookOperationTemplate` helper to register templates from a plugin:\n *\n * ```typescript\n * // Provide a single template\n * hookOperationTemplate({ name: 'Restart device', command: { c8y_Restart: {} } })\n *\n * // Provide multiple templates\n * hookOperationTemplate([\n * { name: 'Restart device', command: { c8y_Restart: {} } },\n * { name: 'Set relay OPEN', command: { c8y_Relay: { relayState: 'OPEN' } } }\n * ])\n * ```\n */\nexport const HOOK_OPERATION_TEMPLATE = new InjectionToken<OperationTemplate[]>(\n 'HOOK_OPERATION_TEMPLATE'\n);\n\n/**\n * Registers one or more operation templates to be shown in the operation modal selector.\n *\n * @example\n * ```typescript\n * \\@NgModule({\n * providers: [\n * hookOperationTemplate({ name: 'Restart device', command: { c8y_Restart: {} } })\n * ]\n * })\n * export class MyPlugin {}\n * ```\n */\nexport function hookOperationTemplate(\n template: GenericHookType<OperationTemplate>,\n options?: Partial<GenericHookOptions>\n) {\n return hookGeneric<OperationTemplate>(template, HOOK_OPERATION_TEMPLATE, options);\n}\n","import { Injectable, Injector } from '@angular/core';\nimport {\n ExtensionPointForPlugins,\n fromTriggerOnce,\n getInjectedHooks,\n PluginsResolveService\n} from '@c8y/ngx-components';\nimport { distinctUntilChanged, Observable, shareReplay } from 'rxjs';\nimport { HOOK_OPERATION_TEMPLATE, OperationTemplate } from './operation-template.hook';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OperationTemplateService extends ExtensionPointForPlugins<OperationTemplate> {\n items$: Observable<OperationTemplate[]>;\n\n constructor(rootInjector: Injector, pluginService: PluginsResolveService) {\n super(rootInjector, pluginService);\n this.items$ = this.setupItemsObservable();\n }\n\n get state() {\n return this.state$.value;\n }\n\n protected setupItemsObservable(): Observable<OperationTemplate[]> {\n return fromTriggerOnce<OperationTemplate>(undefined, this.refresh$, [\n getInjectedHooks<OperationTemplate>(HOOK_OPERATION_TEMPLATE, this.injectors),\n () => this.factories\n ]).pipe(distinctUntilChanged(), shareReplay(1));\n }\n}\n","import { Component, DestroyRef, inject, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport {\n FormBuilder,\n FormControl,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators\n} from '@angular/forms';\nimport {\n CommonModule,\n CoreModule,\n ModalModule,\n ModalLabels,\n C8yTranslateModule\n} from '@c8y/ngx-components';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { TranslateService } from '@ngx-translate/core';\nimport { DeviceShellService, DeviceShellTemplate } from '@c8y/ngx-components/device-shell';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Observable, startWith, withLatestFrom } from 'rxjs';\nimport { OperationTemplate } from '../operation-template.hook';\nimport { OperationTemplateService } from '../operation-template.service';\nimport { OperationModalInitialConfig } from '../operation-picker.model';\n\ninterface OperationRenderForm {\n buttonLabel: FormControl<string>;\n operation: FormControl<string | null>;\n command: FormControl<string>;\n}\n\ninterface OperationRenderFormValue {\n buttonLabel: string;\n operation: string | null;\n command: string;\n}\n\ninterface PredefinedOperation {\n name: string;\n command: Record<string, unknown>;\n}\n\n@Component({\n selector: 'c8y-operation-render-type-modal',\n templateUrl: './operation-modal.component.html',\n standalone: true,\n imports: [\n ModalModule,\n FormsModule,\n ReactiveFormsModule,\n C8yTranslateModule,\n CommonModule,\n CoreModule\n ],\n providers: [DeviceShellService],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class OperationModalComponent implements OnInit {\n showButtonLabelOnly = false;\n initialConfig: OperationModalInitialConfig = {};\n deviceTypes: string[] = [];\n templates: DeviceShellTemplate[] = [];\n pluginTemplates$!: Observable<OperationTemplate[]>;\n predefinedOperations: PredefinedOperation[] = [\n {\n name: gettext('Restart device'),\n command: { description: gettext('Restart device'), c8y_Restart: {} }\n },\n {\n name: gettext('Change relay status to OPEN'),\n command: {\n description: gettext('Change relay status to OPEN.'),\n c8y_Relay: { relayState: 'OPEN' }\n }\n },\n {\n name: gettext('Change relay status to CLOSED'),\n command: {\n description: gettext('Change relay status to CLOSED.'),\n c8y_Relay: { relayState: 'CLOSED' }\n }\n }\n ];\n\n labels: ModalLabels = { ok: gettext('Save'), cancel: gettext('Cancel') };\n form!: FormGroup<OperationRenderForm>;\n\n result: Promise<OperationRenderFormValue> = new Promise((resolve, reject) => {\n this._save = resolve;\n this._cancel = reject;\n });\n\n get modalTitle(): string {\n if (this.showButtonLabelOnly) {\n return this.translate.instant(gettext('Maintenance mode'));\n }\n const buttonLabel = this.form?.get('buttonLabel')?.value;\n return buttonLabel\n ? this.translate.instant(gettext('Edit operation'))\n : this.translate.instant(gettext('Create operation'));\n }\n\n private _save!: (value: OperationRenderFormValue) => void;\n private _cancel!: () => void;\n\n private readonly fb = inject(FormBuilder);\n private readonly translate = inject(TranslateService);\n private readonly deviceShellService = inject(DeviceShellService);\n private readonly operationTemplateService = inject(OperationTemplateService);\n private readonly destroyRef = inject(DestroyRef);\n\n async ngOnInit(): Promise<void> {\n const defaultCommand = JSON.stringify(\n { description: 'Command description', c8y_Command: { text: '<command>' } },\n null,\n 2\n );\n\n this.form = this.fb.group<OperationRenderForm>({\n buttonLabel: new FormControl(this.initialConfig?.buttonLabel ?? '', {\n validators: [Validators.required]\n }),\n operation: new FormControl<string | null>(this.initialConfig?.operationType ?? null),\n command: new FormControl(this.initialConfig?.command ?? defaultCommand, {\n validators: [Validators.required]\n })\n });\n\n if (this.deviceTypes?.length) {\n const loadedTemplates = await this.deviceShellService.getCommandTemplatesForDeviceType(\n this.deviceTypes\n );\n this.templates = loadedTemplates.map(t => ({\n name: t.name,\n text: t.text,\n category: t.category\n }));\n }\n\n this.pluginTemplates$ = this.operationTemplateService.items$;\n\n this.form\n .get('operation')\n ?.valueChanges.pipe(\n withLatestFrom(this.pluginTemplates$.pipe(startWith([] as OperationTemplate[]))),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(([selectedName, pluginTemplates]) => {\n const predefined = [...this.predefinedOperations, ...pluginTemplates].find(\n p => p.name === selectedName\n );\n if (predefined) {\n this.form.get('command')?.setValue(JSON.stringify(predefined.command, null, 2));\n return;\n }\n\n const template = this.templates.find(t => t.name === selectedName);\n if (template) {\n const cmd = JSON.stringify(\n { description: template.name, c8y_Command: { text: template.text } },\n null,\n 2\n );\n this.form.get('command')?.setValue(cmd);\n }\n });\n }\n\n onClose(_: unknown) {\n if (this.form.valid) {\n this._save(this.form.getRawValue());\n }\n }\n\n onDismiss(_: unknown) {\n this._cancel();\n }\n}\n","<c8y-modal\n [title]=\"modalTitle\"\n (onClose)=\"onClose($event)\"\n (onDismiss)=\"onDismiss($event)\"\n [labels]=\"labels\"\n [disabled]=\"form?.invalid\"\n [headerClasses]=\"'dialog-header'\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'cog'\"></span>\n </ng-container>\n <form [formGroup]=\"form\">\n <c8y-form-group>\n <label\n for=\"buttonLabel\"\n translate\n >\n Button label\n </label>\n <input\n class=\"form-control\"\n id=\"buttonLabel\"\n placeholder=\"{{ 'e.g. Execute operation' | translate }}\"\n type=\"text\"\n formControlName=\"buttonLabel\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n @if (!showButtonLabelOnly) {\n <div class=\"form-group\">\n <label\n for=\"operation\"\n translate\n >\n Operation\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"operation\"\n formControlName=\"operation\"\n >\n <optgroup label=\"{{ 'Predefined' | translate }}\">\n @for (op of predefinedOperations; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n @let pluginTemplates = pluginTemplates$ | async;\n @if (pluginTemplates?.length) {\n <optgroup label=\"{{ 'Plugin templates' | translate }}\">\n @for (op of pluginTemplates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n @if (templates.length) {\n <optgroup label=\"{{ 'Device templates' | translate }}\">\n @for (op of templates; track op.name) {\n <option [ngValue]=\"op.name\">{{ op.name | translate }}</option>\n }\n </optgroup>\n }\n </select>\n </div>\n </div>\n <div class=\"form-group\">\n <label\n for=\"command\"\n translate\n >\n Command\n </label>\n <textarea\n class=\"form-control no-resize inner-scroll\"\n style=\"max-height: 300px\"\n id=\"command\"\n c8y-textarea-autoresize\n formControlName=\"command\"\n maxlength=\"900\"\n ></textarea>\n </div>\n }\n </form>\n</c8y-modal>\n","import { inject, Injectable } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { OperationModalInitialConfig, OperationModalResult } from './operation-picker.model';\nimport { OperationModalComponent } from './modal/operation-modal.component';\n\n@Injectable({ providedIn: 'root' })\nexport class OperationPickerService {\n private readonly modalService = inject(BsModalService);\n\n /**\n *\n * @param options Modal configuration options\n * `showButtonLabelOnly` - if `true`, only button label will be shown in the modal, otherwise user will be able to select both operation and command. This is useful when you want to allow users to select only predefined operations (e.g. restart, shutdown) without showing them the underlying operation types and commands.\n * `deviceTypes` - list of device types to filter available operations. Only operations applicable to the provided device types will be shown in the modal.\n * `initialConfig` - initial configuration for the modal form. This is useful when you want to edit existing configuration, so you can prefill the form with existing values.\n * @returns\n */\n async openModal(options: {\n showButtonLabelOnly: boolean;\n deviceTypes: string[];\n initialConfig?: Partial<OperationModalInitialConfig>;\n }): Promise<OperationModalResult> {\n const modal = this.modalService.show(OperationModalComponent, {\n class: 'modal-sm',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title',\n ignoreBackdropClick: true,\n initialState: {\n initialConfig: options.initialConfig ?? {},\n showButtonLabelOnly: options.showButtonLabelOnly,\n deviceTypes: options.deviceTypes\n }\n }).content;\n\n return modal.result;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,uBAAuB,GAAG,IAAI,cAAc,CACvD,yBAAyB,CAC1B;AAED;;;;;;;;;;;;AAYG;AACG,SAAU,qBAAqB,CACnC,QAA4C,EAC5C,OAAqC,EAAA;IAErC,OAAO,WAAW,CAAoB,QAAQ,EAAE,uBAAuB,EAAE,OAAO,CAAC;AACnF;;AC1DM,MAAO,wBAAyB,SAAQ,wBAA2C,CAAA;IAGvF,WAAA,CAAY,YAAsB,EAAE,aAAoC,EAAA;AACtE,QAAA,KAAK,CAAC,YAAY,EAAE,aAAa,CAAC;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,oBAAoB,EAAE;IAC3C;AAEA,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;IAC1B;IAEU,oBAAoB,GAAA;AAC5B,QAAA,OAAO,eAAe,CAAoB,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE;AAClE,YAAA,gBAAgB,CAAoB,uBAAuB,EAAE,IAAI,CAAC,SAAS,CAAC;AAC5E,YAAA,MAAM,IAAI,CAAC;SACZ,CAAC,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACjD;+GAjBW,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,qBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA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