Page MenuHomePhabricator

Allow editing of non-depicts statement block on File page
Closed, ResolvedPublic

Description

User story
As a normal user
I want to be able go to the File page
And delete existing Q-item values for a non-depicts property
And add new Q-item values to a non-depicts property that already has values

We have this
Display of statement blocks for non-depicts statements

We want this
js to hook into non-depicts statement blocks and allow

  • deleting existing value
  • adding new value
  • everything else we can already do for depicts (unless excluded below)

Not in scope:

  • qualifiers
  • properties with data types that are not 'wikibase-entity'

Acceptance Criteria

Test case set up at https://commons.wikimedia.beta.wmflabs.org/wiki/File:T219382.png

On the File page

  • can add Q-item values for a property that is not 'depicts' and that already has Q-item values
  • can delete values from a property that is not 'depicts' and that already has Q-item values
  • can remove entire statement block for all statements

Note: ideally, deletion can only be tested once - after that, it's gone...
To add anew, execute this from JS console, while logged in:

(new mw.Api()).postWithEditToken({
	action: 'wbsetclaim',
	format: 'json',
        claim: JSON.stringify({"type":"statement","mainsnak":{"snaktype":"value","property":"P694","datavalue":{"type":"wikibase-entityid","value":{"id":"Q427329"}}},"id":"M64715$35020f2e-4e2c-c840-567f-457b497c8fcc","rank":"normal"})
});

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseMediaInfo : masterApply DepictsWidget (now StatementWidget) to all statement blocks

Event Timeline

Cparle created this task.Mar 27 2019, 1:45 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 27 2019, 1:45 PM
Ramsey-WMF triaged this task as High priority.Mar 28 2019, 2:28 PM
Ramsey-WMF moved this task from Untriaged to Triaged on the Multimedia board.

Change 502210 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Apply DepictsWidget (now StatementWidget) to all statement blocks

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

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptApr 15 2019, 11:14 AM

@Ramsey-WMF: this ticket was pulled in from a later milestone to improve how we deal with T219381.
I'm not sure if you've had the time to review exactly how this is supposed to work and if you're ok with this, so can you verify the acceptance criteria?
TL;DR: non-depicts statements are going to look & behave exactly like depicts, minus the depicts-specific title, and they'll be greyed out.

If you're ok with this, please re-assign to @Edtadros - this has already been merged and can be tested on beta (see link in acceptance criteria)

I've tested it and this works for me. One question though: what happens when it's a statement with a data type we don't yet support?

There's other tickets (T220613 & T220614) for unsupported data types, so I'll move this one to "Verify on production".

To answer the question, here's roughly how they are different:

  • we'll display the unsupported thing best as we can within the current widget
  • the autocomplete field to add new items does not show up for unsupported data types
  • the values don't have a "Q123" link, because they're not such type of values

Moved this back into 'Needs QA' because we won't be able to verify it on production for another few releases, and by that stage it'll surely need to be QAed again

This ticket is just for the most basic "support": making sure other statements don't break things and can be deleted.
This will already be in production, so we can deal with vandalism from manually crafted API calls to submit other statements.

This has been in production for 6 weeks. @Ramsey-WMF can we resolve it?

Ramsey-WMF closed this task as Resolved.Jul 1 2019, 10:17 PM