Page MenuHomePhabricator

Trim Whitespace around Label/Description/Aliases and Schema text
Closed, ResolvedPublic5 Story Points

Description

Problem:
Whitespace at the beginning and end of labels, descriptions, aliases and the Schema text are unnecessary. We already remove it for labels/descriptions/aliases on Items and Properties and a number of fields on Lexemes. The whitespace at the very beginning and end of a label, description, each of the aliases and the Schema text should be trimmed when saving.

BDD
GIVEN a Schema
WHEN entering a label, description, alias or Schema text with a whitespace at the beginning or end
AND then saving the input
THEN the whitespace is discarded before storing

Acceptance criteria:

  • any number of spaces at the beginning or end of the label, description, aliases or Schema text of a Schema is discarded before saving
  • any whitespace in places other than the beginning or end is kept as-is

Event Timeline

Michael created this task.Feb 11 2019, 9:00 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 11 2019, 9:00 AM
Lydia_Pintscher moved this task from Needs work to Ready to pick up on the Shape Expressions board.
Lydia_Pintscher triaged this task as Low priority.Feb 24 2019, 3:35 PM
Lucas_Werkmeister_WMDE renamed this task from Trim Whitespace around Label/Description/Aliases and Schema to Trim Whitespace around Label/Description/Aliases and Schema text.Mar 7 2019, 2:01 PM
Lucas_Werkmeister_WMDE updated the task description. (Show Details)
Lucas_Werkmeister_WMDE set the point value for this task to 5.EditedMar 7 2019, 2:06 PM

Note: in Wikibase, this happens via the StringNormalizer class.

We’ll probably implement this in the SchemaEncoder, and also change the current alias deduplication to take place there (instead of deduplicating in the edit special page and only checking for duplicates in the encoder, which currently has the effect that Special:NewSchema still throws on duplicate aliases).

Michael claimed this task.Mar 20 2019, 3:58 PM
Michael edited projects, added Shape Expressions Sprint 4; removed Shape Expressions.
Restricted Application added a project: User-Michael. · View Herald TranscriptMar 20 2019, 3:58 PM
Michael moved this task from 🗃️ Incoming to ⏳ In progress on the User-Michael board.

Change 498160 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Trim leading and trailing whitespace

https://gerrit.wikimedia.org/r/498160

Change 498160 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Trim leading and trailing whitespace

https://gerrit.wikimedia.org/r/498160

Lydia_Pintscher closed this task as Resolved.Apr 8 2019, 8:37 AM