text: (self.webpackChunk=self.webpackChunk||[]).push([[1787],{71787:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>o});const l={data:function(){return{collaborationList:null,open:!1,select:null,valid:!0,items:[{text:"Admin"},{text:"Write"},{text:"Read"}],name:"",nameRules:[function(e){return!!e||"Name is required"}],email:"",emailRules:[function(e){return!!e||"E-mail is required"},function(e){return/.+@.+/.test(e)||"E-mail must be valid"}],selectRules:[function(e){return!!e||"Item is required"}],loader:!0,collaborationData:[],headers:[{text:"Image",sortable:!1,value:"image"},{text:"Name",sortable:!1,value:"name"},{text:"Email",sortable:!1,value:"email"},{text:"Access",sortable:!1,value:"access"},{text:"Action",sortable:!1,value:"action"}],selectDeletedItem:null}},mounted:function(){this.getCollaborationData()},methods:{getCollaborationData:function(){},addItemToCollaborationList:function(e){this.$refs.form.validate()?(this.collaborationData.push(e),this.open=!1,this.$refs.form.reset()):console.log("Invalid Inputs")},deleteItemFromCollaborationList:function(e){this.$refs.deleteConfirmationDialog.openDialog(),this.selectDeletedItem=e},ondeleteItemFromCollaborationList:function(){this.$refs.deleteConfirmationDialog.close();var e=this.collaborationData.indexOf(this.selectDeletedItem);this.collaborationData.splice(e,1)}}};const o=(0,a(51900).Z)(l,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"emb-card pa-4"},[a("v-dialog",{staticClass:"pa-4",attrs:{"max-width":"500px"},scopedSlots:e._u([{key:"activator",fn:function(t){var l=t.on;return[a("v-btn",e._g({attrs:{slot:"activator",color:"primary"},on:{click:function(t){t.stopPropagation(),e.open=!0}},slot:"activator"},l),[e._v("\n\t\t\t\t\tAdd Users\n\t\t\t\t")])]}}]),model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[e._v(" "),a("v-card",[a("v-card-title",{staticClass:"h4"},[e._v("\n\t\t\t\tAdd New User\n\t\t\t\t")]),e._v(" "),a("v-card-text",[a("v-form",{ref:"form",attrs:{"lazy-validation":""},model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[a("v-text-field",{attrs:{rules:e.nameRules,label:"Name",required:""},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}}),e._v(" "),a("v-text-field",{attrs:{rules:e.emailRules,label:"E-mail",required:""},model:{value:e.email,callback:function(t){e.email=t},expression:"email"}}),e._v(" "),a("v-select",{attrs:{items:e.items,rules:[function(e){return!!e||"Item is required"}],label:"Access Type",required:""},model:{value:e.select,callback:function(t){e.select=t},expression:"select"}}),e._v(" "),a("v-btn",{staticClass:"mr-3",attrs:{color:"primary"},on:{click:function(t){e.open=!1}}},[e._v("Close")]),e._v(" "),a("v-btn",{attrs:{disabled:!e.valid,color:"error"},on:{click:function(t){return e.addItemToCollaborationList({image:"/static/images/user.png",name:e.name,email:e.email,access:e.select})}}},[e._v("\n\t\t\t\t\t\t\tSubmit\n\t\t\t\t\t\t")])],1)],1)],1)],1),e._v(" "),[a("v-data-table",{attrs:{headers:e.headers,items:e.collaborationData,"hide-default-footer":""},scopedSlots:e._u([{key:"item.image",fn:function(e){var t=e.item;return[a("img",{attrs:{src:t.image,width:"40"}})]}},{key:"item.action",fn:function(t){var l=t.item;return[a("v-btn",{attrs:{icon:"",color:"grey",small:""}},[a("v-icon",{staticClass:"error--text",on:{click:function(t){return e.deleteItemFromCollaborationList(l)}}},[e._v("delete")])],1)]}}])})],e._v(" "),a("emb-delete-confirmation-2",{ref:"deleteConfirmationDialog",attrs:{messageTitle:"Are you sure you want to delete?",messageDescription:"Are you sure you want to delete this user permanently?",btn1:"Cancel",btn2:"Yes"},on:{onConfirm:e.ondeleteItemFromCollaborationList}})],2)}),[],!1,null,null,null).exports}}]);