fix: improve code

This commit is contained in:
chenos 2023-10-29 18:26:54 +08:00
parent e1c30f25e2
commit f508f6bcf1
5 changed files with 38 additions and 5 deletions

View File

@ -18,7 +18,7 @@ export const Options = () => {
allowSignup: {
'x-decorator': 'FormItem',
type: 'boolean',
title: '{{t("Allow to sign up")}}',
'x-content': '{{t("Allow to sign up")}}',
'x-component': 'Checkbox',
'x-component-props': {
defaultChecked: true,

View File

@ -38,8 +38,9 @@ const collection = {
name: 'authType',
uiSchema: {
type: 'string',
title: '{{t("Auth Type")}}',
title: '{{t("Auth type")}}',
'x-component': 'Select',
'x-disabled': true,
dataSource: '{{ types }}',
required: true,
},
@ -69,7 +70,7 @@ const collection = {
name: 'enabled',
uiSchema: {
type: 'boolean',
title: '{{t("Enabled")}}',
'x-content': '{{t("Enabled the auth type")}}',
'x-component': 'Checkbox',
},
},
@ -108,6 +109,7 @@ export const createFormSchema: ISchema = {
authType: {
'x-component': 'CollectionField',
'x-decorator': 'FormItem',
'x-disabled': true,
'x-component-props': {
options: '{{ types }}',
},
@ -123,6 +125,9 @@ export const createFormSchema: ISchema = {
enabled: {
'x-component': 'CollectionField',
'x-decorator': 'FormItem',
'x-decorator-props': {
marginBottom: 0,
},
},
options: {
type: 'object',
@ -299,6 +304,7 @@ export const authenticatorsSchema: ISchema = {
type: 'void',
'x-decorator': 'Table.Column.Decorator',
'x-component': 'Table.Column',
title: '{{t("Enabled")}}',
properties: {
enabled: {
type: 'boolean',

View File

@ -15,7 +15,7 @@ export const Options = () => {
autoSignup: {
'x-decorator': 'FormItem',
type: 'boolean',
title: '{{t("Sign up automatically when the user does not exist")}}',
'x-content': '{{t("Sign up automatically when the user does not exist")}}',
'x-component': 'Checkbox',
},
casUrl: {

View File

@ -23,7 +23,6 @@ export class PresetNocoBase extends Plugin {
'duplicator',
'iframe-block',
'formula-field',
'charts',
'data-visualization',
'auth',
'sms-auth',
@ -31,6 +30,7 @@ export class PresetNocoBase extends Plugin {
];
localPlugins = [
['charts', '0.9.1-alpha.2'],
['audit-logs', '0.7.1-alpha.4'],
['sample-hello', '0.8.0-alpha.4'],
['multi-app-manager', '0.7.0-alpha.1'],

View File

@ -0,0 +1,27 @@
import { Migration } from '@nocobase/server';
export default class SetAuditPluginAsLocalMigration extends Migration {
async up() {
const version = await this.app.version.satisfies('<=0.14.0-alpha.8');
if (!version) {
return;
}
const repository = this.context.db.getRepository('applicationPlugins');
const audit = await repository.findOne({
filter: {
name: 'charts',
},
});
if (!audit) {
return;
}
await repository.update({
values: {
builtIn: false,
},
filter: {
name: 'charts',
},
});
}
}