1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

feat: metadata editor(number、single select、collaborator) (#6385)

* feat: metadata editor(number、single select)

* feat: optimize code

* feat: optimize code

* feat: add checkbox editor

* feat: optimzie code

* feat: delete code

* feat: optimzie code

* feat: optimzie eslint

---------

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2024-07-25 16:42:18 +08:00
committed by GitHub
parent 24ad6cda3e
commit 8a5bcf1c14
79 changed files with 3128 additions and 612 deletions

View File

@@ -68,22 +68,6 @@ class MetadataManagerAPI {
return this.req.get(url, { params: params });
}
insertColumn = (repoID, name, type, { key, data }) => {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/columns/';
let params = {
'column_name': name,
'column_type': type,
};
if (key) {
params['column_key'] = key;
}
if (data) {
params['column_data'] = data;
}
return this.req.post(url, params);
};
getMetadataRecordInfo(repoID, parentDir, name) {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/record/';
let params = {};
@@ -159,6 +143,49 @@ class MetadataManagerAPI {
};
return this._sendPostRequest(url, params, { headers: { 'Content-type': 'application/json' } });
};
// column
insertColumn = (repoID, name, type, { key, data }) => {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/columns/';
let params = {
'column_name': name,
'column_type': type,
};
if (key) {
params['column_key'] = key;
}
if (data) {
params['column_data'] = data;
}
return this.req.post(url, params);
};
deleteColumn = (repoID, columnKey) => {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/columns/';
const params = {
column_key: columnKey,
};
return this.req.delete(url, { data: params });
};
renameColumn = (repoID, columnKey, name) => {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/columns/';
const params = {
column_key: columnKey,
name: name,
};
return this.req.put(url, params);
};
modifyColumnData = (repoID, columnKey, data) => {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/columns/';
const params = {
column_key: columnKey,
data: data,
};
return this.req.put(url, params);
};
}
const metadataAPI = new MetadataManagerAPI();