fix(file-manager): improve initialization logic (#2834)

This commit is contained in:
chenos 2023-10-15 16:00:21 +08:00 committed by GitHub
parent a51df00750
commit 5fbce9fb65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 4 deletions

View File

@ -76,7 +76,7 @@ export const CreateStorage = () => {
{t('Add new')}
</Button>
</Dropdown>
<SchemaComponent schema={schema} />
<SchemaComponent scope={{ createOnly: true }} schema={schema} />
</ActionContext.Provider>
</div>
);
@ -99,7 +99,7 @@ export const EditStorage = () => {
setSchema({
type: 'object',
properties: {
drawer: {
[uid()]: {
type: 'void',
'x-component': 'Action.Drawer',
'x-decorator': 'Form',
@ -140,7 +140,7 @@ export const EditStorage = () => {
>
{t('Edit')}
</a>
<SchemaComponent schema={schema} />
<SchemaComponent scope={{ createOnly: false }} schema={schema} />
</ActionContext.Provider>
</div>
);

View File

@ -179,10 +179,10 @@ export const storageSchema: ISchema = {
type: 'void',
'x-decorator': 'Table.Column.Decorator',
'x-component': 'Table.Column',
title: `{{t("Default storage", { ns: "${NAMESPACE}" })}}`,
properties: {
default: {
type: 'string',
title: `{{t("Default storage", { ns: "${NAMESPACE}" })}}`,
'x-component': 'CollectionField',
'x-read-pretty': true,
},

View File

@ -11,6 +11,7 @@ export default {
name: {
'x-component': 'CollectionField',
'x-decorator': 'FormItem',
'x-disabled': '{{ !createOnly }}',
description:
'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}',
},

View File

@ -11,6 +11,7 @@ export default {
name: {
'x-component': 'CollectionField',
'x-decorator': 'FormItem',
'x-disabled': '{{ !createOnly }}',
description:
'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}',
},

View File

@ -11,6 +11,7 @@ export default {
name: {
'x-component': 'CollectionField',
'x-decorator': 'FormItem',
'x-disabled': '{{ !createOnly }}',
description:
'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}',
},

View File

@ -11,6 +11,7 @@ export default {
name: {
'x-component': 'CollectionField',
'x-decorator': 'FormItem',
'x-disabled': '{{ !createOnly }}',
description:
'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}',
},