Merge branch 'dev' into staging
This commit is contained in:
commit
adb38fd35c
30
package-lock.json
generated
30
package-lock.json
generated
@ -461,9 +461,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@floating-ui/utils": {
|
"node_modules/@floating-ui/utils": {
|
||||||
"version": "0.1.4",
|
"version": "0.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz",
|
||||||
"integrity": "sha512-qprfWkn82Iw821mcKofJ5Pk9wgioHicxcQMxx+5zt5GSKoqdWvgG5AxVmpmUUjzTLPVSH5auBrhI93Deayn/DA=="
|
"integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A=="
|
||||||
},
|
},
|
||||||
"node_modules/@humanwhocodes/config-array": {
|
"node_modules/@humanwhocodes/config-array": {
|
||||||
"version": "0.11.11",
|
"version": "0.11.11",
|
||||||
@ -965,9 +965,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rushstack/eslint-patch": {
|
"node_modules/@rushstack/eslint-patch": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.5.1.tgz",
|
||||||
"integrity": "sha512-EF3948ckf3f5uPgYbQ6GhyA56Dmv8yg0+ir+BroRjwdxyZJsekhZzawOecC2rOTPCz173t7ZcR1HHZu0dZgOCw=="
|
"integrity": "sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA=="
|
||||||
},
|
},
|
||||||
"node_modules/@swc/helpers": {
|
"node_modules/@swc/helpers": {
|
||||||
"version": "0.4.14",
|
"version": "0.4.14",
|
||||||
@ -993,9 +993,9 @@
|
|||||||
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
|
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/prop-types": {
|
"node_modules/@types/prop-types": {
|
||||||
"version": "15.7.7",
|
"version": "15.7.8",
|
||||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.8.tgz",
|
||||||
"integrity": "sha512-FbtmBWCcSa2J4zL781Zf1p5YUBXQomPEcep9QZCfRfQgTxz3pJWiDFLebohZ9fFntX5ibzOkSsrJ0TEew8cAog=="
|
"integrity": "sha512-kMpQpfZKSCBqltAJwskgePRaYRFukDkm1oItcAbC3gNELR20XIBcN9VRgg4+m8DKsTfkWeA4m4Imp4DDuWy7FQ=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/react": {
|
"node_modules/@types/react": {
|
||||||
"version": "18.0.28",
|
"version": "18.0.28",
|
||||||
@ -1507,9 +1507,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001541",
|
"version": "1.0.30001542",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001542.tgz",
|
||||||
"integrity": "sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==",
|
"integrity": "sha512-UrtAXVcj1mvPBFQ4sKd38daP8dEcXXr5sQe6QNNinaPd0iA/cxg9/l3VrSdL73jgw5sKyuQ6jNgiKO12W3SsVA==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@ -4067,9 +4067,9 @@
|
|||||||
"integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
|
"integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
|
||||||
},
|
},
|
||||||
"node_modules/react-select": {
|
"node_modules/react-select": {
|
||||||
"version": "5.7.5",
|
"version": "5.7.7",
|
||||||
"resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.5.tgz",
|
"resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.7.tgz",
|
||||||
"integrity": "sha512-jgYZa2xgKP0DVn5GZk7tZwbRx7kaVz1VqU41S8z1KWmshRDhlrpKS0w80aS1RaK5bVIXpttgSou7XCjWw1ncKA==",
|
"integrity": "sha512-HhashZZJDRlfF/AKj0a0Lnfs3sRdw/46VJIRd8IbB9/Ovr74+ZIwkAdSBjSPXsFMG+u72c5xShqwLSKIJllzqw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.12.0",
|
"@babel/runtime": "^7.12.0",
|
||||||
"@emotion/cache": "^11.4.0",
|
"@emotion/cache": "^11.4.0",
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.85",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.88",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
@ -15,5 +15,6 @@ export enum AppRuleNames {
|
|||||||
officeFolders = "folders",
|
officeFolders = "folders",
|
||||||
officeRoles = "office-roles",
|
officeRoles = "office-roles",
|
||||||
deedTypes = "deed-types",
|
deedTypes = "deed-types",
|
||||||
offices = "offices"
|
offices = "offices",
|
||||||
|
documents = "documents",
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Appointment } from "le-coffre-resources/dist/SuperAdmin";
|
import { Appointment, Vote } from "le-coffre-resources/dist/SuperAdmin";
|
||||||
|
|
||||||
import BaseSuperAdmin from "../BaseSuperAdmin";
|
import BaseSuperAdmin from "../BaseSuperAdmin";
|
||||||
|
|
||||||
@ -18,6 +18,9 @@ export type LiveVote = {
|
|||||||
appointment: Appointment;
|
appointment: Appointment;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type IDeleteVotesParams = {
|
||||||
|
uid: Vote["uid"];
|
||||||
|
};
|
||||||
export default class LiveVotes extends BaseSuperAdmin {
|
export default class LiveVotes extends BaseSuperAdmin {
|
||||||
private static instance: LiveVotes;
|
private static instance: LiveVotes;
|
||||||
private readonly baseURl = this.namespaceUrl.concat("/live-votes");
|
private readonly baseURl = this.namespaceUrl.concat("/live-votes");
|
||||||
@ -46,4 +49,17 @@ export default class LiveVotes extends BaseSuperAdmin {
|
|||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description : Delete a vote
|
||||||
|
*/
|
||||||
|
public async delete(body: IDeleteVotesParams): Promise<Vote> {
|
||||||
|
const url = new URL(`${this.baseURl}/${body.uid}`);
|
||||||
|
try {
|
||||||
|
return await this.deleteRequest<Vote>(url, body);
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
import { Vote } from "le-coffre-resources/dist/SuperAdmin";
|
|
||||||
|
|
||||||
import BaseSuperAdmin from "../BaseSuperAdmin";
|
|
||||||
|
|
||||||
// TODO Type get query params -> Where + inclue + orderby
|
|
||||||
export interface IGetVotessparams {
|
|
||||||
where?: {};
|
|
||||||
include?: {};
|
|
||||||
select?: {};
|
|
||||||
}
|
|
||||||
|
|
||||||
export type IDeleteVotesParams = {
|
|
||||||
uid: Vote["uid"];
|
|
||||||
};
|
|
||||||
|
|
||||||
export default class Votes extends BaseSuperAdmin {
|
|
||||||
private static instance: Votes;
|
|
||||||
private readonly baseURl = this.namespaceUrl.concat("/votes");
|
|
||||||
|
|
||||||
private constructor() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static getInstance() {
|
|
||||||
if (!this.instance) {
|
|
||||||
return new this();
|
|
||||||
} else {
|
|
||||||
return this.instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description : Create a Votes
|
|
||||||
*/
|
|
||||||
public async delete(body: IDeleteVotesParams): Promise<Vote> {
|
|
||||||
const url = new URL(this.baseURl + "/" + body.uid);
|
|
||||||
try {
|
|
||||||
return await this.deleteRequest<Vote>(url, body);
|
|
||||||
} catch (err) {
|
|
||||||
this.onError(err);
|
|
||||||
return Promise.reject(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -71,7 +71,7 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
return (
|
return (
|
||||||
<Confirm
|
<Confirm
|
||||||
isOpen={this.state.isAddDocumentModalVisible}
|
isOpen={this.state.isAddDocumentModalVisible}
|
||||||
onClose={() => {}}
|
onClose={this.props.onClose!}
|
||||||
onAccept={this.onAccept}
|
onAccept={this.onAccept}
|
||||||
closeBtn
|
closeBtn
|
||||||
header={"Ajouter un document"}
|
header={"Ajouter un document"}
|
||||||
|
@ -10,6 +10,8 @@ import Typography, { ITypo } from "../../Typography";
|
|||||||
import WarningBadge from "../../WarningBadge";
|
import WarningBadge from "../../WarningBadge";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document";
|
import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document";
|
||||||
|
import Rules, { RulesMode } from "@Front/Components/Elements/Rules";
|
||||||
|
import { AppRuleActions, AppRuleNames } from "@Front/Api/Entities/rule";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
folderUid: string;
|
folderUid: string;
|
||||||
@ -60,8 +62,11 @@ class DocumentNotaryClass extends React.Component<IPropsClass, IState> {
|
|||||||
} else {
|
} else {
|
||||||
const archivedFilesLength = documentFiles.filter((file) => file.archived_at).length;
|
const archivedFilesLength = documentFiles.filter((file) => file.archived_at).length;
|
||||||
const documentFileLength = documentFiles.length - archivedFilesLength;
|
const documentFileLength = documentFiles.length - archivedFilesLength;
|
||||||
if(this.props.document.document_status === EDocumentStatus.ASKED || this.props.document.document_status === EDocumentStatus.REFUSED){
|
if (
|
||||||
return 'Aucun document déposé';
|
this.props.document.document_status === EDocumentStatus.ASKED ||
|
||||||
|
this.props.document.document_status === EDocumentStatus.REFUSED
|
||||||
|
) {
|
||||||
|
return "Aucun document déposé";
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${documentFileLength} documents déposés`;
|
return `${documentFileLength} documents déposés`;
|
||||||
@ -91,7 +96,18 @@ class DocumentNotaryClass extends React.Component<IPropsClass, IState> {
|
|||||||
case EDocumentStatus.DEPOSITED:
|
case EDocumentStatus.DEPOSITED:
|
||||||
return <WarningBadge />;
|
return <WarningBadge />;
|
||||||
default:
|
default:
|
||||||
return <Image src={TrashIcon} alt="trash icon" className={classes["trash"]} onClick={this.onOpenDeletionModal} />;
|
return (
|
||||||
|
<Rules
|
||||||
|
mode={RulesMode.NECESSARY}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
action: AppRuleActions.delete,
|
||||||
|
name: AppRuleNames.documents,
|
||||||
|
},
|
||||||
|
]}>
|
||||||
|
<Image src={TrashIcon} alt="trash icon" className={classes["trash"]} onClick={this.onOpenDeletionModal} />
|
||||||
|
</Rules>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ type IState = {
|
|||||||
hasValidateAnchoring: boolean;
|
hasValidateAnchoring: boolean;
|
||||||
isVerifDeleteModalVisible: boolean;
|
isVerifDeleteModalVisible: boolean;
|
||||||
isAnchored: boolean | null;
|
isAnchored: boolean | null;
|
||||||
|
isPreventArchiveModalOpen: boolean;
|
||||||
};
|
};
|
||||||
class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||||
public constructor(props: IPropsClass) {
|
public constructor(props: IPropsClass) {
|
||||||
@ -49,6 +50,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
hasValidateAnchoring: false,
|
hasValidateAnchoring: false,
|
||||||
isVerifDeleteModalVisible: false,
|
isVerifDeleteModalVisible: false,
|
||||||
isAnchored: null,
|
isAnchored: null,
|
||||||
|
isPreventArchiveModalOpen: false,
|
||||||
};
|
};
|
||||||
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
||||||
this.openArchivedModal = this.openArchivedModal.bind(this);
|
this.openArchivedModal = this.openArchivedModal.bind(this);
|
||||||
@ -63,6 +65,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
this.openVerifDeleteFolder = this.openVerifDeleteFolder.bind(this);
|
this.openVerifDeleteFolder = this.openVerifDeleteFolder.bind(this);
|
||||||
this.closeVerifDeleteFolder = this.closeVerifDeleteFolder.bind(this);
|
this.closeVerifDeleteFolder = this.closeVerifDeleteFolder.bind(this);
|
||||||
this.verifyAnchorStatus = this.verifyAnchorStatus.bind(this);
|
this.verifyAnchorStatus = this.verifyAnchorStatus.bind(this);
|
||||||
|
this.closePreventArchiveModal = this.closePreventArchiveModal.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Message if the user has not created any folder yet
|
// TODO: Message if the user has not created any folder yet
|
||||||
@ -174,6 +177,22 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<Confirm
|
||||||
|
isOpen={this.state.isPreventArchiveModalOpen}
|
||||||
|
onAccept={this.closePreventArchiveModal}
|
||||||
|
onClose={this.closePreventArchiveModal}
|
||||||
|
closeBtn
|
||||||
|
header={"Vous devez valider et certifier un dossier avant de pouvoir l'archiver"}
|
||||||
|
cancelText={"Annuler"}
|
||||||
|
confirmText={"J'ai compris"}>
|
||||||
|
<div className={classes["modal-title"]}>
|
||||||
|
<Typography typo={ITypo.P_16}>
|
||||||
|
Pour valider un dossier, toutes les pièces envoyées par vos clients doivent être validées (vert). Si certains
|
||||||
|
documents sont en attente (orange), alors, veuillez les valider ou les refuser et veillez à ce qu'aucun document
|
||||||
|
ne soit encore en demandé au client (gris)
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
</Confirm>
|
||||||
<Confirm
|
<Confirm
|
||||||
isOpen={this.state.isValidateModalVisible}
|
isOpen={this.state.isValidateModalVisible}
|
||||||
onClose={this.closeModal}
|
onClose={this.closeModal}
|
||||||
@ -225,6 +244,12 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private closePreventArchiveModal() {
|
||||||
|
this.setState({
|
||||||
|
isPreventArchiveModalOpen: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private async verifyAnchorStatus() {
|
private async verifyAnchorStatus() {
|
||||||
if (!this.state.selectedFolder || !this.state.selectedFolder.uid) return;
|
if (!this.state.selectedFolder || !this.state.selectedFolder.uid) return;
|
||||||
try {
|
try {
|
||||||
@ -352,7 +377,11 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private openArchivedModal(): void {
|
private openArchivedModal(): void {
|
||||||
this.setState({ isArchivedModalOpen: true });
|
if (this.everyDocumentValidated() && this.state.isAnchored) {
|
||||||
|
this.setState({ isArchivedModalOpen: true });
|
||||||
|
} else {
|
||||||
|
this.setState({ isPreventArchiveModalOpen: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private closeArchivedModal(): void {
|
private closeArchivedModal(): void {
|
||||||
|
@ -3,7 +3,6 @@ import WarningIcon from "@Assets/images/warning.png";
|
|||||||
import Roles from "@Front/Api/LeCoffreApi/Admin/Roles/Roles";
|
import Roles from "@Front/Api/LeCoffreApi/Admin/Roles/Roles";
|
||||||
import LiveVotes from "@Front/Api/LeCoffreApi/SuperAdmin/LiveVotes/LiveVotes";
|
import LiveVotes from "@Front/Api/LeCoffreApi/SuperAdmin/LiveVotes/LiveVotes";
|
||||||
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
||||||
import Votes from "@Front/Api/LeCoffreApi/SuperAdmin/Votes/Votes";
|
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
||||||
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
||||||
@ -224,7 +223,7 @@ export default function UserInformations(props: IProps) {
|
|||||||
const user = JwtService.getInstance().decodeJwt();
|
const user = JwtService.getInstance().decodeJwt();
|
||||||
const vote = currentAppointment.votes?.find((vote) => vote.voter?.uid === user?.userId);
|
const vote = currentAppointment.votes?.find((vote) => vote.voter?.uid === user?.userId);
|
||||||
if (!vote) return;
|
if (!vote) return;
|
||||||
await Votes.getInstance().delete({ uid: vote.uid });
|
await LiveVotes.getInstance().delete({ uid: vote.uid });
|
||||||
await getUser();
|
await getUser();
|
||||||
}, [currentAppointment, getUser]);
|
}, [currentAppointment, getUser]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user