Lucas_Werkmeister_WMDE created this task.
Lucas_Werkmeister_WMDE added a project: Wikidata.
Herald added a subscriber: Aklapper.

TASK DESCRIPTION

Currently, a saved new statement gets the CSS class wikibase-statement-new, but no class with its GUID like existing statements (wikibase-statement-Q123$4567-…). As far as I can tell, this makes it impossible for gadgets, user scripts etc. to reliably select the new statement (they cannot select .wikibase-statement-new, since that selects multiple statements if several statements have been added).

The source of the new is this getter in the jquery.wikibase.statementView template parameters:

function() { // GUID                                                                                                                                                                        
    return ( this.options.value && this.options.value.getClaim().getGuid() ) || 'new';
},

Reapplying the template after the statement has been saved (…._applyTemplate()) should insert the GUID, but unfortunately that doesn’t work, since it will also replace all the components of the statement (rank selector, main snak, qualifiers, etc.) with the empty elements they start out with. As far as I can tell, jquery.wikibase.statementview isn’t designed for reapplying the initial template.


TASK DETAIL
https://phabricator.wikimedia.org/T167948

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Aklapper, GoranSMilovanovic, QZanden, Izno, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to