Skip to content

Commit

Permalink
🎨: update WorkflowList delete and bookmark filter conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
itisAliRH committed May 7, 2024
1 parent 65ba939 commit 966c3b4
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions client/src/components/Workflow/WorkflowList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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) {
Expand Down Expand Up @@ -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">
<FontAwesomeIcon :icon="faTrash" fixed-width />
Show deleted
</BButton>
Expand All @@ -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">
<FontAwesomeIcon :icon="faStar" fixed-width />
Expand Down

0 comments on commit 966c3b4

Please sign in to comment.