Compare commits

...

13 Commits

Author SHA1 Message Date
omaroughriss
1621bc1d53 Merge branch 'cicd' into legacy_dev 2025-07-16 16:43:27 +02:00
omaroughriss
f55b495449 Fix schedule errors 2025-07-16 16:33:46 +02:00
omaroughriss
7ffbe26d2b Update time to UTC+1 2025-07-16 16:03:41 +02:00
omaroughriss
c34659902e Update time to UTC+2 2025-07-16 15:56:37 +02:00
omaroughriss
ea3d2d8e8d Fix cicd to use schedule event 2025-07-16 15:46:03 +02:00
affa234d65 revert 3ba6dd767d2257056fbf5f29cfa27c9311701cdd
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 14s
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 4s
revert Add conditions to use only the schedule event
2025-07-16 11:22:16 +00:00
a0ac83bf2f revert 36e1bae353cb973b2f7c63f29ea8d433f6fc54f2
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Has been skipped
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Has been skipped
revert Add schedule to the demo cicd
2025-07-16 11:18:25 +00:00
omaroughriss
3ba6dd767d Add conditions to use only the schedule event
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Has been skipped
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Has been skipped
2025-07-16 12:55:41 +02:00
omaroughriss
36e1bae353 Add schedule to the demo cicd
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 12s
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 4s
2025-07-16 12:30:20 +02:00
omaroughriss
aa3feb4f14 Update resources dep
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 2m56s
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 6s
2025-07-15 15:15:42 +02:00
omaroughriss
1766dc5a75 Add demo cicd
Some checks failed
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Failing after 26s
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Has been skipped
2025-07-15 15:08:27 +02:00
Sosthene
bb370900bd [bug] Don't count refused documents on progress bar for a folder 2025-07-11 13:31:51 +02:00
Sosthene
7065f07373 Fix typo on main page 2025-07-11 13:23:51 +02:00
6 changed files with 87 additions and 8 deletions

76
.github/workflows/demo.yml vendored Normal file
View File

@ -0,0 +1,76 @@
name: Demo - Build & Deploy to Scaleway
on:
schedule:
- cron: '00 15 * * *' # 15:00 UTC -> 17:00 CEST
env:
PROJECT_ID_LECOFFRE: 72d08499-37c2-412b-877e-f8af0471654a
NAMESPACE_ID_LECOFFRE: c992c042-bdb6-4974-becf-aa5039b9ec58
CONTAINER_REGISTRY_ENDPOINT_LECOFFRE: rg.fr-par.scw.cloud/funcscwlecoffredemovts5gdxg
IMAGE_NAME: front
CONTAINER_NAME: front
jobs:
build-and-push-image-lecoffre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: cicd
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Copy SSH
run: cp ~/.ssh/id_rsa id_rsa
- name: Login to Scaleway Container Registry
uses: docker/login-action@v3
with:
username: nologin
password: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
registry: ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}
- name: Build the Docker Image
run: docker build . -t ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/${{ env.IMAGE_NAME }}
- name: Push the Docker Image to Scaleway Container Registry
run: docker push ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/${{ env.IMAGE_NAME }}
deploy-to-scaleway-lecoffre:
needs: build-and-push-image-lecoffre
runs-on: ubuntu-latest
environment: demo
steps:
- name: Install CLI
uses: scaleway/action-scw@v0
- name: Get container ID
run: |
echo "CONTAINER_ID=$(scw container container list namespace-id=${{env.NAMESPACE_ID_LECOFFRE}} -o json | jq -r '.[] | select(.name == "${{ env.CONTAINER_NAME }}") | .id')" >> $GITHUB_ENV
env:
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY_LECOFFRE }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
SCW_DEFAULT_PROJECT_ID: ${{ env.PROJECT_ID_LECOFFRE }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID_LECOFFRE }}
- name: Deploy the container based on the new image
run: |
env_string=""
while IFS= read -r line; do
if [[ "$line" == *"="* ]]; then
key=$(echo "$line" | cut -d '=' -f 1)
value=$(echo "$line" | cut -d '=' -f 2-)
if [[ -n "$key" ]]; then
env_string+="environment-variables.$key=$value "
fi
fi
done <<< "$ENV_VARS"
env_string=$(echo $env_string | sed 's/ $//')
scw container container update ${{ env.CONTAINER_ID }} $env_string
env:
ENV_VARS: ${{ secrets.ENV }}
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY_LECOFFRE }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
SCW_DEFAULT_PROJECT_ID: ${{ env.PROJECT_ID_LECOFFRE }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID_LECOFFRE }}

View File

@ -1,8 +1,8 @@
name: Prod - Build & Deploy to Scaleway name: Prod - Build & Deploy to Scaleway
on: on:
push: schedule:
branches: [main] - cron: '00 20 * * *' # 20:00 UTC -> 22:00 CEST
env: env:

View File

@ -30,7 +30,7 @@
"heroicons": "^2.1.5", "heroicons": "^2.1.5",
"jszip": "^3.10.1", "jszip": "^3.10.1",
"jwt-decode": "^3.1.2", "jwt-decode": "^3.1.2",
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.167", "le-coffre-resources": "git+https://git.4nkweb.com/4nk/lecoffre-ressources.git#v2.167",
"next": "^14.2.3", "next": "^14.2.3",
"prettier": "^2.8.7", "prettier": "^2.8.7",
"react": "18.2.0", "react": "18.2.0",

View File

@ -313,10 +313,11 @@ export default function DocumentTables(props: IProps) {
); );
const progress = useMemo(() => { const progress = useMemo(() => {
const total = askedDocuments.length + toValidateDocuments.length + validatedDocuments.length + refusedDocuments.length; // Exclude refused documents from total - only count documents that are still in progress
const total = askedDocuments.length + toValidateDocuments.length + validatedDocuments.length;
if (total === 0) return 0; if (total === 0) return 0;
return (validatedDocuments.length / total) * 100; return (validatedDocuments.length / total) * 100;
}, [askedDocuments.length, refusedDocuments.length, toValidateDocuments.length, validatedDocuments.length]); }, [askedDocuments.length, toValidateDocuments.length, validatedDocuments.length]);
if (documents.length === 0 && documentsNotary.length === 0) return <NoDocument />; if (documents.length === 0 && documentsNotary.length === 0) return <NoDocument />;

View File

@ -47,8 +47,10 @@ export default function FolderInformation(props: IProps) {
let validatedDocuments = 0; let validatedDocuments = 0;
folder?.customers?.forEach((customer) => { folder?.customers?.forEach((customer) => {
const documents = customer.documents; const documents = customer.documents;
total += documents?.length ?? 0; // Only count documents that are not refused (still in progress)
validatedDocuments += documents?.filter((document) => document.document_status === EDocumentStatus.VALIDATED).length ?? 0; const activeDocuments = documents?.filter((document) => document.document_status !== EDocumentStatus.REFUSED) ?? [];
total += activeDocuments.length;
validatedDocuments += activeDocuments.filter((document) => document.document_status === EDocumentStatus.VALIDATED).length;
}); });
if (total === 0) return 0; if (total === 0) return 0;
const percentage = (validatedDocuments / total) * 100; const percentage = (validatedDocuments / total) * 100;

View File

@ -83,7 +83,7 @@ export default function StepEmail(props: IProps) {
<div className={classes["content"]}> <div className={classes["content"]}>
<div className={classes["section"]}> <div className={classes["section"]}>
<Typography typo={ETypo.TITLE_H6} color={ETypoColor.TEXT_ACCENT} className={classes["section-title"]}> <Typography typo={ETypo.TITLE_H6} color={ETypoColor.TEXT_ACCENT} className={classes["section-title"]}>
Pour les notaires et les colaborateurs : Pour les notaires et les collaborateurs :
</Typography> </Typography>
<Button onClick={redirectUserOnConnection} rightIcon={<Image alt="id-not-logo" src={idNoteLogo} />}> <Button onClick={redirectUserOnConnection} rightIcon={<Image alt="id-not-logo" src={idNoteLogo} />}>
S'identifier avec ID.not S'identifier avec ID.not