1"use strict";(self["webpackChunkappwork_vue_starter"]=self["webpackChunkappwork_vue_starter"]||[]).push([[3566],{73566:function(t,e,s){s.r(e),s.d(e,{default:function(){return c}});s(44114);var a=function(){var t=this,e=t._self._c;return e("div",[t._m(0),t._v(" "),t.loading?t._e():e("div",[t.availableCategories?e("div",[e("b-form-radio-group",{staticClass:"mb-4",attrs:{id:"tooltipLabels",name:"tooltipLabels",options:t.availableCategories,buttons:""},model:{value:t.selectedCategory,callback:function(e){t.selectedCategory=e},expression:"selectedCategory"}})],1):t._e(),t._v(" "),e("h4",{staticClass:"card-title line-after mb-4"},[t._v(t._s(t.selectedCategoryName)+" autofixes")]),t._v(" "),e("div",{staticClass:"card-deck card-deck-500"},t._l(t.filteredTemplates,function(s){return e("div",{key:s.id,staticClass:"card mb-4",style:{opacity:"ACTIVE"!==s.status?.6:1}},[e("div",{staticClass:"card-body py-0"},[e("div",{staticClass:"d-flex mt-4 justify-content-between"},[e("h5",{staticClass:"card-title"},[t.canEdit?e("router-link",{staticClass:"text-body",attrs:{to:{name:"af-templates-edit",params:{id:s.id}}}},[t._v("\n "+t._s(s.name)+"\n ")]):[t._v("\n "+t._s(s.name)+"\n ")]],2),t._v(" "),e("div",{staticStyle:{"text-align":"right"}},[t.canEdit?e("router-link",{staticClass:"btn btn-iso-create",attrs:{to:{name:"af-forms-add",query:{template:s.id,form:t.$route.query.form}}}},[t._v("Select")]):t._e(),t._v(" "),t.$root.hasRole("admin.internal")&&"ACTIVE"!==s.status?e("div",[e("span",{staticClass:"badge",class:t.statusColors[s.status]},[t._v(t._s(s.status))])]):t._e()],1)]),t._v(" "),s.screenshots[0]&&s.screenshots[0].screenshot_uri?e("img",{staticClass:"img-fluid cursor-pointer",staticStyle:{"max-width":"452px"},attrs:{src:s.screenshots[0].screenshot_uri,title:s.name,alt:s.name},on:{click:function(e){t.showScreenshot=s.screenshots[0],t.showScreenshotModal=!0}}}):t._e(),t._v(" "),t.showScreenshot?e("b-modal",{attrs:{size:"xl","hide-footer":"",centered:""},on:{close:function(e){t.showScreenshotModal=!1,t.showScreenshot=null}},model:{value:t.showScreenshotModal,callback:function(e){t.showScreenshotModal=e},expression:"showScreenshotModal"}},[e("img",{staticClass:"img-fluid",attrs:{src:t.showScreenshot.screenshot_uri,alt:""}})]):t._e(),t._v(" "),e("div",{staticClass:"mt-3",domProps:{innerHTML:t._s(s.description)}}),t._v(" "),e("div",{staticClass:"position-relative"},[t.canEdit?e("div",{staticClass:"position-absolute w-100 h-100 unselectable cursor-pointer",staticStyle:{left:"0",top:"0"},on:{click:function(e){return t.$router.push({name:"af-forms-add",query:{template:s.id,form:t.$route.query.form}})}}}):e("div",{staticClass:"position-absolute w-100 h-100 unselectable",staticStyle:{left:"0",top:"0"}})])],1),t._v(" "),e("div",{staticClass:"card-footer"},[e("div",{staticClass:"d-flex"},[e("div",{staticClass:"flex-fill"},t._l(s.categories,function(s){return e("span",{key:s.id,staticClass:"badge badge-outline-secondary bg-light mr-1"},[t._v(t._s(s.name))])}),0),t._v(" "),t.$root.hasRole("admin.internal")?e("div",{staticClass:"align-self-end text-nowrap text-big"},[t.canEdit?e("router-link",{staticClass:"text-body adminOnly",attrs:{to:{name:"af-templates-edit",params:{id:s.id}}}},[e("i",{staticClass:"cursor-pointer ion ion-md-create"})]):t._e()],1):t._e()])])])}),0)])])},i=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"mb-4"},[e("h4",{staticClass:"font-weight-bold mb-2"},[e("span",{staticClass:"text-muted font-weight-light"},[t._v("Autofixes "),e("span",{staticClass:"material-icons md-14 arrow-east"},[t._v("east")])]),t._v(" library\n ")])])}],o=(s(18111),s(22489),s(61701),{name:"AutofixLibrary",metaInfo:{title:"Autofixes - library"},data(){return{loading:!1,categories:[],selectedCategory:null,templates:[],statusColors:{ACTIVE:"badge-success",ARCHIVED:"badge-dark",INACTIVE:"badge-dark",NODATA:"badge-danger"},showScreenshot:null,showScreenshotModal:!1}},computed:{canEdit(){return this.$root.hasRole("admin.internal")||this.$root.hasRole("admin.company")||this.$root.hasRole("configuration.modify")},availableCategories(){const t=this.templates.map(t=>{if("ACTIVE"===t.status)return t.categories.map(t=>
1t.id)}).flat(),e=this.categories.filter(e=>t.includes(e.id)).map(t=>({text:t.name,value:t.id})).sort((t,e)=>{const s=t.text.toLowerCase(),a=e.text.toLowerCase();return"popular"===s&&"popular"!==a?-1:"popular"===a&&"popular"!==s?1:s.localeCompare(a)});return e.unshift({text:"All",value:null}),e},selectedCategoryName(){return this.selectedCategory?this.categories.filter(t=>t.id===this.selectedCategory)[0].name:"All"},filteredTemplates(){return this.selectedCategory?this.templates.filter(t=>t.categories.map(t=>t.id).includes(this.selectedCategory)):this.templates}},methods:{async reload(){if(!this.$root.client)return;this.loading=!0;const[t,e]=await Promise.all([this.$api.get("/interaction-categories",this.$root.client.client_hash),this.$api.get("/interaction-templates/autofixes",this.$root.client.client_hash)]);this.categories=t.data,this.templates=e.data.map(t=>{const e=t.client_hash===this.$root.client.client_hash,s=null===t.client_hash;return e||s?{...t,categories:t.categories||[],preview:this.getTemplatePreview(t)}:null}).filter(Boolean).sort((t,e)=>t.name.localeCompare(e.name)),this.loading=!1},getTemplatePreview(t){const e=(t.default_interaction_configurations||[]).filter(function(t){return"a7a5dd23-8411-4af8-a346-d616482fb14b"===t.interaction_configuration_type_hash}).map(function(t){return t.configuration[0]});return this.$api.eventPost(`/templates/preview?clientCode=${this.$root.client.client_code}`,{template:t.template,FFN_CONFIGURATION:e.length?e[0]:[]}).then(e=>(setTimeout(()=>this.resizeIframe(document.getElementById(t.id)),250),e)).catch(t=>{})},async resizeIframe(t,e=!1){t&&("string"===typeof t&&(t=document.getElementById(t)),"undefined"!==typeof t.contentWindow.document.body&&t.contentWindow.document.body?(t.contentWindow.document.body.style.margin="20px",t.contentWindow.document.body.style.overflow="scroll",t.height=t.contentWindow.document.body.scrollHeight+40+"px",t.style.height=t.height):e||setTimeout(()=>{this.resizeIframe(t,!0)},2500))}},watch:{"$root.client":{async handler(){await this.reload()},immediate:!0}}}),n=o,r=s(81656),l=(0,r.A)(n,a,i,!1,null,"7a1237db",null),c=l.exports}}]); 2//# sourceMappingURL=3566.09ad9e03.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.