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

Add upgrade motivation banner #7768

Merged
merged 31 commits into from
May 16, 2024
Merged

Add upgrade motivation banner #7768

merged 31 commits into from
May 16, 2024

Conversation

dieknolle3333
Copy link
Contributor

@dieknolle3333 dieknolle3333 commented Apr 22, 2024

Steps to test:

  • mock an outdated WK version, e.g. by mocking getBuildInfo(), see comment in maintenance_banner.tsx
  • see banner, make sure it looks good (e.g. across different themes)
  • test link
  • click it away
  • it shouldn't be shown again, even if you log out / close the browser. it should only be shown again after another 3 days
  • it should be shown again in a private browser tab though.

TODOs:

  • fix styling of button, find out how to do theming well
  • fix banner when browser window is narrow
  • fix upcoming maintenance banner when user is logged out

Issues:


(Please delete unneeded items, merge only when none are left open)

);

const getShouldBannerBeShown = () => {
if (!isVersionOutdated) return false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(obviously this can be set to true during testing, dont forget to remove)

@philippotto philippotto changed the title Upgrade motivation banner Add upgrade motivation banner Apr 30, 2024
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Cool stuff 😃 During testing, I noticed two things:

  • I think the banner should only be shown when logged in. Showing this to external visitors doesn't make much sense, in my opinion.
  • webknossos.org should be clickable probably (should open in a new tab)

frontend/javascripts/maintenance_banner.tsx Outdated Show resolved Hide resolved
frontend/javascripts/maintenance_banner.tsx Outdated Show resolved Hide resolved
frontend/javascripts/navbar.tsx Outdated Show resolved Hide resolved
@dieknolle3333 dieknolle3333 marked this pull request as ready for review April 30, 2024 17:59
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Testing went well mostly 🎉 However, when switching the theme while the banner is shown, the navbar height is not set properly:

image

If it's easy to fix, please go ahead. Otherwise, it's not that bad since the case is rather rare.

Also, see my two newest comments :)

frontend/javascripts/banners.tsx Outdated Show resolved Hide resolved
@dieknolle3333
Copy link
Contributor Author

@philippotto thanks for the feedback! actually it was quite easy to ensure the right nav bar height while switching the theme.

I also worked on the case that both a maintenance and an upgrade banner could be shown. I solved it so that only the maintenance banner is shown in that case. Once that is gone, the navbar height is broken (like in your last picture) though. I left it like that because the upgrade banner can be clicked away, because it is a rare case anyway and because fixing it would require letting maintenance and upgrade banner know about each other, which would need some refactoring. Let me know if you disagree and think that I should look into it further :)

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

awesome :)

@dieknolle3333 dieknolle3333 enabled auto-merge (squash) May 16, 2024 13:44
@dieknolle3333 dieknolle3333 merged commit 0357463 into master May 16, 2024
2 checks passed
@dieknolle3333 dieknolle3333 deleted the upgrade-motivation-banner branch May 16, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add banner "Upgrade version" for self-hosted when version is older than 6 months
3 participants