Skip to content

Commit

Permalink
Bugfix - nearbeach-1346 Read only user can edit tags - not able to save
Browse files Browse the repository at this point in the history
  • Loading branch information
robotichead committed Apr 17, 2024
1 parent 8112840 commit 3692205
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/js/components/search/SearchTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ export default {
type: "updateUrl",
rootUrl: this.rootUrl,
});
this.$store.commit({
type: "updateUserLevel",
userLevel: this.userLevel,
});
},
};
</script>
7 changes: 6 additions & 1 deletion src/js/components/tags/EditTagModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
</label>
<input
class="form-control"
v-bind:disabled="userLevel <= 1"
v-model="tagNameModel"
/>
</div>
Expand All @@ -63,6 +64,7 @@
<div class="form-group">
<label>Background Colour</label>
<n-color-picker :show-alpha="false"
v-bind:disabled="userLevel <= 1"
v-model:value="tagColourModel"
:modes="['hex']"
></n-color-picker>
Expand All @@ -72,6 +74,7 @@
<label>Text Colour</label>

<n-color-picker v-model:value="tagTextColourModel"
v-bind:disabled="userLevel <= 1"
:show-alpha="false"
:modes="['hex']"
/>
Expand All @@ -93,7 +96,7 @@
type="button"
class="btn btn-danger delete-tag"
v-on:click="deleteTag"
v-if="tagId !== 0"
v-if="tagId !== 0 && userLevel > 1"
>
Delete Tag
</button>
Expand All @@ -110,6 +113,7 @@
class="btn btn-primary"
v-bind:disabled="!canSave"
v-on:click="saveTag"
v-if="userLevel > 1"
>
Save Tag
</button>
Expand Down Expand Up @@ -177,6 +181,7 @@ export default {
computed: {
...mapGetters({
rootUrl: "getRootUrl",
userLevel: "getUserLevel",
}),
canSave() {
//Return false if user has written a duplicate tag name
Expand Down

0 comments on commit 3692205

Please sign in to comment.