jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Use QuantityInput expert" (not yet deploy, until next
branch)
......................................................................
Revert "Use QuantityInput expert" (not yet deploy, until next branch)
This reverts commit aa01c19922863dd3b884d83424f0c53bd388a1ba.
Change-Id: I0addaf8ea513b676c7a7c24d568a0757b08391a0
---
M composer.json
M lib/includes/formatters/WikibaseValueFormatterBuilders.php
M repo/resources/experts/getStore.js
M repo/resources/experts/resources.php
4 files changed, 9 insertions(+), 18 deletions(-)
Approvals:
Aude: Looks good to me, approved
jenkins-bot: Verified
diff --git a/composer.json b/composer.json
index aa77bf5..e30ada2 100644
--- a/composer.json
+++ b/composer.json
@@ -33,7 +33,7 @@
"data-values/data-types": "~0.4.0",
"data-values/serialization": "~1.0",
"data-values/javascript": "~0.6.0|~0.7.0",
- "data-values/value-view": "~0.15.1",
+ "data-values/value-view": "~0.14.0",
"wikibase/data-model": "~4.0",
"wikibase/data-model-javascript": "^1.0.2",
diff --git a/lib/includes/formatters/WikibaseValueFormatterBuilders.php
b/lib/includes/formatters/WikibaseValueFormatterBuilders.php
index 515d6b8..4928e76 100644
--- a/lib/includes/formatters/WikibaseValueFormatterBuilders.php
+++ b/lib/includes/formatters/WikibaseValueFormatterBuilders.php
@@ -94,7 +94,7 @@
SnakFormatter::FORMAT_PLAIN => array(
'VT:string' => 'ValueFormatters\StringFormatter',
'VT:globecoordinate' => array( 'this',
'newGlobeCoordinateFormatter' ),
- 'VT:quantity' => array( 'this',
'newPlainQuantityFormatter' ),
+ 'VT:quantity' => array( 'this', 'newQuantityFormatter'
),
'VT:time' => 'Wikibase\Lib\MwTimeIsoFormatter',
'VT:wikibase-entityid' => array( 'this',
'newEntityIdFormatter' ),
'VT:bad' =>
'Wikibase\Lib\UnDeserializableValueFormatter',
@@ -114,9 +114,8 @@
SnakFormatter::FORMAT_HTML => array(
'PT:url' => 'Wikibase\Lib\HtmlUrlFormatter',
'PT:commonsMedia' =>
'Wikibase\Lib\CommonsLinkFormatter',
- 'PT:wikibase-item' => array( 'this',
'newEntityIdHtmlFormatter' ),
+ 'PT:wikibase-item' => array( 'this',
'newEntityIdHtmlFormatter' ),
'PT:wikibase-property' => array( 'this',
'newEntityIdHtmlFormatter' ),
- 'VT:quantity' => array( 'this',
'newHtmlQuantityFormatter' ),
'VT:time' => array( 'this', 'newHtmlTimeFormatter' ),
'VT:monolingualtext' => array( 'this',
'newMonolingualHtmlFormatter' ),
),
@@ -610,22 +609,15 @@
}
/**
+ * Builder callback for use in
WikibaseValueFormatterBuilders::$valueFormatterSpecs.
+ * Used to compose the QuantityFormatter.
+ *
* @param FormatterOptions $options
*
* @return QuantityFormatter
*/
- private function newPlainQuantityFormatter( FormatterOptions $options )
{
- $options->setOption( QuantityFormatter::OPT_APPLY_UNIT, false );
- $decimalFormatter = new DecimalFormatter( $options,
$this->getNumberLocalizer( $options ) );
- return new QuantityFormatter( $decimalFormatter, null, $options
);
- }
-
- /**
- * @param FormatterOptions $options
- *
- * @return QuantityFormatter
- */
- private function newHtmlQuantityFormatter( FormatterOptions $options ) {
+ private function newQuantityFormatter( FormatterOptions $options ) {
+ //TODO: use a builder for this DecimalFormatter
$decimalFormatter = new DecimalFormatter( $options,
$this->getNumberLocalizer( $options ) );
$labelDescriptionLookup =
$this->labelDescriptionLookupFactory->getLabelDescriptionLookup( $options );
$unitFormatter = new EntityLabelUnitFormatter(
$this->repoUriParser, $labelDescriptionLookup );
diff --git a/repo/resources/experts/getStore.js
b/repo/resources/experts/getStore.js
index 85bc9ec..0fced22 100644
--- a/repo/resources/experts/getStore.js
+++ b/repo/resources/experts/getStore.js
@@ -19,7 +19,7 @@
);
expertStore.registerDataValueExpert(
- vv.experts.QuantityInput,
+ vv.experts.StringValue,
dv.QuantityValue.TYPE
);
diff --git a/repo/resources/experts/resources.php
b/repo/resources/experts/resources.php
index fd06f4f..3609ca8 100644
--- a/repo/resources/experts/resources.php
+++ b/repo/resources/experts/resources.php
@@ -35,7 +35,6 @@
'jquery.valueview.experts.CommonsMediaType',
'jquery.valueview.experts.GlobeCoordinateInput',
'jquery.valueview.experts.MonolingualText',
- 'jquery.valueview.experts.QuantityInput',
'jquery.valueview.experts.StringValue',
'jquery.valueview.experts.TimeInput',
'jquery.valueview.experts.UnDeserializableValue',
--
To view, visit https://gerrit.wikimedia.org/r/233695
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0addaf8ea513b676c7a7c24d568a0757b08391a0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: wmf/1.26wmf20
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits