jenkins-bot has submitted this change and it was merged. Change subject: Fix GlobeCoordinateInput to allow precision null ......................................................................
Fix GlobeCoordinateInput to allow precision null Related: T66048 Bug: T109455 Change-Id: I259bb529ba67e480e7faf2e8ebdc42860e5f73d3 --- M i18n/en.json M i18n/qqq.json M src/experts/GlobeCoordinateInput.js M src/experts/resources.php 4 files changed, 17 insertions(+), 6 deletions(-) Approvals: Jonas Kress (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index e18bf3b..5200c8f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -11,6 +11,7 @@ "valueview-expert-unsupportedvalue-unsupporteddatatype": "Handling of values for \"$1\" data type is not yet supported.", "valueview-expert-emptyvalue-empty": "empty", "valueview-expert-globecoordinateinput-precision": "Precision:", + "valueview-expert-globecoordinateinput-nullprecision": "unspecified", "valueview-expert-globecoordinateinput-customprecision": "special ($1)", "valueview-expert-timevalue-calendar-gregorian": "Gregorian", "valueview-expert-timevalue-calendar-julian": "Julian", diff --git a/i18n/qqq.json b/i18n/qqq.json index d757946..cc135ff 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -15,6 +15,7 @@ "valueview-expert-unsupportedvalue-unsupporteddatatype": "Error shown if a data value for a certain data type (see [[d:Wikidata:Glossary]]) should be displayed or a form for creating one should be offered while this is not yet possible from a technical point of view (e.g. because a valueview widget expert handling data values for that data type has not yet been implemented).\n\nParameters:\n* $1 - the name of the data type which lacks support", "valueview-expert-emptyvalue-empty": "Message expressing that there is currently no value set in a jQuery valueview.\n{{Identical|Empty}}", "valueview-expert-globecoordinateinput-precision": "Label for the user interface element used to set a specific precision (e.g. 1, 0.1, 0.001) when entering a coordinate value.\n{{Identical|Precision}}", + "valueview-expert-globecoordinateinput-nullprecision": "Label describing the meaning of the coordinate precision \"null\". Usually it means there was no precision specified when the value was entered, other than the precision that can be guessed based on the number of fractional digits of the latitude and longitude values.", "valueview-expert-globecoordinateinput-customprecision": "Label wrapping a custom precision the user can not select when entering coordinates.\n\nParameters\n* $1 - the precision value as a decimal number\n{{Identical|Special}}", "valueview-expert-timevalue-calendar-gregorian": "Label of the GREGORIAN calendar. The label is used for selecting the GREGORIAN calendar model when entering a date and is displayed with dates that refer to that calendar model.\n\nSee also:\n* {{msg-mw|Valueview-expert-timeinput-calendarhint-gregorian}}\n* {{msg-mw|Valueview-expert-timeinput-calendarhint-switch-gregorian}}\n{{Identical|Gregorian}}", "valueview-expert-timevalue-calendar-julian": "Label of the JULIAN calendar. The label is used for selecting the JULIAN calendar model when entering a date and is displayed with dates that refer to that calendar model.\n\nSee also:\n* {{msg-mw|Valueview-expert-timeinput-calendarhint-julian}}\n* {{msg-mw|Valueview-expert-timeinput-calendarhint-switch-julian}}\n{{Identical|Julian}}", diff --git a/src/experts/GlobeCoordinateInput.js b/src/experts/GlobeCoordinateInput.js index 30682a6..d93facc 100644 --- a/src/experts/GlobeCoordinateInput.js +++ b/src/experts/GlobeCoordinateInput.js @@ -107,16 +107,24 @@ if ( !value ) { return value; } - value = value.getValue().getPrecision(); - if ( value === null ) { - return null; + + var precision = value.getValue().getPrecision(); + if ( !precision ) { + return { + custom: true, + value: null, + label: self._messageProvider.getMessage( + 'valueview-expert-globecoordinateinput-nullprecision' + ) + }; } - return getPrecisionSetting( value ) || { + + return getPrecisionSetting( precision ) || { custom: true, - value: value, + value: precision, label: self._messageProvider.getMessage( 'valueview-expert-globecoordinateinput-customprecision', - [ Formatter.PRECISIONTEXT( value ) ] + [ Formatter.PRECISIONTEXT( precision ) ] ) }; } diff --git a/src/experts/resources.php b/src/experts/resources.php index d2c2183..792920d 100644 --- a/src/experts/resources.php +++ b/src/experts/resources.php @@ -67,6 +67,7 @@ ), 'messages' => array( 'valueview-expert-globecoordinateinput-precision', + 'valueview-expert-globecoordinateinput-nullprecision', 'valueview-expert-globecoordinateinput-customprecision', ), ), -- To view, visit https://gerrit.wikimedia.org/r/279398 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I259bb529ba67e480e7faf2e8ebdc42860e5f73d3 Gerrit-PatchSet: 5 Gerrit-Project: data-values/value-view Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: Jonas Kress (WMDE) <jonas.kr...@wikimedia.de> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits