From b7b5c05afd097bff69d007b5970ef0026ad95118 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:20:36 +0100 Subject: [PATCH] Increase readability --- .../HistoryOperations/SelectionOperations.vue | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue b/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue index 0930569fb50f..c3165c5a5d96 100644 --- a/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue +++ b/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue @@ -199,17 +199,11 @@ export default { computed: { /** @returns {Boolean} */ canUnhideSelection() { - return ( - this.areAllSelectedHidden || - (HistoryFilters.checkFilter(this.filterText, "visible", "any") && !this.areAllSelectedVisible) - ); + return this.areAllSelectedHidden || (this.isAnyVisibilityAllowed && !this.areAllSelectedVisible); }, /** @returns {Boolean} */ canHideSelection() { - return ( - this.areAllSelectedVisible || - (HistoryFilters.checkFilter(this.filterText, "visible", "any") && !this.areAllSelectedHidden) - ); + return this.areAllSelectedVisible || (this.isAnyVisibilityAllowed && !this.areAllSelectedHidden); }, /** @returns {Boolean} */ showDeleted() { @@ -217,10 +211,7 @@ export default { }, /** @returns {Boolean} */ canDeleteSelection() { - return ( - this.areAllSelectedActive || - (HistoryFilters.checkFilter(this.filterText, "deleted", "any") && !this.areAllSelectedDeleted) - ); + return this.areAllSelectedActive || (this.isAnyDeletedStateAllowed && !this.areAllSelectedDeleted); }, /** @returns {Boolean} */ canUndeleteSelection() { @@ -289,6 +280,12 @@ export default { } return true; }, + isAnyVisibilityAllowed() { + return HistoryFilters.checkFilter(this.filterText, "visible", "any"); + }, + isAnyDeletedStateAllowed() { + return HistoryFilters.checkFilter(this.filterText, "deleted", "any"); + }, }, watch: { hasSelection(newVal) {