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

Improve WatchAnalytics Styling #84

Merged
merged 12 commits into from
Dec 15, 2018
Merged

Improve WatchAnalytics Styling #84

merged 12 commits into from
Dec 15, 2018

Conversation

krisfield
Copy link
Collaborator

  • Makes CSS configurable colors/thresholds configurable
  • Uses Mediawiki utility colors
  • Cleans up README page since content is on MediaWiki.org

Issues

  1. Closes cssColorClasses should be configurable #55
  2. Closes Make color schemes match between Page Scores and Pending Reviews #46
  3. Closes README doesn't have up to date info #21

@krisfield krisfield changed the title Improve WatchAnalytic Styling Improve WatchAnalytics Styling Nov 21, 2018
Copy link
Contributor

@jamesmontalvo3 jamesmontalvo3 left a comment

Choose a reason for hiding this comment

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

All looks good except for some reason the first few pages in PendingReviews have now color. See DKMS.

@krisfield
Copy link
Collaborator Author

This is ready to be merged once you've completed a final review

@jamesmontalvo3
Copy link
Contributor

I tried to go plaid by adding the following to settings:

$egWatchAnalyticsWatchQualityColors = [
	"21" => "plaid",
	"5" => "excellent",
	"1.5" => "okay"
];

Without that change one page's scores look like:

image

With that change above they look the same. If I make this change:

$egWatchAnalyticsWatchQualityColors = [
	21 => "plaid",
	5 => "excellent",
	1.5 => "okay"
];

then I get:

image

Changing 21 => "plaid" to 10 => "plaid" still no change.

Show me plaid!

@jamesmontalvo3
Copy link
Contributor

If I modify extension.json to say "10" : "plaid" instead of "50" : "plaid" then I get glorious plaid:

image

@jamesmontalvo3
Copy link
Contributor

I made this change to extension.json to make it respect my changes to LocalSettings.php:

                "WatchAnalyticsWatchQualityColors": {
                        "50" : "plaid",
                        "5" : "excellent",
-                       "1.5" : "okay"
+                       "1.5" : "okay",
+                       "_merge_strategy": "array_plus"
                },
                "WatchAnalyticsReviewStatusColors": {
                        "5" : "excellent",

Ref: https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#Merge_strategies

Basically with extension registration (i.e. extension.json) you have to tell it how you want array globals to be handled. Do you want them to be overwritten, merged, etc. I'm not sure array_plus is the perfect solution, but it may be the best available option. I don't recall why the arrays are written in the form 50 => "plaid" versus "plaid" => 50, but that may be better.

@krisfield
Copy link
Collaborator Author

I made this change to extension.json to make it respect my changes to LocalSettings.php:

                "WatchAnalyticsWatchQualityColors": {
                        "50" : "plaid",
                        "5" : "excellent",
-                       "1.5" : "okay"
+                       "1.5" : "okay",
+                       "_merge_strategy": "array_plus"
                },
                "WatchAnalyticsReviewStatusColors": {
                        "5" : "excellent",

Ref: https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#Merge_strategies

Basically with extension registration (i.e. extension.json) you have to tell it how you want array globals to be handled. Do you want them to be overwritten, merged, etc. I'm not sure array_plus is the perfect solution, but it may be the best available option. I don't recall why the arrays are written in the form 50 => "plaid" versus "plaid" => 50, but that may be better.

Thanks for the catch. I added the "array_plus" handling. As far as having numbered keys vs strings I think the current layout makes the most sense. Having the strings as keys seems weird to me.

@jamesmontalvo3
Copy link
Contributor

Have you tested different configurations in LocalSettings.php to verify things are working as expected?

@krisfield
Copy link
Collaborator Author

Yes, that's how i tested the change

@jamesmontalvo3 jamesmontalvo3 merged commit 4c685ba into master Dec 15, 2018
@jamesmontalvo3 jamesmontalvo3 deleted the style branch December 15, 2018 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants