Page MenuHomePhabricator

Take hardcoded labels in the front-end to a constants file
Closed, ResolvedPublic

Description

It would be good to have labels declared as constants instead of hard-coded in the Vue component files (similarly to the PHP file ZTypeRegistry.php), so that instead of this.zobject.Z1K1 we can do something like this.zobject[Z_OBJECT_TYPE] and improve readability.

An important point to take into account, as suggested by James, should be to avoid extracting those labels which are only used in one .vue file. In these cases, these can still be declared as constants in the necessary file.

Event Timeline

Jdforrester-WMF raised the priority of this task from Medium to Needs Triage.Dec 16 2020, 6:12 PM

Change 650300 had a related patch set uploaded (by Gabrielchihonglee; owner: Gabrielchihonglee):
[mediawiki/extensions/WikiLambda@master] Extract hardcoded labels in FullZObject to constants file

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

Change 650300 merged by jenkins-bot:
[mediawiki/extensions/WikiLambda@master] Extract hardcoded labels in FullZObject to constants file

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

Change 650608 had a related patch set uploaded (by Gabrielchihonglee; owner: Gabrielchihonglee):
[mediawiki/extensions/WikiLambda@master] Extract hardcoded labels in vue files to constants file

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

Change 650608 merged by jenkins-bot:
[mediawiki/extensions/WikiLambda@master] Extract hardcoded labels in vue files to constants file

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