Lucas Werkmeister (WMDE) has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/389776 )
Change subject: Add ancillary message for stale results to gadget
......................................................................
Add ancillary message for stale results to gadget
If the API response indicates that a result is potentially outdated,
communicate this to the user in an ancillary message on the
ConstraintReportPanel.
Bug: T179844
Change-Id: I819e108d36786df85167c2696be2bc66bce368f8
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/gadget.js
4 files changed, 10 insertions(+), 3 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
refs/changes/76/389776/1
diff --git a/extension.json b/extension.json
index ea185f2..93c1fd6 100644
--- a/extension.json
+++ b/extension.json
@@ -76,7 +76,8 @@
"wbqc-parameterissues-short",
"wbqc-parameterissues-long",
"wbqc-constrainttypehelp-short",
- "wbqc-constrainttypehelp-long"
+ "wbqc-constrainttypehelp-long",
+ "wbqc-stale-generic"
],
"scripts": [
"modules/ui/module.js",
diff --git a/i18n/en.json b/i18n/en.json
index 93254cb..c68aeb2 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -42,6 +42,7 @@
"wbqc-parameterissues-long": "These issues are problems with the
constraint definition on the property, not with this statement.",
"wbqc-constrainttypehelp-short": "Help",
"wbqc-constrainttypehelp-long": "Help page for this constraint type",
+ "wbqc-stale-generic": "This result is cached and might be slightly out
of date.",
"apihelp-wbcheckconstraints-description": "Performs constraint checks
on any entity you want and returns the result.",
"apihelp-wbcheckconstraints-summary": "Performs constraint checks on
any entity you want and returns the result.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2948cf0..33a390c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -44,6 +44,7 @@
"wbqc-parameterissues-long": "Longer explanation of the section of the
constraint parameter report popup that contains problems about the constraint
parameters.\n{{Related|wbqc-parameterissues-short}}",
"wbqc-constrainttypehelp-short": "Text for the help link shown next to
the constraint type in a constraint violation report. The link leads to a help
page on Wikidata about the constraint type.\n{{Identical|Help}}",
"wbqc-constrainttypehelp-long": "Title for the help link shown next to
the constraint type in a constraint violation report. The link leads to a help
page on Wikidata about the constraint
type.\n{{Related|wbqc-constrainttypehelp-short}}",
+ "wbqc-stale-generic": "Generic message informing the user that a
constraint check result might be slightly outdated.",
"apihelp-wbcheckconstraints-description":
"{{doc-apihelp-description|wbcheckconstraints}}",
"apihelp-wbcheckconstraints-summary":
"{{doc-apihelp-summary|wbcheckconstraints}}",
"apihelp-wbcheckconstraints-param-id":
"{{doc-apihelp-param|wbcheckconstraints|id}}",
diff --git a/modules/gadget.js b/modules/gadget.js
index 6c46e6e..c94c6a7 100644
--- a/modules/gadget.js
+++ b/modules/gadget.js
@@ -25,11 +25,15 @@
}
function buildReport( result ) {
- return new wb.quality.constraints.ui.ConstraintReportPanel( {
+ var config = {
status: result.status,
constraint: result.constraint,
message: result[ 'message-html' ]
- } );
+ };
+ if ( result.stale ) {
+ config.ancillaryMessages = [ mw.message(
'wbqc-stale-generic' ).escaped() ];
+ }
+ return new wb.quality.constraints.ui.ConstraintReportPanel(
config );
}
function buildParameterReport( problem ) {
--
To view, visit https://gerrit.wikimedia.org/r/389776
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I819e108d36786df85167c2696be2bc66bce368f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits