Added framework for CSI questions & viewing. Schema changes to allow anon viewing of survey BOD-98
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import React from "react";
|
||||
import { Form, Checkbox } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function JobIntakeFormCheckboxComponent({ formItem }) {
|
||||
const { name, label, required } = formItem;
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Form.Item
|
||||
name={name}
|
||||
label={label}
|
||||
valuePropName='checked'
|
||||
rules={[
|
||||
{
|
||||
required: required,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}>
|
||||
<Checkbox />
|
||||
</Form.Item>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import React from "react";
|
||||
import CheckboxFormItem from "./checkbox/checkbox.component";
|
||||
import Slider from "./slider/slider.component";
|
||||
import Text from "./text/text.component";
|
||||
import Textarea from "./textarea/textarea.component";
|
||||
import Rate from "./rate/rate.component";
|
||||
|
||||
export default function ConfirmFormComponents({ componentList }) {
|
||||
return (
|
||||
<div>
|
||||
{componentList.map((f, idx) => {
|
||||
switch (f.type) {
|
||||
case "checkbox":
|
||||
return <CheckboxFormItem key={idx} formItem={f} />;
|
||||
case "slider":
|
||||
return <Slider key={idx} formItem={f} />;
|
||||
case "text":
|
||||
return <Text key={idx} formItem={f} />;
|
||||
case "textarea":
|
||||
return <Textarea key={idx} formItem={f} />;
|
||||
case "rate":
|
||||
return <Rate key={idx} formItem={f} />;
|
||||
default:
|
||||
return <div key={idx}>Error</div>;
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import React from "react";
|
||||
import { Form, Rate } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function JobIntakeFormCheckboxComponent({ formItem }) {
|
||||
const { name, label, required } = formItem;
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Form.Item
|
||||
name={name}
|
||||
label={label}
|
||||
rules={[
|
||||
{
|
||||
required: required,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}>
|
||||
<Rate allowHalf />
|
||||
</Form.Item>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Form, Slider } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function JobIntakeFormCheckboxComponent({ formItem }) {
|
||||
const { name, label, required, min, max } = formItem;
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Form.Item
|
||||
name={name}
|
||||
label={label}
|
||||
rules={[
|
||||
{
|
||||
required: required,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}>
|
||||
<Slider min={min || 0} max={max || 10} />
|
||||
</Form.Item>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import React from "react";
|
||||
import { Form, Input } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function JobIntakeFormCheckboxComponent({ formItem }) {
|
||||
const { name, label, required } = formItem;
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Form.Item
|
||||
name={name}
|
||||
label={label}
|
||||
rules={[
|
||||
{
|
||||
required: required,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import React from "react";
|
||||
import { Form, Input } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function JobIntakeFormCheckboxComponent({ formItem }) {
|
||||
const { name, label, required, rows } = formItem;
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Form.Item
|
||||
name={name}
|
||||
label={label}
|
||||
rules={[
|
||||
{
|
||||
required: required,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}>
|
||||
<Input.TextArea rows={rows || 4} />
|
||||
</Form.Item>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user