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
Conversation
059672b
to
866ffe2
Compare
622cdf1
to
f824657
Compare
f824657
to
a78304d
Compare
There was a problem hiding this 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:
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:
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.)", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
<li>{{ msg('error-filters-participants-desc') }}</li> | ||
<li>{{ msg('error-filters-categories-desc') }}</li> | ||
</ul> | ||
</section> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
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? |
a78304d
to
8588ce6
Compare
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. |
8588ce6
to
8be071f
Compare
Oops, I was failing to actually count the wikisWithoutCats... done now. |
8be071f
to
84ecf0b
Compare
84ecf0b
to
648eed6
Compare
Okay, I think this is ready for re-review. |
12afb8d
to
62b3baf
Compare
62b3baf
to
9f411c2
Compare
There was a problem hiding this 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
src/AppBundle/Model/Event.php
Outdated
* Wikidata is excluded because it can never have categories. | ||
* @return Collection Collection of EventWiki objects. | ||
*/ | ||
public function getWikisWithoutCategories(): ArrayCollection |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Of course. :) Done.
6ecccb2
to
193711d
Compare
There was a problem hiding this 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.
Fixed. It now hides itself when either of the 'update data' links are clicked.
I've given it 1em. |
193711d
to
4706291
Compare
4706291
to
3b75081
Compare
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
3b75081
to
66430ff
Compare
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