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

Flash message at top of the page not visible #1629

Merged
merged 2 commits into from Feb 13, 2020
Merged

Flash message at top of the page not visible #1629

merged 2 commits into from Feb 13, 2020

Conversation

hemahg
Copy link
Contributor

@hemahg hemahg commented Feb 4, 2020

What this PR does / why we need it:
Flash message at top of the page not visible when the page is large

Which issue(s) this PR fixes
https://issues.redhat.com/browse/THREESCALE-4028

Verification steps

image

@damianpm damianpm self-requested a review February 4, 2020 11:44
@damianpm damianpm changed the title Flash message at top of the page not visible [WIP] Flash message at top of the page not visible Feb 4, 2020
app/views/shared/provider/_flash.html.erb Outdated Show resolved Hide resolved
app/views/shared/provider/_flash.html.erb Outdated Show resolved Hide resolved
@damianpm damianpm requested a review from cntlsn February 4, 2020 12:10
@cntlsn
Copy link
Contributor

cntlsn commented Feb 4, 2020

@damianpm I would suggest to only add some styling for now.

#flashWrapper could be:

#flashWrapper {
    display: block;
    position: fixed;
    background-color: #fff;
    padding: 1rem;
    margin-top: 1.5rem;
    -webkit-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.3);
    -moz-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.3);
    box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.3);
}

And I would make the text content live into a span instead of a p (in order to lose p styling and avoid additional rewrites):

<span class="flash-message flash-message--notice">Some text</span>

What do you think?

@damianpm
Copy link
Contributor

damianpm commented Feb 4, 2020

@cntlsn @hemahg @thomasmaas
OK, but I'd keep the alignment to the right and the animation

#flashWrapper {
  @include animation(fadeInLeft 0.5s ease-in-out);
  background-color: #fff;
  box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.3);
  display: block;
  margin-top: 1.5rem;
  padding: 1rem;
  position: fixed;
  right: 0;
}

Screenshot 2020-02-04 at 16 59 05

@cntlsn
Copy link
Contributor

cntlsn commented Feb 4, 2020

@damianpm @hemahg absolutely! I forgot to say more explicitly that my idea was to add those properties on top of the existing ones!

@josemigallas
Copy link
Contributor

josemigallas commented Feb 5, 2020

@damianpm @cntlsn
For what is worth I think it looks better with a padding-right margin-right, since it's a floating element with the shadow and all.

@hemahg
I would also use this opportunity to apply conditional rendering. This means you'd check the condition before rendering instead of hiding it with display: none.

= render 'shared/provider/flash', flash: flash unless flash.empty?

@thomasmaas
Copy link
Member

I think the display: none; construct is to make the the flash message available to javascript (<div class="ajaxNoticeValid">. Could be that we no longer use that though.

Styling-wise I kind of like the error message sticking to the right but would be good to deploy to preview.

@cntlsn
Copy link
Contributor

cntlsn commented Feb 5, 2020

@josemigallas do you mean margin right?
Just to be clear, if my styling is added to the current style of #flashWrapper, as suggested in a previous comment, it should look like this:
Screenshot 2020-02-05 10 46 57

cc @damianpm @hemahg

@damianpm
Copy link
Contributor

damianpm commented Feb 5, 2020

@josemigallas do you mean margin right?
Just to be clear, if my styling is added to the current style of #flashWrapper, as suggested in a previous comment, it should look like this:
Screenshot 2020-02-05 10 46 57

cc @damianpm @hemahg

I prefer it aligned to the right

@codecov
Copy link

codecov bot commented Feb 6, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@44c883a). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1629   +/-   ##
=========================================
  Coverage          ?   80.23%           
=========================================
  Files             ?     2245           
  Lines             ?    70376           
  Branches          ?        0           
=========================================
  Hits              ?    56465           
  Misses            ?    13911           
  Partials          ?        0

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 44c883a...5000052. Read the comment docs.

@hemahg hemahg changed the base branch from master to 2.4.0 February 6, 2020 12:25
@hemahg hemahg changed the base branch from 2.4.0 to master February 6, 2020 12:25
@damianpm damianpm changed the title [WIP] Flash message at top of the page not visible Flash message at top of the page not visible Feb 7, 2020
@damianpm
Copy link
Contributor

damianpm commented Feb 7, 2020

@thomasmaas @cntlsn
It's deployed in preview, if you want to check
https://multitenant-admin.preview01.3scale.net/p/admin

@cntlsn
Copy link
Contributor

cntlsn commented Feb 7, 2020

@damianpm @hemahg
It looks like the text content is still wrapped in a p tag, which breaks the padding:
Screenshot 2020-02-07 15 01 27

Copy link
Contributor

@cntlsn cntlsn left a comment

Choose a reason for hiding this comment

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

@hemahg @damianpm
Tested in https://multitenant-admin.preview01.3scale.net/, both css formatting and z-index issues look good to me.

@damianpm damianpm requested a review from cntlsn February 10, 2020 16:40
Copy link
Member

@thomasmaas thomasmaas left a comment

Choose a reason for hiding this comment

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

Would be good if the margins and paddings (and box shadow) would be same as rest page. This means you have to use the `line-height-times' function you will see in other places.
Screenshot 2020-02-10 17 47 15

@Martouta Martouta removed their request for review February 11, 2020 14:00
@Martouta
Copy link
Contributor

@damianpm @hemahg I remove myself from the reviewers here because I do not think that I am the ideal person to review this 😄

@hemahg
Copy link
Contributor Author

hemahg commented Feb 11, 2020

@thomasmaas, @cntlsn Updated margins and paddings with `line-height-times'
image

@cntlsn
Copy link
Contributor

cntlsn commented Feb 11, 2020

@hemahg @damianpm @thomasmaas as I shared in chat already, my feeling is that a more pronounced drop shadow (like the one I posted previously) will make the alert stand out more from the background. This is good UX practice, as it makes the alert more noticeable to users.

@thomasmaas
Copy link
Member

@cntlsn yes, I already told @hemahg earlier, it's already fixed in code.

@thomasmaas
Copy link
Member

thomasmaas commented Feb 11, 2020

@hemahg I would suggest using half line-height margins like so:

Screenshot 2020-02-11 16 54 28

correction: that doesn't work well when there is a scrollbar. So maybe 1 lineheight is better:

Screenshot 2020-02-11 17 03 17

Screenshot 2020-02-11 17 02 47

That makes it align with page content but I'd say that animation + drop shadow size still make it notable enough.

margin-top: line-height-times(3 / 2);
padding: line-height-times(1);
position: fixed;
right: line-height-times(2);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
right: line-height-times(2);
right: line-height-times(1);

Signed-off-by: HemaHG <hhg@redhat.com>
Copy link
Member

@thomasmaas thomasmaas left a comment

Choose a reason for hiding this comment

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

Found a page with an item that also has z-index 1000. You want to serch css for z-indexes and make sure you sit above all.

Screenshot 2020-02-12 13 13 20

Signed-off-by: HemaHG <hhg@redhat.com>
Copy link
Member

@thomasmaas thomasmaas left a comment

Choose a reason for hiding this comment

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

Good job @hemahg 💪🏽

@hemahg hemahg merged commit 1b91dc4 into master Feb 13, 2020
@hallelujah hallelujah deleted the Alertdisplay branch March 11, 2020 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants