From 2ef4454131aa90f4d32ac4904a1db7c5c977a0fd Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Wed, 1 Apr 2026 09:33:30 +0000 Subject: [PATCH] show columns/rows of tasks without specified fields --- dist/index.js | 33 +++++++++++++--------- src/Model/Utility/utility.ts | 24 ++++++++-------- src/View/ChatPages/boardStatusGridPage.tsx | 3 +- src/View/Components/filteredList.tsx | 1 + src/View/Components/propertyValueList.tsx | 5 ++-- src/View/Modals/taskSettingsModal.tsx | 5 +++- src/View/translations.ts | 5 +++- src/View/utility.ts | 2 +- 8 files changed, 45 insertions(+), 33 deletions(-) diff --git a/dist/index.js b/dist/index.js index ce448df3..b563fa30 100644 --- a/dist/index.js +++ b/dist/index.js @@ -322,7 +322,7 @@ function createTimestamp() { return (/* @__PURE__ */ new Date()).toISOString(); } - function checkDoesObjectMatchReference(reference, stringEntryObject) { + function checkDoesObjectMatchReference(reference, stringEntryObject, explicitEmptyValue = false) { reference_entry_loop: for (const referenceEntry of Object.entries( reference )) { @@ -338,10 +338,12 @@ return false; } } else { - if (referenceValue == "" && (stringEntryObjectValue == void 0 || stringEntryObjectValue == "")) { - return false; - } else if (referenceValue == "") { - continue reference_entry_loop; + if (explicitEmptyValue == false) { + if (referenceValue == "" && (stringEntryObjectValue == void 0 || stringEntryObjectValue == "")) { + return false; + } else if (referenceValue == "") { + continue reference_entry_loop; + } } if (stringEntryObjectValue != referenceValue) { return false; @@ -355,7 +357,7 @@ for (const object of objects) { const stringEntryObject = converter(object); const stringEntryObjectValue = stringEntryObject[key]; - if (stringEntryObjectValue == void 0 || stringEntryObjectValue == "") + if (stringEntryObjectValue == void 0) continue; values.add(stringEntryObjectValue.toString()); } @@ -2651,7 +2653,8 @@ /// filterTasksHeadline: "Filter Tasks", /// - renameCategoryInputPlaceholder: "Rename category," + renameCategoryInputPlaceholder: "Rename category", + renameStatusInputPlaceholder: "Rename status" }, calendar: { eventsBoard: "Events", @@ -2825,7 +2828,8 @@ taskTimeLabel: "Uhrzeit", deleteTaskButton: "Aufgabe l\xF6schen", filterTasksHeadline: "Aufgaben filtern", - renameCategoryInputPlaceholder: "Kategorie umbenennen" + renameCategoryInputPlaceholder: "Kategorie umbenennen", + renameStatusInputPlaceholder: "Status umbenennen" }, calendar: { eventsBoard: "Ereignisse", @@ -2995,7 +2999,8 @@ taskTimeLabel: "Hora", deleteTaskButton: "Eliminar tarea", filterTasksHeadline: "Filtrar Tareas", - renameCategoryInputPlaceholder: "Renombrar categor\xEDa" + renameCategoryInputPlaceholder: "Renombrar categor\xEDa", + renameStatusInputPlaceholder: "Renombrar estado" }, calendar: { eventsBoard: "Eventos", @@ -3898,9 +3903,8 @@ propertyValues.add(existingValue); } for (const displayedValue of propertyValues.value.values()) { - if (values.includes(displayedValue) == false) { - propertyValues.remove(displayedValue); - } + if (values.includes(displayedValue)) continue; + propertyValues.remove(displayedValue); } } function createSortedPropertyValueState(propertyValues) { @@ -3922,7 +3926,8 @@ objects.handleAddition((newObject) => { const doesMatch = checkDoesObjectMatchReference( reference, - stringEntryObjectConverter(newObject) + stringEntryObjectConverter(newObject), + true ); if (doesMatch == false) return; matchingObjects.add(newObject); @@ -4151,7 +4156,7 @@ const view = /* @__PURE__ */ createElement("div", { class: "flex-row" }, /* @__PURE__ */ createElement("div", { class: "property-input-wrapper" }, /* @__PURE__ */ createElement( "input", { - placeholder: translations.chatPage.task.renameCategoryInputPlaceholder, + placeholder: translations.chatPage.task.renameStatusInputPlaceholder, "bind:value": viewModel.inputValue, "on:enter": viewModel.set } diff --git a/src/Model/Utility/utility.ts b/src/Model/Utility/utility.ts index 64448c98..88d41179 100644 --- a/src/Model/Utility/utility.ts +++ b/src/Model/Utility/utility.ts @@ -40,6 +40,7 @@ export function filterObjectsByStringEntries( export function checkDoesObjectMatchReference( reference: StringEntryObject, stringEntryObject: StringEntryObject, + explicitEmptyValue: boolean = false, ): boolean { reference_entry_loop: for (const referenceEntry of Object.entries( reference, @@ -68,15 +69,17 @@ export function checkDoesObjectMatchReference( return false; } } else { - // property must exist but be anything - if ( - referenceValue == "" && - (stringEntryObjectValue == undefined || - stringEntryObjectValue == "") - ) { - return false; - } else if (referenceValue == "") { - continue reference_entry_loop; + if (explicitEmptyValue == false) { + // property must exist but be anything + if ( + referenceValue == "" && + (stringEntryObjectValue == undefined || + stringEntryObjectValue == "") + ) { + return false; + } else if (referenceValue == "") { + continue reference_entry_loop; + } } // property must match @@ -99,8 +102,7 @@ export function collectObjectValuesForKey( const stringEntryObject: StringEntryObject = converter(object); const stringEntryObjectValue: Stringifiable | undefined = stringEntryObject[key]; - if (stringEntryObjectValue == undefined || stringEntryObjectValue == "") - continue; + if (stringEntryObjectValue == undefined) continue; values.add(stringEntryObjectValue.toString()); } diff --git a/src/View/ChatPages/boardStatusGridPage.tsx b/src/View/ChatPages/boardStatusGridPage.tsx index 69fb8d18..dd55513f 100644 --- a/src/View/ChatPages/boardStatusGridPage.tsx +++ b/src/View/ChatPages/boardStatusGridPage.tsx @@ -118,8 +118,7 @@ function StatusNameCell(
( const doesMatch: boolean = checkDoesObjectMatchReference( reference, stringEntryObjectConverter(newObject), + true, ); if (doesMatch == false) return; diff --git a/src/View/Components/propertyValueList.tsx b/src/View/Components/propertyValueList.tsx index 58672815..605a939c 100644 --- a/src/View/Components/propertyValueList.tsx +++ b/src/View/Components/propertyValueList.tsx @@ -47,9 +47,8 @@ export function collectPropertyValuesToState( } for (const displayedValue of propertyValues.value.values()) { - if (values.includes(displayedValue) == false) { - propertyValues.remove(displayedValue); - } + if (values.includes(displayedValue)) continue; + propertyValues.remove(displayedValue); } } diff --git a/src/View/Modals/taskSettingsModal.tsx b/src/View/Modals/taskSettingsModal.tsx index 65271fad..cf2845c0 100644 --- a/src/View/Modals/taskSettingsModal.tsx +++ b/src/View/Modals/taskSettingsModal.tsx @@ -53,7 +53,10 @@ export function TaskSettingsModal(taskViewModel: TaskViewModel) { {translations.chatPage.task.taskNameLabel} - +
diff --git a/src/View/translations.ts b/src/View/translations.ts index 7ca57785..63b5884c 100644 --- a/src/View/translations.ts +++ b/src/View/translations.ts @@ -240,7 +240,8 @@ const englishTranslations = { /// - renameCategoryInputPlaceholder: "Rename category,", + renameCategoryInputPlaceholder: "Rename category", + renameStatusInputPlaceholder: "Rename status", }, calendar: { @@ -493,6 +494,7 @@ const allTranslations: { [language: string]: typeof englishTranslations } = { filterTasksHeadline: "Aufgaben filtern", renameCategoryInputPlaceholder: "Kategorie umbenennen", + renameStatusInputPlaceholder: "Status umbenennen", }, calendar: { @@ -739,6 +741,7 @@ const allTranslations: { [language: string]: typeof englishTranslations } = { filterTasksHeadline: "Filtrar Tareas", renameCategoryInputPlaceholder: "Renombrar categoría", + renameStatusInputPlaceholder: "Renombrar estado", }, calendar: { diff --git a/src/View/utility.ts b/src/View/utility.ts index 80536102..963f440b 100644 --- a/src/View/utility.ts +++ b/src/View/utility.ts @@ -16,4 +16,4 @@ export function setFocus() { export function setFocusWithDelay() { setTimeout(setFocus, 100); -} \ No newline at end of file +}