From f5ee42dcf9355d1cb39f438c3bb929a81e39192b Mon Sep 17 00:00:00 2001 From: Allan Otodi Opeto <103313919+AllanOXDi@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:09:02 +0300 Subject: [PATCH 1/7] remove mixed tag as a category --- .../QuickEditModal/EditBooleanMapModal.vue | 6 +++--- .../views/contentNodeFields/CategoryOptions.vue | 12 ------------ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue index ad3ffbac7d..4f597b0036 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue @@ -2,7 +2,7 @@ - + diff --git a/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CategoryOptions.vue b/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CategoryOptions.vue index 032a720873..2bf86abccc 100644 --- a/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CategoryOptions.vue +++ b/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CategoryOptions.vue @@ -157,14 +157,6 @@ }, autocompleteOptions() { const options = [...this.categoriesList]; - if (this.expanded) { - // Just boolean maps can have indeterminate values - options.push({ - value: MIXED, - text: this.$tr('mixedLabel'), - undeletable: true, - }); - } return options; }, autocompleteValues() { @@ -216,9 +208,6 @@ this.selected = {}; }, tooltipText(optionId) { - if (optionId === MIXED) { - return this.$tr('mixedLabel'); - } const option = this.categoriesList.find(option => option.value === optionId); if (!option) { return ''; @@ -301,7 +290,6 @@ }, $trs: { noCategoryFoundText: 'Category not found', - mixedLabel: 'Mixed', }, }; From 1aa3da847b9a8b729cf4304a4301054a915acb5a Mon Sep 17 00:00:00 2001 From: Allan Otodi Opeto <103313919+AllanOXDi@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:09:33 +0300 Subject: [PATCH 2/7] removes indeterminate state checkboxes --- .../components/QuickEditModal/EditBooleanMapModal.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue index 4f597b0036..7b393506d2 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue @@ -2,7 +2,7 @@ node.kind === ContentKindsNames.TOPIC); }, + canSave() { + return Object.values(this.selectedValues).some(value => value.length > 0); + }, }, watch: { selectedValues() { @@ -137,11 +140,6 @@ } }, async handleSave() { - this.validate(); - if (this.error) { - return; - } - await Promise.all( this.nodes.map(node => { const fieldValue = {}; From dc8789a241ccb79c99417580023ba8a0c1067f7f Mon Sep 17 00:00:00 2001 From: Allan Otodi Opeto <103313919+AllanOXDi@users.noreply.github.com> Date: Fri, 6 Sep 2024 19:23:41 +0300 Subject: [PATCH 3/7] add helper text --- .../QuickEditModal/EditBooleanMapModal.vue | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue index 7b393506d2..0080369dfe 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue @@ -2,7 +2,8 @@ {{ resourcesSelectedText }}

+ + +

+ {{ $tr('addAdditionalCategoriesDescription') }} +

+ value.length > 0); }, + hasMixedCategories() { + const selectedNodes = this.nodes.filter(node => this.selectedValues[node.id]); + const categories = selectedNodes.map(node => node.categories || []); + return selectedNodes.length > 0 && new Set(categories.flat()).size > 1; + }, }, watch: { selectedValues() { @@ -169,6 +181,8 @@ cancelAction: 'Cancel', updateDescendantCheckbox: 'Apply to all resources, folders, and subfolders contained within the selected folders.', + addAdditionalCategoriesDescription: + 'You selected resources that have different categories. The categories you choose below will be added to all selected resources. This will not remove existing categories.', }, }; From 86c0d78ad08ce242f4e724a98cadc76ea6373e25 Mon Sep 17 00:00:00 2001 From: Allan Otodi Opeto <103313919+AllanOXDi@users.noreply.github.com> Date: Tue, 10 Sep 2024 23:01:55 +0300 Subject: [PATCH 4/7] fixes strings --- .../QuickEditModal/EditBooleanMapModal.vue | 27 ++++++++++--------- .../contentNodeFields/CategoryOptions.vue | 22 +++++++++++++++ 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue index 0080369dfe..c1e527737b 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditBooleanMapModal.vue @@ -1,3 +1,4 @@ +