mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
fix schema modals
This commit is contained in:
@@ -33,7 +33,7 @@ export class PasswordStrategy extends Strategy<typeof schema> {
|
||||
private getPayloadSchema() {
|
||||
return s.object({
|
||||
email: s.string({
|
||||
pattern: /^[\w-\.\+_]+@([\w-]+\.)+[\w-]{2,4}$/,
|
||||
format: "email",
|
||||
}),
|
||||
password: s.string({
|
||||
minLength: 8, // @todo: this should be configurable
|
||||
|
||||
@@ -23,7 +23,7 @@ export class JsonvTsValidator<T = any, S extends StrictRJSFSchema = RJSFSchema>
|
||||
return { errors: [], validationError: null as any };
|
||||
}
|
||||
|
||||
const jsSchema = s.fromSchema(schema as any);
|
||||
const jsSchema = s.fromSchema(JSON.parse(JSON.stringify(schema)) as any);
|
||||
const result = jsSchema.validate(formData);
|
||||
|
||||
if (result.valid) {
|
||||
|
||||
@@ -65,7 +65,7 @@ export function SchemaFormModal({
|
||||
<JsonSchemaForm
|
||||
tagName="form"
|
||||
ref={formRef}
|
||||
schema={schema}
|
||||
schema={JSON.parse(JSON.stringify(schema))}
|
||||
uiSchema={uiSchema}
|
||||
className="legacy hide-required-mark fieldset-alternative mute-root"
|
||||
onChange={handleChange}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Button } from "../../components/buttons/Button";
|
||||
import { CellValue, DataTable } from "../../components/table/DataTable";
|
||||
import * as AppShell from "../../layouts/AppShell/AppShell";
|
||||
import { routes, useNavigate } from "../../lib/routes";
|
||||
import { stringIdentifier } from "bknd/core";
|
||||
import { s, stringIdentifier } from "bknd/core";
|
||||
|
||||
export function AuthRolesList() {
|
||||
const [navigate] = useNavigate();
|
||||
@@ -29,13 +29,9 @@ export function AuthRolesList() {
|
||||
bkndModals.open(
|
||||
"form",
|
||||
{
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
name: stringIdentifier,
|
||||
},
|
||||
required: ["name"],
|
||||
},
|
||||
schema: s.strictObject({
|
||||
name: stringIdentifier,
|
||||
}),
|
||||
uiSchema: {
|
||||
name: {
|
||||
"ui:title": "Role name",
|
||||
|
||||
Reference in New Issue
Block a user