mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-11 20:01:40 +00:00
feat: metadata filestatus property data (#6805)
Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
parent
e25f97aabc
commit
404a0e0934
@ -273,26 +273,13 @@ const getFileTypeColumnData = (column) => {
|
|||||||
|
|
||||||
export const getDefaultFileStatusOptions = () => {
|
export const getDefaultFileStatusOptions = () => {
|
||||||
return [
|
return [
|
||||||
{ id: '_in_progress', name: '_in_progress' },
|
{ id: '_in_progress', name: gettext('In progress'), color: '#EED5FF', textColor: '#212529' },
|
||||||
{ id: '_in_review', name: '_in_review' },
|
{ id: '_in_review', name: gettext('In review'), color: '#FFFDCF', textColor: '#212529' },
|
||||||
{ id: '_done', name: '_done' },
|
{ 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) => {
|
const getFileSizeColumnData = (column) => {
|
||||||
return {
|
return {
|
||||||
...column.data,
|
...column.data,
|
||||||
@ -304,7 +291,6 @@ export const normalizeColumnData = (column) => {
|
|||||||
const { key, data } = column;
|
const { key, data } = column;
|
||||||
if (PRIVATE_COLUMN_KEYS.includes(key)) {
|
if (PRIVATE_COLUMN_KEYS.includes(key)) {
|
||||||
if (key === PRIVATE_COLUMN_KEY.FILE_TYPE) return getFileTypeColumnData(column);
|
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 (key === PRIVATE_COLUMN_KEY.SIZE) return getFileSizeColumnData(column);
|
||||||
}
|
}
|
||||||
if (column.type === CellType.SINGLE_SELECT) {
|
if (column.type === CellType.SINGLE_SELECT) {
|
||||||
|
Loading…
Reference in New Issue
Block a user