mirror of
https://github.com/docmost/docmost.git
synced 2025-11-23 09:21:10 +10:00
rename column
This commit is contained in:
@ -16,7 +16,7 @@ const ssoSchema = z.object({
|
|||||||
oidcClientSecret: z.string().min(1, "Client secret is required"),
|
oidcClientSecret: z.string().min(1, "Client secret is required"),
|
||||||
isEnabled: z.boolean(),
|
isEnabled: z.boolean(),
|
||||||
allowSignup: z.boolean(),
|
allowSignup: z.boolean(),
|
||||||
isGroupSyncEnabled: z.boolean(),
|
groupSync: z.boolean(),
|
||||||
});
|
});
|
||||||
|
|
||||||
type SSOFormValues = z.infer<typeof ssoSchema>;
|
type SSOFormValues = z.infer<typeof ssoSchema>;
|
||||||
@ -37,7 +37,7 @@ export function SsoOIDCForm({ provider, onClose }: SsoFormProps) {
|
|||||||
oidcClientSecret: provider.oidcClientSecret || "",
|
oidcClientSecret: provider.oidcClientSecret || "",
|
||||||
isEnabled: provider.isEnabled,
|
isEnabled: provider.isEnabled,
|
||||||
allowSignup: provider.allowSignup,
|
allowSignup: provider.allowSignup,
|
||||||
isGroupSyncEnabled: provider.isGroupSyncEnabled || false,
|
groupSync: provider.groupSync || false,
|
||||||
},
|
},
|
||||||
validate: zodResolver(ssoSchema),
|
validate: zodResolver(ssoSchema),
|
||||||
});
|
});
|
||||||
@ -69,8 +69,8 @@ export function SsoOIDCForm({ provider, onClose }: SsoFormProps) {
|
|||||||
if (form.isDirty("allowSignup")) {
|
if (form.isDirty("allowSignup")) {
|
||||||
ssoData.allowSignup = values.allowSignup;
|
ssoData.allowSignup = values.allowSignup;
|
||||||
}
|
}
|
||||||
if (form.isDirty("isGroupSyncEnabled")) {
|
if (form.isDirty("groupSync")) {
|
||||||
ssoData.isGroupSyncEnabled = values.isGroupSyncEnabled;
|
ssoData.groupSync = values.groupSync;
|
||||||
}
|
}
|
||||||
|
|
||||||
await updateSsoProviderMutation.mutateAsync(ssoData);
|
await updateSsoProviderMutation.mutateAsync(ssoData);
|
||||||
@ -128,8 +128,8 @@ export function SsoOIDCForm({ provider, onClose }: SsoFormProps) {
|
|||||||
<div>{t("Group sync")}</div>
|
<div>{t("Group sync")}</div>
|
||||||
<Switch
|
<Switch
|
||||||
className={classes.switch}
|
className={classes.switch}
|
||||||
checked={form.values.isGroupSyncEnabled}
|
checked={form.values.groupSync}
|
||||||
{...form.getInputProps("isGroupSyncEnabled")}
|
{...form.getInputProps("groupSync")}
|
||||||
/>
|
/>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ const ssoSchema = z.object({
|
|||||||
samlCertificate: z.string().min(1, "SAML Idp Certificate is required"),
|
samlCertificate: z.string().min(1, "SAML Idp Certificate is required"),
|
||||||
isEnabled: z.boolean(),
|
isEnabled: z.boolean(),
|
||||||
allowSignup: z.boolean(),
|
allowSignup: z.boolean(),
|
||||||
isGroupSyncEnabled: z.boolean(),
|
groupSync: z.boolean(),
|
||||||
});
|
});
|
||||||
|
|
||||||
type SSOFormValues = z.infer<typeof ssoSchema>;
|
type SSOFormValues = z.infer<typeof ssoSchema>;
|
||||||
@ -46,7 +46,7 @@ export function SsoSamlForm({ provider, onClose }: SsoFormProps) {
|
|||||||
samlCertificate: provider.samlCertificate || "",
|
samlCertificate: provider.samlCertificate || "",
|
||||||
isEnabled: provider.isEnabled,
|
isEnabled: provider.isEnabled,
|
||||||
allowSignup: provider.allowSignup,
|
allowSignup: provider.allowSignup,
|
||||||
isGroupSyncEnabled: provider.isGroupSyncEnabled || false,
|
groupSync: provider.groupSync || false,
|
||||||
},
|
},
|
||||||
validate: zodResolver(ssoSchema),
|
validate: zodResolver(ssoSchema),
|
||||||
});
|
});
|
||||||
@ -77,8 +77,8 @@ export function SsoSamlForm({ provider, onClose }: SsoFormProps) {
|
|||||||
if (form.isDirty("allowSignup")) {
|
if (form.isDirty("allowSignup")) {
|
||||||
ssoData.allowSignup = values.allowSignup;
|
ssoData.allowSignup = values.allowSignup;
|
||||||
}
|
}
|
||||||
if (form.isDirty("isGroupSyncEnabled")) {
|
if (form.isDirty("groupSync")) {
|
||||||
ssoData.isGroupSyncEnabled = values.isGroupSyncEnabled;
|
ssoData.groupSync = values.groupSync;
|
||||||
}
|
}
|
||||||
|
|
||||||
await updateSsoProviderMutation.mutateAsync(ssoData);
|
await updateSsoProviderMutation.mutateAsync(ssoData);
|
||||||
@ -141,8 +141,8 @@ export function SsoSamlForm({ provider, onClose }: SsoFormProps) {
|
|||||||
<div>{t("Group sync")}</div>
|
<div>{t("Group sync")}</div>
|
||||||
<Switch
|
<Switch
|
||||||
className={classes.switch}
|
className={classes.switch}
|
||||||
checked={form.values.isGroupSyncEnabled}
|
checked={form.values.groupSync}
|
||||||
{...form.getInputProps("isGroupSyncEnabled")}
|
{...form.getInputProps("groupSync")}
|
||||||
/>
|
/>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ export interface IAuthProvider {
|
|||||||
oidcClientSecret: string;
|
oidcClientSecret: string;
|
||||||
allowSignup: boolean;
|
allowSignup: boolean;
|
||||||
isEnabled: boolean;
|
isEnabled: boolean;
|
||||||
isGroupSyncEnabled: boolean;
|
groupSync: boolean;
|
||||||
creatorId: string;
|
creatorId: string;
|
||||||
workspaceId: string;
|
workspaceId: string;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
|
|||||||
@ -3,15 +3,13 @@ import { type Kysely } from 'kysely';
|
|||||||
export async function up(db: Kysely<any>): Promise<void> {
|
export async function up(db: Kysely<any>): Promise<void> {
|
||||||
await db.schema
|
await db.schema
|
||||||
.alterTable('auth_providers')
|
.alterTable('auth_providers')
|
||||||
.addColumn('is_group_sync_enabled', 'boolean', (col) =>
|
.addColumn('group_sync', 'boolean', (col) => col.defaultTo(false).notNull())
|
||||||
col.defaultTo(false).notNull(),
|
|
||||||
)
|
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function down(db: Kysely<any>): Promise<void> {
|
export async function down(db: Kysely<any>): Promise<void> {
|
||||||
await db.schema
|
await db.schema
|
||||||
.alterTable('auth_providers')
|
.alterTable('auth_providers')
|
||||||
.dropColumn('is_group_sync_enabled')
|
.dropColumn('group_sync')// enable_group_sync
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
2
apps/server/src/database/types/db.d.ts
vendored
2
apps/server/src/database/types/db.d.ts
vendored
@ -62,7 +62,7 @@ export interface AuthProviders {
|
|||||||
deletedAt: Timestamp | null;
|
deletedAt: Timestamp | null;
|
||||||
id: Generated<string>;
|
id: Generated<string>;
|
||||||
isEnabled: Generated<boolean>;
|
isEnabled: Generated<boolean>;
|
||||||
isGroupSyncEnabled: Generated<boolean>;
|
groupSync: Generated<boolean>;
|
||||||
name: string;
|
name: string;
|
||||||
oidcClientId: string | null;
|
oidcClientId: string | null;
|
||||||
oidcClientSecret: string | null;
|
oidcClientSecret: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user