mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 15:53:28 +00:00
fix: tags api
This commit is contained in:
@@ -73,7 +73,7 @@ const MetadataTagsStatusDialog = ({ value: oldValue, repoID, toggleDialog: toggl
|
|||||||
placeholder={gettext('Tags')}
|
placeholder={gettext('Tags')}
|
||||||
/>
|
/>
|
||||||
<p className="tip m-0">
|
<p className="tip m-0">
|
||||||
{gettext('Enable tags to describe, categorize and mark files.')}
|
{gettext('Enable tags to add tags to files and search files by tags.')}
|
||||||
</p>
|
</p>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
<ModalFooter>
|
<ModalFooter>
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import metadataAPI from './api';
|
import metadataAPI from './api';
|
||||||
|
import tagsAPI from '../tag/api';
|
||||||
import {
|
import {
|
||||||
PRIVATE_COLUMN_KEYS, EDITABLE_DATA_PRIVATE_COLUMN_KEYS, EDITABLE_PRIVATE_COLUMN_KEYS, DELETABLE_PRIVATE_COLUMN_KEY,
|
PRIVATE_COLUMN_KEYS, EDITABLE_DATA_PRIVATE_COLUMN_KEYS, EDITABLE_PRIVATE_COLUMN_KEYS, DELETABLE_PRIVATE_COLUMN_KEY,
|
||||||
FACE_RECOGNITION_VIEW_ID,
|
FACE_RECOGNITION_VIEW_ID,
|
||||||
@@ -13,6 +14,7 @@ class Context {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.settings = { lang };
|
this.settings = { lang };
|
||||||
this.metadataAPI = null;
|
this.metadataAPI = null;
|
||||||
|
this.tagsAPI = null;
|
||||||
this.localStorage = null;
|
this.localStorage = null;
|
||||||
this.eventBus = null;
|
this.eventBus = null;
|
||||||
this.hasInit = false;
|
this.hasInit = false;
|
||||||
@@ -26,9 +28,10 @@ class Context {
|
|||||||
// init settings
|
// init settings
|
||||||
this.settings = { ...this.settings, ...settings };
|
this.settings = { ...this.settings, ...settings };
|
||||||
|
|
||||||
// init metadataAPI
|
// init API
|
||||||
const { repoInfo } = this.settings;
|
const { repoInfo } = this.settings;
|
||||||
this.metadataAPI = metadataAPI;
|
this.metadataAPI = metadataAPI;
|
||||||
|
this.tagsAPI = tagsAPI;
|
||||||
|
|
||||||
// init localStorage
|
// init localStorage
|
||||||
const { repoID, viewID } = this.settings;
|
const { repoID, viewID } = this.settings;
|
||||||
@@ -46,6 +49,7 @@ class Context {
|
|||||||
destroy = () => {
|
destroy = () => {
|
||||||
this.settings = {};
|
this.settings = {};
|
||||||
this.metadataAPI = null;
|
this.metadataAPI = null;
|
||||||
|
this.tagsAPI = null;
|
||||||
this.localStorage = null;
|
this.localStorage = null;
|
||||||
this.eventBus = null;
|
this.eventBus = null;
|
||||||
this.hasInit = false;
|
this.hasInit = false;
|
||||||
@@ -257,12 +261,12 @@ class Context {
|
|||||||
// file tag
|
// file tag
|
||||||
addFileTags = (recordId, tagIds) => {
|
addFileTags = (recordId, tagIds) => {
|
||||||
const repoID = this.settings['repoID'];
|
const repoID = this.settings['repoID'];
|
||||||
return this.metadataAPI.addFileTags(repoID, recordId, tagIds);
|
return this.tagsAPI.addFileTags(repoID, recordId, tagIds);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateFileTags = (recordId, tagIds) => {
|
updateFileTags = (recordId, tagIds) => {
|
||||||
const repoID = this.settings['repoID'];
|
const repoID = this.settings['repoID'];
|
||||||
return this.metadataAPI.updateFileTags(repoID, recordId, tagIds);
|
return this.tagsAPI.updateFileTags(repoID, recordId, tagIds);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user