diff --git a/services/web/app/src/Features/Tags/types.d.ts b/services/web/app/src/Features/Tags/types.d.ts index 89d00e7487..3886cf0424 100644 --- a/services/web/app/src/Features/Tags/types.d.ts +++ b/services/web/app/src/Features/Tags/types.d.ts @@ -1,6 +1,6 @@ export type Tag = { _id: string user_id: string - name: string + name: string | null project_ids?: string[] } diff --git a/services/web/frontend/js/features/project-list/components/dropdown/projects-dropdown.tsx b/services/web/frontend/js/features/project-list/components/dropdown/projects-dropdown.tsx index 6b7d521b8c..59a51c10ad 100644 --- a/services/web/frontend/js/features/project-list/components/dropdown/projects-dropdown.tsx +++ b/services/web/frontend/js/features/project-list/components/dropdown/projects-dropdown.tsx @@ -66,7 +66,7 @@ function ProjectsDropdown() { const tag = tags.find(({ _id: id }) => id === selectedTagId) if (tag) { - setTitle(tag.name) + setTitle(tag.name ?? '') } } }, [filter, tags, selectedTagId, t]) diff --git a/services/web/frontend/js/features/project-list/components/modals/edit-tag-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/edit-tag-modal.tsx index 745cbeae9f..957f870214 100644 --- a/services/web/frontend/js/features/project-list/components/modals/edit-tag-modal.tsx +++ b/services/web/frontend/js/features/project-list/components/modals/edit-tag-modal.tsx @@ -86,7 +86,7 @@ export default function EditTagModal({ type="text" placeholder="Tag Name" name="new-tag-name" - value={newTagName === undefined ? tag.name : newTagName} + value={newTagName === undefined ? tag.name ?? '' : newTagName} required onChange={e => setNewTagName(e.target.value)} /> diff --git a/services/web/frontend/js/features/project-list/components/modals/rename-tag-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/rename-tag-modal.tsx index 70110efb1a..3db7260daf 100644 --- a/services/web/frontend/js/features/project-list/components/modals/rename-tag-modal.tsx +++ b/services/web/frontend/js/features/project-list/components/modals/rename-tag-modal.tsx @@ -85,7 +85,7 @@ export default function RenameTagModal({ type="text" placeholder="Tag Name" name="new-tag-name" - value={newTagName === undefined ? tag.name : newTagName} + value={newTagName === undefined ? tag.name ?? '' : newTagName} required onChange={e => setNewTagName(e.target.value)} /> diff --git a/services/web/frontend/js/features/project-list/components/sidebar/tags-list.tsx b/services/web/frontend/js/features/project-list/components/sidebar/tags-list.tsx index c43dfb2dda..8cf9e18326 100644 --- a/services/web/frontend/js/features/project-list/components/sidebar/tags-list.tsx +++ b/services/web/frontend/js/features/project-list/components/sidebar/tags-list.tsx @@ -39,7 +39,7 @@ export default function TagsList() { {t('new_folder')} - {sortBy(tags, tag => tag.name.toLowerCase()).map(tag => { + {sortBy(tags, tag => tag.name?.toLowerCase()).map(tag => { return (