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