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

View File

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

View File

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