From 8f1c97ff6d3573d051a9adaf4104b40d848dfce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E7=92=87?= Date: Fri, 22 Nov 2024 18:12:55 +0800 Subject: [PATCH] fix: tags api --- .../dialog/metadata-tags-status-dialog/index.js | 2 +- frontend/src/metadata/context.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/metadata/components/dialog/metadata-tags-status-dialog/index.js b/frontend/src/metadata/components/dialog/metadata-tags-status-dialog/index.js index 973b8a4778..2acd51cdc5 100644 --- a/frontend/src/metadata/components/dialog/metadata-tags-status-dialog/index.js +++ b/frontend/src/metadata/components/dialog/metadata-tags-status-dialog/index.js @@ -73,7 +73,7 @@ const MetadataTagsStatusDialog = ({ value: oldValue, repoID, toggleDialog: toggl placeholder={gettext('Tags')} />

- {gettext('Enable tags to describe, categorize and mark files.')} + {gettext('Enable tags to add tags to files and search files by tags.')}

diff --git a/frontend/src/metadata/context.js b/frontend/src/metadata/context.js index 031f099d26..be3421e827 100644 --- a/frontend/src/metadata/context.js +++ b/frontend/src/metadata/context.js @@ -1,4 +1,5 @@ import metadataAPI from './api'; +import tagsAPI from '../tag/api'; import { PRIVATE_COLUMN_KEYS, EDITABLE_DATA_PRIVATE_COLUMN_KEYS, EDITABLE_PRIVATE_COLUMN_KEYS, DELETABLE_PRIVATE_COLUMN_KEY, FACE_RECOGNITION_VIEW_ID, @@ -13,6 +14,7 @@ class Context { constructor() { this.settings = { lang }; this.metadataAPI = null; + this.tagsAPI = null; this.localStorage = null; this.eventBus = null; this.hasInit = false; @@ -26,9 +28,10 @@ class Context { // init settings this.settings = { ...this.settings, ...settings }; - // init metadataAPI + // init API const { repoInfo } = this.settings; this.metadataAPI = metadataAPI; + this.tagsAPI = tagsAPI; // init localStorage const { repoID, viewID } = this.settings; @@ -46,6 +49,7 @@ class Context { destroy = () => { this.settings = {}; this.metadataAPI = null; + this.tagsAPI = null; this.localStorage = null; this.eventBus = null; this.hasInit = false; @@ -257,12 +261,12 @@ class Context { // file tag addFileTags = (recordId, tagIds) => { const repoID = this.settings['repoID']; - return this.metadataAPI.addFileTags(repoID, recordId, tagIds); + return this.tagsAPI.addFileTags(repoID, recordId, tagIds); }; updateFileTags = (recordId, tagIds) => { const repoID = this.settings['repoID']; - return this.metadataAPI.updateFileTags(repoID, recordId, tagIds); + return this.tagsAPI.updateFileTags(repoID, recordId, tagIds); }; }