@digital-realty/ui-service-management 16.0.0 → 16.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sw.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
if(!self.define){let e,i={};const a=(a,n)=>(a=new URL(a+".js",n).href,i[a]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=a,e.onload=i,document.head.appendChild(e)}else e=a,importScripts(a),i()}).then(()=>{let e=i[a];if(!e)throw new Error(`Module ${a} didn’t register its module`);return e}));self.define=(n,r)=>{const s=e||("document"in self?document.currentScript.src:"")||location.href;if(i[s])return;let c={};const
|
|
1
|
+
if(!self.define){let e,i={};const a=(a,n)=>(a=new URL(a+".js",n).href,i[a]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=a,e.onload=i,document.head.appendChild(e)}else e=a,importScripts(a),i()}).then(()=>{let e=i[a];if(!e)throw new Error(`Module ${a} didn’t register its module`);return e}));self.define=(n,r)=>{const s=e||("document"in self?document.currentScript.src:"")||location.href;if(i[s])return;let c={};const f=e=>a(e,s),d={module:{uri:s},exports:c,require:f};i[s]=Promise.all(n.map(e=>d[e]||f(e))).then(e=>(r(...e),c))}}define(["./workbox-b865b753"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.html",revision:"33598f536a26a9f2ab0de37f455190f0"},{url:"ui-service-management.js",revision:"53cdd559177f451dee3caa88e60d0c58"},{url:"ui-service-management10.js",revision:"ff000e145ee14b518d9d59061e01239a"},{url:"ui-service-management11.js",revision:"bdb272eb21c1ba32658f367dad7c00cc"},{url:"ui-service-management12.js",revision:"3bf4c6643fac5b7d6ebaafc807e0726c"},{url:"ui-service-management13.js",revision:"7c4a6635e462946f4428bf102f9ba135"},{url:"ui-service-management14.js",revision:"24b5b9c123d65ad1c9aa09e9c3abc8cd"},{url:"ui-service-management15.js",revision:"13e9eeb4bb344420e56b4208905a40ea"},{url:"ui-service-management16.js",revision:"890788965779193e5d3e8d3a492cc60d"},{url:"ui-service-management17.js",revision:"3979f25210d7f57ed18e3fdacb7334ed"},{url:"ui-service-management18.js",revision:"eba0ac899ae9a77efc777382cae03998"},{url:"ui-service-management19.js",revision:"d0b562bc21b26a3749eccf4d618479ea"},{url:"ui-service-management2.js",revision:"c5f4cc8073df9072c902e7352bccc441"},{url:"ui-service-management20.js",revision:"5cc948776bad10a758d8828422ae5abe"},{url:"ui-service-management21.js",revision:"227ba29ca0e2fbd16ffe7a4f6195b8ff"},{url:"ui-service-management22.js",revision:"516f31c0c2696f188ba78363bbb6cc32"},{url:"ui-service-management23.js",revision:"75d90341de40d7d1a84db6d8b8620061"},{url:"ui-service-management24.js",revision:"967f1f7a5ea0ed2aeff55b804cc83f5b"},{url:"ui-service-management25.js",revision:"4c3512b6acd13f3da1d2afa2ded03baf"},{url:"ui-service-management26.js",revision:"8277e608c50996e2968f6843c2d5a45e"},{url:"ui-service-management27.js",revision:"3717c99adb4538f836b3f60d880b3e3f"},{url:"ui-service-management28.js",revision:"412edbe04f2235b5763377f03d3d110d"},{url:"ui-service-management29.js",revision:"64bd16997fd1c17bbc0cbcbace2851f2"},{url:"ui-service-management3.js",revision:"750f96b2a9b3be9d8a9cd4b96fa77304"},{url:"ui-service-management30.js",revision:"681bfcb112fbbfc72cfe7c10f3095cd3"},{url:"ui-service-management31.js",revision:"c261f7df0d6aebd863db256ffaf2724f"},{url:"ui-service-management4.js",revision:"ef70f4b8d266cf4ef6085d14083b66e8"},{url:"ui-service-management5.js",revision:"2d1f91db46f146aa1153612dd7b2274e"},{url:"ui-service-management6.js",revision:"7ec3d0af53cfb1d903c525b750e5f020"},{url:"ui-service-management7.js",revision:"69a3068583bc315f9c40a6b8a3e630e5"},{url:"ui-service-management8.js",revision:"f187b2794414d0806012b39399471bb8"},{url:"ui-service-management9.js",revision:"8384ac1a127cd1b2cb4c46e6bc085e6f"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"))),e.registerRoute("polyfills/*.js",new e.CacheFirst,"GET")});
|
|
2
2
|
//# sourceMappingURL=sw.js.map
|
package/dist/sw.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sw.js","sources":["../../../../../../tmp/
|
|
1
|
+
{"version":3,"file":"sw.js","sources":["../../../../../../tmp/5903266ba36e24b20aefee2f133b3c32/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/home/vsts/work/1/s/ui-service-management/node_modules/.pnpm/workbox-routing@6.6.0/node_modules/workbox-routing/registerRoute.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/home/vsts/work/1/s/ui-service-management/node_modules/.pnpm/workbox-strategies@6.6.0/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/home/vsts/work/1/s/ui-service-management/node_modules/.pnpm/workbox-core@6.6.0/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/vsts/work/1/s/ui-service-management/node_modules/.pnpm/workbox-precaching@6.6.0/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/home/vsts/work/1/s/ui-service-management/node_modules/.pnpm/workbox-routing@6.6.0/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/home/vsts/work/1/s/ui-service-management/node_modules/.pnpm/workbox-precaching@6.6.0/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"index.html\",\n \"revision\": \"33598f536a26a9f2ab0de37f455190f0\"\n },\n {\n \"url\": \"ui-service-management.js\",\n \"revision\": \"53cdd559177f451dee3caa88e60d0c58\"\n },\n {\n \"url\": \"ui-service-management10.js\",\n \"revision\": \"ff000e145ee14b518d9d59061e01239a\"\n },\n {\n \"url\": \"ui-service-management11.js\",\n \"revision\": \"bdb272eb21c1ba32658f367dad7c00cc\"\n },\n {\n \"url\": \"ui-service-management12.js\",\n \"revision\": \"3bf4c6643fac5b7d6ebaafc807e0726c\"\n },\n {\n \"url\": \"ui-service-management13.js\",\n \"revision\": \"7c4a6635e462946f4428bf102f9ba135\"\n },\n {\n \"url\": \"ui-service-management14.js\",\n \"revision\": \"24b5b9c123d65ad1c9aa09e9c3abc8cd\"\n },\n {\n \"url\": \"ui-service-management15.js\",\n \"revision\": \"13e9eeb4bb344420e56b4208905a40ea\"\n },\n {\n \"url\": \"ui-service-management16.js\",\n \"revision\": \"890788965779193e5d3e8d3a492cc60d\"\n },\n {\n \"url\": \"ui-service-management17.js\",\n \"revision\": \"3979f25210d7f57ed18e3fdacb7334ed\"\n },\n {\n \"url\": \"ui-service-management18.js\",\n \"revision\": \"eba0ac899ae9a77efc777382cae03998\"\n },\n {\n \"url\": \"ui-service-management19.js\",\n \"revision\": \"d0b562bc21b26a3749eccf4d618479ea\"\n },\n {\n \"url\": \"ui-service-management2.js\",\n \"revision\": \"c5f4cc8073df9072c902e7352bccc441\"\n },\n {\n \"url\": \"ui-service-management20.js\",\n \"revision\": \"5cc948776bad10a758d8828422ae5abe\"\n },\n {\n \"url\": \"ui-service-management21.js\",\n \"revision\": \"227ba29ca0e2fbd16ffe7a4f6195b8ff\"\n },\n {\n \"url\": \"ui-service-management22.js\",\n \"revision\": \"516f31c0c2696f188ba78363bbb6cc32\"\n },\n {\n \"url\": \"ui-service-management23.js\",\n \"revision\": \"75d90341de40d7d1a84db6d8b8620061\"\n },\n {\n \"url\": \"ui-service-management24.js\",\n \"revision\": \"967f1f7a5ea0ed2aeff55b804cc83f5b\"\n },\n {\n \"url\": \"ui-service-management25.js\",\n \"revision\": \"4c3512b6acd13f3da1d2afa2ded03baf\"\n },\n {\n \"url\": \"ui-service-management26.js\",\n \"revision\": \"8277e608c50996e2968f6843c2d5a45e\"\n },\n {\n \"url\": \"ui-service-management27.js\",\n \"revision\": \"3717c99adb4538f836b3f60d880b3e3f\"\n },\n {\n \"url\": \"ui-service-management28.js\",\n \"revision\": \"412edbe04f2235b5763377f03d3d110d\"\n },\n {\n \"url\": \"ui-service-management29.js\",\n \"revision\": \"64bd16997fd1c17bbc0cbcbace2851f2\"\n },\n {\n \"url\": \"ui-service-management3.js\",\n \"revision\": \"750f96b2a9b3be9d8a9cd4b96fa77304\"\n },\n {\n \"url\": \"ui-service-management30.js\",\n \"revision\": \"681bfcb112fbbfc72cfe7c10f3095cd3\"\n },\n {\n \"url\": \"ui-service-management31.js\",\n \"revision\": \"c261f7df0d6aebd863db256ffaf2724f\"\n },\n {\n \"url\": \"ui-service-management4.js\",\n \"revision\": \"ef70f4b8d266cf4ef6085d14083b66e8\"\n },\n {\n \"url\": \"ui-service-management5.js\",\n \"revision\": \"2d1f91db46f146aa1153612dd7b2274e\"\n },\n {\n \"url\": \"ui-service-management6.js\",\n \"revision\": \"7ec3d0af53cfb1d903c525b750e5f020\"\n },\n {\n \"url\": \"ui-service-management7.js\",\n \"revision\": \"69a3068583bc315f9c40a6b8a3e630e5\"\n },\n {\n \"url\": \"ui-service-management8.js\",\n \"revision\": \"f187b2794414d0806012b39399471bb8\"\n },\n {\n \"url\": \"ui-service-management9.js\",\n \"revision\": \"8384ac1a127cd1b2cb4c46e6bc085e6f\"\n }\n], {});\n\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"/index.html\")));\n\n\nworkbox_routing_registerRoute(\"polyfills/*.js\", new workbox_strategies_CacheFirst(), 'GET');\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","workbox","registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_strategies_CacheFirst"],"mappings":"inBAwBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,qCAEb,CAAE,GAEwBC,EAAAC,cAAC,IAAIC,EAAAA,gBAAgCC,EAAAA,wBAA2C,iBAGhFH,EAAAC,cAAC,iBAAkB,IAAIG,aAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as r}from"tslib";import{ifDefined as re}from"lit/directives/if-defined.js";import{MobxLitElement as E}from"@adobe/lit-mobx";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-dialog/ix-dialog.js";import"@digital-realty/ix-drawer/ix-drawer.js";import"@digital-realty/ix-progress/ix-progress.js";import{css as oe,html as s,nothing as T,LitElement as q}from"lit";import{property as h,state as p,customElement as f,query as ae}from"lit/decorators.js";import"./ui-service-management3.js";import{T as x,S as N,s as Z,d as P,a as n,r as B,b as M,A as $,D as ne,c as w,e as o,R as S,f as le,n as ce,g as de,P as z,h as U,o as pe,i as he,j as ue,k as ve,l as R,m as ge,p as me,q as ke,t as ye,u as Y,L as J,G as Te,v as F,w as we,x as Se,y as X}from"./ui-service-management.js";import{S as L,a as _}from"./ui-service-management9.js";import"./ui-service-management4.js";import"./ui-service-management5.js";import"./ui-service-management6.js";import"./ui-service-management7.js";import"./ui-service-management8.js";import"@digital-realty/ix-chip/ix-chip.js";import"@digital-realty/ix-date/ix-date.js";import"@digital-realty/ix-date-next/ix-date-next.js";import"@digital-realty/ix-grid/ix-grid-nav.js";import"@digital-realty/ix-grid/ix-grid-no-rows.js";import{Router as ee}from"@vaadin/router";import{A as Ce,F as g,O as y,b as V}from"./ui-service-management11.js";import{d as be}from"./ui-service-management12.js";import{g as fe,T as te}from"./ui-service-management13.js";import"@digital-realty/ix-select/ix-select.js";import"@digital-realty/ix-select/ix-select-option.js";import"@digital-realty/ix-wizard/ix-wizard-step.js";import"@digital-realty/ix-wizard/ix-wizard.js";import"@digital-realty/ix-email-list/ix-email-list.js";import"@digital-realty/ix-file-uploader/ix-file-uploader.js";import"@digital-realty/ix-textbox/ix-textbox.js";import"lit/directives/class-map.js";import"lit-html/directives/if-defined.js";import"lit-html/directives/unsafe-html.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"moment";import"@digital-realty/theme";import"moment-timezone";import"date-fns/format.js";import"mobx";import"mobx-persist-store";import"@digital-realty/ix-account-switcher";import"oidc-client-ts";import"lit-html/directives/until.js";import"libphonenumber-js";import"@digital-realty/ix-toast/ix-toasters.js";import"./ui-service-management10.js";import"@digital-realty/ix-divider/ix-divider.js";import"@digital-realty/ix-checkbox/ix-checkbox.js";import"@digital-realty/ix-radio/ix-radio.js";import"@digital-realty/ix-grid/ix-grid.js";import"./ui-service-management14.js";import"@digital-realty/ix-timer/ix-timer.js";import"@digital-realty/ix-toast/ix-message-toast.js";import"@digital-realty/ix-time/ix-time.js";import"lit/directives/ref.js";import"@digital-realty/ix-filter-select/ix-filter-select.js";import"intl-tel-input/utils";import"@digital-realty/ix-phone-input/ix-phone-input.js";import"@digital-realty/ix-accordion/ix-accordion.js";import"@digital-realty/ix-multi-select/ix-multi-select.js";import"@material/web/icon/icon.js";const ie={Read:"Read",Approve:"Approve"},K=oe`.ticket-card-list{display:flex;flex-direction:column;align-items:flex-start;gap:12px;cursor:pointer}.ticket-card{position:relative;display:grid;grid-template-columns:auto auto;grid-template-rows:min-content auto;grid-column-gap:24px;grid-row-gap:8px;border-radius:8px;padding-right:21px;background:#fff;box-shadow:0 0 0 1px #e1e4e8 inset}.ticket-card__icon{grid-column-start:1;grid-row-start:1;grid-row-end:span 2;display:flex;width:180px;min-height:160px;justify-content:center;align-items:center;flex-shrink:0;border-radius:8px 0 0 8px;background:var(--brand-gradient-corner-to-corner,linear-gradient(90deg,#1456e0 0,#0d2497 99.23%))}.ticket-card__title{grid-column-start:2;grid-row-start:1;color:var(--Text-Dark,#092241);font-family:var(--root-secondary-font);font-size:20px;font-style:normal;font-weight:700;line-height:24px;letter-spacing:.15px;margin:16px 0 0 0}.ticket-card__info{grid-column-start:2;grid-row-start:2;color:var(--Text-Dark-2nd,rgba(9,34,65,.6));font-family:var(--root-primary-font);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.25px;margin-bottom:38px}.ticket-card__button{grid-column-start:2;grid-row-start:2;display:flex;justify-content:center;align-items:center;color:var(--Primary-Main,#1456e0);text-align:center;font-family:var(--root-secondary-font);font-size:14px;font-style:normal;font-weight:700;line-height:normal;letter-spacing:1.25px;text-transform:uppercase;background:0 0;border:none;cursor:pointer;position:absolute;bottom:14px;right:16px;white-space:nowrap;padding:0}.dr-ticket-card-list{display:flex;flex-direction:column;gap:12px;margin:0 1rem}.dr-ticket-card{display:flex;gap:12px;flex-direction:column;padding:18px;border-radius:8px;background:#fff;box-shadow:0 0 0 1px #e1e4e8 inset;align-items:flex-start}.dr-ticket-card md-icon{--_disabled-icon-color:#fff}.dr-ticket-card-title{font-size:13pt;padding-bottom:15px}.dr-ticket-card-blocked-message{font-size:.75rem;line-height:1.33em}.ticket-card-container{width:100%}@media screen and (max-width:600px){.ticket-card{grid-template-columns:auto min-content;grid-template-rows:auto auto auto;grid-column-gap:0;padding:16px}.ticket-card__title{grid-column-start:1;grid-row-start:1;margin:0;line-height:32px}.ticket-card__icon{grid-column-start:2;grid-row-start:1;grid-row-end:unset;width:32px;height:32px;min-height:unset;border-radius:16px}.ticket-card__info{grid-column-start:1;grid-column-end:span 2;grid-row-start:2;margin-bottom:0}.ticket-card__button{grid-column-start:1;grid-column-end:span 2;grid-row-start:3;position:unset;justify-self:end}}`;let A=class extends E{constructor(){super(...arguments),this.selectedSite=void 0,this.removalsServiceBackend=void 0,this.deliveryBlocked=void 0}get deliveryDisabled(){return this.deliveryBlocked!==!1&&(this.removalsServiceBackend===N.ServiceNow||this.removalsServiceBackend===void 0)}async firstUpdated(){var e,t,i,a;this.removalsServiceBackend=await Z.getServiceBackend((e=this.selectedSite)===null||e===void 0?void 0:e.accountNumber,(t=this.selectedSite)===null||t===void 0?void 0:t.id,"Removals"),this.removalsServiceBackend===N.ServiceNow&&(this.deliveryBlocked=await P.isDeliveryBlocked((i=this.selectedSite)===null||i===void 0?void 0:i.id,(a=this.selectedSite)===null||a===void 0?void 0:a.accountNumber))}handleOnCreateTicket(e){e===n.Deliveries?P.updateSite(this.selectedSite):B.updateSite(this.selectedSite),M(this,$.CreateTicket,{ticketType:e})}renderLoadingProgress(){return P.loadings.isDeliveryBlocked?s`<div> <ix-progress .indeterminate="${!0}"></ix-progress> </div>`:T}renderTicketTypeSelectCard(e,t,i,a=!1){return s`<div class="dr-ticket-card"> <div> <div class="dr-ticket-card-title">${e}</div> <div> <ix-button name="${i}" @click="${()=>{this.handleOnCreateTicket(t)}}" has-icon trailing-icon .disabled="${a}"> <md-icon slot="icon">east</md-icon> <span class="create-service-ticket-btn"> START </span> </ix-button> </div> </div> ${t===n.Deliveries&&this.deliveryBlocked?s`<span name="delivery-blocked" class="dr-ticket-card-blocked-message"> ${ne} </span>`:T} </div>`}render(){return s`<ix-wizard slot="content" .enableHideCloseButton="${!0}" .onCloseClick="${()=>this.onCloseClick()}" .onMinimiseClick="${()=>this.onMinimiseClick()}"> <div class="wizard-content"> <div class="form-margin"> <h1 class="dlr-text-page-title"> Create Delivery or Removal Service Ticket </h1> <div class="sub-header dlr-text-heading"> <h4>Choose a request Type</h4> </div> </div> <div class="form-wrapper pt-8"> <div class="dr-ticket-card-list form-margin"> ${this.renderLoadingProgress()} ${this.renderTicketTypeSelectCard("Delivery Ticket",n.Deliveries,"create-delivery-service-btn",this.deliveryDisabled)} ${this.removalsServiceBackend!==N.ServiceNow?T:this.renderTicketTypeSelectCard("Removal Ticket",n.Removals,"create-edit-removals-service-btn")} </div> </div> </div> </ix-wizard>`}};A.styles=[K,L,x],r([h({type:Object})],A.prototype,"selectedSite",void 0),r([p()],A.prototype,"removalsServiceBackend",void 0),r([p()],A.prototype,"deliveryBlocked",void 0),r([h({type:Function})],A.prototype,"onCloseClick",void 0),r([h({type:Function})],A.prototype,"onMinimiseClick",void 0),A=r([f("deliveries-removals-ticket-type-selector")],A);let D=class extends q{constructor(){super(...arguments),this.cardTitle="",this.info="",this.ticketType="",this.launchEvent={actionEvent:"",ticketType:"",triggerFn:e=>{}}}connectedCallback(){if(super.connectedCallback(),this.ticketType){const e=this.ticketType,t=`launch-${this.ticketType}`;this.launchEvent={actionEvent:t,ticketType:e,triggerFn:i=>{this.handleOnCreateTicket(this.ticketType,i.detail)}},document.addEventListener(t,i=>{this.launchEvent.triggerFn(i)})}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(this.launchEvent.actionEvent,this.launchEvent.triggerFn)}handleOnCreateTicket(e,t={fromLaunchpad:!1}){var i;const a=(i=t==null?void 0:t.fromLaunchpad)!==null&&i!==void 0?i:!1;M(this,$.CreateTicket,{ticketType:e,fromLaunchpad:a,data:t})}renderTicketTypeSvg(){switch(this.serviceType){case w.CustomerSupport:return _.CustomerSupport;case w.FacilityAccess:return _.FacilityAccess;case w.RemoteHands:return _.RemoteHands;case w.TroubleTicket:return _.TroubleTickets;case w.DeliveriesAndRemovals:default:return _.DeliveriesAndRemovals}}renderCreateTicketButton(){return s`<button type="button" target="" appearance="text" class="ticket-card__button"> Create Ticket <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> <path d="M12 4L10.59 5.41L16.17 11H4V13H16.17L10.59 18.59L12 20L20 12L12 4Z" fill="#1456E0"/> </svg> </button>`}render(){return s`<div class="ticket-card" .onclick="${()=>this.handleOnCreateTicket(this.ticketType)}"> <div class="ticket-card__icon"> <svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg"> ${this.renderTicketTypeSvg()} </svg> </div> <h4 class="ticket-card__title">${this.cardTitle}</h4> <span class="ticket-card__info">${this.info}</span> ${this.renderCreateTicketButton()} </div>`}};D.styles=[K],r([h({type:String})],D.prototype,"cardTitle",void 0),r([h({type:String})],D.prototype,"info",void 0),r([h({type:String})],D.prototype,"ticketType",void 0),r([h({type:String})],D.prototype,"serviceType",void 0),r([p()],D.prototype,"launchEvent",void 0),D=r([f("ticket-type-card")],D);let W=class extends E{async firstUpdated(){await o.checkPermissions()}renderLoadingProgress(){return o.loadings.ticketCreatePermissionChecks?s`<div class="w-full"> <ix-progress .indeterminate="${!0}"></ix-progress> </div>`:T}renderCustomerSupportCard(){return o.permissions.hasCustomerCareCreatePermission?s`<ticket-type-card class="ticket-card-container" .serviceType="${w.CustomerSupport}" cardTitle="Customer Care" info="Having a billing, contract, or inventory question? Contact Customer Support for non-emergency needs and general questions." .ticketType="${n.CustomerSupport}"> </ticket-type-card>`:s``}renderFacilityAccessCard(){return o.permissions.hasFacilityAccessCreatePermission?s`<ticket-type-card class="ticket-card-container" serviceType="${w.FacilityAccess}" cardTitle="Facility Access" info="Need to request, modify or terminate physical access to select few or all of your locations? Submit a Facility Access Ticket to let our Data Center Security Team know and assist you with that." .ticketType="${n.FacilityAccess}"> </ticket-type-card>`:s``}renderRemoteHandsCard(){return o.permissions.hasRemoteHandsCreatePermission?s`<ticket-type-card class="ticket-card-container" .serviceType="${w.RemoteHands}" cardTitle="Remote Hands" info="Need to reboot, install a panel, or remove a gear? Let Digital Realty Technicians do the work for you. Remote Hands Fees apply (24/7/365)." .ticketType="${n.RemoteHands}"> </ticket-type-card>`:s``}renderDeliveriesAndRemovalsCard(){return o.permissions.hasDeliveriesAndRemovalsCreatePermission?s`<ticket-type-card class="ticket-card-container" .serviceType="${w.DeliveriesAndRemovals}" cardTitle="Deliveries & Removals" info="Sending Equipment to a Digital Realty facility or having it removed? Let us know how to handle the shipment or removal." .ticketType="${n.DeliveriesAndRemovals}"> </ticket-type-card>`:T}renderTroubleTicketsCard(){return o.permissions.hasTroubleTicketsCreatePermission?s`<ticket-type-card class="ticket-card-container" .serviceType="${w.TroubleTicket}" cardTitle="Trouble Tickets" info="Trouble Tickets are for physical on-site issues and maintenance. Remote Hands fees will apply." .ticketType="${n.TroubleTickets}"> </ticket-type-card>`:T}render(){return s` <div class="ticket-card-list"> ${this.renderLoadingProgress()} ${this.renderCustomerSupportCard()} ${this.renderFacilityAccessCard()} ${this.renderRemoteHandsCard()} ${this.renderDeliveriesAndRemovalsCard()} ${this.renderTroubleTicketsCard()} </div>`}};W.styles=[K,x],W=r([f("ticket-type-card-list")],W);let Q=class extends q{render(){return s` <div class="create-service-ticket-container wizard-content form-margin"> <div> <h1 class="dlr-text-page-title">Create Service Ticket</h1> <div class="create-service-ticket-container-subheader"> <h3 class="dlr-text-heading">Select a Ticket Type</h3> </div> </div> <ticket-type-card-list></ticket-type-card-list> </div>`}};Q.styles=[x,L],Q=r([f("create-service-ticket")],Q);function $e(e,t){let i="";switch(e){case"Delivery":i=S.DeliveriesTicketDetails;break;case"Removal":i=S.RemovalsTicketDetails;break;case"Remote Hands":i=S.RemoteHandsTicketDetails;break;case"Customer Care":i=S.CustomerCareTicketDetails;break;case"Facility Access":switch(t){case"Visitor Access":i=S.VisitorAccessTicketDetails;break;case"Permanent Badge":i=S.PermanentBadgeTicketDetails;break;case"OSP Access":i=S.OspAccessTicketDetails;break;case"PoP/POE Access":i=S.PopAccessTicketDetails;break}break;case"Trouble Ticket":i=S.TroubleTicketDetails;break}return i}function se(){const{isStandalone:e}=le,{pathname:t}=fe;return!!(e||t.includes(Ce))}const Ae=[R.Delivery,R.Removal];let C=class extends E{get vaadinGrid(){var e,t,i;const a=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("ix-grid");return(i=(t=a==null?void 0:a.shadowRoot)===null||t===void 0?void 0:t.querySelector("vaadin-grid"))!==null&&i!==void 0?i:null}constructor(){super(),this.items=void 0,this.isOpenTicketsFilterApplied=!0,this.hasDeliveryAndRemovalsCreatePrivilege=!1,this.fetchTicketsController=new AbortController,this.listSort="updated_at desc",this.listSkip=0,this.listPageSize=20,this.locationsHeaderLabel="Location",this.sitesHeaderLabel="Site",this.useNewDatePickerComponent=!1,this.isGridInitialized=!1,this.handlePopState=()=>{this.updateIsOpenTicketsFilterApplied()},this.useNewDatePickerComponent=ce.showNewDatePickerComponent()}async connectedCallback(){this.isGridInitialized=!0,window.addEventListener("popstate",this.handlePopState),this.updateIsOpenTicketsFilterApplied(),this.parsePermissionPrivilege();const e=await de.getHashedRootAccountNumberAndUserEmail();e&&(this.hashedLocalStorageID=`service-tickets-${e}`),super.connectedCallback(),this.debouncedHandleTableChange=be(this.handleTableChange.bind(this),300),this.fetchUserCreatePermission()}parsePermissionPrivilege(){var e;const t=new URLSearchParams(window.location.search);this.permissionPrivilege=(e=t.get(z))!==null&&e!==void 0?e:void 0}clearPermissionPrivilege(){if(!this.permissionPrivilege)return;const e=new URL(window.location.href);e.searchParams.delete(z),this.permissionPrivilege=void 0,o.setPendingApprovalDialogShown(!1),window.history.replaceState(null,"",e.toString())}updateIsOpenTicketsFilterApplied(){const e=new URL(document.location.href).searchParams.get(U);this.isOpenTicketsFilterApplied=e!=="closed"}disconnectedCallback(){var e;this.loadingChangedListener&&((e=this.vaadinGrid)===null||e===void 0||e.removeEventListener("loading-changed",this.loadingChangedListener)),window.removeEventListener("popstate",this.handlePopState),super.disconnectedCallback(),this.isGridInitialized=!1}addEventListeners(){const{vaadinGrid:e}=this;e&&(this.loadingChangedListener=t=>{const i=t.target;i.loading||setTimeout(()=>{i.recalculateColumnWidths(),i.requestContentUpdate()},0)},e.addEventListener("loading-changed",this.loadingChangedListener))}handleKeyPress(e,t){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.handleRowClick(t))}getColumns(){return[{name:"ticketId",header:"Ticket #",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.ticketId} </div>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"],width:"160px"},{name:"ticketType",header:"Ticket Type",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.ticketType} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"200px"},{name:"requestType",header:"Request Type",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.requestType?e.requestType:s` `} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"200px"},{name:"category",header:"Category",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.category?e.category:s` `} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"240px"},{name:"subject",header:"Subject",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.subject?e.subject:s` `} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"372px"},{name:"sites",header:this.sitesHeaderLabel,bodyRenderer:e=>{var t;const i=(t=e.sites)===null||t===void 0?void 0:t.map(a=>{var l;return(l=a.name)===null||l===void 0?void 0:l.trim()}).filter(a=>!!a);return!i||i.length===0?s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${a=>this.handleKeyPress(a,e)}"> </div>`:s` <site-location-cell @click="${()=>this.handleRowClick(e)}" @keypress="${a=>this.handleKeyPress(a,e)}" .items="${i}"> </site-location-cell>`},sortable:!0,filterable:!0,filterOperators:["contains","equals"],width:"224px"},{name:"locations",header:this.locationsHeaderLabel,bodyRenderer:e=>{var t;return s` <site-location-cell @click="${()=>this.handleRowClick(e)}" @keypress="${i=>this.handleKeyPress(i,e)}" .items="${!((t=e.locations)===null||t===void 0)&&t.length?e.locations:[s` `]}"></site-location-cell>`},filterable:!0,filterOperators:["contains","equals"],sortable:!0,width:"224px"},{name:"createdBy",header:"Requester",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.createdBy} </div>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"],width:"160px"},{name:"accessRequestedFor",header:"Access Requested For",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.accessRequestedFor?e.accessRequestedFor:s` `} </div>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"],width:"180px"},{name:"createdAt",header:"Created Date",bodyRenderer:e=>s` <div> ${e.createdAt?this.useNewDatePickerComponent?s`<ix-date-next type="static" variant="date-time" .value="${e.createdAt}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"></ix-date-next>`:s`<ix-date type="static" variant="date-time" .value="${e.createdAt}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> </ix-date>`:""} </div>`,sortable:!0,filterable:!0,filterOperators:["contains"],dataType:"dateTime",width:"160px"},{name:"updatedAt",header:"Updated On",bodyRenderer:e=>s` <div> ${e.updatedAt?this.useNewDatePickerComponent?s`<ix-date-next type="static" variant="date-time" .value="${e.updatedAt}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"></ix-date-next>`:s`<ix-date type="static" variant="date-time" .value="${e.updatedAt}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> </ix-date>`:""} </div>`,sortable:!0,filterable:!0,filterOperators:["contains"],dataType:"dateTime",width:"160px"},{name:"status",header:"Status",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.status} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"140px"},{name:"actions",header:"Actions",width:"94px",bodyRenderer:e=>s` <div style="max-height:1.5REM;min-height:1.5REM"> ${this.renderActionButtons(e)} </div>`,frozenToEnd:!0,flexGrow:1,filterable:!1}]}async handleTableChange(e){this.lastDetail=e.detail;const{columnName:t,page:i,pageSize:a,sortOrder:l,filters:d,filtersOperators:c}=e.detail;this.listSort="updated_at desc",this.listPageSize=a;const m={status:this.tryGetStatusFilter(d,c,"status",g.Single,!0),ticket_id:this.tryGetFilter(d,c,"ticketId",g.Single,!0),ticket_type:this.tryGetFilter(d,c,"ticketType",g.Single,!0),request_type:this.tryGetFilter(d,c,"requestType",g.Single,!0),category:this.tryGetFilter(d,c,"category",g.Single,!0),subject:this.tryGetFilter(d,c,"subject",g.Single,!0),sites:this.tryGetFilter(d,c,"sites",g.ObjectCollection,!0,"name"),locations:this.tryGetFilter(d,c,"locations",g.StringCollection,!0),created_by:this.tryGetFilter(d,c,"createdBy",g.Single,!0),access_requested_for:this.tryGetFilter(d,c,"accessRequestedFor",g.Single,!0),created_at:this.tryGetFilter(d,c,"createdAt",g.Single,!1),updated_at:this.tryGetFilter(d,c,"updatedAt",g.Single,!1,void 0)};if(this.isGridInitialized&&!c.some(k=>d[k.columnField]!=null)&&this.permissionPrivilege&&this.clearPermissionPrivilege(),m.status.length===0&&(m.status=this.getTicketStatusFilter()),this.currentFilters=m,t&&l){const k=this.camelToSnakeCase(t);this.listSort=`${k} ${l}`}this.listSkip=(i-1)*this.listPageSize,this.fetchTicketsController.abort(),this.fetchTicketsController=new AbortController,this.fetchTickets({signal:this.fetchTicketsController.signal})}rewriteUrlForTicketsView(e){const t=new URLSearchParams(window.location.search);t.set(U,e),t.set("page","1"),ee.go(`${window.location.pathname}?${t.toString()}`)}filterOpenTickets(){this.isOpenTicketsFilterApplied=!0,this.updatePaginationToPageOne(),this.rewriteUrlForTicketsView("open")}filterClosedTickets(){this.isOpenTicketsFilterApplied=!1,this.updatePaginationToPageOne(),this.rewriteUrlForTicketsView("closed")}updatePaginationToPageOne(){var e,t,i;this.lastDetail.page=1;const a=(i=(t=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("ix-grid"))===null||t===void 0?void 0:t.shadowRoot)===null||i===void 0?void 0:i.querySelector("ix-pagination");a?a.updatePagination(this.lastDetail.page,this.lastDetail.pageSize):this.handleTableChange({detail:this.lastDetail})}camelToSnakeCase(e){return e.replace(/[A-Z]/g,(t,i)=>(i?"_":"")+t.toLowerCase())}getTicketStatusFilter(){let e;return this.isOpenTicketsFilterApplied?e=pe.map(t=>({matchValue:t,equalityOperator:y.Equals,concatenationOperator:y.Or,fieldType:g.Single,objectProperty:void 0})):e=he.map(t=>({matchValue:t,equalityOperator:y.Equals,concatenationOperator:y.Or,fieldType:g.Single,objectProperty:void 0})),e}async fetchTickets(e){var t,i;if(!se())return;const a=this.listPageSize||20,l={...this.currentFilters};l!=null&&l.created_at&&(l.created_at=this.adjustDateFilterForTimeZone(l.created_at)),l!=null&&l.updated_at&&(l.updated_at=this.adjustDateFilterForTimeZone(l.updated_at));const d=V(l,{orderBy:this.listSort?[this.listSort]:["updated_at desc"],top:a,skip:this.listSkip}),c=new URLSearchParams(d);await o.GetServiceTicketList(c.get("$filter")||void 0,c.get("$orderby")||void 0,this.listSkip,a,this.permissionPrivilege,e),((t=o.serviceTickets)===null||t===void 0?void 0:t.items)!==void 0?this.items=(i=o.serviceTickets)===null||i===void 0?void 0:i.items:this.items=void 0,setTimeout(()=>{this.addEventListeners()},0)}adjustDateFilterForTimeZone(e){return e.flatMap(t=>{const{startOfDayLocal:i,endOfDayLocal:a}=ue(t.matchValue);return[{...t,matchValue:i.toISOString(),equalityOperator:y.GreaterThanOrEqualTo,concatenationOperator:y.And},{...t,matchValue:a.toISOString(),equalityOperator:y.LessThanOrEqualTo,concatenationOperator:y.And}]})}renderActionButtons(e){const t=e.ticketType;return!Ae.includes(t)||!this.hasUserCreatePrivilege(t)?s``:s` <ix-progress id="progress-${e.ticketId}" .linear="${!1}" indeterminate="false" style="--md-circular-progress-size:1.375REM;display:none;padding:.0625REM"></ix-progress> <ix-icon id="clone-icon-${e.ticketId}" style="--ix-icon-font-size:1.375REM;color:#1456e0;display:inline-block;padding:.0625REM;transform:scaleY(-1)" @click="${async i=>this.handleCloneClick(i,t,e.ticketId)}">content_copy </ix-icon> `}async fetchUserCreatePermission(){this.hasDeliveryAndRemovalsCreatePrivilege=await ve()}hasUserCreatePrivilege(e){switch(e){case R.Delivery:case R.Removal:return this.hasDeliveryAndRemovalsCreatePrivilege;default:return!1}}async handleCloneClick(e,t,i){const a=e.currentTarget,{parentElement:l}=a;switch(this.hideCloneIcon(l,a,i),t){case R.Delivery:await P.getDeliveriesServiceTicket(i),M(this,$.CreateTicket,{ticketType:n.Deliveries,isCloned:!0,site:P.newTicket.site});break;case R.Removal:await B.getRemovalsServiceTicket(i),M(this,$.CreateTicket,{ticketType:n.Removals,isCloned:!0,site:B.newTicket.site});break;default:console.warn("Incorrect ticket type")}this.resetActionIconsToDefault(l,a,i)}hideCloneIcon(e,t,i){this.toggleVisibility(e,t,i,!0)}resetActionIconsToDefault(e,t,i){this.toggleVisibility(e,t,i,!1)}toggleVisibility(e,t,i,a){if(e){const l=e.querySelector(`#progress-${i}`);l&&(t.style.display=a?"none":"inline-block",l.style.display=a?"inline-block":"none")}}tryGetFilter(e,t,i,a,l,d=void 0,c=y.Or){const m=t.find(b=>b.columnField===i);if(m===void 0)return[];const k=e[i];if(k===void 0)return[];const O=m.operator==="contains"?y.Contains:y.Equals;return(Array.isArray(k)?k:[k]).map(b=>({matchValue:b.value||b,equalityOperator:O,concatenationOperator:c,fieldType:a,ignoreCase:l,objectProperty:d}))}tryGetStatusFilter(e,t,i,a,l,d=void 0){const c=this.getTicketStatusFilter(),m=this.tryGetFilter(e,t,i,a,l,d,y.And);return c.concat(m)}get downloadMenuItems(){const e=[{label:"All Tickets",name:"download-all-tickets",onClick:t=>{this.handleDownloadCsv(t)}},{label:"Current Filter",name:"download-current-filter",onClick:t=>{this.handleDownloadCsv(t)}}];return this.isOpenTicketsFilterApplied?e.push({label:"Open Tickets",name:"download-open-tickets",onClick:t=>{this.handleDownloadCsv(t)}}):e.push({label:"Closed Tickets",name:"download-closed-tickets",onClick:t=>{this.handleDownloadCsv(t)}}),e}generateQuery(e=void 0){if(e!==void 0)return V(e);const t=this.getTicketStatusFilter();return V({status:t})}async handleDownloadCsv(e){let t;switch(e){case"download-all-tickets":await o.downloadServiceTickets();break;case"download-current-filter":t=new URLSearchParams(this.generateQuery(this.currentFilters)),await o.downloadServiceTickets(t.get("$filter")||void 0,this.permissionPrivilege);break;case"download-closed-tickets":this.isOpenTicketsFilterApplied=!1,t=new URLSearchParams(this.generateQuery()),await o.downloadServiceTickets(t.get("$filter")||void 0);break;default:this.isOpenTicketsFilterApplied=!0,t=new URLSearchParams(this.generateQuery()),await o.downloadServiceTickets(t.get("$filter")||void 0);break}}handleRowClick(e){if(e.ticketId){const t=$e(e==null?void 0:e.ticketType,e==null?void 0:e.requestType);t&&ee.go(ge(t,{ticketId:e.ticketId}))}}renderGridNoRows(){const e=o.error.serviceTicketsGrid?"Sorry, an error has occurred":this.items!==void 0?"No data to display":null;return e?s` <ix-grid-no-rows slot="no-rows" message="${e}"></ix-grid-no-rows>`:T}render(){var e,t;return s` <div class="maintenance-grid"> <ix-grid session-storage-key="sm-service-tickets" column-reordering-allowed .columns="${this.getColumns()}" .rows="${(e=this.items)!==null&&e!==void 0?e:[]}" .recordCount="${(t=o===null||o===void 0?void 0:o.serviceTickets)===null||t===void 0?void 0:t.totalCount}" .addParamsToURL="${se()}" .readParamsFromURL="${!0}" .downloadMenuItems="${this.downloadMenuItems}" .pageSizes="${[10,20,50,100]}" .pageSize="${this.listPageSize}" @change="${this.debouncedHandleTableChange}" .localStorageID="${this.hashedLocalStorageID}" .refreshDataOnColumnVisibilityChange="${!1}" .filterValueChangeDebounceTime="${me().ServiceTicketListFilterValueChangeDebounceTime}" .isLoading="${o.loadings.serviceTicketList}" .isDownloading="${o.loadings.downloadServiceTicketList}" .preservedQueryParamKeys="${[U,z]}" .filterMaxDate="${ke()}" .useNewDatePicker="${this.useNewDatePickerComponent}"> <div slot="header"> ${this.permissionPrivilege===ie.Approve?s`<div class="sub-header ml-[8px] font-bold"> <h3>Showing tickets only pending approval</h3> </div>`:s`<ix-grid-nav class="reports-grid-nav" .buttons="${[{text:"Open Tickets",selected:this.isOpenTicketsFilterApplied,onClick:()=>this.filterOpenTickets()},{text:"Closed Tickets",selected:!this.isOpenTicketsFilterApplied,onClick:()=>this.filterClosedTickets()}]}"></ix-grid-nav>`} </div> ${this.renderGridNoRows()} </ix-grid> </div>`}};C.styles=[x,L],r([p()],C.prototype,"currentFilters",void 0),r([p()],C.prototype,"hashedLocalStorageID",void 0),r([p()],C.prototype,"permissionPrivilege",void 0),r([h({type:Array})],C.prototype,"items",void 0),r([h({type:Boolean})],C.prototype,"isOpenTicketsFilterApplied",void 0),r([h({type:Boolean})],C.prototype,"hasDeliveryAndRemovalsCreatePrivilege",void 0),C=r([f("service-ticket-list")],C);let v=class extends q{constructor(){super(...arguments),this.isDialogOpen=!0,this.modalTitle="",this.accountNumber="",this.sites=[],this.isLoading=!0,this.isAssignableSite=!0,this.isTicketSupported=!0,this.assignableSites=[],this.ticketNotSupportedMessage=ye,this.backendService=void 0}async firstUpdated(){var e;if(this.permissionType){const[t,i]=await Promise.all([Y(J.Create,this.permissionType,this.assignableProcess,this.accountNumber),Y(J.Create,this.permissionType,void 0,this.accountNumber)]);this.assignableSites=t,this.sites=i,this.assignableSites.length===1&&await this.isTicketSupportedForSite(this.assignableSites[0])&&(this.onSiteSelected(this.assignableSites[0]),this.onAccept()),this.isLoading=!1,await this.updateComplete,(e=this.dialog)===null||e===void 0||e.focus()}}isStartButtonDisabled(){return!this.selectedSite||!this.isTicketSupported||!this.isAssignableSite}async onSiteSelectionChanged(e){this.isAssignableSite=this.assignableSites.some(t=>t.siteId===e.siteId),this.isTicketSupported=await this.isTicketSupportedForSite(e),this.onSiteSelected(e)}async isTicketSupportedForSite(e){return o.ticketType===n.TroubleTickets?(this.backendService=await Z.getServiceBackend(this.accountNumber,e.siteId,"Trouble_tickets"),this.backendService!==N.Insite):!0}render(){return s` <ix-dialog id="site-selection-dialog" ?open="${this.isDialogOpen}" @keydown="${e=>{e.key==="Escape"&&this.onReject()}}" @closed="${()=>this.onReject()}"> <div slot="content" class="form-wrapper"> <div id="dialog" tabindex="-1"> ${this.isLoading?s` <div class="w-full flex justify-center mt-6 pb-16"> <ix-progress .indeterminate="${!0}" .linear="${!1}"></ix-progress> </div>`:s` <h3 class="dialog__title dlr-text-heading"> ${this.modalTitle} <ix-icon-button aria-label="Close Site Select Dialog" icon="close" @click="${()=>{this.onReject()}}" @keydown="${e=>{(e.key==="Enter"||e.key==="Space")&&this.onReject()}}"> </ix-icon-button> </h3> <div class="site-dialog__short-desc"> Which site are you submitting a ticket for? </div> <div class="form-wrapper__fields site-selection-dialog"> ${this.renderSiteSelect()} </div> <div slot="actions" class="site-selection-dialog__button-container"> <ix-button .disabled="${this.isStartButtonDisabled()}" appearance="text" @click="${()=>{this.onAccept()}}"> <span class="button-label site-selection-dialog__button-text">START</span> </ix-button> </div>`} </div> </div> </ix-dialog>`}renderSiteSelect(){return!this.sites||this.sites.length<1?s` <div>Loading sites...</div>`:s` <ix-select class="dialog-input" label="Site" menu-positioning="fixed" .wideMenu="${!0}" required @input="${e=>{this.onSiteSelectionChanged(e.target.value)}}"> ${this.sites.map(e=>s` <ix-select-option .value="${e}" .selected="${this.selectedSite===e}"> <div slot="headline">${e.displayName}</div> </ix-select-option>`)} </ix-select> ${this.renderWarning()} `}renderWarning(){let e="";return this.isTicketSupported?this.isAssignableSite||(e=Te):e=this.ticketNotSupportedMessage,e?s`<div> <span id="ticketNotSupportedMessage" class="supporting-text error">*${e}</span> </div>`:s`<div class="required-text">*Required</div>`}};v.styles=[x,L,te],r([ae("#dialog")],v.prototype,"dialog",void 0),r([h({type:Function})],v.prototype,"onAccept",void 0),r([h({type:Function})],v.prototype,"onReject",void 0),r([h({type:String})],v.prototype,"selectedSite",void 0),r([h({type:Function})],v.prototype,"onSiteSelected",void 0),r([h({type:Boolean})],v.prototype,"isDialogOpen",void 0),r([h({type:String})],v.prototype,"modalTitle",void 0),r([h({type:String})],v.prototype,"permissionType",void 0),r([h({type:String})],v.prototype,"accountNumber",void 0),r([h({type:String})],v.prototype,"assignableProcess",void 0),r([p()],v.prototype,"sites",void 0),r([p()],v.prototype,"isLoading",void 0),v=r([f("site-selection-dialog")],v);let I=class extends q{constructor(){super(...arguments),this.onAccept=()=>{}}render(){return s` <ix-dialog id="pending-approval-info-dialog" class="selection-dialog" ?open="${!0}" @keydown="${e=>{e.key==="Escape"&&this.onAccept()}}" @closed="${()=>this.onAccept()}"> <div slot="content" class="py-[24px]"> <div class="pending-approval-dialog__title"> <div> <h3 class="dlr-text-heading">Pending Approval Shown</h3> </div> </div> <div class="pending-approval-dialog__short-desc"> This page is filtered to show only items awaiting your approval. You can adjust or clear the filter at any time. </div> </div> <div slot="actions" class="pending-approval-dialog__button-container"> <ix-button appearance="text" @click="${()=>{this.onAccept()}}"> <span class="button-label">Continue</span> </ix-button> </div> </ix-dialog> `}};I.styles=[x,L,te],r([h({type:Function})],I.prototype,"onAccept",void 0),I=r([f("pending-approval-info-dialog")],I);function De(e){switch(e){case n.DeliveriesAndRemovals:return F.DeliveriesRemovals;case n.RemoteHands:return F.RemoteHands;case n.CustomerSupport:return F.CustomerCare;case n.TroubleTickets:return F.TroubleTickets;case n.VisitorAccess:return F.VisitorAccess;case n.PermanentBadge:return F.PermanentBadge;default:return"default"}}function xe(e){switch(e){case n.DeliveriesAndRemovals:return"Deliveries";case n.RemoteHands:return"Remote_hands";case n.CustomerSupport:return"Customer_care";case n.TroubleTickets:return"Trouble_tickets";case n.FacilityAccess:return"Facilities_access";default:return}}let u=class extends E{constructor(){super(...arguments),this.showDrawer=!1,this.showSiteSelectionDialog=!1,this.showAccountSelectionDialog=!1,this.siteAccepted=!1,this.accountAccepted=!1,this.selectedSite=void 0,this.selectedAccount=void 0,this.modalTitle="",this.permissionType="",this.fromLaunchpad=!0,this.originEl=null,this.renderDrawer=!1,this.showPendingApprovalDialog=!1,this.drawerHandler=()=>this.toggleDrawer(),this.navigationHandler=()=>this.handleNavigation(),this.onCreateHandler=e=>{var t,i,a,l,d,c,m,k,O,b,H,G,j;this.isCloned=(t=e.detail)===null||t===void 0?void 0:t.isCloned,this.originEl=(a=(i=e.detail)===null||i===void 0?void 0:i.data)===null||a===void 0?void 0:a.originEl,this.showDrawer||this.toggleDrawer(),!((l=e.detail)===null||l===void 0)&&l.ticketType&&(this.permissionType=De((d=e.detail)===null||d===void 0?void 0:d.ticketType),this.assignableProcess=xe((c=e.detail)===null||c===void 0?void 0:c.ticketType),this.isCloned&&(this.selectedSite=(m=e.detail)===null||m===void 0?void 0:m.site,this.selectedAccount=(O=(k=e.detail)===null||k===void 0?void 0:k.site)===null||O===void 0?void 0:O.accountNumber,this.siteAccepted=!0,this.accountAccepted=!0)),this.fromLaunchpad=(H=(b=e.detail)===null||b===void 0?void 0:b.fromLaunchpad)!==null&&H!==void 0?H:!1,o.updateTicketType((G=e.detail)===null||G===void 0?void 0:G.ticketType),!((j=e.detail)===null||j===void 0)&&j.ticketType||this.resetComponent()}}toggleDrawer(){const e=this.showDrawer,t=e?this.originEl:null;this.showDrawer=!this.showDrawer,e&&(this.resetComponent(),o.clear(),this.updateComplete.then(()=>{requestAnimationFrame(()=>{t!=null&&t.isConnected&&t.focus()})}))}async firstUpdated(){window.addEventListener($.DrawerClose,this.drawerHandler),window.addEventListener($.CreateTicket,this.onCreateHandler),window.addEventListener("popstate",this.navigationHandler)}updated(e){(e.has("showAccountSelectionDialog")||e.has("showSiteSelectionDialog"))&&(this.renderDrawer=!(this.showAccountSelectionDialog||this.showSiteSelectionDialog))}get hideAside(){var e;return o.ticketType===n.FacilityAccess||!((e=this.selectedSite)===null||e===void 0)&&e.siteId&&this.siteAccepted?!1:this.fromLaunchpad}async handleAccountSelection(e){this.selectedAccount=e}async handleSiteSelection(e){this.selectedSite=e}connectedCallback(){super.connectedCallback(),o.clear(),this.parsePermissionPrivilege(),this.checkAndShowPendingApprovalDialog()}parsePermissionPrivilege(){var e;const t=new URLSearchParams(window.location.search);this.permissionPrivilege=(e=t.get(z))!==null&&e!==void 0?e:void 0}checkAndShowPendingApprovalDialog(){this.permissionPrivilege===ie.Approve&&!o.hasPendingApprovalDialogBeenShown&&(this.showPendingApprovalDialog=!0)}handlePendingApprovalDialogClose(){this.showPendingApprovalDialog=!1,o.setPendingApprovalDialogShown(!0)}handleNavigation(){window.location.pathname.startsWith("/service-management/")||o.setPendingApprovalDialogShown(!1)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener($.DrawerClose,this.drawerHandler),window.removeEventListener($.CreateTicket,this.onCreateHandler),window.removeEventListener("popstate",this.navigationHandler),setTimeout(()=>{window.location.pathname.startsWith("/service-management/")||o.setPendingApprovalDialogShown(!1)},0)}resetComponent(){this.selectedSite=void 0,this.selectedAccount=void 0,this.siteAccepted=!1,this.accountAccepted=!1,this.showSiteSelectionDialog=!1,this.showAccountSelectionDialog=!1,o.ticketType=void 0}handleSiteSelectionDialogClosed(e){this.siteAccepted=e,this.showSiteSelectionDialog=!1,e||(this.fromLaunchpad&&this.toggleDrawer(),this.resetComponent())}handleAccountSelectionDialogClosed(e){this.showAccountSelectionDialog=!1,this.accountAccepted=e,e||(this.fromLaunchpad&&this.toggleDrawer(),this.resetComponent())}handleToggleClick(){var e;const t=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("ix-drawer");t==null||t.handleCloseButton()}handleMinimisedClick(){var e;const t=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("ix-drawer");t==null||t.onMinimised()}getAccountNumber(){return this.selectedAccount}renderTicketWizard(){var e,t,i;if(o.ticketType===n.CustomerSupport){if(!((e=this.selectedSite)===null||e===void 0)&&e.siteId&&this.siteAccepted)return s`<customer-care-service-ticket-wizard .selectedSite="${this.selectedSite}" slot="content" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></customer-care-service-ticket-wizard>`;this.modalTitle="Customer Care",this.accountAccepted?this.showSiteSelectionDialog=!0:this.showAccountSelectionDialog=!0}else{if(o.ticketType===n.Deliveries)return P.newTicket.accountNumber=this.getAccountNumber(),s`<deliveries-service-ticket-wizard slot="content" .isClone="${this.isCloned}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></deliveries-service-ticket-wizard>`;if(o.ticketType===n.Removals)return B.newTicket.accountNumber=this.getAccountNumber(),s`<removals-service-ticket-wizard slot="content" .isCloned="${this.isCloned}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></removals-service-ticket-wizard>`;if(o.ticketType===n.RemoteHands){if(this.modalTitle="Remote Hands",!((t=this.selectedSite)===null||t===void 0)&&t.siteId&&this.siteAccepted)return we.updateAccountNumber(this.getAccountNumber()),s`<remote-hands-service-ticket-wizard slot="content" .selectedSite="${this.selectedSite}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></remote-hands-service-ticket-wizard>`;this.accountAccepted?this.showSiteSelectionDialog=!0:this.showAccountSelectionDialog=!0}else if(o.ticketType===n.TroubleTickets){if(!((i=this.selectedSite)===null||i===void 0)&&i.siteId&&this.siteAccepted)return s`<create-edit-trouble-ticket-wizard slot="content" .selectedSite="${this.selectedSite}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></create-edit-trouble-ticket-wizard>`;this.modalTitle="Trouble Tickets",this.accountAccepted?this.showSiteSelectionDialog=!0:this.showAccountSelectionDialog=!0}else if(o.ticketType===n.DeliveriesAndRemovals){if(this.modalTitle="Deliveries & Removals",this.selectedSite&&this.siteAccepted)return s`<deliveries-removals-ticket-type-selector slot="content" .selectedSite="${this.selectedSite}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></deliveries-removals-ticket-type-selector>`;this.accountAccepted?this.showSiteSelectionDialog=!0:this.showAccountSelectionDialog=!0}else if(o.ticketType===n.FacilityAccess)return s`<facility-access-service-ticket-wizard slot="content" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></facility-access-service-ticket-wizard>`}return s`<create-service-ticket slot="content"></create-service-ticket>`}render(){return s` ${this.showPendingApprovalDialog?s`<pending-approval-info-dialog .onAccept="${()=>this.handlePendingApprovalDialogClose()}"></pending-approval-info-dialog>`:T} ${this.renderDrawer?s` <ix-drawer ?isVisible="${this.showDrawer}" .showConfirmationDialogOnClose="${o.ticketType!==void 0&&o.ticketStep!==Se}" .onClosed="${()=>this.toggleDrawer()}" .hideAside="${this.hideAside}" .hideClose="${re(o.ticketType)}" .scrollable="${!1}" .label="${o.ticketType?`Create ${X[o.ticketType]} Service Ticket`:void 0}" close-label="${o.ticketType?`Close ${X[o.ticketType]} Service Ticket Dialog`:"Close Service Ticket Dialog"}"> ${this.renderTicketWizard()} </ix-drawer>`:T} ${this.showSiteSelectionDialog?s`<site-selection-dialog .isDialogOpen="${this.showSiteSelectionDialog}" .modalTitle="${this.modalTitle}" .onAccept="${()=>this.handleSiteSelectionDialogClosed(!0)}" .onReject="${()=>this.handleSiteSelectionDialogClosed(!1)}" .onSiteSelected="${e=>this.handleSiteSelection(e)}" .selectedSite="${this.selectedSite}" .permissionType="${this.permissionType}" .accountNumber="${this.selectedAccount}" .assignableProcess="${this.assignableProcess}"></site-selection-dialog>`:T} ${this.showAccountSelectionDialog?s`<account-selection-dialog .isDialogOpen="${this.showAccountSelectionDialog}" .modalTitle="${this.modalTitle}" modalText="You have access to multiple accounts, which account are you submitting this ticket for?" .onAccept="${()=>this.handleAccountSelectionDialogClosed(!0)}" .onReject="${()=>this.handleAccountSelectionDialogClosed(!1)}" .selectedAccount="${this.selectedAccount}" .permissionType="${this.permissionType}" .assignableProcess="${this.assignableProcess}" .onAccountSelected="${e=>this.handleAccountSelection(e)}" buttonText="Next"></account-selection-dialog>`:T} <service-ticket-list></service-ticket-list> `}};u.styles=[x,L],r([p()],u.prototype,"showDrawer",void 0),r([p()],u.prototype,"showSiteSelectionDialog",void 0),r([p()],u.prototype,"showAccountSelectionDialog",void 0),r([p()],u.prototype,"siteAccepted",void 0),r([p()],u.prototype,"accountAccepted",void 0),r([p()],u.prototype,"selectedSite",void 0),r([p()],u.prototype,"selectedAccount",void 0),r([p()],u.prototype,"modalTitle",void 0),r([p()],u.prototype,"permissionType",void 0),r([p()],u.prototype,"assignableProcess",void 0),r([p()],u.prototype,"fromLaunchpad",void 0),r([p()],u.prototype,"originEl",void 0),r([p()],u.prototype,"renderDrawer",void 0),r([p()],u.prototype,"showPendingApprovalDialog",void 0),r([p()],u.prototype,"permissionPrivilege",void 0),u=r([f("service-tickets-view")],u);export{u as ServiceTicketsView};
|
|
1
|
+
import{__decorate as r}from"tslib";import{ifDefined as re}from"lit/directives/if-defined.js";import{MobxLitElement as E}from"@adobe/lit-mobx";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-dialog/ix-dialog.js";import"@digital-realty/ix-drawer/ix-drawer.js";import"@digital-realty/ix-progress/ix-progress.js";import{css as oe,html as s,nothing as T,LitElement as q}from"lit";import{property as h,state as p,customElement as f,query as ae}from"lit/decorators.js";import"./ui-service-management3.js";import{T as x,S as N,s as Z,d as P,a as n,r as B,b as M,A as $,D as ne,c as w,e as o,R as S,f as le,n as ce,g as de,P as z,h as U,o as pe,i as he,j as ue,k as ve,l as R,m as ge,p as me,q as ke,t as ye,u as Y,L as J,G as Te,v as F,w as we,x as Se,y as X}from"./ui-service-management.js";import{S as L,a as _}from"./ui-service-management9.js";import"./ui-service-management4.js";import"./ui-service-management5.js";import"./ui-service-management6.js";import"./ui-service-management7.js";import"./ui-service-management8.js";import"@digital-realty/ix-chip/ix-chip.js";import"@digital-realty/ix-date/ix-date.js";import"@digital-realty/ix-date-next/ix-date-next.js";import"@digital-realty/ix-grid/ix-grid-nav.js";import"@digital-realty/ix-grid/ix-grid-no-rows.js";import{Router as ee}from"@vaadin/router";import{A as Ce,F as g,O as y,b as V}from"./ui-service-management11.js";import{d as be}from"./ui-service-management12.js";import{g as fe,T as te}from"./ui-service-management13.js";import"@digital-realty/ix-select/ix-select.js";import"@digital-realty/ix-select/ix-select-option.js";import"@digital-realty/ix-wizard/ix-wizard-step.js";import"@digital-realty/ix-wizard/ix-wizard.js";import"@digital-realty/ix-email-list/ix-email-list.js";import"@digital-realty/ix-file-uploader/ix-file-uploader.js";import"@digital-realty/ix-textbox/ix-textbox.js";import"lit/directives/class-map.js";import"lit-html/directives/if-defined.js";import"lit-html/directives/unsafe-html.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"moment";import"@digital-realty/theme";import"moment-timezone";import"date-fns/format.js";import"mobx";import"mobx-persist-store";import"@digital-realty/ix-account-switcher";import"oidc-client-ts";import"lit-html/directives/until.js";import"libphonenumber-js";import"@digital-realty/ix-toast/ix-toasters.js";import"./ui-service-management10.js";import"@digital-realty/ix-divider/ix-divider.js";import"@digital-realty/ix-checkbox/ix-checkbox.js";import"@digital-realty/ix-radio/ix-radio.js";import"@digital-realty/ix-grid/ix-grid.js";import"./ui-service-management14.js";import"@digital-realty/ix-timer/ix-timer.js";import"@digital-realty/ix-toast/ix-message-toast.js";import"@digital-realty/ix-time/ix-time.js";import"lit/directives/ref.js";import"@digital-realty/ix-filter-select/ix-filter-select.js";import"intl-tel-input/utils";import"@digital-realty/ix-phone-input/ix-phone-input.js";import"@digital-realty/ix-accordion/ix-accordion.js";import"@digital-realty/ix-multi-select/ix-multi-select.js";import"@material/web/icon/icon.js";const ie={Read:"Read",Approve:"Approve"},K=oe`.ticket-card-list{display:flex;flex-direction:column;align-items:flex-start;gap:12px;cursor:pointer}.ticket-card{position:relative;display:grid;grid-template-columns:auto auto;grid-template-rows:min-content auto;grid-column-gap:24px;grid-row-gap:8px;border-radius:8px;padding-right:21px;background:#fff;box-shadow:0 0 0 1px #e1e4e8 inset}.ticket-card__icon{grid-column-start:1;grid-row-start:1;grid-row-end:span 2;display:flex;width:180px;min-height:160px;justify-content:center;align-items:center;flex-shrink:0;border-radius:8px 0 0 8px;background:var(--brand-gradient-corner-to-corner,linear-gradient(90deg,#1456e0 0,#0d2497 99.23%))}.ticket-card__title{grid-column-start:2;grid-row-start:1;color:var(--Text-Dark,#092241);font-family:var(--root-secondary-font);font-size:20px;font-style:normal;font-weight:700;line-height:24px;letter-spacing:.15px;margin:16px 0 0 0}.ticket-card__info{grid-column-start:2;grid-row-start:2;color:var(--Text-Dark-2nd,rgba(9,34,65,.6));font-family:var(--root-primary-font);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.25px;margin-bottom:38px}.ticket-card__button{grid-column-start:2;grid-row-start:2;display:flex;justify-content:center;align-items:center;color:var(--Primary-Main,#1456e0);text-align:center;font-family:var(--root-secondary-font);font-size:14px;font-style:normal;font-weight:700;line-height:normal;letter-spacing:1.25px;text-transform:uppercase;background:0 0;border:none;cursor:pointer;position:absolute;bottom:14px;right:16px;white-space:nowrap;padding:0}.dr-ticket-card-list{display:flex;flex-direction:column;gap:12px;margin:0 1rem}.dr-ticket-card{display:flex;gap:12px;flex-direction:column;padding:18px;border-radius:8px;background:#fff;box-shadow:0 0 0 1px #e1e4e8 inset;align-items:flex-start}.dr-ticket-card md-icon{--_disabled-icon-color:#fff}.dr-ticket-card-title{font-size:13pt;padding-bottom:15px}.dr-ticket-card-blocked-message{font-size:.75rem;line-height:1.33em}.ticket-card-container{width:100%}@media screen and (max-width:600px){.ticket-card{grid-template-columns:auto min-content;grid-template-rows:auto auto auto;grid-column-gap:0;padding:16px}.ticket-card__title{grid-column-start:1;grid-row-start:1;margin:0;line-height:32px}.ticket-card__icon{grid-column-start:2;grid-row-start:1;grid-row-end:unset;width:32px;height:32px;min-height:unset;border-radius:16px}.ticket-card__info{grid-column-start:1;grid-column-end:span 2;grid-row-start:2;margin-bottom:0}.ticket-card__button{grid-column-start:1;grid-column-end:span 2;grid-row-start:3;position:unset;justify-self:end}}`;let A=class extends E{constructor(){super(...arguments),this.selectedSite=void 0,this.removalsServiceBackend=void 0,this.deliveryBlocked=void 0}get deliveryDisabled(){return this.deliveryBlocked!==!1&&(this.removalsServiceBackend===N.ServiceNow||this.removalsServiceBackend===void 0)}async firstUpdated(){var e,t,i,a;this.removalsServiceBackend=await Z.getServiceBackend((e=this.selectedSite)===null||e===void 0?void 0:e.accountNumber,(t=this.selectedSite)===null||t===void 0?void 0:t.id,"Removals"),this.removalsServiceBackend===N.ServiceNow&&(this.deliveryBlocked=await P.isDeliveryBlocked((i=this.selectedSite)===null||i===void 0?void 0:i.id,(a=this.selectedSite)===null||a===void 0?void 0:a.accountNumber))}handleOnCreateTicket(e){e===n.Deliveries?P.updateSite(this.selectedSite):B.updateSite(this.selectedSite),M(this,$.CreateTicket,{ticketType:e})}renderLoadingProgress(){return P.loadings.isDeliveryBlocked?s`<div> <ix-progress .indeterminate="${!0}"></ix-progress> </div>`:T}renderTicketTypeSelectCard(e,t,i,a=!1){return s`<div class="dr-ticket-card"> <div> <div class="dr-ticket-card-title">${e}</div> <div> <ix-button name="${i}" @click="${()=>{this.handleOnCreateTicket(t)}}" has-icon trailing-icon .disabled="${a}"> <md-icon slot="icon">east</md-icon> <span class="create-service-ticket-btn"> START </span> </ix-button> </div> </div> ${t===n.Deliveries&&this.deliveryBlocked?s`<span name="delivery-blocked" class="dr-ticket-card-blocked-message"> ${ne} </span>`:T} </div>`}render(){return s`<ix-wizard slot="content" .enableHideCloseButton="${!0}" .onCloseClick="${()=>this.onCloseClick()}" .onMinimiseClick="${()=>this.onMinimiseClick()}"> <div class="wizard-content"> <div class="form-margin"> <h1 class="dlr-text-page-title"> Create Delivery or Removal Service Ticket </h1> <div class="sub-header dlr-text-heading"> <h4>Choose a request Type</h4> </div> </div> <div class="form-wrapper pt-8"> <div class="dr-ticket-card-list form-margin"> ${this.renderLoadingProgress()} ${this.renderTicketTypeSelectCard("Delivery Ticket",n.Deliveries,"create-delivery-service-btn",this.deliveryDisabled)} ${this.removalsServiceBackend!==N.ServiceNow?T:this.renderTicketTypeSelectCard("Removal Ticket",n.Removals,"create-edit-removals-service-btn")} </div> </div> </div> </ix-wizard>`}};A.styles=[K,L,x],r([h({type:Object})],A.prototype,"selectedSite",void 0),r([p()],A.prototype,"removalsServiceBackend",void 0),r([p()],A.prototype,"deliveryBlocked",void 0),r([h({type:Function})],A.prototype,"onCloseClick",void 0),r([h({type:Function})],A.prototype,"onMinimiseClick",void 0),A=r([f("deliveries-removals-ticket-type-selector")],A);let D=class extends q{constructor(){super(...arguments),this.cardTitle="",this.info="",this.ticketType="",this.launchEvent={actionEvent:"",ticketType:"",triggerFn:e=>{}}}connectedCallback(){if(super.connectedCallback(),this.ticketType){const e=this.ticketType,t=`launch-${this.ticketType}`;this.launchEvent={actionEvent:t,ticketType:e,triggerFn:i=>{this.handleOnCreateTicket(this.ticketType,i.detail)}},document.addEventListener(t,i=>{this.launchEvent.triggerFn(i)})}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(this.launchEvent.actionEvent,this.launchEvent.triggerFn)}handleOnCreateTicket(e,t={fromLaunchpad:!1}){var i;const a=(i=t==null?void 0:t.fromLaunchpad)!==null&&i!==void 0?i:!1;M(this,$.CreateTicket,{ticketType:e,fromLaunchpad:a,data:t})}renderTicketTypeSvg(){switch(this.serviceType){case w.CustomerSupport:return _.CustomerSupport;case w.FacilityAccess:return _.FacilityAccess;case w.RemoteHands:return _.RemoteHands;case w.TroubleTicket:return _.TroubleTickets;case w.DeliveriesAndRemovals:default:return _.DeliveriesAndRemovals}}renderCreateTicketButton(){return s`<button type="button" target="" appearance="text" class="ticket-card__button"> Create Ticket <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> <path d="M12 4L10.59 5.41L16.17 11H4V13H16.17L10.59 18.59L12 20L20 12L12 4Z" fill="#1456E0"/> </svg> </button>`}render(){return s`<div class="ticket-card" .onclick="${()=>this.handleOnCreateTicket(this.ticketType)}"> <div class="ticket-card__icon"> <svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg"> ${this.renderTicketTypeSvg()} </svg> </div> <h4 class="ticket-card__title">${this.cardTitle}</h4> <span class="ticket-card__info">${this.info}</span> ${this.renderCreateTicketButton()} </div>`}};D.styles=[K],r([h({type:String})],D.prototype,"cardTitle",void 0),r([h({type:String})],D.prototype,"info",void 0),r([h({type:String})],D.prototype,"ticketType",void 0),r([h({type:String})],D.prototype,"serviceType",void 0),r([p()],D.prototype,"launchEvent",void 0),D=r([f("ticket-type-card")],D);let W=class extends E{async firstUpdated(){await o.checkPermissions()}renderLoadingProgress(){return o.loadings.ticketCreatePermissionChecks?s`<div class="w-full"> <ix-progress .indeterminate="${!0}"></ix-progress> </div>`:T}renderCustomerSupportCard(){return o.permissions.hasCustomerCareCreatePermission?s`<ticket-type-card class="ticket-card-container" .serviceType="${w.CustomerSupport}" cardTitle="Customer Care" info="Having a billing, contract, or inventory question? Contact Customer Support for non-emergency needs and general questions." .ticketType="${n.CustomerSupport}"> </ticket-type-card>`:s``}renderFacilityAccessCard(){return o.permissions.hasFacilityAccessCreatePermission?s`<ticket-type-card class="ticket-card-container" serviceType="${w.FacilityAccess}" cardTitle="Facility Access" info="Need to request, modify or terminate physical access to select few or all of your locations? Submit a Facility Access Ticket to let our Data Center Security Team know and assist you with that." .ticketType="${n.FacilityAccess}"> </ticket-type-card>`:s``}renderRemoteHandsCard(){return o.permissions.hasRemoteHandsCreatePermission?s`<ticket-type-card class="ticket-card-container" .serviceType="${w.RemoteHands}" cardTitle="Remote Hands" info="Need to reboot, install a panel, or remove a gear? Let Digital Realty Technicians do the work for you. Remote Hands Fees apply (24/7/365)." .ticketType="${n.RemoteHands}"> </ticket-type-card>`:s``}renderDeliveriesAndRemovalsCard(){return o.permissions.hasDeliveriesAndRemovalsCreatePermission?s`<ticket-type-card class="ticket-card-container" .serviceType="${w.DeliveriesAndRemovals}" cardTitle="Deliveries & Removals" info="Sending Equipment to a Digital Realty facility or having it removed? Let us know how to handle the shipment or removal." .ticketType="${n.DeliveriesAndRemovals}"> </ticket-type-card>`:T}renderTroubleTicketsCard(){return o.permissions.hasTroubleTicketsCreatePermission?s`<ticket-type-card class="ticket-card-container" .serviceType="${w.TroubleTicket}" cardTitle="Trouble Tickets" info="Trouble Tickets are for physical on-site issues and maintenance. Remote Hands fees will apply." .ticketType="${n.TroubleTickets}"> </ticket-type-card>`:T}render(){return s` <div class="ticket-card-list"> ${this.renderLoadingProgress()} ${this.renderCustomerSupportCard()} ${this.renderFacilityAccessCard()} ${this.renderRemoteHandsCard()} ${this.renderDeliveriesAndRemovalsCard()} ${this.renderTroubleTicketsCard()} </div>`}};W.styles=[K,x],W=r([f("ticket-type-card-list")],W);let Q=class extends q{render(){return s` <div class="create-service-ticket-container wizard-content form-margin"> <div> <h1 class="dlr-text-page-title">Create Service Ticket</h1> <div class="create-service-ticket-container-subheader"> <h3 class="dlr-text-heading">Select a Ticket Type</h3> </div> </div> <ticket-type-card-list></ticket-type-card-list> </div>`}};Q.styles=[x,L],Q=r([f("create-service-ticket")],Q);function $e(e,t){let i="";switch(e){case"Delivery":i=S.DeliveriesTicketDetails;break;case"Removal":i=S.RemovalsTicketDetails;break;case"Remote Hands":i=S.RemoteHandsTicketDetails;break;case"Customer Care":i=S.CustomerCareTicketDetails;break;case"Facility Access":switch(t){case"Visitor Access":i=S.VisitorAccessTicketDetails;break;case"Permanent Badge":i=S.PermanentBadgeTicketDetails;break;case"OSP Access":i=S.OspAccessTicketDetails;break;case"PoP/POE Access":i=S.PopAccessTicketDetails;break}break;case"Trouble Ticket":i=S.TroubleTicketDetails;break}return i}function se(){const{isStandalone:e}=le,{pathname:t}=fe;return!!(e||t.includes(Ce))}const Ae=[R.Delivery,R.Removal];let C=class extends E{get vaadinGrid(){var e,t,i;const a=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("ix-grid");return(i=(t=a==null?void 0:a.shadowRoot)===null||t===void 0?void 0:t.querySelector("vaadin-grid"))!==null&&i!==void 0?i:null}constructor(){super(),this.items=void 0,this.isOpenTicketsFilterApplied=!0,this.hasDeliveryAndRemovalsCreatePrivilege=!1,this.fetchTicketsController=new AbortController,this.listSort="updated_at desc",this.listSkip=0,this.listPageSize=20,this.locationsHeaderLabel="Location",this.sitesHeaderLabel="Site",this.useNewDatePickerComponent=!1,this.isGridInitialized=!1,this.handlePopState=()=>{this.updateIsOpenTicketsFilterApplied()},this.useNewDatePickerComponent=ce.showNewDatePickerComponent()}async connectedCallback(){this.isGridInitialized=!0,window.addEventListener("popstate",this.handlePopState),this.updateIsOpenTicketsFilterApplied(),this.parsePermissionPrivilege();const e=await de.getHashedRootAccountNumberAndUserEmail();e&&(this.hashedLocalStorageID=`service-tickets-${e}`),super.connectedCallback(),this.debouncedHandleTableChange=be(this.handleTableChange.bind(this),300),this.fetchUserCreatePermission()}parsePermissionPrivilege(){var e;const t=new URLSearchParams(window.location.search);this.permissionPrivilege=(e=t.get(z))!==null&&e!==void 0?e:void 0}clearPermissionPrivilege(){if(!this.permissionPrivilege)return;const e=new URL(window.location.href);e.searchParams.delete(z),this.permissionPrivilege=void 0,o.setPendingApprovalDialogShown(!1),window.history.replaceState(null,"",e.toString())}updateIsOpenTicketsFilterApplied(){const e=new URL(document.location.href).searchParams.get(U);this.isOpenTicketsFilterApplied=e!=="closed"}disconnectedCallback(){var e;this.loadingChangedListener&&((e=this.vaadinGrid)===null||e===void 0||e.removeEventListener("loading-changed",this.loadingChangedListener)),window.removeEventListener("popstate",this.handlePopState),super.disconnectedCallback(),this.isGridInitialized=!1}addEventListeners(){const{vaadinGrid:e}=this;e&&(this.loadingChangedListener=t=>{const i=t.target;i.loading||setTimeout(()=>{i.recalculateColumnWidths(),i.requestContentUpdate()},0)},e.addEventListener("loading-changed",this.loadingChangedListener))}handleKeyPress(e,t){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.handleRowClick(t))}getColumns(){return[{name:"ticketId",header:"Ticket #",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.ticketId} </div>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"],width:"160px"},{name:"ticketType",header:"Ticket Type",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.ticketType} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"200px"},{name:"requestType",header:"Request Type",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.requestType?e.requestType:s` `} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"200px"},{name:"category",header:"Category",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.category?e.category:s` `} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"240px"},{name:"subject",header:"Subject",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.subject?e.subject:s` `} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"372px"},{name:"sites",header:this.sitesHeaderLabel,bodyRenderer:e=>{var t;const i=(t=e.sites)===null||t===void 0?void 0:t.map(a=>{var l;return(l=a.name)===null||l===void 0?void 0:l.trim()}).filter(a=>!!a);return!i||i.length===0?s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${a=>this.handleKeyPress(a,e)}"> </div>`:s` <site-location-cell @click="${()=>this.handleRowClick(e)}" @keypress="${a=>this.handleKeyPress(a,e)}" .items="${i}"> </site-location-cell>`},sortable:!0,filterable:!0,filterOperators:["contains","equals"],width:"224px"},{name:"locations",header:this.locationsHeaderLabel,bodyRenderer:e=>{var t;return s` <site-location-cell @click="${()=>this.handleRowClick(e)}" @keypress="${i=>this.handleKeyPress(i,e)}" .items="${!((t=e.locations)===null||t===void 0)&&t.length?e.locations:[s` `]}"></site-location-cell>`},filterable:!0,filterOperators:["contains","equals"],sortable:!0,width:"224px"},{name:"createdBy",header:"Requester",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.createdBy} </div>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"],width:"160px"},{name:"accessRequestedFor",header:"Access Requested For",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.accessRequestedFor?e.accessRequestedFor:s` `} </div>`,sortable:!0,filterable:!0,filterOperators:["contains","equals"],width:"180px"},{name:"createdAt",header:"Created Date",bodyRenderer:e=>s` <div> ${e.createdAt?this.useNewDatePickerComponent?s`<ix-date-next type="static" variant="date-time" .value="${e.createdAt}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"></ix-date-next>`:s`<ix-date type="static" variant="date-time" .value="${e.createdAt}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> </ix-date>`:""} </div>`,sortable:!0,filterable:!0,filterOperators:["contains"],dataType:"dateTime",width:"160px"},{name:"updatedAt",header:"Updated On",bodyRenderer:e=>s` <div> ${e.updatedAt?this.useNewDatePickerComponent?s`<ix-date-next type="static" variant="date-time" .value="${e.updatedAt}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"></ix-date-next>`:s`<ix-date type="static" variant="date-time" .value="${e.updatedAt}" @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> </ix-date>`:""} </div>`,sortable:!0,filterable:!0,filterOperators:["contains"],dataType:"dateTime",width:"160px"},{name:"status",header:"Status",bodyRenderer:e=>s` <div @click="${()=>this.handleRowClick(e)}" @keypress="${t=>this.handleKeyPress(t,e)}"> ${e.status} </div>`,filterable:!0,filterOperators:["contains","equals"],width:"140px"},{name:"actions",header:"Actions",width:"94px",bodyRenderer:e=>s` <div style="max-height:1.5REM;min-height:1.5REM"> ${this.renderActionButtons(e)} </div>`,frozenToEnd:!0,flexGrow:1,filterable:!1}]}async handleTableChange(e){this.lastDetail=e.detail;const{columnName:t,page:i,pageSize:a,sortOrder:l,filters:d,filtersOperators:c}=e.detail;this.listSort="updated_at desc",this.listPageSize=a;const m={status:this.tryGetStatusFilter(d,c,"status",g.Single,!0),ticket_id:this.tryGetFilter(d,c,"ticketId",g.Single,!0),ticket_type:this.tryGetFilter(d,c,"ticketType",g.Single,!0),request_type:this.tryGetFilter(d,c,"requestType",g.Single,!0),category:this.tryGetFilter(d,c,"category",g.Single,!0),subject:this.tryGetFilter(d,c,"subject",g.Single,!0),sites:this.tryGetFilter(d,c,"sites",g.ObjectCollection,!0,"name"),locations:this.tryGetFilter(d,c,"locations",g.StringCollection,!0),created_by:this.tryGetFilter(d,c,"createdBy",g.Single,!0),access_requested_for:this.tryGetFilter(d,c,"accessRequestedFor",g.Single,!0),created_at:this.tryGetFilter(d,c,"createdAt",g.Single,!1),updated_at:this.tryGetFilter(d,c,"updatedAt",g.Single,!1,void 0)};if(this.isGridInitialized&&!c.some(k=>d[k.columnField]!=null)&&this.permissionPrivilege&&this.clearPermissionPrivilege(),m.status.length===0&&(m.status=this.getTicketStatusFilter()),this.currentFilters=m,t&&l){const k=this.camelToSnakeCase(t);this.listSort=`${k} ${l}`}this.listSkip=(i-1)*this.listPageSize,this.fetchTicketsController.abort(),this.fetchTicketsController=new AbortController,this.fetchTickets({signal:this.fetchTicketsController.signal})}rewriteUrlForTicketsView(e){const t=new URLSearchParams(window.location.search);t.set(U,e),t.set("page","1"),ee.go(`${window.location.pathname}?${t.toString()}`)}filterOpenTickets(){this.isOpenTicketsFilterApplied=!0,this.updatePaginationToPageOne(),this.rewriteUrlForTicketsView("open")}filterClosedTickets(){this.isOpenTicketsFilterApplied=!1,this.updatePaginationToPageOne(),this.rewriteUrlForTicketsView("closed")}updatePaginationToPageOne(){var e,t,i;this.lastDetail.page=1;const a=(i=(t=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("ix-grid"))===null||t===void 0?void 0:t.shadowRoot)===null||i===void 0?void 0:i.querySelector("ix-pagination");a?a.updatePagination(this.lastDetail.page,this.lastDetail.pageSize):this.handleTableChange({detail:this.lastDetail})}camelToSnakeCase(e){return e.replace(/[A-Z]/g,(t,i)=>(i?"_":"")+t.toLowerCase())}getTicketStatusFilter(){let e;return this.isOpenTicketsFilterApplied?e=pe.map(t=>({matchValue:t,equalityOperator:y.Equals,concatenationOperator:y.Or,fieldType:g.Single,objectProperty:void 0})):e=he.map(t=>({matchValue:t,equalityOperator:y.Equals,concatenationOperator:y.Or,fieldType:g.Single,objectProperty:void 0})),e}async fetchTickets(e){var t,i;if(!se())return;const a=this.listPageSize||20,l={...this.currentFilters};l!=null&&l.created_at&&(l.created_at=this.adjustDateFilterForTimeZone(l.created_at)),l!=null&&l.updated_at&&(l.updated_at=this.adjustDateFilterForTimeZone(l.updated_at));const d=V(l,{orderBy:this.listSort?[this.listSort]:["updated_at desc"],top:a,skip:this.listSkip}),c=new URLSearchParams(d);await o.GetServiceTicketList(c.get("$filter")||void 0,c.get("$orderby")||void 0,this.listSkip,a,this.permissionPrivilege,e),((t=o.serviceTickets)===null||t===void 0?void 0:t.items)!==void 0?this.items=(i=o.serviceTickets)===null||i===void 0?void 0:i.items:this.items=void 0,setTimeout(()=>{this.addEventListeners()},0)}adjustDateFilterForTimeZone(e){return e.flatMap(t=>{const{startOfDayLocal:i,endOfDayLocal:a}=ue(t.matchValue);return[{...t,matchValue:i.toISOString(),equalityOperator:y.GreaterThanOrEqualTo,concatenationOperator:y.And},{...t,matchValue:a.toISOString(),equalityOperator:y.LessThanOrEqualTo,concatenationOperator:y.And}]})}renderActionButtons(e){const t=e.ticketType;return!Ae.includes(t)||!this.hasUserCreatePrivilege(t)?s``:s` <ix-progress id="progress-${e.ticketId}" .linear="${!1}" indeterminate="false" style="--md-circular-progress-size:1.375REM;display:none;padding:.0625REM"></ix-progress> <ix-icon id="clone-icon-${e.ticketId}" style="--ix-icon-font-size:1.375REM;color:#1456e0;display:inline-block;padding:.0625REM;transform:scaleY(-1)" @click="${async i=>this.handleCloneClick(i,t,e.ticketId)}">content_copy </ix-icon> `}async fetchUserCreatePermission(){this.hasDeliveryAndRemovalsCreatePrivilege=await ve()}hasUserCreatePrivilege(e){switch(e){case R.Delivery:case R.Removal:return this.hasDeliveryAndRemovalsCreatePrivilege;default:return!1}}async handleCloneClick(e,t,i){const a=e.currentTarget,{parentElement:l}=a;switch(this.hideCloneIcon(l,a,i),t){case R.Delivery:await P.getDeliveriesServiceTicket(i),M(this,$.CreateTicket,{ticketType:n.Deliveries,isCloned:!0,site:P.newTicket.site});break;case R.Removal:await B.getRemovalsServiceTicket(i),M(this,$.CreateTicket,{ticketType:n.Removals,isCloned:!0,site:B.newTicket.site});break;default:console.warn("Incorrect ticket type")}this.resetActionIconsToDefault(l,a,i)}hideCloneIcon(e,t,i){this.toggleVisibility(e,t,i,!0)}resetActionIconsToDefault(e,t,i){this.toggleVisibility(e,t,i,!1)}toggleVisibility(e,t,i,a){if(e){const l=e.querySelector(`#progress-${i}`);l&&(t.style.display=a?"none":"inline-block",l.style.display=a?"inline-block":"none")}}tryGetFilter(e,t,i,a,l,d=void 0,c=y.Or){const m=t.find(b=>b.columnField===i);if(m===void 0)return[];const k=e[i];if(k===void 0)return[];const O=m.operator==="contains"?y.Contains:y.Equals;return(Array.isArray(k)?k:[k]).map(b=>({matchValue:b.value||b,equalityOperator:O,concatenationOperator:c,fieldType:a,ignoreCase:l,objectProperty:d}))}tryGetStatusFilter(e,t,i,a,l,d=void 0){const c=this.getTicketStatusFilter(),m=this.tryGetFilter(e,t,i,a,l,d,y.And);return c.concat(m)}get downloadMenuItems(){const e=[{label:"All Tickets",name:"download-all-tickets",onClick:t=>{this.handleDownloadCsv(t)}},{label:"Current Filter",name:"download-current-filter",onClick:t=>{this.handleDownloadCsv(t)}}];return this.isOpenTicketsFilterApplied?e.push({label:"Open Tickets",name:"download-open-tickets",onClick:t=>{this.handleDownloadCsv(t)}}):e.push({label:"Closed Tickets",name:"download-closed-tickets",onClick:t=>{this.handleDownloadCsv(t)}}),e}generateQuery(e=void 0){if(e!==void 0)return V(e);const t=this.getTicketStatusFilter();return V({status:t})}async handleDownloadCsv(e){let t;switch(e){case"download-all-tickets":await o.downloadServiceTickets();break;case"download-current-filter":t=new URLSearchParams(this.generateQuery(this.currentFilters)),await o.downloadServiceTickets(t.get("$filter")||void 0,this.permissionPrivilege);break;case"download-closed-tickets":this.isOpenTicketsFilterApplied=!1,t=new URLSearchParams(this.generateQuery()),await o.downloadServiceTickets(t.get("$filter")||void 0);break;default:this.isOpenTicketsFilterApplied=!0,t=new URLSearchParams(this.generateQuery()),await o.downloadServiceTickets(t.get("$filter")||void 0);break}}handleRowClick(e){if(e.ticketId){const t=$e(e==null?void 0:e.ticketType,e==null?void 0:e.requestType);t&&ee.go(ge(t,{ticketId:e.ticketId}))}}renderGridNoRows(){const e=o.error.serviceTicketsGrid?"Sorry, an error has occurred":this.items!==void 0?"No data to display":null;return e?s` <ix-grid-no-rows slot="no-rows" message="${e}"></ix-grid-no-rows>`:T}render(){var e,t;return s` <div class="maintenance-grid"> <ix-grid session-storage-key="sm-service-tickets" column-reordering-allowed .columns="${this.getColumns()}" .rows="${(e=this.items)!==null&&e!==void 0?e:[]}" .recordCount="${(t=o===null||o===void 0?void 0:o.serviceTickets)===null||t===void 0?void 0:t.totalCount}" .addParamsToURL="${se()}" .readParamsFromURL="${!0}" .downloadMenuItems="${this.downloadMenuItems}" .pageSizes="${[10,20,50,100]}" .pageSize="${this.listPageSize}" @change="${this.debouncedHandleTableChange}" .localStorageID="${this.hashedLocalStorageID}" .refreshDataOnColumnVisibilityChange="${!1}" .filterValueChangeDebounceTime="${me().ServiceTicketListFilterValueChangeDebounceTime}" .isLoading="${o.loadings.serviceTicketList}" .isDownloading="${o.loadings.downloadServiceTicketList}" .preservedQueryParamKeys="${[U,z]}" .filterMaxDate="${ke()}" .useNewDatePicker="${this.useNewDatePickerComponent}"> <div slot="header"> ${this.permissionPrivilege===ie.Approve?s`<div class="sub-header ml-[8px] font-bold"> <h3>Showing tickets only pending approval</h3> </div>`:s`<ix-grid-nav class="reports-grid-nav" .buttons="${[{text:"Open Tickets",selected:this.isOpenTicketsFilterApplied,onClick:()=>this.filterOpenTickets()},{text:"Closed Tickets",selected:!this.isOpenTicketsFilterApplied,onClick:()=>this.filterClosedTickets()}]}"></ix-grid-nav>`} </div> ${this.renderGridNoRows()} </ix-grid> </div>`}};C.styles=[x,L],r([p()],C.prototype,"currentFilters",void 0),r([p()],C.prototype,"hashedLocalStorageID",void 0),r([p()],C.prototype,"permissionPrivilege",void 0),r([h({type:Array})],C.prototype,"items",void 0),r([h({type:Boolean})],C.prototype,"isOpenTicketsFilterApplied",void 0),r([h({type:Boolean})],C.prototype,"hasDeliveryAndRemovalsCreatePrivilege",void 0),C=r([f("service-ticket-list")],C);let v=class extends q{constructor(){super(...arguments),this.isDialogOpen=!0,this.modalTitle="",this.accountNumber="",this.sites=[],this.isLoading=!0,this.isAssignableSite=!0,this.isTicketSupported=!0,this.assignableSites=[],this.ticketNotSupportedMessage=ye,this.backendService=void 0}async firstUpdated(){var e;if(this.permissionType){const[t,i]=await Promise.all([Y(J.Create,this.permissionType,this.assignableProcess,this.accountNumber),Y(J.Create,this.permissionType,void 0,this.accountNumber)]);this.assignableSites=t,this.sites=i,this.assignableSites.length===1&&await this.isTicketSupportedForSite(this.assignableSites[0])&&(this.onSiteSelected(this.assignableSites[0]),this.onAccept()),this.isLoading=!1,await this.updateComplete,(e=this.dialog)===null||e===void 0||e.focus()}}isStartButtonDisabled(){return!this.selectedSite||!this.isTicketSupported||!this.isAssignableSite}async onSiteSelectionChanged(e){this.isAssignableSite=this.assignableSites.some(t=>t.siteId===e.siteId),this.isTicketSupported=await this.isTicketSupportedForSite(e),this.onSiteSelected(e)}async isTicketSupportedForSite(e){return o.ticketType===n.TroubleTickets?(this.backendService=await Z.getServiceBackend(this.accountNumber,e.siteId,"Trouble_tickets"),this.backendService!==N.Insite):!0}render(){return s` <ix-dialog id="site-selection-dialog" ?open="${this.isDialogOpen}" @keydown="${e=>{e.key==="Escape"&&this.onReject()}}" @closed="${()=>this.onReject()}"> <div slot="content" class="form-wrapper"> <div id="dialog" tabindex="-1"> ${this.isLoading?s` <div class="w-full flex justify-center mt-6 pb-16"> <ix-progress .indeterminate="${!0}" .linear="${!1}"></ix-progress> </div>`:s` <h3 class="dialog__title dlr-text-heading"> ${this.modalTitle} <ix-icon-button aria-label="Close Site Select Dialog" icon="close" @click="${()=>{this.onReject()}}" @keydown="${e=>{(e.key==="Enter"||e.key==="Space")&&this.onReject()}}"> </ix-icon-button> </h3> <div class="site-dialog__short-desc"> Which site are you submitting a ticket for? </div> <div class="form-wrapper__fields site-selection-dialog"> ${this.renderSiteSelect()} </div> <div slot="actions" class="site-selection-dialog__button-container"> <ix-button .disabled="${this.isStartButtonDisabled()}" appearance="text" @click="${()=>{this.onAccept()}}"> <span class="button-label site-selection-dialog__button-text">START</span> </ix-button> </div>`} </div> </div> </ix-dialog>`}renderSiteSelect(){return!this.sites||this.sites.length<1?s` <div>Loading sites...</div>`:s` <ix-select class="dialog-input" label="Site" menu-positioning="fixed" .wideMenu="${!0}" required data-testid="site-select" @input="${e=>{this.onSiteSelectionChanged(e.target.value)}}"> ${this.sites.map(e=>s` <ix-select-option .value="${e}" .selected="${this.selectedSite===e}"> <div slot="headline">${e.displayName}</div> </ix-select-option>`)} </ix-select> ${this.renderWarning()} `}renderWarning(){let e="";return this.isTicketSupported?this.isAssignableSite||(e=Te):e=this.ticketNotSupportedMessage,e?s`<div> <span id="ticketNotSupportedMessage" class="supporting-text error">*${e}</span> </div>`:s`<div class="required-text">*Required</div>`}};v.styles=[x,L,te],r([ae("#dialog")],v.prototype,"dialog",void 0),r([h({type:Function})],v.prototype,"onAccept",void 0),r([h({type:Function})],v.prototype,"onReject",void 0),r([h({type:String})],v.prototype,"selectedSite",void 0),r([h({type:Function})],v.prototype,"onSiteSelected",void 0),r([h({type:Boolean})],v.prototype,"isDialogOpen",void 0),r([h({type:String})],v.prototype,"modalTitle",void 0),r([h({type:String})],v.prototype,"permissionType",void 0),r([h({type:String})],v.prototype,"accountNumber",void 0),r([h({type:String})],v.prototype,"assignableProcess",void 0),r([p()],v.prototype,"sites",void 0),r([p()],v.prototype,"isLoading",void 0),v=r([f("site-selection-dialog")],v);let I=class extends q{constructor(){super(...arguments),this.onAccept=()=>{}}render(){return s` <ix-dialog id="pending-approval-info-dialog" class="selection-dialog" ?open="${!0}" @keydown="${e=>{e.key==="Escape"&&this.onAccept()}}" @closed="${()=>this.onAccept()}"> <div slot="content" class="py-[24px]"> <div class="pending-approval-dialog__title"> <div> <h3 class="dlr-text-heading">Pending Approval Shown</h3> </div> </div> <div class="pending-approval-dialog__short-desc"> This page is filtered to show only items awaiting your approval. You can adjust or clear the filter at any time. </div> </div> <div slot="actions" class="pending-approval-dialog__button-container"> <ix-button appearance="text" @click="${()=>{this.onAccept()}}"> <span class="button-label">Continue</span> </ix-button> </div> </ix-dialog> `}};I.styles=[x,L,te],r([h({type:Function})],I.prototype,"onAccept",void 0),I=r([f("pending-approval-info-dialog")],I);function De(e){switch(e){case n.DeliveriesAndRemovals:return F.DeliveriesRemovals;case n.RemoteHands:return F.RemoteHands;case n.CustomerSupport:return F.CustomerCare;case n.TroubleTickets:return F.TroubleTickets;case n.VisitorAccess:return F.VisitorAccess;case n.PermanentBadge:return F.PermanentBadge;default:return"default"}}function xe(e){switch(e){case n.DeliveriesAndRemovals:return"Deliveries";case n.RemoteHands:return"Remote_hands";case n.CustomerSupport:return"Customer_care";case n.TroubleTickets:return"Trouble_tickets";case n.FacilityAccess:return"Facilities_access";default:return}}let u=class extends E{constructor(){super(...arguments),this.showDrawer=!1,this.showSiteSelectionDialog=!1,this.showAccountSelectionDialog=!1,this.siteAccepted=!1,this.accountAccepted=!1,this.selectedSite=void 0,this.selectedAccount=void 0,this.modalTitle="",this.permissionType="",this.fromLaunchpad=!0,this.originEl=null,this.renderDrawer=!1,this.showPendingApprovalDialog=!1,this.drawerHandler=()=>this.toggleDrawer(),this.navigationHandler=()=>this.handleNavigation(),this.onCreateHandler=e=>{var t,i,a,l,d,c,m,k,O,b,H,G,j;this.isCloned=(t=e.detail)===null||t===void 0?void 0:t.isCloned,this.originEl=(a=(i=e.detail)===null||i===void 0?void 0:i.data)===null||a===void 0?void 0:a.originEl,this.showDrawer||this.toggleDrawer(),!((l=e.detail)===null||l===void 0)&&l.ticketType&&(this.permissionType=De((d=e.detail)===null||d===void 0?void 0:d.ticketType),this.assignableProcess=xe((c=e.detail)===null||c===void 0?void 0:c.ticketType),this.isCloned&&(this.selectedSite=(m=e.detail)===null||m===void 0?void 0:m.site,this.selectedAccount=(O=(k=e.detail)===null||k===void 0?void 0:k.site)===null||O===void 0?void 0:O.accountNumber,this.siteAccepted=!0,this.accountAccepted=!0)),this.fromLaunchpad=(H=(b=e.detail)===null||b===void 0?void 0:b.fromLaunchpad)!==null&&H!==void 0?H:!1,o.updateTicketType((G=e.detail)===null||G===void 0?void 0:G.ticketType),!((j=e.detail)===null||j===void 0)&&j.ticketType||this.resetComponent()}}toggleDrawer(){const e=this.showDrawer,t=e?this.originEl:null;this.showDrawer=!this.showDrawer,e&&(this.resetComponent(),o.clear(),this.updateComplete.then(()=>{requestAnimationFrame(()=>{t!=null&&t.isConnected&&t.focus()})}))}async firstUpdated(){window.addEventListener($.DrawerClose,this.drawerHandler),window.addEventListener($.CreateTicket,this.onCreateHandler),window.addEventListener("popstate",this.navigationHandler)}updated(e){(e.has("showAccountSelectionDialog")||e.has("showSiteSelectionDialog"))&&(this.renderDrawer=!(this.showAccountSelectionDialog||this.showSiteSelectionDialog))}get hideAside(){var e;return o.ticketType===n.FacilityAccess||!((e=this.selectedSite)===null||e===void 0)&&e.siteId&&this.siteAccepted?!1:this.fromLaunchpad}async handleAccountSelection(e){this.selectedAccount=e}async handleSiteSelection(e){this.selectedSite=e}connectedCallback(){super.connectedCallback(),o.clear(),this.parsePermissionPrivilege(),this.checkAndShowPendingApprovalDialog()}parsePermissionPrivilege(){var e;const t=new URLSearchParams(window.location.search);this.permissionPrivilege=(e=t.get(z))!==null&&e!==void 0?e:void 0}checkAndShowPendingApprovalDialog(){this.permissionPrivilege===ie.Approve&&!o.hasPendingApprovalDialogBeenShown&&(this.showPendingApprovalDialog=!0)}handlePendingApprovalDialogClose(){this.showPendingApprovalDialog=!1,o.setPendingApprovalDialogShown(!0)}handleNavigation(){window.location.pathname.startsWith("/service-management/")||o.setPendingApprovalDialogShown(!1)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener($.DrawerClose,this.drawerHandler),window.removeEventListener($.CreateTicket,this.onCreateHandler),window.removeEventListener("popstate",this.navigationHandler),setTimeout(()=>{window.location.pathname.startsWith("/service-management/")||o.setPendingApprovalDialogShown(!1)},0)}resetComponent(){this.selectedSite=void 0,this.selectedAccount=void 0,this.siteAccepted=!1,this.accountAccepted=!1,this.showSiteSelectionDialog=!1,this.showAccountSelectionDialog=!1,o.ticketType=void 0}handleSiteSelectionDialogClosed(e){this.siteAccepted=e,this.showSiteSelectionDialog=!1,e||(this.fromLaunchpad&&this.toggleDrawer(),this.resetComponent())}handleAccountSelectionDialogClosed(e){this.showAccountSelectionDialog=!1,this.accountAccepted=e,e||(this.fromLaunchpad&&this.toggleDrawer(),this.resetComponent())}handleToggleClick(){var e;const t=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("ix-drawer");t==null||t.handleCloseButton()}handleMinimisedClick(){var e;const t=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("ix-drawer");t==null||t.onMinimised()}getAccountNumber(){return this.selectedAccount}renderTicketWizard(){var e,t,i;if(o.ticketType===n.CustomerSupport){if(!((e=this.selectedSite)===null||e===void 0)&&e.siteId&&this.siteAccepted)return s`<customer-care-service-ticket-wizard .selectedSite="${this.selectedSite}" slot="content" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></customer-care-service-ticket-wizard>`;this.modalTitle="Customer Care",this.accountAccepted?this.showSiteSelectionDialog=!0:this.showAccountSelectionDialog=!0}else{if(o.ticketType===n.Deliveries)return P.newTicket.accountNumber=this.getAccountNumber(),s`<deliveries-service-ticket-wizard slot="content" .isClone="${this.isCloned}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></deliveries-service-ticket-wizard>`;if(o.ticketType===n.Removals)return B.newTicket.accountNumber=this.getAccountNumber(),s`<removals-service-ticket-wizard slot="content" .isCloned="${this.isCloned}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></removals-service-ticket-wizard>`;if(o.ticketType===n.RemoteHands){if(this.modalTitle="Remote Hands",!((t=this.selectedSite)===null||t===void 0)&&t.siteId&&this.siteAccepted)return we.updateAccountNumber(this.getAccountNumber()),s`<remote-hands-service-ticket-wizard slot="content" .selectedSite="${this.selectedSite}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></remote-hands-service-ticket-wizard>`;this.accountAccepted?this.showSiteSelectionDialog=!0:this.showAccountSelectionDialog=!0}else if(o.ticketType===n.TroubleTickets){if(!((i=this.selectedSite)===null||i===void 0)&&i.siteId&&this.siteAccepted)return s`<create-edit-trouble-ticket-wizard slot="content" .selectedSite="${this.selectedSite}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></create-edit-trouble-ticket-wizard>`;this.modalTitle="Trouble Tickets",this.accountAccepted?this.showSiteSelectionDialog=!0:this.showAccountSelectionDialog=!0}else if(o.ticketType===n.DeliveriesAndRemovals){if(this.modalTitle="Deliveries & Removals",this.selectedSite&&this.siteAccepted)return s`<deliveries-removals-ticket-type-selector slot="content" .selectedSite="${this.selectedSite}" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></deliveries-removals-ticket-type-selector>`;this.accountAccepted?this.showSiteSelectionDialog=!0:this.showAccountSelectionDialog=!0}else if(o.ticketType===n.FacilityAccess)return s`<facility-access-service-ticket-wizard slot="content" .onCloseClick="${()=>this.handleToggleClick()}" .onMinimiseClick="${()=>this.handleMinimisedClick()}"></facility-access-service-ticket-wizard>`}return s`<create-service-ticket slot="content"></create-service-ticket>`}render(){return s` ${this.showPendingApprovalDialog?s`<pending-approval-info-dialog .onAccept="${()=>this.handlePendingApprovalDialogClose()}"></pending-approval-info-dialog>`:T} ${this.renderDrawer?s` <ix-drawer ?isVisible="${this.showDrawer}" .showConfirmationDialogOnClose="${o.ticketType!==void 0&&o.ticketStep!==Se}" .onClosed="${()=>this.toggleDrawer()}" .hideAside="${this.hideAside}" .hideClose="${re(o.ticketType)}" .scrollable="${!1}" .label="${o.ticketType?`Create ${X[o.ticketType]} Service Ticket`:void 0}" close-label="${o.ticketType?`Close ${X[o.ticketType]} Service Ticket Dialog`:"Close Service Ticket Dialog"}"> ${this.renderTicketWizard()} </ix-drawer>`:T} ${this.showSiteSelectionDialog?s`<site-selection-dialog .isDialogOpen="${this.showSiteSelectionDialog}" .modalTitle="${this.modalTitle}" .onAccept="${()=>this.handleSiteSelectionDialogClosed(!0)}" .onReject="${()=>this.handleSiteSelectionDialogClosed(!1)}" .onSiteSelected="${e=>this.handleSiteSelection(e)}" .selectedSite="${this.selectedSite}" .permissionType="${this.permissionType}" .accountNumber="${this.selectedAccount}" .assignableProcess="${this.assignableProcess}"></site-selection-dialog>`:T} ${this.showAccountSelectionDialog?s`<account-selection-dialog .isDialogOpen="${this.showAccountSelectionDialog}" .modalTitle="${this.modalTitle}" modalText="You have access to multiple accounts, which account are you submitting this ticket for?" .onAccept="${()=>this.handleAccountSelectionDialogClosed(!0)}" .onReject="${()=>this.handleAccountSelectionDialogClosed(!1)}" .selectedAccount="${this.selectedAccount}" .permissionType="${this.permissionType}" .assignableProcess="${this.assignableProcess}" .onAccountSelected="${e=>this.handleAccountSelection(e)}" buttonText="Next"></account-selection-dialog>`:T} <service-ticket-list></service-ticket-list> `}};u.styles=[x,L],r([p()],u.prototype,"showDrawer",void 0),r([p()],u.prototype,"showSiteSelectionDialog",void 0),r([p()],u.prototype,"showAccountSelectionDialog",void 0),r([p()],u.prototype,"siteAccepted",void 0),r([p()],u.prototype,"accountAccepted",void 0),r([p()],u.prototype,"selectedSite",void 0),r([p()],u.prototype,"selectedAccount",void 0),r([p()],u.prototype,"modalTitle",void 0),r([p()],u.prototype,"permissionType",void 0),r([p()],u.prototype,"assignableProcess",void 0),r([p()],u.prototype,"fromLaunchpad",void 0),r([p()],u.prototype,"originEl",void 0),r([p()],u.prototype,"renderDrawer",void 0),r([p()],u.prototype,"showPendingApprovalDialog",void 0),r([p()],u.prototype,"permissionPrivilege",void 0),u=r([f("service-tickets-view")],u);export{u as ServiceTicketsView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as l}from"tslib";import{MobxLitElement as k}from"@adobe/lit-mobx";import"@digital-realty/ix-divider/ix-divider.js";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-drawer/ix-drawer.js";import"@digital-realty/ix-wizard/ix-wizard-step.js";import"@digital-realty/ix-wizard/ix-wizard.js";import{html as s,nothing as m}from"lit";import{property as w,customElement as $,state as p}from"lit/decorators.js";import"./ui-service-management6.js";import"@digital-realty/ix-date-next/ix-date-next.js";import"@digital-realty/ix-date/ix-date.js";import{ifDefined as v}from"lit-html/directives/if-defined.js";import{n as b,E as P,w as t,aN as V,S as y,O as L,T as R,H as A,aZ as B,e as r,x as S,M as q,aV as N,A as u,a6 as U,L as z,v as F,a as E,aW as O,aX as Z}from"./ui-service-management.js";import{S as T,N as j,h as M,i as W,j as X,k as G,U as J}from"./ui-service-management9.js";import{r as K,m as H,i as I}from"./ui-service-management16.js";import"@digital-realty/ix-chip/ix-custom-chip.js";import"./ui-service-management17.js";import{g as Q}from"./ui-service-management13.js";import"@digital-realty/ix-email-list/ix-email-list.js";import"@digital-realty/ix-file-uploader/ix-file-uploader.js";import"@digital-realty/ix-progress/ix-progress.js";import"@digital-realty/ix-select/ix-select-option.js";import"@digital-realty/ix-select/ix-select.js";import"@digital-realty/ix-textbox/ix-textbox.js";import"@digital-realty/ix-time/ix-time.js";import"@vaadin/router";import"@digital-realty/ix-dialog/ix-dialog.js";import"./ui-service-management10.js";import"lit-html/directives/unsafe-html.js";import"moment";import"@digital-realty/theme";import"moment-timezone";import"date-fns/format.js";import"mobx";import"mobx-persist-store";import"@digital-realty/ix-account-switcher";import"oidc-client-ts";import"lit/directives/if-defined.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"lit-html/directives/until.js";import"libphonenumber-js";import"@digital-realty/ix-toast/ix-toasters.js";import"./ui-service-management18.js";import"lit/directives/class-map.js";import"@digital-realty/ix-toast/ix-message-toast.js";import"@material/web/icon/icon.js";let f=class extends k{constructor(){super(),this.showCustomerReference=!0,this.useNewDatePickerComponent=!1,this.useNewDatePickerComponent=b.showNewDatePickerComponent()}async firstUpdated(){var e;this.siteName=await P((e=t.selectedTicket)===null||e===void 0?void 0:e.site)}renderCustomerReference(){var e;return this.showCustomerReference?s`<info-field class="informations-section__items-col" label="Customer Reference Number" value="${v((e=t.selectedTicket)===null||e===void 0?void 0:e.referenceNumber)}" .hideIcon="${!0}"> </info-field>`:m}renderExpectedStart(){if(!V(t.newTicket))return m;const{startDate:e,startDateTime:i}=t.newTicket;return s`<info-field class="informations-section__items-col" label="Latest Expected Start Date" useHtmlValue .hideIcon="${!0}"> <div slot="htmlValue"> ${this.useNewDatePickerComponent===!0?s`<ix-date-next type="static" variant="date" .value="${e}" .noTimeZoneConversion="${!0}"> </ix-date-next>`:s`<ix-date type="static" variant="date" .value="${e}" .noTimeZoneConversion="${!0}"></ix-date>`} </div> </info-field> <info-field class="informations-section__items-col" label="Time" useHtmlValue .hideIcon="${!0}"> <div slot="htmlValue"> ${this.useNewDatePickerComponent===!0?s`<ix-date-next type="static" .noTimeZoneConversion="${!0}" variant="time" .value="${i}"> </ix-date-next>`:s`<ix-date type="static" .noTimeZoneConversion="${!0}" variant="time" .value="${i}"></ix-date>`} </div> </info-field> `}render(){var e,i,o,n,a,d;return s` <div class="ticket-details-body__section"> <div class="informations-section__items"> <div class="informations-section__items-row"> <info-field class="informations-section__items-col" label="Request Type" value="${v((e=t.selectedTicket)===null||e===void 0?void 0:e.requestType)}" .hideIcon="${!0}"> </info-field> <info-field class="informations-section__items-col" label="Category" value="${v((i=t.selectedTicket)===null||i===void 0?void 0:i.category)}" .hideIcon="${!0}"> </info-field> ${this.renderCustomerReference()} <info-field class="informations-section__items-col" label="Deliveries & Removals Ticket Number" .hideIcon="${!0}" .value="${v((o=t.selectedTicket)===null||o===void 0?void 0:o.referenceTicketNumber)}"> </info-field> ${this.renderExpectedStart()} </div> <div class="informations-section__items-row"> <info-field class="informations-section__items-col-4" label="Site" value="${v(this.siteName)}" .hideIcon="${!0}"> </info-field> </div> <div class="informations-section__items-row"> <info-field class="informations-section__items-col-4" label="Location(s)" .hideIcon="${!0}" .useHtmlValue="${!0}"> <div slot="htmlValue"> <div> ${((n=t.selectedTicket)===null||n===void 0?void 0:n.locations)||"-"} </div> </div> </info-field> </div> </div> </div> ${((a=t.selectedTicket)===null||a===void 0?void 0:a.serviceBackend)!==y.TelxSFDC?s` <ix-divider></ix-divider> <div class="informations-section__items-row"> <info-field class="informations-section__items-col" label="${L}" .hideIcon="${!0}" .useHtmlValue="${!0}"> <div slot="htmlValue"> ${K((d=t.selectedTicket)===null||d===void 0?void 0:d.contacts)} </div> </info-field> </div>`:m} `}};f.styles=[T],l([w({type:String})],f.prototype,"siteName",void 0),l([w({type:Boolean})],f.prototype,"showCustomerReference",void 0),f=l([$("remote-hands-other-information-section")],f);let D=class extends k{render(){var e,i,o,n,a;const d=((e=t.selectedTicket)===null||e===void 0?void 0:e.state)===A.Cancelled||((i=t.selectedTicket)===null||i===void 0?void 0:i.state)===B.CancellationRequested;return s` <div class="ticket-details-body__section"> <span class="informations-section__title">Ticket Details</span> <div class="informations-section__items"> <div class="informations-section__items-row"> <info-field label="Subject" value="${v((o=t.selectedTicket)===null||o===void 0?void 0:o.subject)}" .hideIcon="${!0}"> </info-field> </div> <div class="informations-section__items-row"> <info-field label="Description" .hideIcon="${!0}" useHtmlValue> <div slot="htmlValue" class="break-normal"> <span class="whitespace-break-spaces">${(n=t.selectedTicket)===null||n===void 0?void 0:n.shortDescription}</span> </div> </info-field> </div> ${d?s` <div class="informations-section__items-row"> <info-field label="Reason for Cancellation" value="${v((a=t.selectedTicket)===null||a===void 0?void 0:a.cancellationReason)}" .hideIcon="${!0}"> </info-field> </div>`:m} </div> </div> `}};D.styles=[T,R],D=l([$("remote-hands-ticket-details-section")],D);let x=class extends k{constructor(){super(),this.useNewDatePickerComponent=!1,this.useNewDatePickerComponent=b.showNewDatePickerComponent()}render(){var e,i,o,n,a,d,C,g,_;return s` <div class="ticket-details-body__section"> <span class="informations-section__title">Service Ticket Information</span> <div class="informations-section__items"> <div class="informations-section__items-row"> <info-field class="informations-section__items-col" label="Ticket Number" value="${v((e=t.selectedTicket)===null||e===void 0?void 0:e.id)}"> <svg slot="icon">${j}</svg> </info-field> <info-field class="informations-section__items-col" label="Ticket Type" value="Remote Hands"> <svg slot="icon">${M}</svg> </info-field> <info-field class="informations-section__items-col" label="Status" useHtmlValue> <svg slot="icon">${W}</svg> <div slot="htmlValue"> ${H((i=t===null||t===void 0?void 0:t.selectedTicket)===null||i===void 0?void 0:i.state)!=="default"?s` <ix-custom-chip pill appearance="${H((o=t===null||t===void 0?void 0:t.selectedTicket)===null||o===void 0?void 0:o.state)}"></ix-custom-chip> `:s` <ix-custom-chip noIcon pill appearance="default">${(n=t===null||t===void 0?void 0:t.selectedTicket)===null||n===void 0?void 0:n.state} </ix-custom-chip>`} </div> </info-field> <info-field class="informations-section__items-col" label="Requester" .value="${(a=t.selectedTicket)===null||a===void 0?void 0:a.requester}"> <svg slot="icon">${X}</svg> </info-field> <info-field class="informations-section__items-col" label="Create Date" useHtmlValue> <svg slot="icon">${G}</svg> <div slot="htmlValue"> ${this.useNewDatePickerComponent===!0?s`<ix-date-next type="static" .value="${(d=t.selectedTicket)===null||d===void 0?void 0:d.createdAt}"> </ix-date-next>`:s`<ix-date type="static" .value="${(C=t.selectedTicket)===null||C===void 0?void 0:C.createdAt}"> </ix-date>`} </div> </info-field> <info-field class="informations-section__items-col" label="Updated On" useHtmlValue> <svg slot="icon">${J}</svg> <div slot="htmlValue"> ${this.useNewDatePickerComponent===!0?s`<ix-date-next type="static" .value="${(g=t.selectedTicket)===null||g===void 0?void 0:g.updatedAt}"> </ix-date-next>`:s`<ix-date type="static" .value="${(_=t.selectedTicket)===null||_===void 0?void 0:_.updatedAt}"> </ix-date>`} </div> </info-field> </div> </div> </div>`}};x.styles=[T],x=l([$("remote-hands-ticket-information-section")],x);const h={None:0,Edit:1,Result:2};let c=class extends k{constructor(){super(...arguments),this.ticketId="",this.currentStep=h.None,this.showDrawer=!1,this.editClicked=!1,this.showCancellationDialog=!1,this.selectedCancellationReason="",this.hasPermissions=!1,this.toggleDrawerHandler=this.toggleDrawer.bind(this),this.cancelTicketHandler=this.setShowCancellationDialog.bind(this),this.editTicketHandler=this.handleEditClick.bind(this)}async toggleDrawer(){this.showDrawer=!this.showDrawer;try{!this.showDrawer&&(r.ticketStep!==S||r.ticketStep===S&&t.submissionResult.state===q.Error)&&await t.setNewTicket()}catch(e){await N(e,!1)}}setShowCancellationDialog(){this.showCancellationDialog=!0}handleEditClick(){this.currentStep=h.Edit,this.toggleDrawer(),this.editClicked=!0,t.newTicket.attachments=[]}connectedCallback(){super.connectedCallback(),window.addEventListener(u.DrawerClose,this.toggleDrawerHandler),window.addEventListener(u.CancelTicket,this.cancelTicketHandler),window.addEventListener(u.EditTicket,this.editTicketHandler)}async firstUpdated(){var e,i,o,n;try{r.loadings.serviceTicket=!0,r.error.fetchingTicket=!1,this.ticketId||(this.ticketId=Q.pathname.split("/").pop()),await t.getRemoteHandsServiceTicket(this.ticketId);try{t.loadings.ticketDetailsPermissionCheck=!0,this.hasPermissions=await U(z.Update,F.RemoteHands,(i=(e=t.newTicket)===null||e===void 0?void 0:e.location)===null||i===void 0?void 0:i.id,(n=(o=t.newTicket)===null||o===void 0?void 0:o.location)===null||n===void 0?void 0:n.accountNumber)}catch(a){throw await N(a,!1),this.hasPermissions=!1,a}finally{t.loadings.ticketDetailsPermissionCheck=!1}}catch(a){r.error.fetchingTicket=!0}finally{r.loadings.serviceTicket=!1}}disconnectedCallback(){super.disconnectedCallback(),t.clear(),window.removeEventListener(u.DrawerClose,this.toggleDrawerHandler),window.removeEventListener(u.CancelTicket,this.cancelTicketHandler),window.removeEventListener(u.EditTicket,this.editTicketHandler),t.clear()}renderBody(){var e,i,o;return s` <remote-hands-ticket-information-section></remote-hands-ticket-information-section> <ix-divider></ix-divider> <remote-hands-ticket-details-section></remote-hands-ticket-details-section> <ix-divider></ix-divider> <remote-hands-other-information-section .showCustomerReference="${((e=t.selectedTicket)===null||e===void 0?void 0:e.serviceBackend)!==y.TelxSFDC}"></remote-hands-other-information-section> <ix-divider></ix-divider> <attachments-section .ticketType="${E.RemoteHands}" .ticketNumber="${(i=t.selectedTicket)===null||i===void 0?void 0:i.id}" ?IsDisabled="${!this.hasPermissions||I((o=t.selectedTicket)===null||o===void 0?void 0:o.state)}"></attachments-section> `}renderComments(){var e;if(!t)return m;const{selectedTicket:i}=t||{};return i?s` <ticket-comments ticketNumber="${i.id}" ticketType="${E.RemoteHands}" .comments="${i.comments}" ?IsDisabled="${!this.hasPermissions||I((e=t.selectedTicket)===null||e===void 0?void 0:e.state)}"> </ticket-comments>`:m}renderEditStep(){return this.currentStep!==h.Edit?m:s` <ix-wizard-step .isVisible="${this.currentStep===h.Edit}" .isNextButtonVisible="${!1}"> <create-edit-remote-hands-service-ticket ?isEdit="${!0}" .onSubmitted="${()=>{this.currentStep=h.Result}}" .onCancelled="${()=>this.toggleDrawer()}"></create-edit-remote-hands-service-ticket> </ix-wizard-step> `}renderResultStep(){return this.currentStep!==h.Result?m:s` <ix-wizard-step .isVisible="${this.currentStep===h.Result}" .isNextButtonVisible="${!1}"> <create-edit-remote-hands-result isEdit="true" .onClosed="${()=>this.toggleDrawer()}"></create-edit-remote-hands-result> </ix-wizard-step> `}async handleCancellationDialogClosed(e){if(this.showCancellationDialog=!1,e)try{await t.cancelTicket(this.selectedCancellationReason)}catch(i){O(Z)}else this.resetCancellationFields()}handleCancellationSelection(e){this.selectedCancellationReason=e}resetCancellationFields(){this.selectedCancellationReason="",this.showCancellationDialog=!1}get createEditRemoteHandsServiceTicket(){var e;return(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("create-edit-remote-hands-service-ticket")}render(){var e;return s` <loading-error-section .loadingsState="${{...r.loadings}}" .errorState="${{...r.error}}"> </loading-error-section> ${!(!((e=t.selectedTicket)===null||e===void 0)&&e.id)||r.loadings.serviceTicket?m:s` <div> <div> <ix-drawer ?isVisible="${this.showDrawer}" .onClosed="${()=>this.toggleDrawer()}" ?showConfirmationDialogOnClose="${r.ticketStep!==S}"> <ix-wizard slot="content" .isNextButtonVisible="${!1}" .totalSteps="${1}" .currentStep="${this.currentStep}" .hideStepCount="${!0}" .enableNextStepClick="${!0}"> ${this.renderEditStep()} ${this.renderResultStep()} </ix-wizard> </ix-drawer> <div class="ticket-details-container"> <div class="ticket-details-container__body"> ${this.renderBody()} </div> <div class="ticket-details-container__comments"> ${this.renderComments()} </div> </div> </div> <cancellation-dialog .isDialogOpen="${this.showCancellationDialog}" .onAccept="${()=>this.handleCancellationDialogClosed(!0)}" .onReject="${()=>this.handleCancellationDialogClosed(!1)}" .onCancellationSelected="${i=>this.handleCancellationSelection(i)}" .selectedCancellationReason="${this.selectedCancellationReason}"></cancellation-dialog> </div>`}`}};c.styles=[R,T],l([w({type:String})],c.prototype,"ticketId",void 0),l([p()],c.prototype,"currentStep",void 0),l([p()],c.prototype,"showDrawer",void 0),l([p()],c.prototype,"editClicked",void 0),l([p()],c.prototype,"showCancellationDialog",void 0),l([p()],c.prototype,"selectedCancellationReason",void 0),l([w()],c.prototype,"hasPermissions",void 0),c=l([$("remote-hands-ticket-details-view")],c);export{c as RemoteHandsTicketDetailsView,h as ServiceTicketSteps};
|
|
1
|
+
import{__decorate as l}from"tslib";import{MobxLitElement as k}from"@adobe/lit-mobx";import"@digital-realty/ix-divider/ix-divider.js";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-drawer/ix-drawer.js";import"@digital-realty/ix-wizard/ix-wizard-step.js";import"@digital-realty/ix-wizard/ix-wizard.js";import{html as s,nothing as m}from"lit";import{property as w,customElement as $,state as p}from"lit/decorators.js";import"./ui-service-management6.js";import"@digital-realty/ix-date-next/ix-date-next.js";import"@digital-realty/ix-date/ix-date.js";import{ifDefined as v}from"lit-html/directives/if-defined.js";import{n as b,E as P,w as t,aN as V,S as y,O as L,T as R,H as A,aZ as B,e as r,x as S,M as q,aV as N,A as u,a6 as U,L as z,v as F,a as E,aW as O,aX as Z}from"./ui-service-management.js";import{S as T,N as j,h as M,i as W,j as X,k as G,U as J}from"./ui-service-management9.js";import{r as K,m as H,i as I}from"./ui-service-management16.js";import"@digital-realty/ix-chip/ix-custom-chip.js";import"./ui-service-management17.js";import{g as Q}from"./ui-service-management13.js";import"@digital-realty/ix-email-list/ix-email-list.js";import"@digital-realty/ix-file-uploader/ix-file-uploader.js";import"@digital-realty/ix-progress/ix-progress.js";import"@digital-realty/ix-select/ix-select-option.js";import"@digital-realty/ix-select/ix-select.js";import"@digital-realty/ix-textbox/ix-textbox.js";import"@digital-realty/ix-time/ix-time.js";import"@vaadin/router";import"@digital-realty/ix-dialog/ix-dialog.js";import"./ui-service-management10.js";import"lit-html/directives/unsafe-html.js";import"moment";import"@digital-realty/theme";import"moment-timezone";import"date-fns/format.js";import"mobx";import"mobx-persist-store";import"@digital-realty/ix-account-switcher";import"oidc-client-ts";import"lit/directives/if-defined.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"lit-html/directives/until.js";import"libphonenumber-js";import"@digital-realty/ix-toast/ix-toasters.js";import"./ui-service-management18.js";import"lit/directives/class-map.js";import"@digital-realty/ix-toast/ix-message-toast.js";import"@material/web/icon/icon.js";let f=class extends k{constructor(){super(),this.showCustomerReference=!0,this.useNewDatePickerComponent=!1,this.useNewDatePickerComponent=b.showNewDatePickerComponent()}async firstUpdated(){var e;this.siteName=await P((e=t.selectedTicket)===null||e===void 0?void 0:e.site)}renderCustomerReference(){var e;return this.showCustomerReference?s`<info-field class="informations-section__items-col" label="Customer Reference Number" value="${v((e=t.selectedTicket)===null||e===void 0?void 0:e.referenceNumber)}" .hideIcon="${!0}"> </info-field>`:m}renderExpectedStart(){if(!V(t.newTicket))return m;const{startDate:e,startDateTime:i}=t.newTicket;return s`<info-field class="informations-section__items-col" label="Latest Expected Start Date" useHtmlValue .hideIcon="${!0}"> <div slot="htmlValue"> ${this.useNewDatePickerComponent===!0?s`<ix-date-next type="static" variant="date" .value="${e}" .noTimeZoneConversion="${!0}"> </ix-date-next>`:s`<ix-date type="static" variant="date" .value="${e}" .noTimeZoneConversion="${!0}"></ix-date>`} </div> </info-field> <info-field class="informations-section__items-col" label="Time" useHtmlValue .hideIcon="${!0}"> <div slot="htmlValue"> ${this.useNewDatePickerComponent===!0?s`<ix-date-next type="static" .noTimeZoneConversion="${!0}" variant="time" .value="${i}"> </ix-date-next>`:s`<ix-date type="static" .noTimeZoneConversion="${!0}" variant="time" .value="${i}"></ix-date>`} </div> </info-field> `}render(){var e,i,o,n,a,d;return s` <div class="ticket-details-body__section"> <div class="informations-section__items"> <div class="informations-section__items-row"> <info-field class="informations-section__items-col" label="Request Type" value="${v((e=t.selectedTicket)===null||e===void 0?void 0:e.requestType)}" .hideIcon="${!0}"> </info-field> <info-field class="informations-section__items-col" label="Category" value="${v((i=t.selectedTicket)===null||i===void 0?void 0:i.category)}" .hideIcon="${!0}"> </info-field> ${this.renderCustomerReference()} <info-field class="informations-section__items-col" label="Deliveries & Removals Ticket Number" .hideIcon="${!0}" .value="${v((o=t.selectedTicket)===null||o===void 0?void 0:o.referenceTicketNumber)}"> </info-field> ${this.renderExpectedStart()} </div> <div class="informations-section__items-row"> <info-field class="informations-section__items-col-4" label="Site" value="${v(this.siteName)}" .hideIcon="${!0}"> </info-field> </div> <div class="informations-section__items-row"> <info-field class="informations-section__items-col-4" label="Location(s)" .hideIcon="${!0}" .useHtmlValue="${!0}"> <div slot="htmlValue"> <div> ${((n=t.selectedTicket)===null||n===void 0?void 0:n.locations)||"-"} </div> </div> </info-field> </div> </div> </div> ${((a=t.selectedTicket)===null||a===void 0?void 0:a.serviceBackend)!==y.TelxSFDC?s` <ix-divider></ix-divider> <div class="informations-section__items-row"> <info-field class="informations-section__items-col" label="${L}" .hideIcon="${!0}" .useHtmlValue="${!0}"> <div slot="htmlValue"> ${K((d=t.selectedTicket)===null||d===void 0?void 0:d.contacts)} </div> </info-field> </div>`:m} `}};f.styles=[T],l([w({type:String})],f.prototype,"siteName",void 0),l([w({type:Boolean})],f.prototype,"showCustomerReference",void 0),f=l([$("remote-hands-other-information-section")],f);let D=class extends k{render(){var e,i,o,n,a;const d=((e=t.selectedTicket)===null||e===void 0?void 0:e.state)===A.Cancelled||((i=t.selectedTicket)===null||i===void 0?void 0:i.state)===B.CancellationRequested;return s` <div class="ticket-details-body__section"> <span class="informations-section__title" data-testid="ticket-details-section-title">Ticket Details</span> <div class="informations-section__items"> <div class="informations-section__items-row"> <info-field label="Subject" value="${v((o=t.selectedTicket)===null||o===void 0?void 0:o.subject)}" .hideIcon="${!0}"> </info-field> </div> <div class="informations-section__items-row"> <info-field label="Description" .hideIcon="${!0}" useHtmlValue> <div slot="htmlValue" class="break-normal"> <span class="whitespace-break-spaces">${(n=t.selectedTicket)===null||n===void 0?void 0:n.shortDescription}</span> </div> </info-field> </div> ${d?s` <div class="informations-section__items-row"> <info-field label="Reason for Cancellation" value="${v((a=t.selectedTicket)===null||a===void 0?void 0:a.cancellationReason)}" .hideIcon="${!0}"> </info-field> </div>`:m} </div> </div> `}};D.styles=[T,R],D=l([$("remote-hands-ticket-details-section")],D);let x=class extends k{constructor(){super(),this.useNewDatePickerComponent=!1,this.useNewDatePickerComponent=b.showNewDatePickerComponent()}render(){var e,i,o,n,a,d,C,g,_;return s` <div class="ticket-details-body__section"> <span class="informations-section__title" data-testid="ticket-information-section-title">Service Ticket Information</span> <div class="informations-section__items"> <div class="informations-section__items-row"> <info-field class="informations-section__items-col" label="Ticket Number" value="${v((e=t.selectedTicket)===null||e===void 0?void 0:e.id)}"> <svg slot="icon">${j}</svg> </info-field> <info-field class="informations-section__items-col" label="Ticket Type" value="Remote Hands"> <svg slot="icon">${M}</svg> </info-field> <info-field class="informations-section__items-col" label="Status" useHtmlValue> <svg slot="icon">${W}</svg> <div slot="htmlValue"> ${H((i=t===null||t===void 0?void 0:t.selectedTicket)===null||i===void 0?void 0:i.state)!=="default"?s` <ix-custom-chip pill appearance="${H((o=t===null||t===void 0?void 0:t.selectedTicket)===null||o===void 0?void 0:o.state)}"></ix-custom-chip> `:s` <ix-custom-chip noIcon pill appearance="default">${(n=t===null||t===void 0?void 0:t.selectedTicket)===null||n===void 0?void 0:n.state} </ix-custom-chip>`} </div> </info-field> <info-field class="informations-section__items-col" label="Requester" .value="${(a=t.selectedTicket)===null||a===void 0?void 0:a.requester}"> <svg slot="icon">${X}</svg> </info-field> <info-field class="informations-section__items-col" label="Create Date" useHtmlValue> <svg slot="icon">${G}</svg> <div slot="htmlValue"> ${this.useNewDatePickerComponent===!0?s`<ix-date-next type="static" .value="${(d=t.selectedTicket)===null||d===void 0?void 0:d.createdAt}"> </ix-date-next>`:s`<ix-date type="static" .value="${(C=t.selectedTicket)===null||C===void 0?void 0:C.createdAt}"> </ix-date>`} </div> </info-field> <info-field class="informations-section__items-col" label="Updated On" useHtmlValue> <svg slot="icon">${J}</svg> <div slot="htmlValue"> ${this.useNewDatePickerComponent===!0?s`<ix-date-next type="static" .value="${(g=t.selectedTicket)===null||g===void 0?void 0:g.updatedAt}"> </ix-date-next>`:s`<ix-date type="static" .value="${(_=t.selectedTicket)===null||_===void 0?void 0:_.updatedAt}"> </ix-date>`} </div> </info-field> </div> </div> </div>`}};x.styles=[T],x=l([$("remote-hands-ticket-information-section")],x);const h={None:0,Edit:1,Result:2};let c=class extends k{constructor(){super(...arguments),this.ticketId="",this.currentStep=h.None,this.showDrawer=!1,this.editClicked=!1,this.showCancellationDialog=!1,this.selectedCancellationReason="",this.hasPermissions=!1,this.toggleDrawerHandler=this.toggleDrawer.bind(this),this.cancelTicketHandler=this.setShowCancellationDialog.bind(this),this.editTicketHandler=this.handleEditClick.bind(this)}async toggleDrawer(){this.showDrawer=!this.showDrawer;try{!this.showDrawer&&(r.ticketStep!==S||r.ticketStep===S&&t.submissionResult.state===q.Error)&&await t.setNewTicket()}catch(e){await N(e,!1)}}setShowCancellationDialog(){this.showCancellationDialog=!0}handleEditClick(){this.currentStep=h.Edit,this.toggleDrawer(),this.editClicked=!0,t.newTicket.attachments=[]}connectedCallback(){super.connectedCallback(),window.addEventListener(u.DrawerClose,this.toggleDrawerHandler),window.addEventListener(u.CancelTicket,this.cancelTicketHandler),window.addEventListener(u.EditTicket,this.editTicketHandler)}async firstUpdated(){var e,i,o,n;try{r.loadings.serviceTicket=!0,r.error.fetchingTicket=!1,this.ticketId||(this.ticketId=Q.pathname.split("/").pop()),await t.getRemoteHandsServiceTicket(this.ticketId);try{t.loadings.ticketDetailsPermissionCheck=!0,this.hasPermissions=await U(z.Update,F.RemoteHands,(i=(e=t.newTicket)===null||e===void 0?void 0:e.location)===null||i===void 0?void 0:i.id,(n=(o=t.newTicket)===null||o===void 0?void 0:o.location)===null||n===void 0?void 0:n.accountNumber)}catch(a){throw await N(a,!1),this.hasPermissions=!1,a}finally{t.loadings.ticketDetailsPermissionCheck=!1}}catch(a){r.error.fetchingTicket=!0}finally{r.loadings.serviceTicket=!1}}disconnectedCallback(){super.disconnectedCallback(),t.clear(),window.removeEventListener(u.DrawerClose,this.toggleDrawerHandler),window.removeEventListener(u.CancelTicket,this.cancelTicketHandler),window.removeEventListener(u.EditTicket,this.editTicketHandler),t.clear()}renderBody(){var e,i,o;return s` <remote-hands-ticket-information-section></remote-hands-ticket-information-section> <ix-divider></ix-divider> <remote-hands-ticket-details-section></remote-hands-ticket-details-section> <ix-divider></ix-divider> <remote-hands-other-information-section .showCustomerReference="${((e=t.selectedTicket)===null||e===void 0?void 0:e.serviceBackend)!==y.TelxSFDC}"></remote-hands-other-information-section> <ix-divider></ix-divider> <attachments-section .ticketType="${E.RemoteHands}" .ticketNumber="${(i=t.selectedTicket)===null||i===void 0?void 0:i.id}" ?IsDisabled="${!this.hasPermissions||I((o=t.selectedTicket)===null||o===void 0?void 0:o.state)}"></attachments-section> `}renderComments(){var e;if(!t)return m;const{selectedTicket:i}=t||{};return i?s` <ticket-comments ticketNumber="${i.id}" ticketType="${E.RemoteHands}" .comments="${i.comments}" ?IsDisabled="${!this.hasPermissions||I((e=t.selectedTicket)===null||e===void 0?void 0:e.state)}"> </ticket-comments>`:m}renderEditStep(){return this.currentStep!==h.Edit?m:s` <ix-wizard-step .isVisible="${this.currentStep===h.Edit}" .isNextButtonVisible="${!1}"> <create-edit-remote-hands-service-ticket ?isEdit="${!0}" .onSubmitted="${()=>{this.currentStep=h.Result}}" .onCancelled="${()=>this.toggleDrawer()}"></create-edit-remote-hands-service-ticket> </ix-wizard-step> `}renderResultStep(){return this.currentStep!==h.Result?m:s` <ix-wizard-step .isVisible="${this.currentStep===h.Result}" .isNextButtonVisible="${!1}"> <create-edit-remote-hands-result isEdit="true" .onClosed="${()=>this.toggleDrawer()}"></create-edit-remote-hands-result> </ix-wizard-step> `}async handleCancellationDialogClosed(e){if(this.showCancellationDialog=!1,e)try{await t.cancelTicket(this.selectedCancellationReason)}catch(i){O(Z)}else this.resetCancellationFields()}handleCancellationSelection(e){this.selectedCancellationReason=e}resetCancellationFields(){this.selectedCancellationReason="",this.showCancellationDialog=!1}get createEditRemoteHandsServiceTicket(){var e;return(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("create-edit-remote-hands-service-ticket")}render(){var e;return s` <loading-error-section .loadingsState="${{...r.loadings}}" .errorState="${{...r.error}}"> </loading-error-section> ${!(!((e=t.selectedTicket)===null||e===void 0)&&e.id)||r.loadings.serviceTicket?m:s` <div> <div> <ix-drawer ?isVisible="${this.showDrawer}" .onClosed="${()=>this.toggleDrawer()}" ?showConfirmationDialogOnClose="${r.ticketStep!==S}"> <ix-wizard slot="content" .isNextButtonVisible="${!1}" .totalSteps="${1}" .currentStep="${this.currentStep}" .hideStepCount="${!0}" .enableNextStepClick="${!0}"> ${this.renderEditStep()} ${this.renderResultStep()} </ix-wizard> </ix-drawer> <div class="ticket-details-container"> <div class="ticket-details-container__body"> ${this.renderBody()} </div> <div class="ticket-details-container__comments"> ${this.renderComments()} </div> </div> </div> <cancellation-dialog .isDialogOpen="${this.showCancellationDialog}" .onAccept="${()=>this.handleCancellationDialogClosed(!0)}" .onReject="${()=>this.handleCancellationDialogClosed(!1)}" .onCancellationSelected="${i=>this.handleCancellationSelection(i)}" .selectedCancellationReason="${this.selectedCancellationReason}"></cancellation-dialog> </div>`}`}};c.styles=[R,T],l([w({type:String})],c.prototype,"ticketId",void 0),l([p()],c.prototype,"currentStep",void 0),l([p()],c.prototype,"showDrawer",void 0),l([p()],c.prototype,"editClicked",void 0),l([p()],c.prototype,"showCancellationDialog",void 0),l([p()],c.prototype,"selectedCancellationReason",void 0),l([w()],c.prototype,"hasPermissions",void 0),c=l([$("remote-hands-ticket-details-view")],c);export{c as RemoteHandsTicketDetailsView,h as ServiceTicketSteps};
|