mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-24 16:02:20 +08:00
Merge branch 'develop' of github.com:nocobase/nocobase into develop
This commit is contained in:
@@ -31,7 +31,7 @@ const { DateFilterDynamicComponent: DateFilterDynamicComponentLazy } = lazy(
|
||||
export interface VariableFilterItemValue {
|
||||
path: string;
|
||||
operator: string;
|
||||
value: string;
|
||||
value: string | boolean;
|
||||
}
|
||||
|
||||
export interface VariableFilterItemProps {
|
||||
@@ -151,7 +151,7 @@ export const VariableFilterItem: React.FC<VariableFilterItemProps> = observer(
|
||||
value.operator = operatorValue;
|
||||
const cur = operatorMetaList.find((op) => op.value === operatorValue);
|
||||
if (cur?.noValue) {
|
||||
value.value = '';
|
||||
value.value = true;
|
||||
}
|
||||
},
|
||||
[operatorMetaList, value],
|
||||
|
||||
@@ -265,19 +265,29 @@ export function useBeforeUpload(rules) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return useCallback(
|
||||
(file) => {
|
||||
const error = validate(file, rules);
|
||||
|
||||
if (error) {
|
||||
file.status = 'error';
|
||||
file.response = t(error);
|
||||
} else {
|
||||
if (file.status === 'error') {
|
||||
delete file.status;
|
||||
delete file.response;
|
||||
(file, fileList) => {
|
||||
let proxiedFile = file;
|
||||
if (!file.type) {
|
||||
const extname = file.name?.match(/\.[^.]+$/)?.[0];
|
||||
if (extname) {
|
||||
proxiedFile = new File([file], file.name, {
|
||||
type: mime.getType(extname) || 'application/octet-stream',
|
||||
lastModified: file.lastModified,
|
||||
});
|
||||
}
|
||||
}
|
||||
return !error;
|
||||
const error = validate(proxiedFile, rules);
|
||||
|
||||
if (error) {
|
||||
proxiedFile.status = 'error';
|
||||
proxiedFile.response = t(error);
|
||||
} else {
|
||||
if (proxiedFile.status === 'error') {
|
||||
delete proxiedFile.status;
|
||||
delete proxiedFile.response;
|
||||
}
|
||||
}
|
||||
return error ? false : proxiedFile;
|
||||
},
|
||||
[rules],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user