Page MenuHomePhabricator

[MEX] 3.1.2 Use WikibaseWbui2025EditableSnakValue component in `addQualifier.vue` and `addReferences.vue`
Closed, ResolvedPublic

Description

We currently include the following code in three files:

<cdx-text-input v-if="!valueStrategy.isLookupDatatype() && snakTypeSelection === 'value'" v-model="textvalue"></cdx-text-input>
<cdx-lookup
	v-else-if="valueStrategy.isLookupDatatype()"
	v-model:selected="lookupSelection"
	v-model:input-value="lookupInputValue"
	:menu-items="lookupMenuItems"
	:menu-config="menuConfig"
	@update:input-value="onUpdateInputValue"
	@load-more="onLoadMore"
>
</cdx-lookup>

with minor variations and associated logic in the views. This duplication makes it harder to introduce new snak value types and means that the functionality of addQualifier and addReferences lags behind the functionality in the main editStatement view.

Additionally, the addQualifier and addReference versions have no support for adding somevalue and novalue snaks, which is presumably desirable.

Acceptance Criteria

  • editableSnak, addQualifier and addReference use the same component for snak input, presumably WikibaseWbui2025EditableSnakValue
  • associated logic is removed from addQualifier and addReference so that the logic for snakvalues is encapsulated in the WikibaseWbui2025EditableSnakValue component

Event Timeline

Change #1203818 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/Wikibase@master] Refactor addReferences and addQualifiers to use editableSnakValue

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

Change #1203818 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Refactor addReferences and addQualifiers to use editableSnakValue

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