@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
1 lines • 13 kB
Source Map (JSON)
{"version":3,"file":"c8y-ngx-components-operations-operation-details.mjs","sources":["../../operations/operation-details/operation-details-modal.component.ts","../../operations/operation-details/operation-details-modal.component.html","../../operations/operation-details/operation-details.service.ts","../../operations/operation-details/operation-details.component.ts","../../operations/operation-details/operation-details.component.html","../../operations/operation-details/operation-details.module.ts","../../operations/operation-details/c8y-ngx-components-operations-operation-details.ts"],"sourcesContent":["import { Component, Input } from '@angular/core';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { IOperation } from '@c8y/client';\nimport {\n OperationsListService,\n OperationsListItemComponent\n} from '@c8y/ngx-components/operations/operations-list';\nimport { C8yTranslatePipe } from '@c8y/ngx-components';\n@Component({\n selector: 'c8y-operation-details-modal',\n templateUrl: './operation-details-modal.component.html',\n imports: [OperationsListItemComponent, C8yTranslatePipe]\n})\nexport class OperationDetailsModalComponent {\n @Input() operation: Partial<IOperation>;\n @Input() collapsed = false;\n @Input() readOnly = false;\n isSmartRulesMicroserviceAvailable = false;\n\n constructor(\n public modalRef: BsModalRef,\n private operationsListService: OperationsListService\n ) {}\n\n async ngOnInit() {\n this.isSmartRulesMicroserviceAvailable =\n await this.operationsListService.isSmartRulesMicroserviceAvailable();\n }\n}\n","<div class=\"viewport-modal\">\n <div class=\"modal-header separator\">\n <h3 id=\"modal-title\">{{ 'Single operation details' | translate }}</h3>\n </div>\n\n <div\n class=\"modal-inner-scroll\"\n id=\"modal-body\"\n >\n <c8y-operations-list-item\n [operation]=\"operation\"\n [collapsed]=\"collapsed\"\n [noExpandToggle]=\"true\"\n [readOnly]=\"readOnly\"\n [isSmartRulesMicroserviceAvailable]=\"isSmartRulesMicroserviceAvailable\"\n ></c8y-operations-list-item>\n </div>\n\n <div class=\"modal-footer\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Close' | translate }}\"\n type=\"button\"\n (click)=\"modalRef.hide()\"\n >\n {{ 'Close' | translate }}\n </button>\n </div>\n</div>\n","import { Injectable } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { IOperation, OperationService } from '@c8y/client';\nimport { OperationDetailsModalComponent } from './operation-details-modal.component';\n\n@Injectable({ providedIn: 'root' })\nexport class OperationDetailsService {\n constructor(\n private operationService: OperationService,\n private modalService: BsModalService\n ) {}\n\n /**\n * Opens a modal window with the details of given single operation.\n * @param operationOrOperationId Operation's object or id.\n * @param options Additional options:\n * - `collapsed`: boolean - whether the details pane should be initially collapsed\n * - `readOnly`: boolean - whether the details should be displayed in read-only mode\n */\n async openDetails(\n operationOrOperationId: IOperation | string | number,\n options?: { collapsed?: boolean; readOnly?: boolean }\n ) {\n const operation: IOperation = (operationOrOperationId as IOperation).id\n ? (operationOrOperationId as IOperation)\n : (await this.operationService.detail(operationOrOperationId)).data;\n const initialState = { operation, ...options };\n\n this.modalService.show(OperationDetailsModalComponent, {\n initialState,\n class: 'modal-lg',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title'\n });\n }\n}\n","import { Component, forwardRef, Input } from '@angular/core';\nimport { IOperation } from '@c8y/client';\nimport {\n operationStatusClasses,\n operationStatusIcons,\n ProductExperienceEvent,\n ProductExperienceEventSource,\n PRODUCT_EXPERIENCE_EVENT_SOURCE,\n IconDirective,\n ProductExperienceDirective,\n C8yTranslatePipe,\n DatePipe\n} from '@c8y/ngx-components';\nimport { ACTIONS_OPERATIONS, COMPONENTS } from '@c8y/ngx-components/operations/product-experience';\nimport { OperationDetailsService } from './operation-details.service';\nimport { NgIf, NgClass } from '@angular/common';\nimport { TooltipDirective } from 'ngx-bootstrap/tooltip';\n\n/**\n * Operation details component displays a single operation's status, description and creationTime.\n *\n * ```html\n * <c8y-operation-details [operation]=\"operation\"></c8y-operation-details>\n * ```\n */\n@Component({\n selector: 'c8y-operation-details',\n templateUrl: './operation-details.component.html',\n providers: [\n {\n provide: PRODUCT_EXPERIENCE_EVENT_SOURCE,\n useExisting: forwardRef(() => OperationDetailsComponent)\n }\n ],\n imports: [\n NgIf,\n TooltipDirective,\n IconDirective,\n NgClass,\n ProductExperienceDirective,\n C8yTranslatePipe,\n DatePipe\n ]\n})\nexport class OperationDetailsComponent implements ProductExperienceEventSource {\n ACTIONS = ACTIONS_OPERATIONS;\n @Input() operation: IOperation;\n\n statusIcons: object;\n statusClasses: object;\n\n productExperienceEvent: ProductExperienceEvent = {\n eventName: undefined, // supress emitting events if a parent component does not declare event name\n data: {\n component: COMPONENTS.OPERATION_DETAILS\n }\n };\n\n constructor(private operationDetailsService: OperationDetailsService) {}\n\n ngOnInit() {\n this.statusIcons = operationStatusIcons;\n this.statusClasses = operationStatusClasses;\n }\n\n openDetails() {\n this.operationDetailsService.openDetails(this.operation);\n }\n}\n","<div class=\"c8y-list--group\" *ngIf=\"operation\">\n <a class=\"c8y-list__item\">\n <div class=\"c8y-list__item__block\">\n <div class=\"c8y-list__item__icon\">\n <button\n class=\"btn-clean\"\n type=\"button\"\n [attr.aria-label]=\"operation.status?.toString() | translate\"\n [tooltip]=\"operation.status?.toString() | translate\"\n [delay]=\"500\"\n placement=\"right\"\n container=\"body\"\n >\n <i\n [c8yIcon]=\"statusIcons[operation.status]\"\n [ngClass]=\"statusClasses[operation.status]\"\n ></i>\n </button>\n </div>\n <div class=\"c8y-list__item__body p-r-16\">\n <div class=\"content-flex-40\">\n <div class=\"col-8\">\n <button\n class=\"btn-clean text-truncate\"\n type=\"button\"\n title=\"{{ operation.description | translate }}\"\n (click)=\"openDetails()\"\n c8yProductExperience\n inherit\n [actionData]=\"{ action: ACTIONS.OPEN_OPERATION_DETAILS }\"\n >\n {{ operation.description | translate }}\n </button>\n </div>\n <div class=\"col-4 text-muted\">\n <small class=\"icon-flex\">\n <i c8yIcon=\"calendar\" class=\"m-r-4\"></i>\n <span>{{ operation.creationTime | c8yDate }}</span>\n </small>\n </div>\n </div>\n </div>\n </div>\n </a>\n</div>\n","import { NgModule } from '@angular/core';\nimport { BulkOperationListItemService } from '@c8y/ngx-components/operations/bulk-operation-list-item';\nimport { OperationDetailsComponent } from './operation-details.component';\nimport { OperationDetailsService } from './operation-details.service';\n\n/**\n * This module allows to display details of a single operation in a modal.\n */\n@NgModule({\n imports: [OperationDetailsComponent],\n providers: [OperationDetailsService, BulkOperationListItemService],\n exports: [OperationDetailsComponent]\n})\nexport class OperationDetailsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i1.OperationDetailsService"],"mappings":";;;;;;;;;;;;MAaa,8BAA8B,CAAA;IAMzC,WAAA,CACS,QAAoB,EACnB,qBAA4C,EAAA;QAD7C,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACP,IAAA,CAAA,qBAAqB,GAArB,qBAAqB;QANtB,IAAA,CAAA,SAAS,GAAG,KAAK;QACjB,IAAA,CAAA,QAAQ,GAAG,KAAK;QACzB,IAAA,CAAA,iCAAiC,GAAG,KAAK;IAKtC;AAEH,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,IAAI,CAAC,iCAAiC;AACpC,YAAA,MAAM,IAAI,CAAC,qBAAqB,CAAC,iCAAiC,EAAE;IACxE;+GAdW,8BAA8B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,qBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,8BAA8B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,SAAA,EAAA,WAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,E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