Page MenuHomePhabricator

Create the API module allowing editing the representation, and the grammatical features of a Form (days: 4)
Closed, ResolvedPublic

Description

The API module should allow changing the list of representations of a form, and/or changing its grammatical features.

The API module is intended for the Lexeme page UI only.

API specification:

  • input:
    • formId
    • data: JSON array, containing representations and grammatical features after the edit, e.g.
{
  "representations": {
    "en-gb": "colours",
    "en-us": "colors",
  },
  "grammaticalFeatures: ["Q666"]
}
  • action-specific fields in the response:
    • form: JSON representation of the saved form
    • lastrevid: revision ID
  • edit summary format: TBC

Related Objects

Event Timeline

WMDE-leszek triaged this task as High priority.EditedJan 8 2018, 9:52 AM
WMDE-leszek created this task.

The API input and response format should be specified here, so that the task for using the API in the UI (T184411) could be tackled independently!

WMDE-leszek moved this task from Backlog to In Progress on the Wikidata-Sprint-2018-01-03 board.

Will update the task description in a bit. Experimenting here and there, to get the possibly full specs.

WMDE-leszek updated the task description. (Show Details)Jan 8 2018, 4:17 PM
WMDE-leszek updated the task description. (Show Details)

Change 402868 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/WikibaseLexeme@master] [WIP] Add API action for editing elements of a form

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

WMDE-leszek added subscribers: Jonas, Ladsgroup.EditedJan 10 2018, 2:43 PM

@Lydia_Pintscher: re what the edit summary should look like, please find below the cases I believe are possible

Represetations

Before: EN color
After: EN colour

Summary: ?

Before: EN-GB colour, EN-US color
After: EN-GB-colour

Summary: ?

Before: EN-GB colour
After: EN-GB colour, EN-US color

Summary: ?

Grammatical features

Before: Q666 (dative)
After: Q777 (accusative)

Summary: ?

Before: Q666 (dative), Q888 (singular)
After: Q666 (dative)

Summary: ?

Before: Q666 (dative)
After: Q666 (dative), Q888 (singular)

Summary: ?

Bonus question: It's been decided once that when the user changes both representation(s) and grammatical feature(s), and then clicks save, the changes she made are stored as a single edit, thus there is a single edit summary to consider. Question then: How would the summary look in such a case?
Hint: one couldn't refer to item/property changes AFAIK, as when e.g. changing the label, and the description, and then saving, there are two edits saved on the item/property, and each has an edit summary about the respective field.

Change 403449 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/WikibaseLexeme@master] Added tests for classes related to EditFormElements API

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

WMDE-leszek renamed this task from Create the API module allowing editing the representation, and the grammatical features of a Form to Create the API module allowing editing the representation, and the grammatical features of a Form (days: 1).Jan 11 2018, 9:36 AM

The summary part has been moved to the separate task: T184702.

Change 403716 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/WikibaseLexeme@master] Add revision ID to the response of edit form elements API

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

Change 403716 abandoned by WMDE-leszek:
Add revision ID to the response of edit form elements API

Reason:
Having thought about it for more than 3 minutes, I have realized this is not needed, and could even lead to bugs, so ditching this before anyone notices!

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

WMDE-leszek renamed this task from Create the API module allowing editing the representation, and the grammatical features of a Form (days: 1) to Create the API module allowing editing the representation, and the grammatical features of a Form (days: 2).Jan 13 2018, 11:39 AM
WMDE-leszek renamed this task from Create the API module allowing editing the representation, and the grammatical features of a Form (days: 2) to Create the API module allowing editing the representation, and the grammatical features of a Form (days: 3).Jan 15 2018, 5:23 PM
WMDE-leszek renamed this task from Create the API module allowing editing the representation, and the grammatical features of a Form (days: 3) to Create the API module allowing editing the representation, and the grammatical features of a Form (days: 4).Jan 16 2018, 3:33 PM

Change 402868 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Add API action for editing elements of a form

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

Change 403449 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Added tests for classes related to EditFormElements API

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

WMDE-leszek closed this task as Resolved.Jan 17 2018, 11:08 AM
238482n375 removed WMDE-leszek as the assignee of this task.Jun 15 2018, 8:02 AM
238482n375 lowered the priority of this task from High to Lowest.
238482n375 moved this task from Next Up to In Code Review on the Analytics-Kanban board.
238482n375 edited subscribers, added: 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GhlIHRpbWV6b25lIHNldHRpbmcgaW4geW91ciBwcm9maWxlLCBjbGljayB0byByZWNvbmNpbGUu

238482n375 set Security to Software security bug.Jun 15 2018, 8:05 AM
238482n375 changed the visibility from "Public (No Login Required)" to "Custom Policy".

SG9tZVBoYWJyaWNhdG9yCk5vIG1lc3NhZ2VzLiBObyBub3RpZmljYXRpb25zLgoKICAgIFNlYXJjaAoKQ3JlYXRlIFRhc2sKTWFuaXBoZXN0ClQxOTcyODEKRml4IGZhaWxpbmcgd2VicmVxdWVzdCBob3VycyAodXBsb2FkIGFuZCB0ZXh0IDIwMTgtMDYtMTQtMTEpCk9wZW4sIE5lZWRzIFRyaWFnZVB1YmxpYwoKICAgIEVkaXQgVGFzawogICAgRWRpdCBSZWxhdGVkIFRhc2tzLi4uCiAgICBFZGl0IFJlbGF0ZWQgT2JqZWN0cy4uLgogICAgUHJvdGVjdCBhcyBzZWN1cml0eSBpc3N1ZQoKICAgIE11dGUgTm90aWZpY2F0aW9ucwogICAgQXdhcmQgVG9rZW4KICAgIEZsYWcgRm9yIExhdGVyCgpFVzZSC3IERpc2NsYWltZXIgtyBDQy1CWS1TQSC3IEdQTApZb3VyIGJyb3dzZXIgdGltZXpvbmUgc2V0dGluZyBkaWZmZXJzIGZyb20gdGhlIHRpbWV6b25lIHNldHRpbmcgaW4geW91ciBwcm9maWxlLCBjbGljayB0byByZWNvbmNpbGUu

Restricted Application added a project: Security. · View Herald TranscriptJun 15 2018, 1:49 PM
Aklapper changed the visibility from "Custom Policy" to "Public (No Login Required)".