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

fixes #467 add data error alert notice #478

Merged
merged 4 commits into from
May 8, 2020
Merged

fixes #467 add data error alert notice #478

merged 4 commits into from
May 8, 2020

Conversation

spasovski
Copy link
Contributor

@spasovski spasovski commented May 7, 2020

Do localStorage.clear() in your console to see again after dismissing.

  • Not super happy with the text copy and possibly color scheme so feel free to suggest better.

image

Updated with John's copy:

image

@spasovski spasovski requested review from hamilton and openjck May 7, 2020 21:34
</style>

{#if alertVisible}
<div class="alert-notice" transition:fade={{easing: cubicOut}}>
Copy link
Contributor

Choose a reason for hiding this comment

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

  65:46  error  A space is required after '{'   object-curly-spacing
  65:63  error  A space is required before '}'  object-curly-spacing

Copy link
Contributor

Choose a reason for hiding this comment

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

And yay fade!

// Required: Which localStorage key to check whether this notice has been dismissed.
export let toggleKey = '';

$: alertVisible = window.localStorage.getItem(KEY_PREFIX + toggleKey) !== 'true';
Copy link
Contributor

Choose a reason for hiding this comment

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

In Slack, Rob Miller mentioned that he'd like the message to reappear daily if it's not too much engineering effort, or if that would be too much engineering effort, to use sessionStorage instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

What does the $: reactivity do in this case? It doesn't seem that manually altering localStorage has any immediate effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, just an artifact of some earlier testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a remnant of an earlier approach, and yep I added the check against today


// So we don't pollute the entire LS namespace.
const KEY_PREFIX = 'alertNotice-';
export let dismissText = 'dismiss'; // Label of 'dismiss' button.
Copy link
Contributor

Choose a reason for hiding this comment

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

For the sake of consistency, I'd suggest putting all of the props just below the imports.

border-radius: var(--border-radius-base);
padding: var(--space-2x);
align-items: center;
grid-gap: var(--space-3x);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't do anything in display: flex, does it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I guess it does. Guess I need to brush up.

padding: var(--space-2x);
align-items: center;
grid-gap: var(--space-3x);
width: fit-content;
Copy link
Contributor

Choose a reason for hiding this comment

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

Huh. I've never used this!

Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be used here? Firefox says it's an invalid value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea another remnant of an earlier approach. Good catch.

@@ -71,4 +72,7 @@
<Footer />
</ContentFooter>
</Content>
<AlertNotice toggleKey="dataErrorsWarning">
<p>The staging and development instances of GLAM are likely to have data issues and UI bugs.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

I actually think this copy is great. The only thing I'd suggest is maybe being more specific about "data issues" if we can.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose if someone is on dev, they may not care about stage, and vice versa. Maybe something like this.

"This dashboard is under active development. Bugs and [data accuracy issues] may exist."

But I'd defer to Rob for the final copy.

}

.alert-notice-action button {
padding: var(--space-base);
Copy link
Contributor

Choose a reason for hiding this comment

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

jarek-kalwa-space-base

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're way ahead of Elon!

Copy link
Contributor

Choose a reason for hiding this comment

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

we really should make this --space-1x across the board.


<style>
.alert-notice {
position: absolute;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe position: sticky instead, so that it remains at the bottom-left when the page scrolls?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems a little intrusive but I'll see what the consensus is. Easy to change.

<style>
.alert-notice {
position: absolute;
left: var(--space-4x);
Copy link
Contributor

Choose a reason for hiding this comment

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

For some reason, it feels more natural to me on the right. I want to say it's because of some common UI convention or something, but it may just be personal preference.

Copy link
Contributor

@openjck openjck left a comment

Choose a reason for hiding this comment

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

Added some comments

Copy link
Contributor

@hamilton hamilton left a comment

Choose a reason for hiding this comment

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

Looking great @spasovski. Thanks for getting this together so quickly.

  • I'd love to see a dismiss icon as well. If only a new icon set could be easily and effortlessly applied, gosh. (maybe the Close icon). These icons don't require any other stylesheet so they can be used without postcss, so it should be as easy as npm installing the package and then importing the one you want to use. I think the story shows all the icons + the names if you want to peruse.
  • I'd like to see a slight shadow to the element, if possible, to bring it a bit off the page. I think we might have some barely-used box-shadow variables that could be applied.
  • made a suggestion for the copy that gives more context.

</style>

{#if alertVisible}
<div class="alert-notice" transition:fade={{easing: cubicOut}}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I might suggest transition:fly with a y: 10 or so and a duration of maybe 200?

Copy link
Contributor

Choose a reason for hiding this comment

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

(I appreciate the instinct to apply a transition!)

@@ -71,4 +72,7 @@
<Footer />
</ContentFooter>
</Content>
<AlertNotice toggleKey="dataErrorsWarning">
<p>This dashboard is under active development. Bugs and data accuracy issues may exist.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<p>This dashboard is under active development. Bugs and data accuracy issues may exist.</p>
<p>Thank you for testing the GLAM prototype!
This tool is still in active development. UX bugs and data issues may exist.
Help us make it suit your needs by directing questions or feedback to the #glam Slack channel.</p>

}

.alert-notice-action button {
padding: var(--space-base);
Copy link
Contributor

Choose a reason for hiding this comment

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

we really should make this --space-1x across the board.

@spasovski spasovski merged commit 5b56207 into master May 8, 2020
@spasovski spasovski deleted the data-notice branch May 8, 2020 19:03
@hamilton hamilton added this to Done in 2020.5.0 May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
2020.5.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants