@@ -47,7 +47,7 @@ export default {
data() {
return {
// By default, system tags creation is not restricted to admins
- systemTagsCreationRestrictedToAdmin: loadState('settings', 'restrictSystemTagsCreationToAdmin', false),
+ systemTagsCreationRestrictedToAdmin: loadState('systemtags', 'restrictSystemTagsCreationToAdmin', false),
}
},
methods: {
@@ -61,7 +61,7 @@ export default {
})
} catch (e) {
this.handleResponse({
- errorMessage: t('settings', 'Unable to update setting'),
+ errorMessage: t('systemtags', 'Unable to update setting'),
error: e,
})
}
@@ -71,8 +71,8 @@ export default {
if (status === 'ok') {
this.systemTagsCreationRestrictedToAdmin = isRestricted
showSuccess(isRestricted
- ? t('settings', 'System tag creation is now restricted to administrators')
- : t('settings', 'System tag creation is now allowed for everybody'),
+ ? t('systemtags', 'System tag creation is now restricted to administrators')
+ : t('systemtags', 'System tag creation is now allowed for everybody'),
)
return
}
diff --git a/dist/systemtags-admin.js b/dist/systemtags-admin.js
index 8a63df0c1f4..eb76a3c97b7 100644
--- a/dist/systemtags-admin.js
+++ b/dist/systemtags-admin.js
@@ -1,2 +1,2 @@
-(()=>{var t,e,s,a={6919:(t,e,s)=>{"use strict";s.d(e,{A:()=>o});var a=s(71354),r=s.n(a),n=s(76314),i=s.n(n)()(r());i.push([t.id,".system-tag-form[data-v-2e1d5eac]{display:flex;flex-direction:column;max-width:400px;gap:8px 0}.system-tag-form__group[data-v-2e1d5eac]{display:flex;flex-direction:column}.system-tag-form__row[data-v-2e1d5eac]{margin-top:8px;display:flex;gap:0 4px}","",{version:3,sources:["webpack://./apps/systemtags/src/components/SystemTagForm.vue"],names:[],mappings:"AACA,kCACC,YAAA,CACA,qBAAA,CACA,eAAA,CACA,SAAA,CAEA,yCACC,YAAA,CACA,qBAAA,CAGD,uCACC,cAAA,CACA,YAAA,CACA,SAAA",sourcesContent:["\n.system-tag-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmax-width: 400px;\n\tgap: 8px 0;\n\n\t&__group {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\n\t&__row {\n\t\tmargin-top: 8px;\n\t\tdisplay: flex;\n\t\tgap: 0 4px;\n\t}\n}\n"],sourceRoot:""}]);const o=i},42634:()=>{},59169:()=>{},63779:()=>{},64389:(t,e,s)=>{"use strict";var a=s(21777),r=s(85471),n=s(59892),i=s(88837),o=s(53334),l=s(85168),d=s(97012),c=s(67607),g=s(5212),u=s(82182),m=s(71654);const p={userVisible:!0,userAssignable:!0,canAssign:!0};var h=s(65043),y=s(63814),v=s(60669);const b=(0,y.dC)("dav"),f=(0,v.UU)(b),A=t=>{f.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})};(0,a.zo)(A),A((0,a.do)());const T=(0,s(35947).YK)().setApp("systemtags").detectUser().build();var C=s(61338),_=s(56760);var w;!function(t){t.Public="Public",t.Restricted="Restricted",t.Invisible="Invisible"}(w||(w={}));const x=[{id:w.Public,label:(0,o.Tl)("systemtags","Public")},{id:w.Restricted,label:(0,o.Tl)("systemtags","Restricted")},{id:w.Invisible,label:(0,o.Tl)("systemtags","Invisible")}],N=(t,e)=>({[[!0,!0].join(",")]:w.Public,[[!0,!1].join(",")]:w.Restricted,[[!1,!1].join(",")]:w.Invisible}[[t,e].join(",")]),S=r.Ay.extend({name:"SystemTagForm",components:{NcButton:d.A,NcLoadingIcon:n.A,NcSelect:c.A,NcSelectTags:g.A,NcTextField:u.A},props:{tags:{type:Array,required:!0}},data:()=>({loading:!1,tagLevelOptions:x,selectedTag:null,errorMessage:"",tagName:"",tagLevel:w.Public}),watch:{selectedTag(t){this.tagName=t?t.displayName:"",this.tagLevel=t?N(t.userVisible,t.userAssignable):w.Public}},computed:{isCreating(){return null===this.selectedTag},isCreateDisabled(){return""===this.tagName},isUpdateDisabled(){return""===this.tagName||this.selectedTag?.displayName===this.tagName&&N(this.selectedTag?.userVisible,this.selectedTag?.userAssignable)===this.tagLevel},isResetDisabled(){return this.isCreating?""===this.tagName&&this.tagLevel===w.Public:null===this.selectedTag},userVisible(){return{[w.Public]:!0,[w.Restricted]:!0,[w.Invisible]:!1}[this.tagLevel]},userAssignable(){return{[w.Public]:!0,[w.Restricted]:!1,[w.Invisible]:!1}[this.tagLevel]},tagProperties(){return{displayName:this.tagName,userVisible:this.userVisible,userAssignable:this.userAssignable}}},methods:{t:o.Tl,async handleSubmit(){this.isCreating?await this.create():await this.update()},async create(){const t={...p,...this.tagProperties};this.loading=!0;try{const e=await(async t=>{const e=(t=>{if("name"in t&&!("displayName"in t))return{...t};const e={...t};return e.name=e.displayName,delete e.displayName,e})(t);try{const{headers:s}=await f.customRequest("/systemtags",{method:"POST",data:e}),a=s.get("content-location");if(a)return(0,C.Ic)("systemtags:tag:created",t),(t=>{const e=t.indexOf("?");e>0&&(t=t.substring(0,e));const s=t.split("/");let a;do{a=s[s.length-1],s.pop()}while(!a&&s.length>0);return Number(a)})(a);throw T.error((0,o.t)("systemtags",'Missing "Content-Location" header')),new Error((0,o.t)("systemtags",'Missing "Content-Location" header'))}catch(t){if(409===t?.response?.status)throw T.error((0,o.t)("systemtags","A tag with the same name already exists"),{error:t}),new Error((0,o.t)("systemtags","A tag with the same name already exists"));throw T.error((0,o.t)("systemtags","Failed to create tag"),{error:t}),new Error((0,o.t)("systemtags","Failed to create tag"))}})(t),s={...t,id:e};this.$emit("tag:created",s),(0,l.Te)((0,o.Tl)("systemtags","Created tag")),this.reset()}catch(t){this.errorMessage=(0,o.Tl)("systemtags","Failed to create tag")}this.loading=!1},async update(){if(null===this.selectedTag)return;const t={...this.selectedTag,...this.tagProperties};this.loading=!0;try{await(async t=>{const e="/systemtags/"+t.id,s=`\n\t