From 688746941cc68d5379c532838c786210ac39e620 Mon Sep 17 00:00:00 2001 From: KirillDogadin-std <59374892+KirillDogadin-std@users.noreply.github.com> Date: Tue, 7 Mar 2023 18:47:30 +0100 Subject: [PATCH] feat: Production banner to advertise electron app (#583) Co-authored-by: Abdelrhman Farag Co-authored-by: Valia Fetisov --- .drone.yml | 14 +++++++---- frontend/Dockerfile | 2 ++ frontend/README.md | 1 + .../collateral/CollateralAuctionFlow.vue | 8 +++--- frontend/components/auction/debt/DebtFlow.vue | 8 +++--- .../auction/surplus/SurplusFlow.vue | 8 +++--- frontend/components/layout/Header.stories.js | 15 ++++++++--- frontend/components/layout/Header.vue | 7 ++++++ .../layout/ProductionBannerElectron.vue | 25 +++++++++++++++++++ frontend/components/vault/VaultFlow.vue | 8 +++--- frontend/containers/UnifiedContainer.vue | 8 +++--- frontend/layouts/default.vue | 4 +++ frontend/nuxt.config.js | 1 + 13 files changed, 81 insertions(+), 28 deletions(-) create mode 100644 frontend/components/layout/ProductionBannerElectron.vue diff --git a/.drone.yml b/.drone.yml index b926d8747..fe25c4ab2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,6 +22,8 @@ data: value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/contact_email - key: STAGING_BANNER_URL value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/staging_banner_url + - key: PRODUCTION_BANNER_URL + value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/production_banner_url - key: HEAPIO_ID value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/heapio_id - key: FRONTEND_ORIGIN @@ -130,6 +132,8 @@ data: value_from_secret: auction-ui/production.auction-ui.k8s.sidestream.tech/frontend/heapio_id - key: FRONTEND_ORIGIN value_from_secret: auction-ui/production.auction-ui.k8s.sidestream.tech/frontend/frontend_origin + - key: PRODUCTION_BANNER_URL + value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/production_banner_url tags_to_cache_from: - "main" trigger: @@ -214,8 +218,8 @@ data: aws_target_eks_cluster_name: eks-cluster-sidestream aws_ssm_path_to_base64_encoded_secrets_yaml: auction-ui/secrets.yaml value_files: - - values.yaml - - values.override_main.auction-ui.k8s.sidestream.tech.yaml + - values.yaml + - values.override_main.auction-ui.k8s.sidestream.tech.yaml target_namespace: "auction-ui-main" release_name: "auction-ui" values_to_set: @@ -234,8 +238,8 @@ data: aws_target_eks_cluster_name: eks-cluster-sidestream aws_ssm_path_to_base64_encoded_secrets_yaml: auction-ui/secrets.yaml value_files: - - values.yaml - - values.override_unified-auctions.makerdao.com.yaml + - values.yaml + - values.override_unified-auctions.makerdao.com.yaml target_namespace: "auction-ui-production" release_name: "auction-ui" values_to_set: @@ -299,7 +303,7 @@ data: - npm run test services: - - name: hardhat-service # named with 'service' to avoid duplication with the default value + - name: hardhat-service # named with 'service' to avoid duplication with the default value image: ghcr.io/sidestream-tech/unified-auctions-ui/core-hardhat:pr-${DRONE_PULL_REQUEST} expose: 8545 diff --git a/frontend/Dockerfile b/frontend/Dockerfile index d1c9c1d9e..78a0d5cb9 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -44,6 +44,8 @@ ARG CONTACT_EMAIL ENV CONTACT_EMAIL=${CONTACT_EMAIL} ARG STAGING_BANNER_URL ENV STAGING_BANNER_URL=${STAGING_BANNER_URL} +ARG PRODUCTION_BANNER_URL +ENV PRODUCTION_BANNER_URL=${PRODUCTION_BANNER_URL} ARG HEAPIO_ID ENV HEAPIO_ID=${HEAPIO_ID} ARG FRONTEND_ORIGIN diff --git a/frontend/README.md b/frontend/README.md index a9eea1764..9c1258372 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -40,6 +40,7 @@ Help on both things is given in the linked resources above. - `PRODUCTION_DOMAIN`: (optional) Required in order to enable [plausible.io statistics](https://github.com/moritzsternemann/vue-plausible#configuration). In addition to adding it here, the domain (e.g. `auctions.makerdao.network`) should also be registered within [plausible dashboard](https://plausible.io/). - `CONTACT_EMAIL`: (optional) Required in order to display contact link in the footer. This email should be able to accept and manage bug reports and other contact requests. - `STAGING_BANNER_URL`: (optional) When set a banner will be displayed, warning the user that they are using a staging version. The text will use `STAGING_BANNER_URL` as a link to production UI. +- `PRODUCTION_BANNER_URL`: (optional) When set a banner will be displayed, notifying the user that they can also use an electron app. The text will use `PRODUCTION_BANNER_URL` as a link the electron app. - `MAX_PRIORITY_FEE_PER_GAS_WEI`: (optional, default can be found in core/src/gas.ts) – [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) `max_priority_fee_per_gas` value - `HEAPIO_ID`: (optional) [HeapIO analytics](https://heapanalytics.com/) Project's Environment ID. Required for tracking analytics. - `FRONTEND_ORIGIN`: (optional, default empty) – public url of the frontend, eg `https://unified-auctions.makerdao.com`. Used to correctly specify open graph meta tags diff --git a/frontend/components/auction/collateral/CollateralAuctionFlow.vue b/frontend/components/auction/collateral/CollateralAuctionFlow.vue index 34181bcfd..ce89007fc 100644 --- a/frontend/components/auction/collateral/CollateralAuctionFlow.vue +++ b/frontend/components/auction/collateral/CollateralAuctionFlow.vue @@ -1,5 +1,5 @@