Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Banner for production #583

Merged
merged 12 commits into from
Mar 7, 2023
Merged

feat: Banner for production #583

merged 12 commits into from
Mar 7, 2023

Conversation

KirillDogadin-std
Copy link
Contributor

@KirillDogadin-std KirillDogadin-std commented Feb 7, 2023

Closes #581

Checklist:

  • issue number linked above after pound (#)
    • replace "Closes " with "Contributes to" or other if this PR does not close the issue
  • issue checkboxes are all addressed
  • manually checked my feature / not applicable
  • wrote tests / not applicable
  • attached screenshots / not applicable

image

@LukSteib
Copy link
Contributor

LukSteib commented Feb 7, 2023

  • Can we adjust the wording from "... electron packaged application" to "Desktop application".

Copy link
Contributor

@LukSteib LukSteib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way for me to test locally?!

@@ -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 `STAGING_BANNER_URL` as a link the electron app.
Copy link
Contributor

@LukSteib LukSteib Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 2nd sentence probably needs to be adjusted to "Production_Banner_URL"?!

@KirillDogadin-std
Copy link
Contributor Author

Is there a way for me to test locally?!

set the variable in the terminal according to the readme

export PRODUCTION_BANNER_URL='https://asdfalsdjf`
npm run dev

LukSteib
LukSteib previously approved these changes Feb 7, 2023
Copy link
Contributor

@valiafetisov valiafetisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't merge this very noticeable banner on top of every page, until we have updation strategy in place. Otherwise, we will end up with users downloading the app and never updating it (and not even knowing that it's outdated)

@LukSteib
Copy link
Contributor

LukSteib commented Feb 7, 2023

Otherwise, we will end up with users downloading the app and never updating it

Good point. Didn't think about it tbh. So I agree here. Let's keep the PR open for now.

@LukSteib
Copy link
Contributor

LukSteib commented Mar 6, 2023

@valiafetisov can we merge this one as well as the updation strategy got merged?
If we do, is there anything else that needs to be done additionally except for adding the PRODUCTION_BANNER_URLto the chamber?

@valiafetisov
Copy link
Contributor

valiafetisov commented Mar 6, 2023

Let's wait for the #589 as well 🙂

Although I wouldn't actually announce electron app via such annoying banner, which kind of suggests to go and install the electron instead of using the web app. I think instead we might want to just add electron somewhere to the main page, close to the regular links [1] or as a separate "block".

[1]
Screenshot 2023-03-06 at 19 41 10

@LukSteib
Copy link
Contributor

LukSteib commented Mar 7, 2023

Although I wouldn't actually announce electron app via such annoying banner, which kind of suggests to go and install the electron instead of using the web app

See your point. I'd suggest to still show the banner but in a way more subtle way by giving it a more decent greyish color.

think instead we might want to just add electron somewhere to the main page, close to the regular links [1] or as a separate "block".

Agree. There is a PR for it already: #593

@valiafetisov
Copy link
Contributor

I'd suggest to still show the banner but in a way more subtle way by giving it a more decent greyish color.

Ok, let's do it using warning/info antd Alert, also closable similar to the #589

@aomafarag
Copy link
Contributor

Current appearance:

Screenshot from 2023-03-07 16-44-24

@aomafarag
Copy link
Contributor

I had to revert the changes made in SuplusFlow.vue, DebtFlow.vue, etc. manually in order to refactor them by adding a new case for an Alert in ElectronUpdateBanner.vue.

Comment on lines 16 to 22
<Alert v-else-if="status === 'production'" type="info" show-icon banner closable class="text-center">
<template #message>
You can now run the Unified Auctions UI locally as a desktop application. Please see its release at
<a class="underline" :href="url" target="_blank">{{ url }}</a
>.
</template>
</Alert>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What it has to do with the ElectronUpdateBanner or its states? Please move it back to its dedicated component and just use closable Alert

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My logic was that it is an electron-related topic, so instead of editing multiple components, just use an existing one that follows the same pattern.

Copy link
Contributor

@valiafetisov valiafetisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good.

  • Have you checked if the image is correctly built when PRODUCTION_BANNER_URL is provided (locally)? (ie: please check how docker file for STAGING_BANNER_URL)
  • I don't see the code which passes desired env var from the secrets to the build process in CI (ie: please check how it's done for STAGING_BANNER_URL)
  • Was the required url added to the production secrets?

Comment on lines +25 to +26
- key: PRODUCTION_BANNER_URL
value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/production_banner_url
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only add it to the main.auction-ui.k8s.sidestream.tech (which is staging). You also need to add it down to publish-frontend-makerdao-on-tag step

@valiafetisov
Copy link
Contributor

Was the required url added to the production secrets?

I've added it via:

secret write auction-ui/production.auction-ui.k8s.sidestream.tech/frontend PRODUCTION_BANNER_URL https://github.com/sidestream-tech/unified-auctions-ui/releases/latest

Is it a correct path @aomafarag?

@aomafarag
Copy link
Contributor

  • Have you checked if the image is correctly built when PRODUCTION_BANNER_URL is provided (locally)? (ie: please check how docker file for STAGING_BANNER_URL)

Yes, the above screenshot is from local testing.

* [x]  I don't see the code which passes desired env var from the secrets to the build process in CI (ie: please check how it's done for `STAGING_BANNER_URL`)

Added PRODUCTION_BANNER_URL to Dockerfile and .drone.yml with the latest commit.

  • Was the required url added to the production secrets?

If by this you mean adding it to our secrets storage on AWS, I don't believe I have the privileges to do that.

@aomafarag
Copy link
Contributor

Is it a correct path @aomafarag?

The path is correct. However, the variable name should be all lowercase to match our secrets pattern.

@valiafetisov valiafetisov merged commit 6887469 into main Mar 7, 2023
@valiafetisov valiafetisov deleted the banner-electron branch March 7, 2023 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement banner to announce packaged version
4 participants