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

Reconfigure filter warning messages #234

Merged
merged 1 commit into from Mar 25, 2019
Merged

Conversation

samwilson
Copy link
Member

@samwilson samwilson commented Mar 19, 2019

Set up three filter-message sections (only one of which is
displayed) and modify the form-panel descriptions depending
on the event state.

Bug: T218340

@samwilson samwilson force-pushed the filtering-ui-T218340 branch 2 times, most recently from 059672b to 866ffe2 Compare March 19, 2019 07:13
@samwilson samwilson marked this pull request as ready for review March 19, 2019 07:14
@samwilson samwilson force-pushed the filtering-ui-T218340 branch 3 times, most recently from 622cdf1 to f824657 Compare March 19, 2019 07:33
Copy link
Member

@MusikAnimal MusikAnimal left a comment

Choose a reason for hiding this comment

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

If the event has had at least one update, I still see "Statistics have not yet been generated for this event. Calculate totals." in a green alert-success banner at the top. That seems like a bug, or maybe something's wrong on my end? Either way I think should be alert-warning, and also maybe add a bit of spacing above the banner:

Screenshot from 2019-03-19 20-35-15

Also the new banners are missing some spacing between it and the metadata above it. I don't think it's need to be as much as space as in the mock, but it looks a little odd now:

Screenshot from 2019-03-19 20-55-35

i18n/en.json Show resolved Hide resolved
i18n/en.json Outdated
"error-filters-participants-desc": "Participants filtering applies to all wikis and satisfies all filtering requirements.",
"error-filters-participants-none": "No participants supplied",
"error-filters-participants-or-categories": "You can filter by Participants or Categories—or combine the two.",
"error-filters-wikidata": "To get metrics about <strong>Wikidata</strong>, you must supply Participants. (Categories don’t exist on Wikidata.)",
Copy link
Member

Choose a reason for hiding this comment

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

We've successfully gone this long without any HTML in our messages. Are we sure we really need "Wikidata" to be in bold?

I realize we're using |raw in other places we shouldn't, but the HTML here is a clear indication we're using it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, the spec says "Please observe boldfacing", and we don't like piecemeal messages. We could lookup the name Wikidata in the language, and inject it, but even then it's probably not the right thing to do from a l10n perspective.

I'm always confused about the best way to do these things. I wish we could have messages in Markdown!

i18n/qqq.json Outdated Show resolved Hide resolved
app/Resources/views/events/show.html.twig Outdated Show resolved Hide resolved
<li>{{ msg('error-filters-participants-desc') }}</li>
<li>{{ msg('error-filters-categories-desc') }}</li>
</ul>
</section>
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this <section> group needs to be indented, same with the above

(see also https://twig.symfony.com/doc/2.x/coding_standards.html which of course we don't have to strictly follow :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

I guess there's no linter for the Twig standards?

src/AppBundle/Model/Event.php Outdated Show resolved Hide resolved
src/AppBundle/Model/Event.php Outdated Show resolved Hide resolved
i18n/en.json Outdated Show resolved Hide resolved
src/AppBundle/Controller/EventController.php Outdated Show resolved Hide resolved
@MusikAnimal
Copy link
Member

MusikAnimal commented Mar 20, 2019

Another possible bug (sorry for the flurry of comments): If I have two wikis, en.wikipedia and commons.wikimedia, both with categories, I still see "Event partially configured" even though it should be valid. Perhaps this is because #217 hasn't been merged yet? Overall I think this PR should wait on it... what do you think?

@samwilson
Copy link
Member Author

If the event has had at least one update, I still see "Statistics have not yet been generated for this event. Calculate totals." in a green alert-success banner at the top. That seems like a bug, or maybe something's wrong on my end? Either way I think should be alert-warning, and also maybe add a bit of spacing above the banner:

Also the new banners are missing some spacing between it and the metadata above it. I don't think it's need to be as much as space as in the mock, but it looks a little odd now:

I was working on the idea that #228 would be done as well, but now that it's not I'll update these. The green box however is in the spec (although the message needs to be updated; I was going to do that in a separate patch along with some other message changes for the two forms — but part of the same task).

I've added some spacing below the metadata.

@samwilson
Copy link
Member Author

Another possible bug (sorry for the flurry of comments): If I have two wikis, en.wikipedia and commons.wikimedia, both with categories, I still see "Event partially configured" even though it should be valid. Perhaps this is because #217 hasn't been merged yet? Overall I think this PR should wait on it... what do you think?

Oops, I was failing to actually count the wikisWithoutCats... done now.

@samwilson samwilson changed the title Add filter warning messages Reconfigure filter warning messages Mar 20, 2019
@samwilson
Copy link
Member Author

Okay, I think this is ready for re-review.

@samwilson samwilson force-pushed the filtering-ui-T218340 branch 2 times, most recently from 12afb8d to 62b3baf Compare March 21, 2019 05:33
@samwilson samwilson added Ready for review Ready for peer review WIP Work In Progress and removed Ready for review Ready for peer review labels Mar 21, 2019
@samwilson samwilson added Ready for review Ready for peer review and removed WIP Work In Progress labels Mar 21, 2019
Copy link
Member

@MusikAnimal MusikAnimal left a comment

Choose a reason for hiding this comment

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

One more tiny thing. Looks like master needs to be rebased in, too

* Wikidata is excluded because it can never have categories.
* @return Collection Collection of EventWiki objects.
*/
public function getWikisWithoutCategories(): ArrayCollection
Copy link
Member

Choose a reason for hiding this comment

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

The return type declaration also needs to be Collection. I think if there are EventWikis that are persisted but haven't been flushed to the database, the $this->wikis->filter code will return a PersistentCollection, which in turn will cause an exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops! Of course. :) Done.

@samwilson samwilson force-pushed the filtering-ui-T218340 branch 3 times, most recently from 6ecccb2 to 193711d Compare March 21, 2019 15:24
Copy link
Member

@MusikAnimal MusikAnimal left a comment

Choose a reason for hiding this comment

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

I'm still seeing the "Statistics have not yet been generated for this even" banner even if they have been generated. And it doesn't hide itself once the update starts. For that I think you just need to give the banner the .event-wiki-stats--empty class (may need to update the styling in events.scss too), which is then handled by https://github.com/wikimedia/eventmetrics/blob/master/app/Resources/assets/js/eventshow.js#L59 I also realize now this CSS class name isn't very clear... that message doesn't necessarily have to do with EventWikis.

I also think whatever banner is at the top really needs some padding above it. A bit too tight up against the metadata part. But we can take care of that later, maybe this was an intentional design choice.

@samwilson
Copy link
Member Author

I'm still seeing the "Statistics have not yet been generated for this even" banner even if they have been generated. And it doesn't hide itself once the update starts.

Fixed. It now hides itself when either of the 'update data' links are clicked.

I also think whatever banner is at the top really needs some padding above it. A bit too tight up against the metadata part. But we can take care of that later, maybe this was an intentional design choice.

I've given it 1em.

@samwilson samwilson added WIP Work In Progress and removed Ready for review Ready for peer review labels Mar 22, 2019
@MusikAnimal
Copy link
Member

Looks good to me! Just need to resolve the merge conflict

Set up three filter-message sections (only one of which is
displayed) and modify the form-panel descriptions depending
on the event state.

Bug: T218340
@samwilson samwilson merged commit 6755541 into master Mar 25, 2019
@samwilson samwilson deleted the filtering-ui-T218340 branch March 25, 2019 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work In Progress
3 participants