diff --git a/client/src/components/Workflow/WorkflowActions.vue b/client/src/components/Workflow/WorkflowActions.vue index be67fccc429a..7c709b27aea8 100644 --- a/client/src/components/Workflow/WorkflowActions.vue +++ b/client/src/components/Workflow/WorkflowActions.vue @@ -126,7 +126,7 @@ async function onDelete() { const actions: ComputedRef<(AAction | BAction)[]> = computed(() => { return [ { - condition: !shared.value && !props.workflow.show_in_tool_panel, + condition: !props.workflow.deleted && !shared.value && !props.workflow.show_in_tool_panel, class: "workflow-bookmark-button-add", component: "async", title: "Add bookmarks", @@ -137,7 +137,7 @@ const actions: ComputedRef<(AAction | BAction)[]> = computed(() => { action: () => onToggleBookmark(true), }, { - condition: !shared.value && props.workflow.show_in_tool_panel, + condition: !props.workflow.deleted && !shared.value && props.workflow.show_in_tool_panel, class: "workflow-bookmark-button-remove", component: "async", title: "Remove bookmark", diff --git a/client/src/components/Workflow/WorkflowList.vue b/client/src/components/Workflow/WorkflowList.vue index 8a0f770c88a2..3cbda017cc01 100644 --- a/client/src/components/Workflow/WorkflowList.vue +++ b/client/src/components/Workflow/WorkflowList.vue @@ -71,6 +71,10 @@ const sortDesc = computed(() => (listHeader.value && listHeader.value.sortDesc) const sortBy = computed(() => (listHeader.value && listHeader.value.sortBy) || "update_time"); const noItems = computed(() => !loading.value && workflowsLoaded.value.length === 0 && !filterText.value); const noResults = computed(() => !loading.value && workflowsLoaded.value.length === 0 && filterText.value); +const deleteButtonTitle = computed(() => (showDeleted.value ? "Hide deleted workflows" : "Show deleted workflows")); +const bookmarkButtonTitle = computed(() => + showBookmarked.value ? "Hide bookmarked workflows" : "Show bookmarked workflows" +); // Filtering computed refs const workflowFilters = computed(() => WorkflowFilters(props.activeList)); @@ -87,8 +91,17 @@ function updateFilterValue(filterKey: string, newValue: any) { filterText.value = workflowFilters.value.setFilterValue(currentFilterText, filterKey, newValue); } +function toggleBookmarked(bookmarked?: boolean) { + showBookmarked.value = bookmarked ?? !showBookmarked.value; +} + function onToggleBookmarked() { - showBookmarked.value = !showBookmarked.value; + toggleBookmarked(); +} + +function onToggleDeleted() { + updateFilterValue("deleted", true); + toggleBookmarked(false); } async function load(overlayLoading = false, silent = false) { @@ -234,10 +247,10 @@ onMounted(() => { id="show-deleted" v-b-tooltip.hover size="sm" - :title="!showDeleted ? 'Show deleted workflows' : 'Hide deleted workflows'" + :title="deleteButtonTitle" :pressed="showDeleted" variant="outline-primary" - @click="updateFilterValue('deleted', true)"> + @click="onToggleDeleted"> Show deleted @@ -246,8 +259,9 @@ onMounted(() => { id="show-bookmarked" v-b-tooltip.hover size="sm" - :title="!showBookmarked ? 'Show bookmarked workflows' : 'Hide bookmarked workflows'" + :title="bookmarkButtonTitle" :pressed="showBookmarked" + :disabled="showDeleted" variant="outline-primary" @click="onToggleBookmarked">