Shaping CurrentFirmSchemaCreate arch
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import {FormContextType, getTemplate, RJSFSchema, StrictRJSFSchema, WidgetProps} from "@rjsf/utils";
|
||||
|
||||
import ForeignKeyWidget from "./foreign-key";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
export default function CrudTextWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
|
||||
props: WidgetProps<T, S, F>
|
||||
) {
|
||||
if (props.schema.hasOwnProperty("foreign_key")) {
|
||||
const { schema } = props;
|
||||
if (schema.hasOwnProperty("foreign_key")) {
|
||||
return (<ForeignKeyWidget {...props} />);
|
||||
} else if (schema.hasOwnProperty("const")) {
|
||||
return <Typography >{schema.const as string}</Typography>;
|
||||
} else {
|
||||
const { options, registry } = props;
|
||||
const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);
|
||||
|
||||
@@ -49,7 +49,14 @@ const FirmInitForm = (props: FirmInitFormPros) => {
|
||||
return (
|
||||
<>
|
||||
<h1>Initialization of {`${currentFirm.instance} / ${currentFirm.firm}`}</h1>
|
||||
<CrudForm schemaName={"CurrentFirmSchemaCreate"} resource={`/firm/${currentFirm.instance}/${currentFirm.firm}`} />
|
||||
|
||||
<CrudForm
|
||||
schemaName={"CurrentFirmSchemaCreate"}
|
||||
resource={`firm/${currentFirm.instance}/${currentFirm.firm}/`}
|
||||
uiSchema={{
|
||||
corporation: {entity_data: {employees: {"ui:style": {"display": "none"}}}},
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user