Skip to content

Commit

Permalink
show hidden tag when there are no available tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mayswind committed Feb 6, 2025
1 parent 721eb12 commit 58c1382
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/views/desktop/transactions/list/dialogs/EditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,17 @@
</v-list-item-title>
</template>
</v-list-item>
<v-list-item :disabled="true" v-bind="props"
v-if="item.raw.hidden && item.raw.name.toLowerCase().indexOf(tagSearchContent.toLowerCase()) >= 0 && isAllFilteredTagHidden">
<template #title>
<v-list-item-title>
<div class="d-flex align-center">
<v-icon size="20" start :icon="mdiPound"/>
<span>{{ item.title }}</span>
</div>
</v-list-item-title>
</template>
</v-list-item>
</template>

<template #no-data>
Expand Down Expand Up @@ -564,6 +575,23 @@ const sourceAmountColor = computed<string | undefined>(() => {
return undefined;
});
const isAllFilteredTagHidden = computed<boolean>(() => {
const lowerCaseTagSearchContent = tagSearchContent.value.toLowerCase();
let hiddenCount = 0;
for (const tag of allTags.value) {
if (!lowerCaseTagSearchContent || tag.name.toLowerCase().indexOf(lowerCaseTagSearchContent) >= 0) {
if (!tag.hidden) {
return false;
}
hiddenCount++;
}
}
return hiddenCount > 0;
});
function setTransaction(newTransaction: Transaction | null, options: SetTransactionOptions, setContextData: boolean, convertContextTime: boolean): void {
setTransactionModelByTransaction(
transaction.value,
Expand Down

0 comments on commit 58c1382

Please sign in to comment.