diff --git a/.ssh/id_rsa.pub b/.ssh/id_rsa.pub new file mode 100644 index 00000000..e1327d66 --- /dev/null +++ b/.ssh/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDOfOFPvQNw5XguFuX1YNvED8ulP+tIA/5xw7LHcA0gRj3hwILCAEAjuDs+d13zCsnEb0yd+laT3PU9iRIKa28Tynu+sTjGDyfx8MX/HjJtbEzyd6jLn87uTvw/6lzg2y5ZDEa6PEqrPIv0KEhuq6HuU8qAA0nBpsTIAUTK3XR8qm3I6J9Rs1JyBjvIP5UeICApvoLmgHuz6mKdvoQ8qKDWamsL4pSc4Hr7HlQ8ITNhnyS8XMgQInU/I2TzT/I4Dxx5IeFUQ5KOfJJNgK1d+PByLSWUrn+eRXki8m1hjMiwGIehVAriFW1C309SEHxLHjQKUPXHSv4kH7zqjO+p3kY5gwp/lvsBRSnihj8s1lADsJlMqjnSLeIQ+sY2CNkmXXI8ABkzhuJKTGTl+8pzGGhIHzeU7e7lpSn3gLn4p217kIppHNAr6dZH9UaYbgnwVonwr5cLbatRPFyI1NfXKDyZtSYlGQxLQUt9KDrNvVTZzaTt3YwM/YCsRIADAagKosM= gisele-smartchain@MacBook-Pro-6.local diff --git a/Dockerfile.front b/Dockerfile.front new file mode 100644 index 00000000..11d63f6c --- /dev/null +++ b/Dockerfile.front @@ -0,0 +1,44 @@ +# Install dependencies only when needed +FROM node:19-alpine AS deps + +WORKDIR leCoffre-front + +COPY package.json ./ + +RUN apk update && apk add openssh-client git + +COPY id_rsa /root/.ssh/id_rsa +RUN chmod 600 ~/.ssh/id_rsa +RUN eval "$(ssh-agent -s)" && ssh-add /root/.ssh/id_rsa +RUN ssh-keyscan github.com smart-chain-fr/leCoffre-resources.git >> /root/.ssh/known_hosts + +RUN npm install --frozen-lockfile + +# Rebuild the source code only when needed +FROM node:19-alpine AS builder + +WORKDIR leCoffre-front + +COPY --from=deps leCoffre-front/node_modules ./node_modules +COPY --from=deps leCoffre-front/package.json package.json +COPY tsconfig.json tsconfig.json +COPY src src + +RUN npm run build + +# Production image, copy all the files and run next +FROM node:19-alpine AS production + +WORKDIR leCoffre-front + +RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser . + +COPY public ./public +COPY --from=builder --chown=lecoffreuser leCoffre-front/node_modules ./node_modules +COPY --from=builder --chown=lecoffreuser leCoffre-front/.next ./.next +COPY --from=builder --chown=lecoffreuser leCoffre-front/package.json ./package.json + +USER lecoffreuser + +CMD ["npm", "run", "start"] +EXPOSE 3000 \ No newline at end of file diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts index 0e195537..fdad59f3 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"; - // TODO Type get query params -> Where + inclue + orderby export interface IGetFilesparams { where?: {}; @@ -57,7 +56,6 @@ export default class Files extends BaseSuperAdmin { return this.baseURl.concat(`/download/${uid}`); } - public async getByUid(uid: string, q?: any): Promise { const url = new URL(this.baseURl.concat(`/${uid}`)); const query = { q }; diff --git a/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx b/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx index 986d573e..5e4bfbf3 100644 --- a/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx +++ b/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx @@ -58,9 +58,13 @@ class DocumentNotaryClass extends React.Component { return fileName; } } else { - const archivedFilesLenght = documentFiles.filter((file) => file.archived_at).length; - const documentFileLenght = documentFiles.length - archivedFilesLenght; - return `${documentFileLenght} documents déposés`; + const archivedFilesLength = documentFiles.filter((file) => file.archived_at).length; + const documentFileLength = documentFiles.length - archivedFilesLength; + if(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`; } } else { return "Aucun document déposé"; diff --git a/src/front/Components/DesignSystem/Header/index.tsx b/src/front/Components/DesignSystem/Header/index.tsx index e90524bc..d992c01e 100644 --- a/src/front/Components/DesignSystem/Header/index.tsx +++ b/src/front/Components/DesignSystem/Header/index.tsx @@ -10,6 +10,9 @@ import BurgerMenu from "./BurgerMenu"; import WindowStore from "@Front/Stores/WindowStore"; import Module from "@Front/Config/Module"; import Head from "next/head"; +import { useRouter } from "next/router"; +import LogoCielNatureIcon from "./logo-ciel-notaires.jpeg"; + enum EHeaderOpeningState { OPEN = "open", CLOSED = "closed", @@ -19,6 +22,11 @@ enum EHeaderOpeningState { type IProps = { isUserConnected: boolean; }; + +type IPropsClass = IProps & { + isOnCustomerLoginPage: boolean; +}; + type IState = { open: EHeaderOpeningState; isBurgerMenuOpen: boolean; @@ -26,11 +34,11 @@ type IState = { isProfileMenuOpen: boolean; }; -export default class Header extends React.Component { +class HeaderClass extends React.Component { private onWindowResize = () => {}; private headerBreakpoint = 1300; - constructor(props: IProps) { + constructor(props: IPropsClass) { super(props); this.state = { @@ -85,6 +93,7 @@ export default class Header extends React.Component { )} + {this.props.isOnCustomerLoginPage && ciel-nature} ); } @@ -126,3 +135,10 @@ export default class Header extends React.Component { this.setState({ isProfileMenuOpen: false }); } } + +export default function Header(props: IProps) { + const router = useRouter(); + const { pathname } = router; + let isActive = Module.getInstance().get().modules.pages.CustomersLogin.props.path === pathname; + return ; +} diff --git a/src/front/Components/DesignSystem/Header/logo-ciel-notaires.jpeg b/src/front/Components/DesignSystem/Header/logo-ciel-notaires.jpeg new file mode 100644 index 00000000..1dfd9047 Binary files /dev/null and b/src/front/Components/DesignSystem/Header/logo-ciel-notaires.jpeg differ diff --git a/src/front/Config/Module/development.json b/src/front/Config/Module/development.json index 882bd5dd..740f6ee9 100644 --- a/src/front/Config/Module/development.json +++ b/src/front/Config/Module/development.json @@ -24,6 +24,13 @@ "labelKey": "design_system" } }, + "CustomersLogin": { + "enabled": true, + "props": { + "path": "/customers/login", + "labelKey": "customer_login" + } + }, "Folder": { "enabled": true, "props": { diff --git a/src/front/Config/Module/preprod.json b/src/front/Config/Module/preprod.json index 882bd5dd..740f6ee9 100644 --- a/src/front/Config/Module/preprod.json +++ b/src/front/Config/Module/preprod.json @@ -24,6 +24,13 @@ "labelKey": "design_system" } }, + "CustomersLogin": { + "enabled": true, + "props": { + "path": "/customers/login", + "labelKey": "customer_login" + } + }, "Folder": { "enabled": true, "props": { diff --git a/src/front/Config/Module/production.json b/src/front/Config/Module/production.json index 882bd5dd..740f6ee9 100644 --- a/src/front/Config/Module/production.json +++ b/src/front/Config/Module/production.json @@ -24,6 +24,13 @@ "labelKey": "design_system" } }, + "CustomersLogin": { + "enabled": true, + "props": { + "path": "/customers/login", + "labelKey": "customer_login" + } + }, "Folder": { "enabled": true, "props": { diff --git a/src/front/Config/Module/staging.json b/src/front/Config/Module/staging.json index 882bd5dd..740f6ee9 100644 --- a/src/front/Config/Module/staging.json +++ b/src/front/Config/Module/staging.json @@ -24,6 +24,13 @@ "labelKey": "design_system" } }, + "CustomersLogin": { + "enabled": true, + "props": { + "path": "/customers/login", + "labelKey": "customer_login" + } + }, "Folder": { "enabled": true, "props": {