1"use strict";(self["webpackChunkclient"]=self["webpackChunkclient"]||[]).push([[3718],{73718:function(e,t,s){s.r(t),s.d(t,{default:function(){return B}});var a=s(20641),i=s(90033);const n={class:"o-minwidth p-5"},o={class:"level"},l={class:"level-left"},r={class:"level-item"},c={class:"title"},d={class:"level-right"},m={key:0,class:"columns is-mobile is-size-6"},u={class:"column ml-3 mt-1"},h={class:"column",style:{display:"flex","align-items":"center","justify-content":"center"}},p=["onClick"],v={class:"icon is-small"},g={key:1,class:"mt-2"};function b(e,t,s,b,f,k){const y=(0,a.g2)("font-awesome-icon"),C=(0,a.g2)("TagsCreate"),$=(0,a.g2)("TagsUpdate");return(0,a.uX)(),(0,a.CE)("section",n,[(0,a.Lk)("div",o,[(0,a.Lk)("div",l,[(0,a.Lk)("div",r,[(0,a.Lk)("h2",c,(0,i.v_)(e.$t("Tags")),1)])]),(0,a.Lk)("div",d,[f.showCreateForm?(0,a.Q3)("",!0):((0,a.uX)(),(0,a.CE)("div",{key:0,class:"button is-primary is-rounded",onClick:t[0]||(t[0]=e=>f.showCreateForm=!0)},[(0,a.bF)(y,{icon:"fa-light fa-plus",class:"pr-2"}),(0,a.eW)(" "+(0,i.v_)(e.$t("Create tag")),1)]))])]),f.showCreateForm?((0,a.uX)(),(0,a.Wv)(C,{key:0,onClose:t[1]||(t[1]=e=>f.showCreateForm=!1),onSaved:k.handleFormSaved},null,8,["onSaved"])):(0,a.Q3)("",!0),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(f.items,(e,t)=>((0,a.uX)(),(0,a.CE)("div",{key:e.id,class:"card p-3 mb-2"},[f.showTagEdit!==e.id?((0,a.uX)(),(0,a.CE)("div",m,[(0,a.Lk)("div",u,(0,i.v_)(e.name),1),(0,a.Lk)("div",h,[(0,a.Lk)("button",{class:"button is-small is-rounded",onClick:t=>f.showTagEdit=e.id},[(0,a.Lk)("span",v,[(0,a.bF)(y,{icon:"fa-light fa-pencil-alt"})])],8,p)])])):((0,a.uX)(),(0,a.CE)("div",g,[(0,a.bF)($,{item:e,onClose:k.handleUpdateSaved,onSaved:k.handleUpdateSaved},null,8,["item","onClose","onSaved"])]))]))),128))])}s(18111),s(22489);const f={class:"o-maxwidth card p-5 mb-4"};function k(e,t,s,i,n,o){const l=(0,a.g2)("Form");return(0,a.uX)(),(0,a.CE)("section",f,[t[1]||(t[1]=(0,a.Lk)("p",{class:"has-text-weight-semibold is-size-5"},"Create Tag",-1)),t[2]||(t[2]=(0,a.Lk)("hr",null,null,-1)),(0,a.bF)(l,{item:{},onSave:o.save,onCancel:t[0]||(t[0]=t=>e.$emit("close"))},null,8,["onSave"])])}var y=s(53751);const C={class:"field is-grouped mb-3 mt-5"},$={class:"control"},L={class:"control"},F={key:0,class:"level"},S={class:"buttons level-right"};function w(e,t,s,n,o,l){const r=(0,a.g2)("b-input"),c=(0,a.g2)("b-field");return(0,a.uX)(),(0,a.CE)("section",null,[(0,a.Lk)("form",{onSubmit:t[3]||(t[3]=(0,y.D$)((...e)=>l.save&&l.save(...e),["prevent"]))},[(0,a.bF)(c,{label:"Name"},{default:(0,a.k6)(()=>[(0,a.bF)(r,{modelValue:o.localItem.name,"onUpdate:modelValue":[t[0]||(t[0]=e=>o.localItem.name=e),l.initTranslation],required:""},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),(0,a.Lk)("div",C,[(0,a.Lk)("div",$,[(0,a.Lk)("button",{class:(0,i.C4)(["button is-primary is-rounded",{"is-loading":e.$store.state.isLoadingButton}]),type:"submit"},(0,i.v_)(e.$t("save")),3)]),(0,a.Lk)("div",L,[(0,a.Lk)("button",{class:"button is-default is-rounded",type:"button",onClick:t[1]||(t[1]=(...e)=>l.cancelForm&&l.cancelForm(...e))},(0,i.v_)(e.$t("cancel")),1)]),o.localItem.id?((0,a.uX)(),(0,a.CE)("div",F,[(0,a.Lk)("div",S,[(0,a.Lk)("a",{class:"button is-danger is-rounded is-outlined",onClick:t[2]||(t[2]=t=>e.$emit("delete"))},(0,i.v_)(e.$t("remove")),1)])])):(0,a.Q3)("",!0)])],32)])}var E=s(40834),T={props:["item"],data(){return{localItem:JSON.parse(JSON.stringify(this.item)),isDragging:null}},created(){this.initTranslation()},methods:{save(){this.$emit("save",this.localItem)},cancelForm(){this.$emit("cancel")},initTranslation(){if(!this.localItem.id){let e={};for(let t of this.tenantLanguages)e[t]=this.localItem.name}}},computed:{...(0,E.L8)(["tenant","tenantLanguages"])},components:{}},I=s(66262);const X=(0,I.A)(T,[["render",w],["__scopeId","data-v-2cb54ba9"]]);var _=X,D={data(){return{item:{name:""}}},methods:{async save(e){let t={...e};try{await this.$http.plain.post("/tags",t),this.saveSuccess()}catch(s){console.error(s);const e=s.response?.data?.["hydra:description"]||s.response?.data?.detail;this.$buefy.snackbar.open({type:"is-danger",message:e||this.$t("Error creating tag"),duration:6e3,position:"is-top"})}},saveSuccess(e){this.$buefy.snackbar.open({message:this.$t("createdSuccessfully")}),this.$emit("saved")}},computed:{...(0,E.L8)(["isGranted","user","tenant"])},components:{Form:_}};const A=(0,I.A)(D,[["render",k]]);var U=A;const P={key:0,class:"o-minwidth"};function x(e,t,s,i,n,o){const l=(0,a.g2)("Form");return s.item?((0,a.uX)(),(0,a.CE)("section",P,[(0,a.bF)(l,{item:s.item,onSave:o.save,onCancel:t[0]||(t[0]=t=>e.$emit("close")),onDelete:o.confirmDelete}
1,null,8,["item","onSave","onDelete"])])):(0,a.Q3)("",!0)}var Q={props:{item:{type:Object,required:!0}},methods:{...(0,E.L8)(["user"]),async save(e){let t={...e};try{await this.$http.plain.patch(`/tags/${t.id}`,t),this.saveSuccess()}catch(s){console.error(s);const e=s.response?.data?.["hydra:description"]||s.response?.data?.detail;this.$buefy.snackbar.open({type:"is-danger",message:e||this.$t("Error updating tag"),duration:6e3,position:"is-top"})}},saveSuccess(e){this.$buefy.snackbar.open({type:"is-success",message:this.$t("updatedSuccessfully")}),this.$emit("saved")},confirmDelete(){this.$buefy.dialog.confirm({title:this.$t("deleting"),message:this.$t("confirmDelete")+" "+this.item.name+"? "+this.$t("confirmDeleteLast"),confirmText:this.$t("delete"),type:"is-danger",onConfirm:()=>this.delete()})},async delete(){try{await this.$http.plain.delete("/tags/"+this.item.id),this.deleteSuccess()}catch(e){console.error(e)}},deleteSuccess(){this.$buefy.toast.open(this.$t("deleted")),this.$emit("close")}},computed:{},components:{Form:_}};const V=(0,I.A)(Q,[["render",x]]);var N=V,O=s(61273),j=s(78048),q={components:{BTableColumn:j.HP,FontAwesomeIcon:O.gc,TagsCreate:U,TagsUpdate:N},data(){return{showCreateForm:!1,showTagEdit:null,items:[]}},created(){this.loadItemsPage()},methods:{handleUpdateSaved(){this.showTagEdit=null,this.loadItemsPage()},handleFormSaved(){this.showCreateForm=!1,this.loadItemsPage()},async loadItemsPage(){await this.$http.plain.get("/tags").then(e=>{this.items=e.data["hydra:member"]}).catch(e=>console.error(e))},error(e){console.error(e)}},computed:{...(0,E.L8)(["isGranted","user","tenant"]),filteredItems(){return Array.isArray(this.items)?this.items.filter(e=>e.id!==this.showTagEdit):[]}}};const z=(0,I.A)(q,[["render",b]]);var B=z}}]);
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.