1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 00:00:00 +00:00

fix: metadata system folders (#6588)

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2024-08-20 11:28:53 +08:00
committed by GitHub
parent af50cc2bab
commit 508a96e140
2 changed files with 11 additions and 0 deletions

View File

@@ -21,6 +21,11 @@ export const NOT_DISPLAY_COLUMN_KEYS = [
PRIVATE_COLUMN_KEY.FILE_DETAILS,
];
export const SYSTEM_FOLDERS = [
'/_Internal',
'/images'
];
export {
PRIVATE_COLUMN_KEY,
};

View File

@@ -10,6 +10,7 @@ import { gettext } from '../../utils/constants';
import { DetailEditor, CellFormatter } from '../metadata-view';
import { getColumnOriginName } from '../metadata-view/utils/column-utils';
import { CellType, getColumnOptions, getOptionName, PREDEFINED_COLUMN_KEYS, getColumnOptionNamesByIds } from '../metadata-view/_basic';
import { SYSTEM_FOLDERS } from './constants';
import './index.css';
@@ -20,6 +21,11 @@ const MetadataDetails = ({ repoID, filePath, repoInfo, direntType }) => {
useEffect(() => {
setLoading(true);
if (SYSTEM_FOLDERS.find(folderPath => filePath.startsWith(folderPath))) {
setLoading(false);
return;
}
const dirName = Utils.getDirName(filePath);
const fileName = Utils.getFileName(filePath);
let parentDir = direntType === 'file' ? dirName : dirName.slice(0, dirName.length - fileName.length - 1);