From 789331ca9349ccc81d5ee67f9c6a6f329474fe4e Mon Sep 17 00:00:00 2001 From: Aleksandar Petkov Date: Wed, 13 Dec 2023 16:10:01 +0200 Subject: [PATCH 1/4] client/Campaigns: Fix NaN due to guaranteedAmount missing (#1683) --- src/components/client/campaigns/CampaignCard/CampaignCard.tsx | 2 +- src/components/client/campaigns/CampaignDetails.tsx | 4 ++-- src/components/client/campaigns/InlineDonation.tsx | 2 +- .../ActiveCampaignCard/ActiveCampaignCard.tsx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/client/campaigns/CampaignCard/CampaignCard.tsx b/src/components/client/campaigns/CampaignCard/CampaignCard.tsx index d99672f4f..cf1ab0d60 100644 --- a/src/components/client/campaigns/CampaignCard/CampaignCard.tsx +++ b/src/components/client/campaigns/CampaignCard/CampaignCard.tsx @@ -40,7 +40,7 @@ export default function ActiveCampaignCard({ campaign, index }: Props) { const campaignImagesUrl = campaignListPictureUrl(campaign) - const reached = summary ? summary.reachedAmount + summary.guaranteedAmount : 0 + const reached = summary ? summary.reachedAmount + (summary.guaranteedAmount ?? 0) : 0 const reachedAmount = moneyPublic(reached) const targetAmount = moneyPublic(campaign.targetAmount) const percentage = (reached / target) * 100 diff --git a/src/components/client/campaigns/CampaignDetails.tsx b/src/components/client/campaigns/CampaignDetails.tsx index 0c6987e4e..3a9bf57de 100644 --- a/src/components/client/campaigns/CampaignDetails.tsx +++ b/src/components/client/campaigns/CampaignDetails.tsx @@ -203,7 +203,7 @@ type CampaignFinanceProps = Props & { expenses: number } const CampaignFinanceSummary = ({ campaign, expenses }: CampaignFinanceProps) => { - const total = campaign.summary.guaranteedAmount + campaign.summary.reachedAmount + const total = (campaign.summary.guaranteedAmount ?? 0) + campaign.summary.reachedAmount const transferred = campaign.summary.blockedAmount + campaign.summary.withdrawnAmount return ( @@ -219,7 +219,7 @@ const CampaignFinanceSummary = ({ campaign, expenses }: CampaignFinanceProps) => - Гарантирани: {moneyPublic(campaign.summary.guaranteedAmount)} + Гарантирани: {moneyPublic(campaign.summary.guaranteedAmount ?? 0)} Date: Wed, 13 Dec 2023 19:26:01 +0200 Subject: [PATCH 2/4] Temporary disable k8s scans tests as they are failing and the deployment is failing. (#1685) --- .github/workflows/tests.yml | 60 ++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 63e16d5ba..ad13277f2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,36 +71,36 @@ jobs: with: image: ghcr.io/podkrepi-bg/maintenance:pr - scan-manifests: - name: Scan k8s manifests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Install kustomize - uses: imranismail/setup-kustomize@v2 - - - name: Build development manifests - run: kustomize build manifests/overlays/development > dev-manifests.yaml - - - name: Scan development manifests with Mondoo - uses: mondoohq/actions/k8s-manifest@main - env: - MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }} - with: - path: dev-manifests.yaml - - - name: Build production manifests - run: kustomize build manifests/overlays/production > prod-manifests.yaml - - - name: Scan production manifests with Mondoo - uses: mondoohq/actions/k8s-manifest@main - env: - MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }} - with: - path: prod-manifests.yaml +# scan-manifests: +# name: Scan k8s manifests +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# with: +# ref: ${{ github.event.pull_request.head.sha }} +# +# - name: Install kustomize +# uses: imranismail/setup-kustomize@v2 +# +# - name: Build development manifests +# run: kustomize build manifests/overlays/development > dev-manifests.yaml +# +# - name: Scan development manifests with Mondoo +# uses: mondoohq/actions/k8s-manifest@main +# env: +# MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }} +# with: +# path: dev-manifests.yaml +# +# - name: Build production manifests +# run: kustomize build manifests/overlays/production > prod-manifests.yaml +# +# - name: Scan production manifests with Mondoo +# uses: mondoohq/actions/k8s-manifest@main +# env: +# MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }} +# with: +# path: prod-manifests.yaml run-playwright: name: Run Playwright From 147e1fc9be56b597b6be73e25b84fb9647cb4563 Mon Sep 17 00:00:00 2001 From: Slavcho Ivanov Date: Wed, 13 Dec 2023 19:54:37 +0200 Subject: [PATCH 3/4] Disable the k8s tests from both release and test (#1686) * Temporary disable k8s scans tests as they are failing and the deployment is failing. * Temporary disable k8s scans tests from release as well. They are failing and the deployment is failing. * Remove the scan-manifests step from release-dev --- .github/workflows/release.yml | 58 +++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96f5342f1..36d8669b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,34 +89,34 @@ jobs: with: image: ghcr.io/podkrepi-bg/frontend:${{ env.VERSION }} - scan-manifests: - name: Scan k8s manifests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install kustomize - uses: imranismail/setup-kustomize@v2 - - - name: Build development manifests - run: kustomize build manifests/overlays/development > dev-manifests.yaml - - - name: Scan development manifests with Mondoo - uses: mondoohq/actions/k8s-manifest@main - env: - MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }} - with: - path: dev-manifests.yaml - - - name: Build production manifests - run: kustomize build manifests/overlays/production > prod-manifests.yaml - - - name: Scan production manifests with Mondoo - uses: mondoohq/actions/k8s-manifest@main - env: - MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }} - with: - path: prod-manifests.yaml +# scan-manifests: +# name: Scan k8s manifests +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# +# - name: Install kustomize +# uses: imranismail/setup-kustomize@v2 +# +# - name: Build development manifests +# run: kustomize build manifests/overlays/development > dev-manifests.yaml +# +# - name: Scan development manifests with Mondoo +# uses: mondoohq/actions/k8s-manifest@main +# env: +# MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }} +# with: +# path: dev-manifests.yaml +# +# - name: Build production manifests +# run: kustomize build manifests/overlays/production > prod-manifests.yaml +# +# - name: Scan production manifests with Mondoo +# uses: mondoohq/actions/k8s-manifest@main +# env: +# MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }} +# with: +# path: prod-manifests.yaml run-playwright: name: Run Playwright @@ -126,7 +126,7 @@ jobs: release-dev: name: Release to dev runs-on: ubuntu-latest - needs: [build-frontend-image, build-maintenance-image, scan-manifests, run-playwright] + needs: [build-frontend-image, build-maintenance-image, run-playwright] environment: name: dev url: https://dev.podkrepi.bg From 740fd9e44d73c401569427cc63390f25e94aaf13 Mon Sep 17 00:00:00 2001 From: Aleksandar Petkov Date: Thu, 14 Dec 2023 14:04:16 +0200 Subject: [PATCH 4/4] client/campaigns: Fix expenses chart and table not showing (#1688) Prettier seems to have added brackets in a place that was not needed --- .../client/campaigns/CampaignDetails.tsx | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/components/client/campaigns/CampaignDetails.tsx b/src/components/client/campaigns/CampaignDetails.tsx index 3a9bf57de..f60bd78c1 100644 --- a/src/components/client/campaigns/CampaignDetails.tsx +++ b/src/components/client/campaigns/CampaignDetails.tsx @@ -155,22 +155,21 @@ export default function CampaignDetails({ campaign }: Props) { - {expensesList?.length || - (canEditCampaign && ( - <> - - - - - - - - ))} + {(expensesList?.length || canEditCampaign) && ( + <> + + + + + + + + )}