diff --git a/src/components/modals/EditSearchFilterGroupModal.vue b/src/components/modals/EditSearchFilterGroupModal.vue
index 173783ba7..14c6573bf 100644
--- a/src/components/modals/EditSearchFilterGroupModal.vue
+++ b/src/components/modals/EditSearchFilterGroupModal.vue
@@ -29,6 +29,12 @@
:label="$t('main.color')"
v-model="form.color"
/>
+
+
@@ -111,14 +112,21 @@ export default {
name: '',
search_filter_group_id: null,
search_query: '',
- is_shared: 'false',
- task_status_id: null
+ is_shared: 'false'
}
}
},
computed: {
- ...mapGetters(['currentProduction', 'isCurrentUserManager'])
+ ...mapGetters(['currentProduction', 'isCurrentUserManager']),
+
+ allowedGroups() {
+ return this.groupOptions.filter(
+ group =>
+ group.is_shared === (this.form.is_shared === 'true') ||
+ group.value === null
+ )
+ }
},
methods: {
@@ -142,22 +150,20 @@ export default {
watch: {
searchQueryToEdit() {
if (this.searchQueryToEdit?.id) {
- this.form.id = this.searchQueryToEdit.id
- this.form.name = this.searchQueryToEdit.name
- this.form.search_filter_group_id =
- this.searchQueryToEdit.search_filter_group_id
- this.form.search_query = this.searchQueryToEdit.search_query
- this.form.is_shared = this.searchQueryToEdit.is_shared
- ? 'true'
- : 'false'
+ this.form = {
+ id: this.searchQueryToEdit.id,
+ name: this.searchQueryToEdit.name,
+ search_filter_group_id: this.searchQueryToEdit.search_filter_group_id,
+ search_query: this.searchQueryToEdit.search_query,
+ is_shared: this.searchQueryToEdit.is_shared ? 'true' : 'false'
+ }
} else {
this.form = {
id: null,
name: '',
search_filter_group_id: null,
search_query: '',
- is_shared: 'false',
- task_status_id: null
+ is_shared: 'false'
}
}
},
diff --git a/src/components/widgets/SearchQueryList.vue b/src/components/widgets/SearchQueryList.vue
index 518455e47..31086c9d7 100644
--- a/src/components/widgets/SearchQueryList.vue
+++ b/src/components/widgets/SearchQueryList.vue
@@ -10,7 +10,10 @@
@@ -38,7 +42,9 @@
class="del"
:style="{ backgroundColor: `${group.color}53` }"
@click.stop="removeGroup(group)"
- v-if="!group.queries.length"
+ v-if="
+ !group.queries.length && (!group.is_shared || isCurrentUserManager)
+ "
>
@@ -53,6 +59,9 @@
@@ -75,6 +85,7 @@
class="del"
:style="{ backgroundColor: `${group.color}53` }"
@click.stop="removeSearch(searchQuery)"
+ v-if="!searchQuery.is_shared || isCurrentUserManager"
>
@@ -82,8 +93,8 @@
({
label: group.name,
- value: group.id
+ value: group.id,
+ is_shared: group.is_shared
}))
]
}
@@ -268,7 +280,9 @@ export default {
try {
this.loading.group = true
this.errors.group = false
-
+ filterGroup.project_id = this.currentProduction
+ ? this.currentProduction.id
+ : null
if (!filterGroup.id) {
await this[
`save${stringHelpers.capitalize(this.type)}SearchFilterGroup`
@@ -391,9 +405,6 @@ export default {
transform: scale(1.1);
}
-.search-queries .group.tag .group-header:hover {
-}
-
.search-queries .group.tag.open .tag:hover {
transform: scale(1.03);
}
diff --git a/src/store/api/people.js b/src/store/api/people.js
index 23e72c6e4..17a0ef786 100644
--- a/src/store/api/people.js
+++ b/src/store/api/people.js
@@ -257,7 +257,9 @@ export default {
updateFilterGroup(filterGroup) {
const data = {
name: filterGroup.name,
- color: filterGroup.color
+ color: filterGroup.color,
+ is_shared: filterGroup.is_shared,
+ project_id: filterGroup.project_id
}
return client.pput(`/api/data/user/filter-groups/${filterGroup.id}`, data)
},
diff --git a/src/store/modules/concepts.js b/src/store/modules/concepts.js
index b0ca0a07e..c0ccb44a0 100644
--- a/src/store/modules/concepts.js
+++ b/src/store/modules/concepts.js
@@ -85,7 +85,6 @@ const actions = {
async newConcept({ commit, dispatch, rootGetters }, form) {
const production = rootGetters.currentProduction
- console.log(form)
// Create Entity
const entity = {
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 75e65fc8b..0e541a9bb 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -704,6 +704,9 @@ const mutations = {
)
if (filterGroup) {
Object.assign(filterGroup, userFilterGroup)
+ state.userFilters?.[typeName]?.[projectId].forEach(filter => {
+ filter.is_shared = userFilterGroup.is_shared
+ })
}
})
})