🐛 Removing act type choose in ask documents

This commit is contained in:
Maxime Lalo 2023-04-27 10:46:52 +02:00
parent 39cba4981f
commit 10f7f08121

View File

@ -4,7 +4,7 @@ import CheckBox from "@Front/Components/DesignSystem/CheckBox";
import Form, { IApiFormErrors } from "@Front/Components/DesignSystem/Form"; import Form, { IApiFormErrors } from "@Front/Components/DesignSystem/Form";
import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField"; import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField";
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm"; import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
import Select, { IOption } from "@Front/Components/DesignSystem/Select"; import { IOption } from "@Front/Components/DesignSystem/Select";
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
import BackArrow from "@Front/Components/Elements/BackArrow"; import BackArrow from "@Front/Components/Elements/BackArrow";
import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
@ -15,19 +15,12 @@ import classes from "./classes.module.scss";
type IProps = {}; type IProps = {};
type IState = { type IState = {
actType: IOption | null;
isCreateDocumentModalVisible: boolean; isCreateDocumentModalVisible: boolean;
documentName: string; documentName: string;
visibleDescription: string; visibleDescription: string;
}; };
export default class AskDocuments extends BasePage<IProps, IState> { export default class AskDocuments extends BasePage<IProps, IState> {
private actsOptions: IOption[] = [
{ label: "Divorce", value: "divorce" },
{ label: "Succession", value: "succession" },
{ label: "Vente immobilière", value: "vente_immobiliere" },
];
private documentsType: IOption[] = [ private documentsType: IOption[] = [
{ label: "Carte d'identité", value: "carte_identite" }, { label: "Carte d'identité", value: "carte_identite" },
{ label: "Diagnostic État Risques et Pollution", value: "diagnostic_erep" }, { label: "Diagnostic État Risques et Pollution", value: "diagnostic_erep" },
@ -46,13 +39,11 @@ export default class AskDocuments extends BasePage<IProps, IState> {
super(props); super(props);
this.state = { this.state = {
actType: null,
isCreateDocumentModalVisible: false, isCreateDocumentModalVisible: false,
documentName: "", documentName: "",
visibleDescription: "", visibleDescription: "",
}; };
this.onActTypeChange = this.onActTypeChange.bind(this);
this.onFormSubmit = this.onFormSubmit.bind(this); this.onFormSubmit = this.onFormSubmit.bind(this);
this.closeModal = this.closeModal.bind(this); this.closeModal = this.closeModal.bind(this);
this.openModal = this.openModal.bind(this); this.openModal = this.openModal.bind(this);
@ -73,18 +64,9 @@ export default class AskDocuments extends BasePage<IProps, IState> {
</Typography> </Typography>
<Form onSubmit={this.onFormSubmit}> <Form onSubmit={this.onFormSubmit}>
<div className={classes["form-container"]}> <div className={classes["form-container"]}>
{!this.state.actType && (
<Select options={this.actsOptions} placeholder={"Type dacte"} onChange={this.onActTypeChange} />
)}
{this.state.actType && (
<>
<div className={classes["checkbox-container"]}> <div className={classes["checkbox-container"]}>
{this.documentsType.map((documentType) => ( {this.documentsType.map((documentType) => (
<CheckBox <CheckBox toolTip="Checkbox with tooltip" option={documentType} key={documentType.value as string} />
toolTip="Checkbox with tooltip"
option={documentType}
key={documentType.value as string}
/>
))} ))}
</div> </div>
<div className={classes["add-document-container"]}> <div className={classes["add-document-container"]}>
@ -103,8 +85,6 @@ export default class AskDocuments extends BasePage<IProps, IState> {
</Button> </Button>
<Button type="submit">Valider</Button> <Button type="submit">Valider</Button>
</div> </div>
</>
)}
</div> </div>
</Form> </Form>
<Confirm <Confirm
@ -166,7 +146,6 @@ export default class AskDocuments extends BasePage<IProps, IState> {
private cancel() { private cancel() {
this.setState({ this.setState({
actType: null,
visibleDescription: "", visibleDescription: "",
documentName: "", documentName: "",
}); });
@ -188,12 +167,6 @@ export default class AskDocuments extends BasePage<IProps, IState> {
}); });
} }
private onActTypeChange(selectedOption: IOption) {
this.setState({
actType: selectedOption,
});
}
private onFormSubmit( private onFormSubmit(
e: React.FormEvent<HTMLFormElement> | null, e: React.FormEvent<HTMLFormElement> | null,
values: { values: {