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 status banner + fix templates 403 redirect loop #4684

Merged
merged 5 commits into from
Mar 9, 2022

Conversation

Rory-Powell
Copy link
Contributor

Description

Banner

Templates 403 loop

  • When the currentapp cookie is present for an app in another tenant the builder and admin properties are incorrectly removed from the current user
  • When the builder is accessed, remove the currentapp cookie if the app belongs to another tenant.

Screenshots

Screenshot 2022-02-24 at 14 55 42

@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2022

Codecov Report

Merging #4684 (a7dc7ca) into develop (e9dc7c4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #4684   +/-   ##
========================================
  Coverage    69.19%   69.19%           
========================================
  Files          145      145           
  Lines         5012     5012           
  Branches       768      768           
========================================
  Hits          3468     3468           
  Misses        1090     1090           
  Partials       454      454           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41cd197...a7dc7ca. Read the comment docs.

Copy link
Member

@shogunpurple shogunpurple left a comment

Choose a reason for hiding this comment

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

LGTM! Will be so helpful to have this during an outage👌

Copy link
Member

@aptkingston aptkingston left a comment

Choose a reason for hiding this comment

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

Love this Rory 🚀

How does the banner interact with normal notifications? Basically just wondering if it would be better to add a feature to notifications to show buttons (which I think is the only difference) and the just use the normal BBUI notifications module to show it. I think at the minute this will render above (depth wise) normal notifications will it?

Either that, or make the banner a full width header that actually shifts the page down or something, so it wouldn't affect notifications.

@Rory-Powell
Copy link
Contributor Author

How does the banner interact with normal notifications?
I think at the minute this will render above (depth wise) normal notifications will it?

@aptkingston you're spot on it renders above normal notifications. Making this a normal notification would be a nice way to integrate them better, the only other usage of the banner is on the rest transformer here:

Screenshot 2022-02-28 at 07 18 45

Which we could probably convert as well, although it might be strange to have a notification going outside of the normal usage and being embedded like that. I like the idea of making the banner display full width, which I think is probably the correct ux here as well - I'll take a look

@Rory-Powell
Copy link
Contributor Author

@aptkingston added the full width banner which helps a bit with the overlapping notifications:

Screenshot 2022-03-08 at 16 25 44

after the banner is closed:

Screenshot 2022-03-08 at 16 25 55

Copy link
Member

@aptkingston aptkingston left a comment

Choose a reason for hiding this comment

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

Looks great @Rory-Powell! I much prefer the full width approach. Just left one suggestion about simplifying things and then it should be good to go 👍

import { parse, stringify } from "qs"
import HelpIcon from "components/common/HelpIcon.svelte"

const queryHandler = { parse, stringify }
</script>

<div class="banner-container" />
<BannerDisplay />
Copy link
Member

Choose a reason for hiding this comment

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

This seems a bit strange to me - rendering a DOM node and then immediately after rendering a svelte portal which targets that DOM node. Why don't we just rename BannerDisplay to StatusBanner, remove the portal altogether and the .banner-container div, and just have the StatusBanner render a normal banner with status info in it's current location? That would achieve the same result but be a bit less complicated, and more explicit that it's intended to be used for status messages rather than a generic banner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like a good suggestion @aptkingston . I had a go at this but hit a roadblock around pointer events, the pointer isn't able to interact with with banner without the portal. Attached is the diff of what I tried, if you have any other suggestions of how to work around this I'd be up for trying them out. Gonna merge this one for now so that we can release the two fixes in the release

diff: status.txt

@Rory-Powell Rory-Powell merged commit b32c7d4 into develop Mar 9, 2022
@Rory-Powell Rory-Powell deleted the labday/status-banner branch March 9, 2022 22:05
@github-actions github-actions bot locked and limited conversation to collaborators Mar 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants