From 404a0e0934a646b5bd3b0594d8cffa57a4b81be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E7=92=87?= <37972689+YangGuoXuan-0503@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:32:21 +0800 Subject: [PATCH] feat: metadata filestatus property data (#6805) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 杨国璇 --- frontend/src/metadata/utils/column/index.js | 22 ++++----------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/frontend/src/metadata/utils/column/index.js b/frontend/src/metadata/utils/column/index.js index 5969f3b899..392264c1e9 100644 --- a/frontend/src/metadata/utils/column/index.js +++ b/frontend/src/metadata/utils/column/index.js @@ -273,26 +273,13 @@ const getFileTypeColumnData = (column) => { export const getDefaultFileStatusOptions = () => { return [ - { id: '_in_progress', name: '_in_progress' }, - { id: '_in_review', name: '_in_review' }, - { id: '_done', name: '_done' }, + { id: '_in_progress', name: gettext('In progress'), color: '#EED5FF', textColor: '#212529' }, + { id: '_in_review', name: gettext('In review'), color: '#FFFDCF', textColor: '#212529' }, + { id: '_done', name: gettext('Done'), color: '#59CB74', textColor: '#FFFFFF', borderColor: '#844BD2' }, + { id: '_outdated', name: gettext('Outdated'), color: '#C2C2C2', textColor: '#FFFFFF', borderColor: '#ADADAD' }, ]; }; -const getFileStatusColumnData = (column) => { - const { data } = column; - let newData = { ...data }; - const _OPTIONS = { - '_in_progress': { name: gettext('In progress'), color: '#EED5FF', textColor: '#202428' }, - '_in_review': { name: gettext('In review'), color: '#FFFDCF', textColor: '#202428' }, - '_done': { name: gettext('Done'), color: '#59CB74', textColor: '#FFFFFF', borderColor: '#844BD2' }, - }; - newData.options = Array.isArray(data?.options) ? data.options.map(o => { - return { ...o, ..._OPTIONS[o.id] }; - }) : []; - return newData; -}; - const getFileSizeColumnData = (column) => { return { ...column.data, @@ -304,7 +291,6 @@ export const normalizeColumnData = (column) => { const { key, data } = column; if (PRIVATE_COLUMN_KEYS.includes(key)) { if (key === PRIVATE_COLUMN_KEY.FILE_TYPE) return getFileTypeColumnData(column); - if (key === PRIVATE_COLUMN_KEY.FILE_STATUS) return getFileStatusColumnData(column); if (key === PRIVATE_COLUMN_KEY.SIZE) return getFileSizeColumnData(column); } if (column.type === CellType.SINGLE_SELECT) {