added system tag for buckets
This commit is contained in:
@@ -17,7 +17,11 @@ export const TagPicker: Component<TagPickerProps> = (props) => {
|
||||
const [valueScore, setValueScore] = createSignal(5);
|
||||
|
||||
// Filter tags for the "Name" part
|
||||
const allTagNames = () => store.tagDefinitions.map(d => d.name).sort();
|
||||
const allTagNames = () => {
|
||||
const definedTags = store.tagDefinitions.map(d => d.name);
|
||||
const bucketTags = store.buckets.map(b => b.name);
|
||||
return [...new Set([...definedTags, ...bucketTags])].sort();
|
||||
};
|
||||
|
||||
// When a tag name is selected, update the value score to match its current definition
|
||||
createEffect(() => {
|
||||
@@ -35,7 +39,9 @@ export const TagPicker: Component<TagPickerProps> = (props) => {
|
||||
if (!name) return;
|
||||
|
||||
// update global definition
|
||||
upsertTagDefinition(name, valueScore(), undefined, resolvedTheme());
|
||||
const bucket = store.buckets.find(b => b.name === name);
|
||||
const color = bucket ? bucket.color : undefined;
|
||||
upsertTagDefinition(name, valueScore(), color, resolvedTheme());
|
||||
|
||||
// Toggle in current task selection if not already there
|
||||
const currentSelected = props.selectedTags;
|
||||
|
||||
Reference in New Issue
Block a user