From c918ba5c4045a3ae2d9cc610adbadc48606a27c1 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Wed, 10 May 2023 16:23:57 +0200 Subject: [PATCH 01/11] :bug: Fixing dynamic title in documents --- src/front/Components/DesignSystem/DepositDocument/index.tsx | 4 +--- src/front/Components/Layouts/ClientDashboard/index.tsx | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/front/Components/DesignSystem/DepositDocument/index.tsx b/src/front/Components/DesignSystem/DepositDocument/index.tsx index a43af23a..a977cb76 100644 --- a/src/front/Components/DesignSystem/DepositDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositDocument/index.tsx @@ -17,8 +17,6 @@ import Confirm from "../Modal/Confirm"; import InputField from "../Form/Elements/InputField"; type IProps = { - title: string; - dateAsked: Date; defaultFiles?: FileCustomer[]; onChange?: (files: File[]) => void; document: Document; @@ -84,7 +82,7 @@ export default class DepositDocument extends React.Component {
- {this.props.title}{" "} + {this.props.document.document_type?.name}{" "} {this.props.document.document_type?.public_description !== "" && ( )} diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index 360aa976..ba7e0bae 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -39,8 +39,6 @@ export default class ClientDashboard extends Base {
{this.state.documents?.map((document) => ( { Glissez / Déposez votre document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le document correspondant. - +
From b9e384ae0d32075f487273d831e5cf1035909888 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Wed, 10 May 2023 16:35:55 +0200 Subject: [PATCH 02/11] :bug: Forgot console.log --- src/front/Api/BaseApiService.ts | 1 - src/front/Components/DesignSystem/DepositDocument/index.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/src/front/Api/BaseApiService.ts b/src/front/Api/BaseApiService.ts index fc1b55cc..2992b609 100644 --- a/src/front/Api/BaseApiService.ts +++ b/src/front/Api/BaseApiService.ts @@ -17,7 +17,6 @@ export default abstract class BaseApiService { } protected getBaseUrl() { - console.log("BaseApiService.baseUrl", BaseApiService.baseUrl); return BaseApiService.baseUrl; } diff --git a/src/front/Components/DesignSystem/DepositDocument/index.tsx b/src/front/Components/DesignSystem/DepositDocument/index.tsx index a977cb76..fae00235 100644 --- a/src/front/Components/DesignSystem/DepositDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositDocument/index.tsx @@ -63,7 +63,6 @@ export default class DepositDocument extends React.Component { } public override render(): JSX.Element { - console.log("Reason in state : ", this.state.refusedReason); return (
Date: Wed, 10 May 2023 17:38:26 +0200 Subject: [PATCH 03/11] Removed reflect-metadata/typedi --- package-lock.json | 12 ------------ package.json | 4 +--- src/front/Api/Auth/IdNot/index.ts | 2 -- src/front/Api/LeCoffreApi/Customer/Users/Users.ts | 2 -- src/front/Api/LeCoffreApi/Notary/Users/Users.ts | 2 -- .../LeCoffreApi/SuperAdmin/Customers/Customers.ts | 2 -- .../LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes.ts | 2 -- src/front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts | 2 -- .../SuperAdmin/DocumentTypes/DocumentTypes.ts | 2 -- .../LeCoffreApi/SuperAdmin/Documents/Documents.ts | 2 -- src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts | 13 +++++-------- .../Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts | 2 -- src/front/Api/LeCoffreApi/SuperAdmin/Users/Users.ts | 2 -- .../LayoutTemplates/DefaultDoubleSidePage/index.tsx | 1 - .../DefaultNotaryDashboard/index.tsx | 1 - .../LayoutTemplates/DefaultTemplate/index.tsx | 1 - .../Components/Layouts/ClientDashboard/index.tsx | 1 - src/front/Components/Layouts/DesignSystem/index.tsx | 1 - .../Layouts/Folder/AddClientToFolder/index.tsx | 1 - .../Layouts/Folder/AskDocuments/index.tsx | 1 - .../Layouts/Folder/FolderInformation/index.tsx | 1 - .../Folder/UpdateFolderDescription/index.tsx | 1 - .../Layouts/Folder/UpdateFolderMetadata/index.tsx | 1 - .../Layouts/Folder/ViewDocuments/index.tsx | 1 - .../FolderArchived/FolderInformation/index.tsx | 1 - src/front/Services/CryptoService/CryptoService.ts | 13 +++++++++---- 26 files changed, 15 insertions(+), 59 deletions(-) diff --git a/package-lock.json b/package-lock.json index 383aea2d..641aa33c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,9 +26,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-select": "^5.7.2", - "reflect-metadata": "^0.1.13", "sass": "^1.59.2", - "typedi": "^0.10.0", "typescript": "4.9.5" } }, @@ -3906,11 +3904,6 @@ "node": ">=8.10.0" } }, - "node_modules/reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" - }, "node_modules/regenerator-runtime": { "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", @@ -4498,11 +4491,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/typedi": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/typedi/-/typedi-0.10.0.tgz", - "integrity": "sha512-v3UJF8xm68BBj6AF4oQML3ikrfK2c9EmZUyLOfShpJuItAqVBHWP/KtpGinkSsIiP6EZyyb6Z3NXyW9dgS9X1w==" - }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", diff --git a/package.json b/package.json index eac9c138..5578f5bd 100644 --- a/package.json +++ b/package.json @@ -21,16 +21,14 @@ "dotenv": "^16.0.3", "eslint": "8.36.0", "eslint-config-next": "13.2.4", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.40", "form-data": "^4.0.0", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.40", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", "react-dom": "18.2.0", "react-select": "^5.7.2", - "reflect-metadata": "^0.1.13", "sass": "^1.59.2", - "typedi": "^0.10.0", "typescript": "4.9.5" } } diff --git a/src/front/Api/Auth/IdNot/index.ts b/src/front/Api/Auth/IdNot/index.ts index d82c0a17..32f10aee 100644 --- a/src/front/Api/Auth/IdNot/index.ts +++ b/src/front/Api/Auth/IdNot/index.ts @@ -1,8 +1,6 @@ -import { Service } from "typedi"; import BaseApiService from "@Front/Api/BaseApiService"; import { FrontendVariables } from "@Front/Config/VariablesFront"; -@Service() export default class Auth extends BaseApiService { private static instance: Auth; diff --git a/src/front/Api/LeCoffreApi/Customer/Users/Users.ts b/src/front/Api/LeCoffreApi/Customer/Users/Users.ts index 9b23e782..e64928bc 100644 --- a/src/front/Api/LeCoffreApi/Customer/Users/Users.ts +++ b/src/front/Api/LeCoffreApi/Customer/Users/Users.ts @@ -1,8 +1,6 @@ -import { Service } from "typedi"; import BaseNotary from "../BaseCustomer"; import User from "le-coffre-resources/dist/Notary"; -@Service() export default class Users extends BaseNotary { private static instance: Users; private readonly baseURl = this.namespaceUrl.concat("/Users"); diff --git a/src/front/Api/LeCoffreApi/Notary/Users/Users.ts b/src/front/Api/LeCoffreApi/Notary/Users/Users.ts index a3fea677..15da8be9 100644 --- a/src/front/Api/LeCoffreApi/Notary/Users/Users.ts +++ b/src/front/Api/LeCoffreApi/Notary/Users/Users.ts @@ -1,8 +1,6 @@ -import { Service } from "typedi"; import BaseNotary from "../BaseNotary"; import User from "le-coffre-resources/dist/Notary"; -@Service() export default class Users extends BaseNotary { private static instance: Users; private readonly baseURl = this.namespaceUrl.concat("/Users"); diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Customers/Customers.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Customers/Customers.ts index ac7fa867..a345d13b 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Customers/Customers.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Customers/Customers.ts @@ -1,5 +1,4 @@ import { Contact, Customer } from "le-coffre-resources/dist/SuperAdmin"; -import { Service } from "typedi"; import BaseSuperAdmin from "../BaseSuperAdmin"; import { ECivility } from "le-coffre-resources/dist/Customer/Contact"; @@ -26,7 +25,6 @@ export interface IPostCustomersParams { address?: Contact["address"]; } -@Service() export default class Customers extends BaseSuperAdmin { private static instance: Customers; private readonly baseURl = this.namespaceUrl.concat("/customers"); diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes.ts b/src/front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes.ts index cdaa4e3d..548a95ff 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes.ts @@ -1,4 +1,3 @@ -import { Service } from "typedi"; import { DeedType } from "le-coffre-resources/dist/Notary"; import BaseSuperAdmin from "../BaseSuperAdmin"; @@ -19,7 +18,6 @@ export type IPutDeedTypesParams = { deed_type_has_document_types?: DeedType["deed_type_has_document_types"]; }; -@Service() export default class DeedTypes extends BaseSuperAdmin { private static instance: DeedTypes; private readonly baseURl = this.namespaceUrl.concat("/deed-types"); diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts index bb51d0e0..3953781f 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts @@ -1,4 +1,3 @@ -import { Service } from "typedi"; import { Deed, OfficeFolder } from "le-coffre-resources/dist/Notary"; import BaseSuperAdmin from "../BaseSuperAdmin"; @@ -19,7 +18,6 @@ export type IPutDeedsParams = { deed_has_document_types?: Deed["deed_has_document_types"]; }; -@Service() export default class Deeds extends BaseSuperAdmin { private static instance: Deeds; private readonly baseURl = this.namespaceUrl.concat("/deeds"); diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes.ts b/src/front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes.ts index 55746b8f..7904e6e5 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes.ts @@ -1,5 +1,4 @@ import { DocumentType } from "le-coffre-resources/dist/SuperAdmin"; -import { Service } from "typedi"; import BaseSuperAdmin from "../BaseSuperAdmin"; @@ -23,7 +22,6 @@ export interface IPostDocumentTypesParams { }; } -@Service() export default class DocumentTypes extends BaseSuperAdmin { private static instance: DocumentTypes; private readonly baseURl = this.namespaceUrl.concat("/document-types"); diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Documents/Documents.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Documents/Documents.ts index e15c4f7e..d7c0a95a 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Documents/Documents.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Documents/Documents.ts @@ -1,5 +1,4 @@ import { Document } from "le-coffre-resources/dist/SuperAdmin"; -import { Service } from "typedi"; import BaseSuperAdmin from "../BaseSuperAdmin"; import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; @@ -19,7 +18,6 @@ export type IPutDocumentsParams = { export interface IPostDocumentsParams {} -@Service() export default class Documents extends BaseSuperAdmin { private static instance: Documents; private readonly baseURl = this.namespaceUrl.concat("/documents"); diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts index 63cc47ed..7fb5d21d 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts @@ -1,8 +1,9 @@ import { File } from "le-coffre-resources/dist/SuperAdmin"; -import Container, { Service } from "typedi"; import BaseSuperAdmin from "../BaseSuperAdmin"; import CryptoService from "@Front/Services/CryptoService/CryptoService"; +console.log(CryptoService); + // TODO Type get query params -> Where + inclue + orderby export interface IGetFilesparams { @@ -16,21 +17,17 @@ export type IPutFilesParams = {}; export interface IPostFilesParams {} -@Service() export default class Files extends BaseSuperAdmin { private static instance: Files; private readonly baseURl = this.namespaceUrl.concat("/files"); - private constructor(private cryptoService: CryptoService) { + private cryptoService: CryptoService = CryptoService.getInstance(); + private constructor() { super(); } public static getInstance() { - if (!this.instance) { - return new this(Container.get(CryptoService)); - } else { - return this.instance; - } + return (this.instance ??= new this()); } public async get(q: IGetFilesparams): Promise { diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts index 393cb400..cc188375 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts @@ -1,4 +1,3 @@ -import { Service } from "typedi"; import User, { Customer, DeedType, Office, OfficeFolder } from "le-coffre-resources/dist/Notary"; import BaseSuperAdmin from "../BaseSuperAdmin"; import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder"; @@ -42,7 +41,6 @@ export type IPutFoldersParams = { office_folder_has_customers?: { customer: { uid: Customer["uid"] } }[]; }; -@Service() export default class Folders extends BaseSuperAdmin { private static instance: Folders; private readonly baseURl = this.namespaceUrl.concat("/folders"); diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Users/Users.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Users/Users.ts index f08f26f1..17432643 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Users/Users.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Users/Users.ts @@ -1,4 +1,3 @@ -import { Service } from "typedi"; import User from "le-coffre-resources/dist/SuperAdmin"; import BaseSuperAdmin from "../BaseSuperAdmin"; @@ -20,7 +19,6 @@ export type IPutUsersParams = { documents?: User["documents"]; }; -@Service() export default class Users extends BaseSuperAdmin { private static instance: Users; private readonly baseURl = this.namespaceUrl.concat("/users"); diff --git a/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/index.tsx b/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/index.tsx index ce0192fb..e76a0821 100644 --- a/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultDoubleSidePage/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import Header from "@Front/Components/DesignSystem/Header"; import Version from "@Front/Components/DesignSystem/Version"; import classNames from "classnames"; diff --git a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx index c7405edb..e13833f1 100644 --- a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import ChevronIcon from "@Assets/Icons/chevron.svg"; import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; diff --git a/src/front/Components/LayoutTemplates/DefaultTemplate/index.tsx b/src/front/Components/LayoutTemplates/DefaultTemplate/index.tsx index bbb87f0a..f6dbe5a2 100644 --- a/src/front/Components/LayoutTemplates/DefaultTemplate/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultTemplate/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import React, { ReactNode } from "react"; import classes from "./classes.module.scss"; diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index ba7e0bae..6fe77df4 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import DepositDocument from "@Front/Components/DesignSystem/DepositDocument"; import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField"; diff --git a/src/front/Components/Layouts/DesignSystem/index.tsx b/src/front/Components/Layouts/DesignSystem/index.tsx index c8bed0ce..c12ec94f 100644 --- a/src/front/Components/Layouts/DesignSystem/index.tsx +++ b/src/front/Components/Layouts/DesignSystem/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import CheckBox from "@Front/Components/DesignSystem/CheckBox"; diff --git a/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx b/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx index b9449f9f..fa658d25 100644 --- a/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx +++ b/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import Customers from "@Front/Api/LeCoffreApi/SuperAdmin/Customers/Customers"; import Folders, { IPutFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; diff --git a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx index d83ea240..9f718dac 100644 --- a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import PlusIcon from "@Assets/Icons/plus.svg"; import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index a9efa69d..176f61f3 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import ChevronIcon from "@Assets/Icons/chevron.svg"; import Folders, { IPutFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; diff --git a/src/front/Components/Layouts/Folder/UpdateFolderDescription/index.tsx b/src/front/Components/Layouts/Folder/UpdateFolderDescription/index.tsx index 33e8fa64..bb2cbb72 100644 --- a/src/front/Components/Layouts/Folder/UpdateFolderDescription/index.tsx +++ b/src/front/Components/Layouts/Folder/UpdateFolderDescription/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import Form from "@Front/Components/DesignSystem/Form"; import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField"; diff --git a/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx b/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx index dd06cdc1..6e898dd9 100644 --- a/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx +++ b/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 7dcea4f7..c8a51fb9 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import LeftArrowIcon from "@Assets/Icons/left-arrow.svg"; import RightArrowIcon from "@Assets/Icons/right-arrow.svg"; diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index 840adf24..fa34a49d 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -1,4 +1,3 @@ -import "reflect-metadata"; import ChevronIcon from "@Assets/Icons/chevron.svg"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; diff --git a/src/front/Services/CryptoService/CryptoService.ts b/src/front/Services/CryptoService/CryptoService.ts index 281d7023..78a071dc 100644 --- a/src/front/Services/CryptoService/CryptoService.ts +++ b/src/front/Services/CryptoService/CryptoService.ts @@ -1,20 +1,25 @@ -import { Service } from "typedi"; import { FrontendVariables } from "@Front/Config/VariablesFront"; import crypto from "crypto"; +console.log(crypto); + -@Service() export default class CryptoService { private jwkKey: JsonWebKey; private subtle: SubtleCrypto = window.crypto.subtle; - constructor(protected variables: FrontendVariables) { + private static instance: CryptoService; + private constructor() { this.jwkKey = { kty: "oct", - k: variables.KEY_DATA, + k: FrontendVariables.getInstance().KEY_DATA, alg: "A256GCM", ext: true, }; } + public static getInstance() { + return (this.instance ??= new this()); + } + private async getKey() { return await this.subtle.importKey("jwk", this.jwkKey, { name: "AES-GCM" }, false, ["encrypt", "decrypt"]); } From bafa3265bedb5e817779499b7d328043a9cbf1f6 Mon Sep 17 00:00:00 2001 From: Vincent Alamelle Date: Wed, 10 May 2023 17:46:43 +0200 Subject: [PATCH 04/11] ressource v2.41 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5578f5bd..26a0b868 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.40", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.41", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", From 15e7f6a3d93b04a647d6fff87b0226196a863fdc Mon Sep 17 00:00:00 2001 From: Vincent Alamelle Date: Wed, 10 May 2023 18:13:14 +0200 Subject: [PATCH 05/11] v2.44 --- package-lock.json | 12 +++++++++--- package.json | 2 +- src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts | 1 - src/front/Services/CryptoService/CryptoService.ts | 1 - 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 641aa33c..76839135 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.40", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.44", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", @@ -3202,11 +3202,12 @@ } }, "node_modules/le-coffre-resources": { - "resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#62639b8bfcd0f779357554a04cd40e8a3ba4e62b", + "resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#30c8ee50b872a8bc6bec0f5d8c4626d8f4490177", "license": "MIT", "dependencies": { "class-transformer": "^0.5.1", - "class-validator": "^0.14.0" + "class-validator": "^0.14.0", + "reflect-metadata": "^0.1.13" } }, "node_modules/levn": { @@ -3904,6 +3905,11 @@ "node": ">=8.10.0" } }, + "node_modules/reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" + }, "node_modules/regenerator-runtime": { "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", diff --git a/package.json b/package.json index 26a0b868..8f6f84e7 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.41", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.44", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts index 7fb5d21d..219e507c 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts @@ -2,7 +2,6 @@ import { File } from "le-coffre-resources/dist/SuperAdmin"; import BaseSuperAdmin from "../BaseSuperAdmin"; import CryptoService from "@Front/Services/CryptoService/CryptoService"; -console.log(CryptoService); // TODO Type get query params -> Where + inclue + orderby diff --git a/src/front/Services/CryptoService/CryptoService.ts b/src/front/Services/CryptoService/CryptoService.ts index 78a071dc..870c8dee 100644 --- a/src/front/Services/CryptoService/CryptoService.ts +++ b/src/front/Services/CryptoService/CryptoService.ts @@ -1,6 +1,5 @@ import { FrontendVariables } from "@Front/Config/VariablesFront"; import crypto from "crypto"; -console.log(crypto); export default class CryptoService { From 0da2fa8ce1e63996b62c2bce7a95de48aae6501d Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Wed, 10 May 2023 18:17:50 +0200 Subject: [PATCH 06/11] :art: correctifs LA --- src/front/Api/BaseApiService.ts | 1 + src/front/Assets/Icons/id-note-logo.svg | 10 +++++ .../FolderList/classes.module.scss | 2 +- .../DesignSystem/FolderList/index.tsx | 44 +++++++++++-------- .../FolderListContainer/classes.module.scss | 11 ++++- .../FolderListContainer/index.tsx | 16 ++++--- .../DesignSystem/Header/classes.module.scss | 6 +-- .../Layouts/Login/classes.module.scss | 8 ++++ src/front/Components/Layouts/Login/index.tsx | 5 ++- 9 files changed, 69 insertions(+), 34 deletions(-) create mode 100644 src/front/Assets/Icons/id-note-logo.svg diff --git a/src/front/Api/BaseApiService.ts b/src/front/Api/BaseApiService.ts index 2992b609..f3786452 100644 --- a/src/front/Api/BaseApiService.ts +++ b/src/front/Api/BaseApiService.ts @@ -17,6 +17,7 @@ export default abstract class BaseApiService { } protected getBaseUrl() { + console.log("BaseApiService.baseUrl >>> ", BaseApiService.baseUrl); return BaseApiService.baseUrl; } diff --git a/src/front/Assets/Icons/id-note-logo.svg b/src/front/Assets/Icons/id-note-logo.svg new file mode 100644 index 00000000..caee423d --- /dev/null +++ b/src/front/Assets/Icons/id-note-logo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/front/Components/DesignSystem/FolderList/classes.module.scss b/src/front/Components/DesignSystem/FolderList/classes.module.scss index 8b1f302f..0bf5be03 100644 --- a/src/front/Components/DesignSystem/FolderList/classes.module.scss +++ b/src/front/Components/DesignSystem/FolderList/classes.module.scss @@ -4,4 +4,4 @@ .active { background-color: var(--grey-medium); } -} +} \ No newline at end of file diff --git a/src/front/Components/DesignSystem/FolderList/index.tsx b/src/front/Components/DesignSystem/FolderList/index.tsx index 7d67e2c7..359ca97f 100644 --- a/src/front/Components/DesignSystem/FolderList/index.tsx +++ b/src/front/Components/DesignSystem/FolderList/index.tsx @@ -28,25 +28,31 @@ class FolderListClass extends React.Component { : Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path; return (
- {this.props.folders.sort((folder) => { - const pendingDocuments = (folder.documents ?? []).filter((document) => document.document_status === EDocumentStatus.DEPOSITED); - return pendingDocuments.length >= 1 ? -1 : 1; - }).sort((folder1, folder2) => { - return folder1.created_at! < folder2.created_at! ? -1 : 1; - }).sort((folder1, folder2) => { - return folder1.folder_number! < folder2.folder_number! ? -1 : 1; - }).map((folder) => { - return ( -
- - ; - -
- ); - })} + {this.props.folders + .sort((folder) => { + const pendingDocuments = (folder.documents ?? []).filter( + (document) => document.document_status === EDocumentStatus.DEPOSITED, + ); + return pendingDocuments.length >= 1 ? -1 : 1; + }) + .sort((folder1, folder2) => { + return folder1.created_at! < folder2.created_at! ? -1 : 1; + }) + .sort((folder1, folder2) => { + return folder1.folder_number! < folder2.folder_number! ? -1 : 1; + }) + .map((folder) => { + return ( +
+ + ; + +
+ ); + })} ;
); diff --git a/src/front/Components/DesignSystem/FolderListContainer/classes.module.scss b/src/front/Components/DesignSystem/FolderListContainer/classes.module.scss index 3fa26504..588e1a18 100644 --- a/src/front/Components/DesignSystem/FolderListContainer/classes.module.scss +++ b/src/front/Components/DesignSystem/FolderListContainer/classes.module.scss @@ -7,7 +7,16 @@ flex-direction: column; justify-content: space-between; + .header { + flex: 1; + } + .searchbar { padding: 40px 24px 24px 24px; } -} + + .folderlist-container { + height: 100%; + border-right: 1px solid var(--grey-medium); + } +} \ No newline at end of file diff --git a/src/front/Components/DesignSystem/FolderListContainer/index.tsx b/src/front/Components/DesignSystem/FolderListContainer/index.tsx index 70ac65bf..521122ba 100644 --- a/src/front/Components/DesignSystem/FolderListContainer/index.tsx +++ b/src/front/Components/DesignSystem/FolderListContainer/index.tsx @@ -31,16 +31,18 @@ export default class FolderListContainer extends React.Component const navigatePath = Module.getInstance().get().modules.pages.Folder.pages.CreateFolder.props.path; return (
-
+
- +
+ +
{!this.props.isArchived && ( diff --git a/src/front/Components/DesignSystem/Header/classes.module.scss b/src/front/Components/DesignSystem/Header/classes.module.scss index 89f3b93d..3c51f7f6 100644 --- a/src/front/Components/DesignSystem/Header/classes.module.scss +++ b/src/front/Components/DesignSystem/Header/classes.module.scss @@ -31,10 +31,6 @@ .profile-section { display: inline-flex; - > :first-child { - margin-right: 32px; - } - @media (max-width: $screen-ls) { display: none; } @@ -61,4 +57,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/front/Components/Layouts/Login/classes.module.scss b/src/front/Components/Layouts/Login/classes.module.scss index 8fc12a31..b1f43eee 100644 --- a/src/front/Components/Layouts/Login/classes.module.scss +++ b/src/front/Components/Layouts/Login/classes.module.scss @@ -1,13 +1,21 @@ +@import "@Themes/constants.scss"; + .root { display: flex; align-items: center; justify-content: center; flex-direction: column; height: 100%; + max-width: 530px; + margin: auto; .title { margin: 32px 0; text-align: center; + + @media (max-width: $screen-s) { + font-family: 48px; + } } .forget-password { diff --git a/src/front/Components/Layouts/Login/index.tsx b/src/front/Components/Layouts/Login/index.tsx index 196dd836..5b5be2e8 100644 --- a/src/front/Components/Layouts/Login/index.tsx +++ b/src/front/Components/Layouts/Login/index.tsx @@ -7,6 +7,7 @@ import LandingImage from "./landing-connect.png"; import Image from "next/image"; import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage"; import { FrontendVariables } from "@Front/Config/VariablesFront"; +import idNoteLogo from "@Assets/Icons/id-note-logo.svg"; export default class LoginClass extends BasePage { public override render(): JSX.Element { @@ -17,7 +18,9 @@ export default class LoginClass extends BasePage {
Connexion espace professionnel
- +
Vous n'arrivez pas à vous connecter ?
From bfe98b3b780bbaeb41260046ba630cf3d1ca0a91 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Wed, 10 May 2023 18:21:56 +0200 Subject: [PATCH 07/11] :bug: Small fixes --- src/front/Components/DesignSystem/Modal/index.tsx | 2 +- src/front/Components/DesignSystem/UserFolder/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/front/Components/DesignSystem/Modal/index.tsx b/src/front/Components/DesignSystem/Modal/index.tsx index 3a9624e2..d1ba8b86 100644 --- a/src/front/Components/DesignSystem/Modal/index.tsx +++ b/src/front/Components/DesignSystem/Modal/index.tsx @@ -106,7 +106,7 @@ export default class Modal extends React.Component { private handleKeyDown = (e: KeyboardEvent): void => { - if (e.key === "Escape" || e.key === "Esc" || e.key === "Backspace") { + if (e.key === "Escape" || e.key === "Esc") { this.props.onClose(); } } diff --git a/src/front/Components/DesignSystem/UserFolder/index.tsx b/src/front/Components/DesignSystem/UserFolder/index.tsx index 9cd68c3c..b3ce9b9d 100644 --- a/src/front/Components/DesignSystem/UserFolder/index.tsx +++ b/src/front/Components/DesignSystem/UserFolder/index.tsx @@ -63,7 +63,7 @@ export default class UserFolder extends React.Component { onAccept={this.deleteAskedDocument} closeBtn header={"Supprimer la demande de document ?"} - cancelText={"Cancel"} + cancelText={"Annuler"} confirmText={"Confirmer"}> Êtes-vous vous de vouloir supprimer la demande de document ? From ff3d607186ddcede306644956e2b8fba668a997b Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Wed, 10 May 2023 18:50:48 +0200 Subject: [PATCH 08/11] :bug: Fix create folder & textarea --- .../DesignSystem/Form/Elements/InputField/index.tsx | 4 +--- src/front/Components/Layouts/Folder/CreateFolder/index.tsx | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx b/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx index 9c3d8838..7c91b6d1 100644 --- a/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx +++ b/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx @@ -52,9 +52,7 @@ export default class InputField extends BaseField { this.props.className ? [classes["textarea"], classes[this.props.className]].join(" ") : classes["textarea"] } value={value} - readOnly={this.props.readOnly}> - {value.toString()} - + readOnly={this.props.readOnly} />
{this.props.fakeplaceholder} {!this.props.required && " (Facultatif)"}
diff --git a/src/front/Components/Layouts/Folder/CreateFolder/index.tsx b/src/front/Components/Layouts/Folder/CreateFolder/index.tsx index dcdcd315..205c61af 100644 --- a/src/front/Components/Layouts/Folder/CreateFolder/index.tsx +++ b/src/front/Components/Layouts/Folder/CreateFolder/index.tsx @@ -13,7 +13,7 @@ import { ActionMeta, MultiValue } from "react-select"; import BasePage from "../../Base"; import classes from "./classes.module.scss"; -import { DeedType, OfficeFolder, OfficeFolderHasStakeholder } from "le-coffre-resources/dist/Notary"; +import { DeedType, OfficeFolderHasStakeholder } from "le-coffre-resources/dist/Notary"; import DeedTypes from "@Front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes"; import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users"; import User from "le-coffre-resources/dist/Notary"; @@ -284,7 +284,6 @@ class CreateFolderClass extends BasePage { let office_folder_has_stakeholders = collaborators.map((collaborator) => { return OfficeFolderHasStakeholder.hydrate({ - office_folder: new OfficeFolder(), user_stakeholder: collaborator, }); }); From 6029a217605ccfcd41960ceb72b135ee70175f87 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Wed, 10 May 2023 18:59:00 +0200 Subject: [PATCH 09/11] :bug: Fixing folders order --- .../DesignSystem/FolderList/index.tsx | 74 +++++++++++-------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/src/front/Components/DesignSystem/FolderList/index.tsx b/src/front/Components/DesignSystem/FolderList/index.tsx index 359ca97f..d98d432c 100644 --- a/src/front/Components/DesignSystem/FolderList/index.tsx +++ b/src/front/Components/DesignSystem/FolderList/index.tsx @@ -1,12 +1,12 @@ import { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; +import Module from "@Front/Config/Module"; +import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; import Link from "next/link"; import { useRouter } from "next/router"; import React from "react"; import FolderContainer from "../FolderContainer"; import classes from "./classes.module.scss"; -import Module from "@Front/Config/Module"; -import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; type IProps = { folders: IDashBoardFolder[]; @@ -22,41 +22,53 @@ type IPropsClass = IProps & { type IState = {}; class FolderListClass extends React.Component { + private redirectPath: string = this.props.isArchived + ? Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.pages.FolderInformation.props.path + : Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path; public override render(): JSX.Element { - const redirectPath: string = this.props.isArchived - ? Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.pages.FolderInformation.props.path - : Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path; return (
- {this.props.folders - .sort((folder) => { - const pendingDocuments = (folder.documents ?? []).filter( - (document) => document.document_status === EDocumentStatus.DEPOSITED, - ); - return pendingDocuments.length >= 1 ? -1 : 1; - }) - .sort((folder1, folder2) => { - return folder1.created_at! < folder2.created_at! ? -1 : 1; - }) - .sort((folder1, folder2) => { - return folder1.folder_number! < folder2.folder_number! ? -1 : 1; - }) - .map((folder) => { - return ( -
- - ; - -
- ); - })} - ; + {this.renderFolders()}
); } + + private renderFolders(): JSX.Element[] { + const pendingFolders = this.props.folders + .filter((folder) => { + const pendingDocuments = (folder.documents ?? []).filter( + (document) => document.document_status === EDocumentStatus.DEPOSITED, + ); + return pendingDocuments.length >= 1; + }) + .sort((folder1, folder2) => { + return folder1.created_at! > folder2.created_at! ? -1 : 1; + }); + + const otherFolders = this.props.folders + .filter((folder) => { + const pendingDocuments = (folder.documents ?? []).filter( + (document) => document.document_status === EDocumentStatus.DEPOSITED, + ); + return pendingDocuments.length === 0; + }) + .sort((folder1, folder2) => { + return folder1.created_at! > folder2.created_at! ? -1 : 1; + }); + + return [...pendingFolders, ...otherFolders].map((folder) => { + return ( +
+ + ; + +
+ ); + }); + } } export default function FolderList(props: IProps) { From 40f9671738f2cb1f3c6096545e8abe89fabe862f Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Wed, 10 May 2023 19:25:19 +0200 Subject: [PATCH 10/11] :art: fix idnot link port --- src/front/Components/Layouts/Login/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/front/Components/Layouts/Login/index.tsx b/src/front/Components/Layouts/Login/index.tsx index 5b5be2e8..59a9cc2f 100644 --- a/src/front/Components/Layouts/Login/index.tsx +++ b/src/front/Components/Layouts/Login/index.tsx @@ -32,8 +32,7 @@ export default class LoginClass extends BasePage { private redirectUserOnConnection() { const variables = FrontendVariables.getInstance(); - const baseFronturl = - variables.BACK_API_PROTOCOL + variables.FRONT_APP_HOST + (variables.FRONT_APP_PORT ? ":" + variables.FRONT_APP_PORT : ""); + const baseFronturl = variables.BACK_API_PROTOCOL + variables.FRONT_APP_HOST; const authorizeEndPoint = variables.IDNOT_AUTHORIZE_ENDPOINT; const clientId = variables.IDNOT_CLIENT_ID; const url = `${authorizeEndPoint}?client_id=${clientId}&redirect_uri=${baseFronturl}/authorized-client&scope=openid,profile,offline_access&response_type=code`; From f134d115cda0d82cc668528d0c770778d69111f3 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Wed, 10 May 2023 19:34:35 +0200 Subject: [PATCH 11/11] :bug: Fixing env variables --- next.config.js | 17 ++++++++--------- src/front/Api/BaseApiService.ts | 1 - src/pages/_app.tsx | 33 +++++++++++++++++---------------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/next.config.js b/next.config.js index 898d4a52..4a45c7f6 100644 --- a/next.config.js +++ b/next.config.js @@ -4,15 +4,14 @@ const nextConfig = { reactStrictMode: false, publicRuntimeConfig: { // Will be available on both server and client - BACK_API_PROTOCOL: process.env.BACK_API_PROTOCOL, - BACK_API_HOST: process.env.BACK_API_HOST, - BACK_API_PORT: process.env.BACK_API_PORT, - BACK_API_ROOT_URL: process.env.BACK_API_ROOT_URL, - BACK_API_VERSION: process.env.BACK_API_VERSION, - FRONT_APP_HOST: process.env.FRONT_APP_HOST, - FRONT_APP_PORT: process.env.FRONT_APP_PORT, - IDNOT_AUTHORIZE_ENDPOINT: process.env.IDNOT_AUTHORIZE_ENDPOINT, - IDNOT_CLIENT_ID: process.env.IDNOT_CLIENT_ID, + BACK_API_PROTOCOL: process.env.NEXT_PUBLIC_BACK_API_PROTOCOL, + BACK_API_HOST: process.env.NEXT_PUBLIC_BACK_API_HOST, + BACK_API_ROOT_URL: process.env.NEXT_PUBLIC_BACK_API_ROOT_URL, + BACK_API_VERSION: process.env.NEXT_PUBLIC_BACK_API_VERSION, + FRONT_APP_HOST: process.env.NEXT_PUBLIC_FRONT_APP_HOST, + FRONT_APP_PORT: process.env.NEXT_PUBLIC_FRONT_APP_PORT, + IDNOT_AUTHORIZE_ENDPOINT: process.env.NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT, + IDNOT_CLIENT_ID: process.env.NEXT_PUBLIC_IDNOT_CLIENT_ID, }, }; diff --git a/src/front/Api/BaseApiService.ts b/src/front/Api/BaseApiService.ts index f3786452..2992b609 100644 --- a/src/front/Api/BaseApiService.ts +++ b/src/front/Api/BaseApiService.ts @@ -17,7 +17,6 @@ export default abstract class BaseApiService { } protected getBaseUrl() { - console.log("BaseApiService.baseUrl >>> ", BaseApiService.baseUrl); return BaseApiService.baseUrl; } diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index be5cf63c..4e9c36fe 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -36,28 +36,29 @@ const MyApp = (({ }: AppPropsWithLayout) => { const getLayout = Component.getLayout ?? ((page) => ); - FrontendVariables.getInstance().BACK_API_PROTOCOL = backApiProtocol; - FrontendVariables.getInstance().BACK_API_HOST = backApiHost; - FrontendVariables.getInstance().BACK_API_ROOT_URL = backApiRootUrl; - FrontendVariables.getInstance().BACK_API_VERSION = backApiVersion; - FrontendVariables.getInstance().FRONT_APP_HOST = frontAppHost; - FrontendVariables.getInstance().FRONT_APP_PORT = frontAppPort; - FrontendVariables.getInstance().IDNOT_AUTHORIZE_ENDPOINT = idNotAuthorizeEndpoint; - FrontendVariables.getInstance().IDNOT_CLIENT_ID = idNotClientId; + const instance = FrontendVariables.getInstance(); + instance.BACK_API_PROTOCOL = backApiProtocol; + instance.BACK_API_HOST = backApiHost; + instance.BACK_API_ROOT_URL = backApiRootUrl; + instance.BACK_API_VERSION = backApiVersion; + instance.FRONT_APP_HOST = frontAppHost; + instance.FRONT_APP_PORT = frontAppPort; + instance.IDNOT_AUTHORIZE_ENDPOINT = idNotAuthorizeEndpoint; + instance.IDNOT_CLIENT_ID = idNotClientId; return getLayout(); }) as AppType; MyApp.getInitialProps = async () => { return { - backApiProtocol: process.env["BACK_API_PROTOCOL"], - backApiHost: process.env["BACK_API_HOST"], - backApiRootUrl: process.env["BACK_API_ROOT_URL"], - backApiVersion: process.env["BACK_API_VERSION"], - frontAppHost: process.env["FRONT_APP_HOST"], - frontAppPort: process.env["FRONT_APP_PORT"], - idNotAuthorizeEndpoint: process.env["IDNOT_AUTHORIZE_ENDPOINT"], - idNotClientId: process.env["IDNOT_CLIENT_ID"], + backApiProtocol: process.env["NEXT_PUBLIC_BACK_API_PROTOCOL"], + backApiHost: process.env["NEXT_PUBLIC_BACK_API_HOST"], + backApiRootUrl: process.env["NEXT_PUBLIC_BACK_API_ROOT_URL"], + backApiVersion: process.env["NEXT_PUBLIC_BACK_API_VERSION"], + frontAppHost: process.env["NEXT_PUBLIC_FRONT_APP_HOST"], + frontAppPort: process.env["NEXT_PUBLIC_FRONT_APP_PORT"], + idNotAuthorizeEndpoint: process.env["NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT"], + idNotClientId: process.env["NEXT_PUBLIC_IDNOT_CLIENT_ID"], }; };