{"version":3,"sources":["src/app/pages/internal/incidents/components/incident-priority-switch/incident-priority-switch.component.ts","src/app/pages/internal/incidents/components/incident-priority-switch/incident-priority-switch.component.html","src/app/pages/internal/incidents/components/incident-state-switch/incident-state-switch.component.ts","src/app/pages/internal/incidents/components/incident-state-switch/incident-state-switch.component.html","src/app/core/components/chip/chip.component.ts","src/app/core/components/chip/chip.component.html"],"sourcesContent":["import { Component, inject, Input, OnChanges } from '@angular/core';\nimport { Store } from '@ngxs/store';\nimport {\n VDropdownButtonComponent,\n VDropdownButtonItem,\n} from 'src/app/core/components/ui-kit/dropdown-button/dropdown-button.component';\nimport { VDropdownSize } from 'src/app/core/components/ui-kit/select-button/select-button.component';\nimport { SharedModule } from 'src/app/core/shared.module';\nimport { Incident } from 'src/app/models/incident';\nimport {\n UpdateIncidentPriorityAction,\n UpdateSelectedIncidentPriority,\n} from '../../../../../store/incidents/incidents.actions';\n\n@Component({\n imports: [VDropdownButtonComponent, SharedModule],\n selector: 'app-incident-priority-switch',\n templateUrl: './incident-priority-switch.component.html',\n styleUrls: ['./incident-priority-switch.component.scss'],\n})\nexport class IncidentPrioritySwitchComponent implements OnChanges {\n private store = inject(Store);\n\n @Input({ required: true }) incident!: Incident;\n @Input() size: VDropdownSize = 'md';\n @Input() context: 'global' | 'details' = 'details';\n\n ngOnChanges(): void {\n this.generateMenuEntries();\n }\n\n isUpdating = false;\n availableDropdownItems: VDropdownButtonItem[] = [];\n\n get currentIncidentState(): VDropdownButtonItem {\n return {\n id: this.incident?.priority.id || '',\n label: this.incident?.priority.name || '',\n bgColor: this.incident?.priority.color || '',\n image: this.incident?.priority.icon,\n };\n }\n\n generateMenuEntries() {\n if (!this.incident) return;\n\n this.availableDropdownItems = this.incident.schemaVersion.priorities.map(\n priority => {\n return {\n id: priority.id,\n label: priority.name,\n bgColor: priority.color,\n image: priority.icon,\n };\n }\n );\n }\n\n async onIncidentPriorityChange(item: VDropdownButtonItem) {\n if (!this.incident) return;\n\n const priority = this.incident.schemaVersion.priorities.find(\n s => s.id === item.id\n );\n\n if (!priority) return;\n\n let action: any;\n\n if (this.context === 'global') {\n action = new UpdateIncidentPriorityAction(this.incident.id, priority.id);\n } else {\n action = new UpdateSelectedIncidentPriority(priority.id);\n }\n\n this.store.dispatch(action).subscribe({\n complete: () => {\n this.isUpdating = false;\n },\n error: () => {\n this.isUpdating = false;\n },\n });\n }\n}\n","
\n \n
\n","import { Component, inject, Input } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { Store } from '@ngxs/store';\nimport {\n VDropdownButtonComponent,\n VDropdownButtonItem,\n VDropdownSize,\n} from 'src/app/core/components/ui-kit/dropdown-button/dropdown-button.component';\nimport { Incident } from 'src/app/models/incident';\nimport {\n UpdateIncidentStateAction,\n UpdateSelectedIncidentState,\n} from '../../../../../store/incidents/incidents.actions';\n\n@Component({\n imports: [VDropdownButtonComponent],\n selector: 'app-incident-state-switch',\n templateUrl: './incident-state-switch.component.html',\n styleUrls: ['./incident-state-switch.component.scss'],\n})\nexport class IncidentStateSwitchComponent {\n private store = inject(Store);\n\n private t = inject(TranslateService);\n\n @Input() size: VDropdownSize = 'lg';\n\n @Input() context: 'global' | 'details' = 'details';\n\n @Input()\n public set incident(incident: Incident) {\n this._incident = incident;\n this.generateMenuEntries();\n }\n\n availableDropdownItems: VDropdownButtonItem[] = [];\n _incident?: Incident;\n isUpdating = false;\n\n get currentIncidentState(): VDropdownButtonItem {\n return {\n id: this._incident?.state.id || '',\n label: this._incident?.state.name || 'New',\n bgColor: this._incident?.state.color || 'rgb(198, 44, 44)',\n image: this._incident?.state.icon,\n };\n }\n\n generateMenuEntries() {\n if (!this._incident) return;\n\n const dropdownItems: VDropdownButtonItem[] = [];\n\n this._incident.schemaVersion.states.forEach(state => {\n if (state.id === this._incident?.state.id) return;\n\n dropdownItems.push({\n id: state.id,\n label: state.name,\n bgColor: state.color,\n image: state.icon,\n });\n });\n\n this.availableDropdownItems = dropdownItems;\n }\n\n async onIncidentStateChange(item: VDropdownButtonItem) {\n if (!this._incident) return;\n\n const state = this._incident.schemaVersion.states.find(\n s => s.id === item.id\n );\n\n if (!state) return;\n\n let action: any;\n\n if (this.context === 'global') {\n action = new UpdateIncidentStateAction(this._incident.id, state.id);\n } else {\n action = new UpdateSelectedIncidentState(state.id);\n }\n\n this.store.dispatch(action).subscribe({\n complete: () => {\n this.isUpdating = false;\n },\n error: () => {\n this.isUpdating = false;\n },\n });\n }\n}\n","
\n \n
\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { NgIf } from '@angular/common';\nimport { RouterLink } from '@angular/router';\n\n@Component({\n selector: 'app-chip',\n templateUrl: './chip.component.html',\n styleUrls: ['./chip.component.scss'],\n imports: [NgIf, RouterLink]\n})\nexport class ChipComponent {\n @Input() label = '';\n @Input() icon?: string;\n @Input() image?: string;\n @Input() link?: string;\n @Input() routerLink?: string;\n\n @Input() showDelete = false;\n @Output() deleted = new EventEmitter();\n\n onClickDelete() {\n this.deleted.emit();\n }\n}\n","
\n
\n \n
\n \n \"avatar\"\n
\n {{ label }}\n {{ label }}\n {{ label }}\n
\n \n
\n
\n"],"names":["IncidentPrioritySwitchComponent","constructor","store","inject","Store","size","context","isUpdating","availableDropdownItems","ngOnChanges","generateMenuEntries","currentIncidentState","id","incident","priority","label","name","bgColor","color","image","icon","schemaVersion","priorities","map","onIncidentPriorityChange","item","__async","find","s","action","UpdateIncidentPriorityAction","UpdateSelectedIncidentPriority","dispatch","subscribe","complete","error","selectors","inputs","features","ɵɵNgOnChangesFeature","decls","vars","consts","template","rf","ctx","ɵɵelementStart","ɵɵlistener","$event","ɵɵelementEnd","ɵɵproperty","ɵɵpureFunction3","_c0","ɵɵadvance","VDropdownButtonComponent","SharedModule","NgClass","styles","IncidentStateSwitchComponent","constructor","store","inject","Store","t","TranslateService","size","context","availableDropdownItems","isUpdating","incident","_incident","generateMenuEntries","currentIncidentState","id","state","label","name","bgColor","color","image","icon","dropdownItems","schemaVersion","states","forEach","push","onIncidentStateChange","item","__async","find","s","action","UpdateIncidentStateAction","UpdateSelectedIncidentState","dispatch","subscribe","complete","error","selectors","inputs","decls","vars","consts","template","rf","ctx","ɵɵelementStart","ɵɵlistener","$event","ɵɵelementEnd","ɵɵadvance","ɵɵproperty","VDropdownButtonComponent","styles","ɵɵelement","ɵɵclassMap","ctx_r0","icon","ɵɵproperty","image","ɵɵsanitizeUrl","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","link","ɵɵadvance","ɵɵtextInterpolate","label","ɵɵlistener","ɵɵrestoreView","_r2","ɵɵnextContext","ɵɵresetView","onClickDelete","ChipComponent","constructor","showDelete","deleted","EventEmitter","emit","selectors","inputs","routerLink","outputs","decls","vars","consts","template","rf","ctx","ɵɵtemplate","ChipComponent_i_4_Template","ChipComponent_img_5_Template","ChipComponent_a_6_Template","ChipComponent_a_7_Template","ChipComponent_span_8_Template","ChipComponent_button_9_Template","ɵɵclassProp","NgIf","RouterLink","styles"],"mappings":";;wbAoBaA,IAA+B,IAAA,CAAtC,MAAOA,CAA+B,CAN5CC,aAAA,CAOU,KAAAC,MAAQC,EAAOC,CAAK,EAGnB,KAAAC,KAAsB,KACtB,KAAAC,QAAgC,UAMzC,KAAAC,WAAa,GACb,KAAAC,uBAAgD,CAAA,EALhDC,aAAW,CACT,KAAKC,oBAAmB,CAC1B,CAKA,IAAIC,sBAAoB,CACtB,MAAO,CACLC,GAAI,KAAKC,UAAUC,SAASF,IAAM,GAClCG,MAAO,KAAKF,UAAUC,SAASE,MAAQ,GACvCC,QAAS,KAAKJ,UAAUC,SAASI,OAAS,GAC1CC,MAAO,KAAKN,UAAUC,SAASM,KAEnC,CAEAV,qBAAmB,CACZ,KAAKG,WAEV,KAAKL,uBAAyB,KAAKK,SAASQ,cAAcC,WAAWC,IACnET,IACS,CACLF,GAAIE,EAASF,GACbG,MAAOD,EAASE,KAChBC,QAASH,EAASI,MAClBC,MAAOL,EAASM,MAEnB,EAEL,CAEMI,yBAAyBC,EAAyB,QAAAC,E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