Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
1a78a55e42 | |||
d214239efe |
76
.github/workflows/demo.yml
vendored
76
.github/workflows/demo.yml
vendored
@ -1,76 +0,0 @@
|
||||
name: Demo - Build & Deploy to Scaleway
|
||||
|
||||
on:
|
||||
push:
|
||||
- [legacy_dev]
|
||||
|
||||
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 }}
|
24
.github/workflows/test.yml
vendored
24
.github/workflows/test.yml
vendored
@ -6,8 +6,8 @@ on:
|
||||
|
||||
env:
|
||||
PROJECT_ID_LECOFFRE: 72d08499-37c2-412b-877e-f8af0471654a
|
||||
NAMESPACE_ID_LECOFFRE: e2036b1d-b5c1-4cdd-b168-d895c498f679
|
||||
CONTAINER_REGISTRY_ENDPOINT_LECOFFRE: rg.fr-par.scw.cloud/funcscwlecoffretestfhhn6rcl
|
||||
NAMESPACE_ID_LECOFFRE: 3829c5cd-9fb0-4871-97a1-eb33e4bc1114
|
||||
CONTAINER_REGISTRY_ENDPOINT_LECOFFRE: rg.fr-par.scw.cloud/funcscwlecoffretestouylprmj
|
||||
|
||||
IMAGE_NAME: front
|
||||
CONTAINER_NAME: front
|
||||
@ -17,16 +17,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- 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: 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:
|
||||
|
@ -313,11 +313,10 @@ export default function DocumentTables(props: IProps) {
|
||||
);
|
||||
|
||||
const progress = useMemo(() => {
|
||||
// Exclude refused documents from total - only count documents that are still in progress
|
||||
const total = askedDocuments.length + toValidateDocuments.length + validatedDocuments.length;
|
||||
const total = askedDocuments.length + toValidateDocuments.length + validatedDocuments.length + refusedDocuments.length;
|
||||
if (total === 0) return 0;
|
||||
return (validatedDocuments.length / total) * 100;
|
||||
}, [askedDocuments.length, toValidateDocuments.length, validatedDocuments.length]);
|
||||
}, [askedDocuments.length, refusedDocuments.length, toValidateDocuments.length, validatedDocuments.length]);
|
||||
|
||||
if (documents.length === 0 && documentsNotary.length === 0) return <NoDocument />;
|
||||
|
||||
|
@ -47,10 +47,8 @@ export default function FolderInformation(props: IProps) {
|
||||
let validatedDocuments = 0;
|
||||
folder?.customers?.forEach((customer) => {
|
||||
const documents = customer.documents;
|
||||
// Only count documents that are not refused (still in progress)
|
||||
const activeDocuments = documents?.filter((document) => document.document_status !== EDocumentStatus.REFUSED) ?? [];
|
||||
total += activeDocuments.length;
|
||||
validatedDocuments += activeDocuments.filter((document) => document.document_status === EDocumentStatus.VALIDATED).length;
|
||||
total += documents?.length ?? 0;
|
||||
validatedDocuments += documents?.filter((document) => document.document_status === EDocumentStatus.VALIDATED).length ?? 0;
|
||||
});
|
||||
if (total === 0) return 0;
|
||||
const percentage = (validatedDocuments / total) * 100;
|
||||
|
@ -83,7 +83,7 @@ export default function StepEmail(props: IProps) {
|
||||
<div className={classes["content"]}>
|
||||
<div className={classes["section"]}>
|
||||
<Typography typo={ETypo.TITLE_H6} color={ETypoColor.TEXT_ACCENT} className={classes["section-title"]}>
|
||||
Pour les notaires et les collaborateurs :
|
||||
Pour les notaires et les colaborateurs :
|
||||
</Typography>
|
||||
<Button onClick={redirectUserOnConnection} rightIcon={<Image alt="id-not-logo" src={idNoteLogo} />}>
|
||||
S'identifier avec ID.not
|
||||
|
Loading…
x
Reference in New Issue
Block a user