diff --git a/.github/workflows/build-and-deploy-beta.yml b/.github/workflows/build-and-deploy-beta.yml deleted file mode 100644 index eb9e05763..000000000 --- a/.github/workflows/build-and-deploy-beta.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Build and deploy GovTool to BETA server -run-name: Deploy by @${{ github.actor }} - -# That should be executed on create: tag event -on: - workflow_dispatch: - inputs: - isProposalDiscussionForumEnabled: - description: "Enable proposal discussion forum" - required: true - type: choice - default: "enabled" - options: - - "enabled" - - "disabled" - forceRebuildDockerImages: - description: "Force rebuild the docker images" - required: false - type: choice - default: "false" - options: - - "true" - - "false" - -env: - ENVIRONMENT: "beta" - CARDANO_NETWORK: "sanchonet" - DOMAIN: "sanchogov.tools" - FORCE_REBUILD: ${{inputs.forceRebuildDockerImages == 'true'}} - -jobs: - deploy: - name: Deploy app - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./scripts/govtool - env: - DBSYNC_POSTGRES_DB: ${{ secrets.DBSYNC_POSTGRES_DB || 'cexplorer' }} - DBSYNC_POSTGRES_PASSWORD: ${{ secrets.DBSYNC_POSTGRES_PASSWORD || 'pSa8JCpQOACMUdGb' }} - DBSYNC_POSTGRES_USER: ${{ secrets.DBSYNC_POSTGRES_USER || 'postgres' }} - DBSYNC_POSTGRES_HOST: ${{ secrets.DBSYNC_POSTGRES_HOST || 'postgres' }} - DBSYNC_POSTGRES_PORT: ${{ secrets.DBSYNC_POSTGRES_PORT || '5432' }} - GA_CLIENT_EMAIL: ${{ secrets.GA_CLIENT_EMAIL }} - GA_PRIVATE_KEY: ${{ secrets.GA_PRIVATE_KEY }} - GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }} - GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }} - GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }} - GTM_ID: ${{ secrets.GTM_ID }} - NPMRC_TOKEN: ${{ secrets.NPMRC_TOKEN }} - IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }} - IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }} - NEXT_PUBLIC_API_URL: "https://participation.sanchogov.tools" - NEXT_PUBLIC_GA4_PROPERTY_ID: ${{ secrets.NEXT_PUBLIC_GA4_PROPERTY_ID }} - PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }} - SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }} - SENTRY_IGNORE_API_RESOLUTION_ERROR: "1" - TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" - USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} - IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{ inputs.isProposalDiscussionForumEnabled == 'enabled' }} - PDF_API_URL: ${{ secrets.PDF_API_URL}} - IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }} - IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v3 - with: - aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Login to AWS ECR - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: eu-west-1 - - - name: Setup SSH agent - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }} - - - name: Deploy app - run: | - make --debug=b all - - - name: Reprovision Grafana - run: | - sleep 30 # give grafana time to start up - make --debug=b reload-grafana diff --git a/.github/workflows/build-and-deploy-dev.yml b/.github/workflows/build-and-deploy-dev.yml deleted file mode 100644 index f80a3b91b..000000000 --- a/.github/workflows/build-and-deploy-dev.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Build and deploy GovTool to DEV server -run-name: Deploy by @${{ github.actor }} - -on: - workflow_dispatch: - inputs: - isProposalDiscussionForumEnabled: - description: "Enable proposal discussion forum" - required: true - type: choice - default: "enabled" - options: - - "enabled" - - "disabled" - forceRebuildDockerImages: - description: "Force rebuild the docker images" - required: false - type: choice - default: "false" - options: - - "true" - - "false" - -env: - ENVIRONMENT: "dev" - CARDANO_NETWORK: "sanchonet" - DOMAIN: "dev-sanchonet.govtool.byron.network" - FORCE_REBUILD: ${{inputs.forceRebuildDockerImages == 'true'}} - -jobs: - deploy: - name: Deploy app - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./scripts/govtool - env: - DBSYNC_POSTGRES_DB: ${{ secrets.DBSYNC_POSTGRES_DB || 'cexplorer' }} - DBSYNC_POSTGRES_PASSWORD: ${{ secrets.DBSYNC_POSTGRES_PASSWORD || 'pSa8JCpQOACMUdGb' }} - DBSYNC_POSTGRES_USER: ${{ secrets.DBSYNC_POSTGRES_USER || 'postgres' }} - DBSYNC_POSTGRES_HOST: ${{ secrets.DBSYNC_POSTGRES_HOST || 'postgres' }} - DBSYNC_POSTGRES_PORT: ${{ secrets.DBSYNC_POSTGRES_PORT || '5432' }} - GA_CLIENT_EMAIL: ${{ secrets.GA_CLIENT_EMAIL }} - GA_PRIVATE_KEY: ${{ secrets.GA_PRIVATE_KEY }} - GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }} - GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }} - GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }} - GTM_ID: ${{ secrets.GTM_ID }} - NPMRC_TOKEN: ${{ secrets.NPMRC_TOKEN }} - IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }} - IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }} - NEXT_PUBLIC_API_URL: "https://participation.sanchogov.tools" - NEXT_PUBLIC_GA4_PROPERTY_ID: ${{ secrets.NEXT_PUBLIC_GA4_PROPERTY_ID }} - DEV_NGINX_BASIC_AUTH: ${{ secrets.DEV_NGINX_BASIC_AUTH }} - PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }} - SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }} - SENTRY_IGNORE_API_RESOLUTION_ERROR: "1" - TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" - USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} - IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{ inputs.isProposalDiscussionForumEnabled == 'enabled' }} - PDF_API_URL: ${{ secrets.PDF_API_URL }} - IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }} - IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v3 - with: - aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Login to AWS ECR - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: eu-west-1 - - - name: Setup SSH agent - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }} - - - name: Deploy app - run: | - make --debug=b all - - - name: Reprovision Grafana - run: | - sleep 30 # give grafana time to start up - make --debug=b reload-grafana diff --git a/.github/workflows/build-and-deploy-staging.yml b/.github/workflows/build-and-deploy-staging.yml deleted file mode 100644 index bbd68afc3..000000000 --- a/.github/workflows/build-and-deploy-staging.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Build and deploy GovTool to STAGING server -run-name: Deploy by @${{ github.actor }} - -on: - push: - branches: - - staging - workflow_dispatch: - inputs: - isProposalDiscussionForumEnabled: - description: "Enable proposal discussion forum" - required: true - type: choice - default: "enabled" - options: - - "enabled" - - "disabled" - forceRebuildDockerImages: - description: "Force rebuild the docker images" - required: false - type: choice - default: "false" - options: - - "true" - - "false" - -env: - ENVIRONMENT: "staging" - CARDANO_NETWORK: "sanchonet" - DOMAIN: "staging.govtool.byron.network" - FORCE_REBUILD: ${{inputs.forceRebuildDockerImages == 'true'}} - -jobs: - deploy: - name: Deploy app - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./scripts/govtool - env: - DBSYNC_POSTGRES_DB: ${{ secrets.DBSYNC_POSTGRES_DB || 'cexplorer' }} - DBSYNC_POSTGRES_PASSWORD: ${{ secrets.DBSYNC_POSTGRES_PASSWORD || 'pSa8JCpQOACMUdGb' }} - DBSYNC_POSTGRES_USER: ${{ secrets.DBSYNC_POSTGRES_USER || 'postgres' }} - DBSYNC_POSTGRES_HOST: ${{ secrets.DBSYNC_POSTGRES_HOST || 'postgres' }} - DBSYNC_POSTGRES_PORT: ${{ secrets.DBSYNC_POSTGRES_PORT || '5432' }} - GA_CLIENT_EMAIL: ${{ secrets.GA_CLIENT_EMAIL }} - GA_PRIVATE_KEY: ${{ secrets.GA_PRIVATE_KEY }} - GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }} - GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }} - GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }} - GTM_ID: ${{ secrets.GTM_ID }} - NPMRC_TOKEN: ${{ secrets.NPMRC_TOKEN }} - IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }} - IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }} - NEXT_PUBLIC_API_URL: "https://participation.sanchogov.tools" - NEXT_PUBLIC_GA4_PROPERTY_ID: ${{ secrets.NEXT_PUBLIC_GA4_PROPERTY_ID }} - STAGING_NGINX_BASIC_AUTH: ${{ secrets.STAGING_NGINX_BASIC_AUTH }} - PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }} - SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }} - SENTRY_IGNORE_API_RESOLUTION_ERROR: "1" - TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" - USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} - IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} - PDF_API_URL: ${{ secrets.PDF_API_URL}} - IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }} - IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v3 - with: - aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Login to AWS ECR - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: eu-west-1 - - - name: Setup SSH agent - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }} - - - name: Deploy app - run: | - make --debug=b all - - - name: Reprovision Grafana - run: | - sleep 30 # give grafana time to start up - make --debug=b reload-grafana diff --git a/.github/workflows/build-and-deploy-test-stack.yml b/.github/workflows/build-and-deploy-test-stack.yml index 522c723b8..1d234776a 100644 --- a/.github/workflows/build-and-deploy-test-stack.yml +++ b/.github/workflows/build-and-deploy-test-stack.yml @@ -61,7 +61,7 @@ jobs: cd $DEST_DIR/tests/test-infrastructure ./build-and-deploy.sh update-images yes | docker system prune -f || echo "Ignoring system prune eror" - envs: GOVTOOL_TAG, GRAFANA_ADMIN_PASSWORD, GRAFANA_SLACK_RECIPIENT, GRAFANA_SLACK_OAUTH_TOKEN, SENTRY_DSN_BACKEND, GTM_ID, NPMRC_TOKEN, SENTRY_DSN_FRONTEND, PIPELINE_URL, USERSNAP_SPACE_API_KEY, APP_ENV, PDF_API_URL, KUBER_API_KEY, IPFS_GATEWAY, IPFS_PROJECT_ID + envs: GOVTOOL_TAG, GRAFANA_ADMIN_PASSWORD, GRAFANA_SLACK_RECIPIENT, GRAFANA_SLACK_OAUTH_TOKEN, SENTRY_DSN_BACKEND, GTM_ID, NPMRC_TOKEN, SENTRY_DSN_FRONTEND, PIPELINE_URL, USERSNAP_SPACE_API_KEY, APP_ENV, PDF_API_URL, KUBER_API_KEY, IPFS_GATEWAY, IPFS_PROJECT_ID, VITE_OUTCOMES_API_URL env: GOVTOOL_TAG: ${{ github.sha }} GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }} @@ -75,6 +75,7 @@ jobs: USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} APP_ENV: test PDF_API_URL: ${{ secrets.PDF_API_URL }} + OUTCOMES_API_URL: ${{ secrets.OUTCOMES_API_URL }} KUBER_API_KEY: ${{ secrets.KUBER_API_KEY }} IPFS_GATEWAY: $${{secrets.IPFS_GATEWAY}} IPFS_PROJECT_ID: $${{secrets.IPFS_PROJECT_ID}} diff --git a/.github/workflows/build-and-deploy-test.yml b/.github/workflows/build-and-deploy-test.yml deleted file mode 100644 index 201f18799..000000000 --- a/.github/workflows/build-and-deploy-test.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Build and deploy GovTool to TEST server -run-name: Deploy by @${{ github.actor }} - -on: - push: - branches: - - test - workflow_dispatch: - inputs: - isProposalDiscussionForumEnabled: - description: "Enable proposal discussion forum" - required: true - type: choice - default: "enabled" - options: - - "enabled" - - "disabled" - forceRebuildDockerImages: - description: "Force rebuild the docker images" - required: false - type: choice - default: "false" - options: - - "true" - - "false" - -env: - ENVIRONMENT: "test" - CARDANO_NETWORK: "sanchonet" - DOMAIN: "test-sanchonet.govtool.byron.network" - FORCE_REBUILD: ${{inputs.forceRebuildDockerImages == 'true'}} - -jobs: - deploy: - name: Deploy app - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./scripts/govtool - env: - DBSYNC_POSTGRES_DB: ${{ secrets.DBSYNC_POSTGRES_DB || 'cexplorer' }} - DBSYNC_POSTGRES_PASSWORD: ${{ secrets.DBSYNC_POSTGRES_PASSWORD || 'pSa8JCpQOACMUdGb' }} - DBSYNC_POSTGRES_USER: ${{ secrets.DBSYNC_POSTGRES_USER || 'postgres' }} - DBSYNC_POSTGRES_HOST: ${{ secrets.DBSYNC_POSTGRES_HOST || 'postgres' }} - DBSYNC_POSTGRES_PORT: ${{ secrets.DBSYNC_POSTGRES_PORT || '5432' }} - GA_CLIENT_EMAIL: ${{ secrets.GA_CLIENT_EMAIL }} - GA_PRIVATE_KEY: ${{ secrets.GA_PRIVATE_KEY }} - GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }} - GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }} - GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }} - GTM_ID: ${{ secrets.GTM_ID }} - NPMRC_TOKEN: ${{ secrets.NPMRC_TOKEN }} - IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }} - IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }} - NEXT_PUBLIC_API_URL: "https://participation.sanchogov.tools" - NEXT_PUBLIC_GA4_PROPERTY_ID: ${{ secrets.NEXT_PUBLIC_GA4_PROPERTY_ID }} - TEST_NGINX_BASIC_AUTH: ${{ secrets.TEST_NGINX_BASIC_AUTH }} - PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }} - SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }} - SENTRY_IGNORE_API_RESOLUTION_ERROR: "1" - TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" - USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} - IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} - PDF_API_URL: ${{ secrets.PDF_API_URL}} - IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }} - IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v3 - with: - aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Login to AWS ECR - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: eu-west-1 - - - name: Setup SSH agent - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }} - - - name: Deploy app - run: | - make --debug=b all - - - name: Reprovision Grafana - run: | - sleep 30 # give grafana time to start up - make --debug=b reload-grafana diff --git a/.github/workflows/deploy-dev-from-tag.yml b/.github/workflows/deploy-dev-from-tag.yml deleted file mode 100644 index 9c0d94ec8..000000000 --- a/.github/workflows/deploy-dev-from-tag.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Build and deploy GovTool to DEV server -run-name: Deploy by @${{ github.actor }} - -on: - create: - -env: - ENVIRONMENT: "dev" - CARDANO_NETWORK: "sanchonet" - DOMAIN: "dev-sanchonet.govtool.byron.network" - -jobs: - deploy: - name: Deploy app - if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/dev-') - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./scripts/govtool - env: - DBSYNC_POSTGRES_DB: "cexplorer" - DBSYNC_POSTGRES_USER: "postgres" - DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb" - GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }} - GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }} - GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }} - NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }} - SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }} - TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" - GTM_ID: ${{ secrets.GTM_ID }} - NPMRC_TOKEN: ${{ secrets.NPMRC_TOKEN }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }} - PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }} - IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }} - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - fetch-depth: 0 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v3 - with: - aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Login to AWS ECR - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: eu-west-1 - - - name: Setup SSH agent - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }} - - - name: Deploy app - run: | - make --debug=b all - - - name: Reprovision Grafana - run: | - sleep 30 # give grafana time to start up - make --debug=b reload-grafana diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml index 3dd137070..65d582123 100644 --- a/.github/workflows/merge.yaml +++ b/.github/workflows/merge.yaml @@ -136,6 +136,7 @@ jobs: VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED=${{ secrets.VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED }} VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED=${{ secrets.VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED }} VITE_PDF_API_URL=${{ secrets.VITE_PDF_API_URL }} + VITE_OUTCOMES_API_URL=${{ secrets.VITE_OUTCOMES_API_URL }} VITE_IPFS_GATEWAY=${{ secrets.IPFS_GATEWAY }} VITE_IPFS_PROJECT_ID=${{ secrets.IPFS_PROJECT_ID }} IPFS_GATEWAY=${{ secrets.IPFS_GATEWAY }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index eed67c623..7cf668aa6 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -122,6 +122,7 @@ jobs: VITE_USERSNAP_SPACE_API_KEY=${{ secrets.VITE_USERSNAP_SPACE_API_KEY }} VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED=${{ secrets.VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED }} VITE_PDF_API_URL=${{ secrets.VITE_PDF_API_URL }} + VITE_OUTCOMES_API_URL=${{ secrets.VITE_OUTCOMES_API_URL }} VITE_IPFS_GATEWAY=${{ secrets.IPFS_GATEWAY }} VITE_IPFS_PROJECT_ID=${{ secrets.IPFS_PROJECT_ID }} IPFS_GATEWAY=${{ secrets.IPFS_GATEWAY }} diff --git a/.github/workflows/resync-cardano-node-and-db-sync.yml b/.github/workflows/resync-cardano-node-and-db-sync.yml deleted file mode 100644 index f4ffc8fac..000000000 --- a/.github/workflows/resync-cardano-node-and-db-sync.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: Re-sync Cardano Node and Cardano DB Sync -run-name: Cardano re-sync on ${{ inputs.environment }} by @${{ github.actor }} - -on: - workflow_dispatch: - inputs: - environment: - required: true - type: choice - default: "dev" - options: - - "dev" - - "test" - - "staging" - - "beta" - isProposalDiscussionForumEnabled: - description: "Enable proposal discussion forum" - required: true - type: choice - default: "enabled" - options: - - "enabled" - - "disabled" - forceRebuildDockerImages: - description: "Force rebuild the docker images" - required: false - type: choice - default: "false" - options: - - "true" - - "false" - -env: - ENVIRONMENT: ${{ inputs.environment || 'dev' }} - CARDANO_NETWORK: "sanchonet" - FORCE_REBUILD: ${{inputs.forceRebuildDockerImages == 'true'}} - -jobs: - deploy: - name: Re-sync Cardano state - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./scripts/govtool - env: - DBSYNC_POSTGRES_DB: ${{ secrets.DBSYNC_POSTGRES_DB || 'cexplorer' }} - DBSYNC_POSTGRES_PASSWORD: ${{ secrets.DBSYNC_POSTGRES_PASSWORD || 'pSa8JCpQOACMUdGb' }} - DBSYNC_POSTGRES_USER: ${{ secrets.DBSYNC_POSTGRES_USER || 'postgres' }} - DBSYNC_POSTGRES_HOST: ${{ secrets.DBSYNC_POSTGRES_HOST || 'postgres' }} - DBSYNC_POSTGRES_PORT: ${{ secrets.DBSYNC_POSTGRES_PORT || '5432' }} - GA_CLIENT_EMAIL: ${{ secrets.GA_CLIENT_EMAIL }} - GA_PRIVATE_KEY: ${{ secrets.GA_PRIVATE_KEY }} - GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }} - GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }} - GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }} - GTM_ID: ${{ secrets.GTM_ID }} - NPMRC_TOKEN: ${{ secrets.NPMRC_TOKEN }} - IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }} - IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }} - NEXT_PUBLIC_API_URL: "https://participation.sanchogov.tools" - NEXT_PUBLIC_GA4_PROPERTY_ID: ${{ secrets.NEXT_PUBLIC_GA4_PROPERTY_ID }} - DEV_NGINX_BASIC_AUTH: ${{ secrets.DEV_NGINX_BASIC_AUTH }} - TEST_NGINX_BASIC_AUTH: ${{ secrets.TEST_NGINX_BASIC_AUTH }} - STAGING_NGINX_BASIC_AUTH: ${{ secrets.STAGING_NGINX_BASIC_AUTH }} - PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }} - SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }} - SENTRY_IGNORE_API_RESOLUTION_ERROR: "1" - TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" - USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} - IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{ inputs.isProposalDiscussionForumEnabled == 'enabled' }} - PDF_API_URL: ${{ secrets.PDF_API_URL }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v3 - with: - aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Login to AWS ECR - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: eu-west-1 - - - name: Setup SSH agent - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }} - - - name: Set domain - run: | - if [[ "${{ inputs.environment }}" == "staging" ]]; then - echo "DOMAIN=staging.govtool.byron.network" >> $GITHUB_ENV - elif [[ "${{ inputs.environment }}" == "beta" ]]; then - echo "DOMAIN=sanchogov.tools" >> $GITHUB_ENV - else - echo "DOMAIN=${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network}" >> $GITHUB_ENV - fi - - - name: Destroy Cardano Node, DB sync and Postgres database - run: | - make --debug=b destroy-cardano-node-and-dbsync - - - name: Deploy app - run: | - make --debug=b all diff --git a/.github/workflows/toggle-maintenance.yml b/.github/workflows/toggle-maintenance.yml deleted file mode 100644 index bdb5f5434..000000000 --- a/.github/workflows/toggle-maintenance.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Toggle maintenance page -run-name: Maintenance mode set to ${{ inputs.maintenance }} on ${{ inputs.environment }} by @${{ github.actor }} - -on: - workflow_dispatch: - inputs: - environment: - required: true - type: choice - default: "dev" - options: - - "dev" - - "test" - - "staging" - - "beta" - maintenance: - required: true - type: choice - default: "enabled" - options: - - "enabled" - - "disabled" - -env: - ENVIRONMENT: ${{ inputs.environment || 'dev' }} - CARDANO_NETWORK: "sanchonet" - -jobs: - toggle_maintenance: - name: Toggl maintenance state - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./scripts/govtool - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v3 - with: - aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Login to AWS ECR - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: eu-west-1 - - - name: Setup SSH agent - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }} - - - name: Set domain - run: | - if [[ "${{ inputs.environment }}" == "staging" ]]; then - echo "DOMAIN=staging.govtool.byron.network" >> $GITHUB_ENV - elif [[ "${{ inputs.environment }}" == "beta" ]]; then - echo "DOMAIN=sanchogov.tools" >> $GITHUB_ENV - else - echo "DOMAIN=${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network}" >> $GITHUB_ENV - fi - - - name: Toggle maintenance - run: | - make toggle-maintenance maintenance=${{ inputs.maintenance || 'disabled' }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 259b34714..c924719a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,13 +14,18 @@ changes. ### Fixed +- Fix responsive error on menu [Issue 3055](https://github.com/IntersectMBO/govtool/issues/3055) +- Fix wrong placement of nav items in disconnected menu [Issue 3057](https://github.com/IntersectMBO/govtool/issues/3057) +- Fix missing subtraction withdrawals from ada holder balance [Issue 3061](https://github.com/IntersectMBO/govtool/issues/3061) + ### Changed +- Change drep details and governance action header components to follow accessibility standards [Issue 3065](https://github.com/IntersectMBO/govtool/issues/3065) + ### Removed ## [v2.0.12](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.12) 2025-02-21 - ### Added - Add metadata url and hash to drep details [Issue 2911](https://github.com/IntersectMBO/govtool/issues/2911) @@ -34,6 +39,7 @@ changes. - Add script to update GovTool version - Add `isStakeKeyRegistered` for the usage by pillars [Issue 2384](https://github.com/IntersectMBO/govtool/issues/2384) - Add server side compression for large assets +- Add outcomes ### Fixed diff --git a/README.md b/README.md index 27388fa33..5fb7b8912 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,6 @@ The Cardano GovTool enables ada holders to experience the governance features de - [gov.tools](https://gov.tools/) -#### SanchoNet - -- [sanchogov.tools](https://sanchogov.tools/) - #### Preview Testnet - [preview.gov.tools](https://preview.gov.tools/) @@ -42,7 +38,6 @@ Learn more; [docs.gov.tools](https://docs.gov.tools/cardano-govtool/using-govtoo - [Backend](./govtool/backend/README.md) - [Frontend](./govtool/frontend/README.md) -- [Infrastructure](./infra/terraform/README.md) - [In repo documentation](./docs/) - [Tests](./tests/) diff --git a/docs/operations/DEPLOY.md b/docs/operations/DEPLOY.md deleted file mode 100644 index 2f75566f3..000000000 --- a/docs/operations/DEPLOY.md +++ /dev/null @@ -1,70 +0,0 @@ -# Deployment - -## AWS Setup - -Requirements: - -- aws-cli v2+ -- Terraform v1.5.6+ -- AWS IAM account CLI keys - -### Using NIX configuration - -Change directory to `src` and type `nix-shell`. The required tools will be -downloaded and installed in their required versions. - -### Bootstrap - -AWS is configured with Terraform, but the account needs to be bootstrapped beforehand. - -This has to be done only once per AWS account. - -1. Configure AWS CLI with `aws configure` (if you are using a configuration profile, use `aws --profile MYPROFILE configure` and then `export AWS_PROFILE=MYPROFILE`). -1. Execute `./infra/terraform/bootstrap-aws-account.sh` script. - -### Infrastructure setup - -1. Change directory to `src/terraform`. -1. Run `terraform init` to initialize Terraform. -1. Run `terraform plan` to view changes that would be performed to infrastructure. -1. Take note of the outputs - they contain ECR repo URLs and app domains. - -Note: the Terraform code configures the EC2 instance using `infra/terraform/modules/govtool-ec2/user_data.sh`. This script is only executed on instance creation. - -## Application deployment - -1. Set environment variables in your shell (see `src/.env.example` file for list of variables and sample values). -1. Prepare configuration files for target environment: - 1. Run `make prepare-config` - this will create `config/target` directory on your machine with necessary files. - 1. Run `make upload-config instance=$INSTANCE cardano_network=$CARDANO_NETWORK env=$ENVIRONMENT` - this will upload the `config/target` directory to appropriate EC2 instance. -1. Build the application Docker images: - 1. Run `make build-backend`. - 1. Run `make build-frontend instance=$INSTANCE cardano_network=$CARDANO_NETWORK env=$ENVIRONMENT`. -1. Push the images to ECR: - 1. Run `make docker-login`. - 1. Run `make push-backend`. - 1. Run `make push-frontend instance=$INSTANCE cardano_network=$CARDANO_NETWORK env=$ENVIRONMENT`. -1. Deploy the application: run `make deploy-stack instance=$INSTANCE cardano_network=$CARDANO_NETWORK env=$ENVIRONMENT`. - -On first deploy, the last command will take a long while. On subsequent deployments it should perform faster. - -Alternatively you can type `make all instance=$INSTANCE cardano_network=$CARDANO_NETWORK env=$ENVIRONMENT` to deploy all at once. - -View the app at `https://${ENVIRONMENT}-${INSTANCE}.govtool.byron.network`. -Keep in mind that after initial deployment on a new environment, it will take some time for the Cardano node to get in sync. - -## Aftermatch - -After performing a deploy from a local machine, it is crucial to carefully track -the application's accessibility and functionality to ensure no unintended -changes, such as the accidental activation of BasicAuth[^1], have occurred. - -Additionally, verifying that all configuration files and environment variables, -particularly those related to environment-specific settings like database -connections or external service endpoints, are correctly generated and applied -is essential for maintaining the intended behavior of the application across -different environments. This includes a thorough check of environment variables -to confirm they are correctly set and aligned with the specific needs of the -deployed environment. - -[^1]: https://github.com/IntersectMBO/govtool/discussions/174 diff --git a/docs/operations/README.md b/docs/operations/README.md deleted file mode 100644 index f14769304..000000000 --- a/docs/operations/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# Overview - -The application is setup with the following tools: - -- Terraform - for creating infrastructure in AWS for each environment -- Docker - to build and run application components -- Docker Compose - to connect the application components together and deploy them as a stack -- make - to simplify operations tasks -- Prometheus - to gather metrics from application host and Docker containers -- Grafana - to visualize metrics gathered from Prometheus and handle alerting - -# Environments - -The application is hosted on AWS, there are several application environments, each of them is described with Terraform in `src/terraform/main.tf` file. Terraform is executed manually, in order to add/modify/delete an environment, modify the code and run `terraform plan` to see the changes and `terraform apply` to execute them. - -Each environment consists of: - -- VPC network (with subnets, route tables, IGW) -- Security Groups -- EC2 instance -- Elastic IPs associated with EC2 instance -- Route 53 record (only for environments using `govtool.byron.network` domain) - -For each environment, the frontend is hosted at root and the backend is at `/api`. - -## List of public environments - -### beta - -A beta environment connected to `preview` Cardano network. - -Available at https://preview.gov.tools/. The DNS record for this domain is created manually. - -# Deployment - -Deployment is performed via GitHub Actions workflow (`.github/workflows/build-and-deploy.yml`). - -The workflow performs the following steps: - -- check if the environment is defined in Terraform (to avoid deployment attempt to inexistant environment) -- build of frontend app -- build of backend app -- generate configuration files and upload them (over SSH) to the target environment -- setup the application compoments with Docker Compose on the target environment - -The workflow can be triggered directly from GitHub Actions panel. When ruuning the workflow, you need to specify: - -- Cardano network to be used -- environment name -- optionally skip the build process (frontend and backend) - useful when there are plain configuration changes that do not require the application to be rebuild - -# Monitoring - -Monitoring is achieved with Prometheus and Grafana, which are deployed together with each environment. Grafana is available at `/grafana`, the `admin` password is defined in a GitHub Actions secret `GRAFANA_ADMIN_PASSWORD`. - -Each Grafana instance is managed as code and provisioned with YAML files located at `src/config/grafana-provisioning`. This includes a default datasource, dashboard and alerting. The alerts are configured to be sent to Slack via Slack bot. - -The Slack bot OAuth token and recipient are defined with GitHub Actions secrets `GRAFANA_SLACK_OAUTH_TOKEN` and `GRAFANA_SLACK_RECIPIENT`, respectively. - -### Frontend - -Deploying new versions of the application is done using Github actions - -1. Open [`repository`](https://github.com/IntersectMBO/govtool) -2. Select "Actions" tab -3. From left menu choose "Build and deploy app" -4. From the droping options - "Run workflow", select the branch, Cardano network and type of environment for your deployment -5. Press "Run workflow" -6. Wait for the final effect. It's done. diff --git a/govtool/backend/sql/get-stake-key-voting-power.sql b/govtool/backend/sql/get-stake-key-voting-power.sql index 0e604ccf6..1ad120042 100644 --- a/govtool/backend/sql/get-stake-key-voting-power.sql +++ b/govtool/backend/sql/get-stake-key-voting-power.sql @@ -27,9 +27,18 @@ Balance AS ( GROUP BY addr_id, addr_raw +), +Withdrawal AS ( + SELECT + COALESCE(SUM(w.amount), 0) AS withdrawal_amount, + w.addr_id + FROM + withdrawal w + GROUP BY + w.addr_id ) SELECT - (COALESCE(rr.amount, 0) + COALESCE(r.amount, 0) + COALESCE(b.amount, 0)) AS total_balance, + (COALESCE(rr.amount, 0) + COALESCE(r.amount, 0) + COALESCE(b.amount, 0) - COALESCE(w.withdrawal_amount, 0)) AS total_balance, b.addr_raw::text AS stake_address FROM Balance b @@ -37,10 +46,13 @@ LEFT JOIN RewardRest rr ON rr.addr_id = b.addr_id LEFT JOIN Reward r ON r.addr_id = rr.addr_id +LEFT JOIN + Withdrawal w ON w.addr_id = b.addr_id WHERE b.addr_id = (SELECT id FROM stake_address WHERE hash_raw = decode(?, 'hex')) GROUP BY b.addr_raw, rr.amount, r.amount, - b.amount \ No newline at end of file + b.amount, + w.withdrawal_amount \ No newline at end of file diff --git a/govtool/frontend/.env.example b/govtool/frontend/.env.example index 5050248ee..db8d2ae78 100644 --- a/govtool/frontend/.env.example +++ b/govtool/frontend/.env.example @@ -9,5 +9,6 @@ VITE_USERSNAP_SPACE_API_KEY="" VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true' VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED='true' VITE_PDF_API_URL="" +VITE_OUTCOMES_API_URL="" VITE_IPFS_GATEWAY="" VITE_IPFS_PROJECT_ID="" \ No newline at end of file diff --git a/govtool/frontend/Dockerfile b/govtool/frontend/Dockerfile index 7c3eb3740..0e225b197 100644 --- a/govtool/frontend/Dockerfile +++ b/govtool/frontend/Dockerfile @@ -10,6 +10,7 @@ ARG NPMRC_TOKEN ARG VITE_USERSNAP_SPACE_API_KEY ARG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true' ARG VITE_PDF_API_URL +ARG VITE_OUTCOMES_API_URL ARG VITE_IPFS_GATEWAY ARG VITE_IPFS_PROJECT_ID @@ -25,6 +26,8 @@ RUN \ : "${VITE_SENTRY_DSN:?Build argument VITE_SENTRY_DSN is not set}" && \ : "${NPMRC_TOKEN:?Build argument NPMRC_TOKEN is not set}" && \ : "${VITE_USERSNAP_SPACE_API_KEY:?Build argument VITE_USERSNAP_SPACE_API_KEY is not set}" && \ + : "${VITE_PDF_API_URL:?Build argument VITE_PDF_API_URL is not set}" && \ + : "${VITE_OUTCOMES_API_URL:?Build argument VITE_OUTCOMES_API_URL is not set}" && \ : "${VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED:?Build argument VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED is not set}" && \ : "${VITE_IPFS_GATEWAY:?Build argument VITE_IPFS_GATEWAY is not set}" && \ : "${VITE_IPFS_PROJECT_ID:?Build argument VITE_IPFS_PROJECT_ID is not set}" diff --git a/govtool/frontend/Dockerfile.qovery b/govtool/frontend/Dockerfile.qovery index 0f871462f..2b84fc493 100644 --- a/govtool/frontend/Dockerfile.qovery +++ b/govtool/frontend/Dockerfile.qovery @@ -10,6 +10,7 @@ ARG NPMRC_TOKEN ARG VITE_USERSNAP_SPACE_API_KEY ARG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED ARG VITE_PDF_API_URL +ARG VITE_OUTCOMES_API_URL ARG VITE_IPFS_GATEWAY ARG VITE_IPFS_PROJECT_ID diff --git a/govtool/frontend/default.nix b/govtool/frontend/default.nix index 3dd8e1e52..083eb15f0 100644 --- a/govtool/frontend/default.nix +++ b/govtool/frontend/default.nix @@ -6,6 +6,7 @@ , VITE_SENTRY_DSN ? "" , VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED ? "" , VITE_PDF_API_URL ? "" +, VITE_OUTCOMES_API_URL ? "" , CARDANO_NETWORK ? "sanchonet" }: let diff --git a/govtool/frontend/package-lock.json b/govtool/frontend/package-lock.json index c7d901ef2..d291ec4ec 100644 --- a/govtool/frontend/package-lock.json +++ b/govtool/frontend/package-lock.json @@ -13,7 +13,7 @@ "@emotion/styled": "^11.11.0", "@emurgo/cardano-serialization-lib-asmjs": "^12.1.1", "@hookform/resolvers": "^3.3.1", - "@intersect.mbo/govtool-outcomes-pillar-ui": "1.2.0", + "@intersect.mbo/govtool-outcomes-pillar-ui": "1.2.2", "@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8", "@intersect.mbo/pdf-ui": "0.6.2", "@mui/icons-material": "^5.14.3", @@ -3372,17 +3372,16 @@ } }, "node_modules/@intersect.mbo/govtool-outcomes-pillar-ui": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@intersect.mbo/govtool-outcomes-pillar-ui/-/govtool-outcomes-pillar-ui-1.2.0.tgz", - "integrity": "sha512-AzY2pOAExXCz7M6S2YeIglZ06Gdf0N9gWxJBRDQ2BuDsRC2arn4DwT2F+XHyOhM2AWSZeql0Dx86a0pZP7a1+w==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@intersect.mbo/govtool-outcomes-pillar-ui/-/govtool-outcomes-pillar-ui-1.2.2.tgz", + "integrity": "sha512-ecUCLtzXm2SVmpU+3/EiaUBep2xJwFMvxXOEa2PfUxrJUhqmrpdjGJalW8ZpiKM3JTgaLUvh3pZYZ3uc8Y/q8Q==", "license": "ISC", "dependencies": { "@fontsource/poppins": "^5.0.14", "@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8", "axios": "^1.7.9", "bech32": "^2.0.0", - "buffer": "^6.0.3", - "react-query": "^3.39.3" + "buffer": "^6.0.3" }, "peerDependencies": { "@emotion/react": "^11.11.4", @@ -3391,6 +3390,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-markdown": "^9.0.1", + "react-query": "^3.39.3", "react-router-dom": "^6.23.1", "sass": "^1.77.2" } diff --git a/govtool/frontend/package.json b/govtool/frontend/package.json index 09218386d..d8cfdcc8f 100644 --- a/govtool/frontend/package.json +++ b/govtool/frontend/package.json @@ -27,7 +27,7 @@ "@emotion/styled": "^11.11.0", "@emurgo/cardano-serialization-lib-asmjs": "^12.1.1", "@hookform/resolvers": "^3.3.1", - "@intersect.mbo/govtool-outcomes-pillar-ui": "1.2.0", + "@intersect.mbo/govtool-outcomes-pillar-ui": "1.2.2", "@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8", "@intersect.mbo/pdf-ui": "0.6.2", "@mui/icons-material": "^5.14.3", diff --git a/govtool/frontend/src/components/molecules/DataMissingHeader.tsx b/govtool/frontend/src/components/molecules/DataMissingHeader.tsx index c0e431663..46e0ff880 100644 --- a/govtool/frontend/src/components/molecules/DataMissingHeader.tsx +++ b/govtool/frontend/src/components/molecules/DataMissingHeader.tsx @@ -75,6 +75,7 @@ export const DataMissingHeader = ({ ...titleStyle, }} variant="title2" + component="h1" > {(isDataMissing && getMetadataDataMissingStatusTranslation( diff --git a/govtool/frontend/src/components/molecules/GovernanceActionCardElement.tsx b/govtool/frontend/src/components/molecules/GovernanceActionCardElement.tsx index a0900abe7..9084ffa0c 100644 --- a/govtool/frontend/src/components/molecules/GovernanceActionCardElement.tsx +++ b/govtool/frontend/src/components/molecules/GovernanceActionCardElement.tsx @@ -172,6 +172,7 @@ export const GovernanceActionCardElement = ({ > {label} @@ -409,7 +410,9 @@ const ReferencesLink = ({ label, uri }: ReferenceItem) => ( }, }} > - {label} + + {label} + { src={IMAGES.appLogo} /> - {screenWidth >= 1024 ? renderDesktopNav() : renderMobileNav()} + {screenWidth >= 1145 ? renderDesktopNav() : renderMobileNav()} ); diff --git a/govtool/frontend/src/consts/navItems.tsx b/govtool/frontend/src/consts/navItems.tsx index 1eee2e44d..ca6319782 100644 --- a/govtool/frontend/src/consts/navItems.tsx +++ b/govtool/frontend/src/consts/navItems.tsx @@ -24,6 +24,12 @@ export const NAV_ITEMS = [ navTo: PATHS.dRepDirectory, label: i18n.t("dRepDirectory.title"), }, + { + dataTestId: "proposed-governance-actions-link", + navTo: PDF_PATHS.proposalDiscussion, + label: i18n.t("proposalDiscussion.title"), + newTabLink: null, + }, { dataTestId: "governance-actions-link", navTo: PATHS.governanceActions, @@ -36,12 +42,6 @@ export const NAV_ITEMS = [ navTo: OUTCOMES_PATHS.governanceActionsOutcomes, newTabLink: null, }, - { - dataTestId: "proposed-governance-actions-link", - navTo: PDF_PATHS.proposalDiscussion, - label: i18n.t("proposalDiscussion.title"), - newTabLink: null, - }, { dataTestId: "guides-link", navTo: "", diff --git a/govtool/frontend/src/pages/Dashboard.tsx b/govtool/frontend/src/pages/Dashboard.tsx index 497b34413..684558337 100644 --- a/govtool/frontend/src/pages/Dashboard.tsx +++ b/govtool/frontend/src/pages/Dashboard.tsx @@ -3,7 +3,12 @@ import { useLocation, Outlet, useNavigate } from "react-router-dom"; import { Box } from "@mui/material"; import { Background, ScrollToManage } from "@atoms"; -import { CONNECTED_NAV_ITEMS, DRAWER_WIDTH, PATHS } from "@consts"; +import { + CONNECTED_NAV_ITEMS, + DRAWER_WIDTH, + OUTCOMES_PATHS, + PATHS, +} from "@consts"; import { useCardano } from "@context"; import { useScreenDimension, useTranslation } from "@hooks"; import { DashboardTopNav, Drawer, Footer } from "@organisms"; @@ -19,6 +24,16 @@ export const Dashboard = () => { const getPageTitle = (path: string) => { if (path === PATHS.dashboard) return t("dashboard.title"); + + if (path.startsWith(OUTCOMES_PATHS.governanceActionsOutcomes)) { + const outcomesNavItem = findNavItem( + CONNECTED_NAV_ITEMS, + OUTCOMES_PATHS.governanceActionsOutcomes, + ); + + return outcomesNavItem ?? ""; + } + return findNavItem(CONNECTED_NAV_ITEMS, path) ?? ""; }; diff --git a/govtool/frontend/src/pages/GovernanceActionOutComes.tsx b/govtool/frontend/src/pages/GovernanceActionOutComes.tsx index 27548f6e2..cf703d9b0 100644 --- a/govtool/frontend/src/pages/GovernanceActionOutComes.tsx +++ b/govtool/frontend/src/pages/GovernanceActionOutComes.tsx @@ -43,7 +43,9 @@ export const GovernanceActionOutComesPillar = () => { } > - + {!context.isEnabled &&