Page MenuHomePhabricator

Add support for <textarea> fields to the ApiSandbox
Closed, ResolvedPublic

Description

Certain Wikibase API modules, e.g. SetClaim or SetReference, do have a field that must contain a JSON blob. Even if these API modules are not made to be used manually by a user, we want users to play around with the API and learn how it works. That's one of the reasons why we have the ApiSandbox.

Problem: The fields to input JSON blobs are tiny single-line, 225px wide (see ApiSandbox/resources/styles.css) <input> fields. Editing a JSON blob in this field is pretty much impossible.

Suggestion: Add support for <textarea> fields to the ApiSandbox, so extensions like Wikibase can make use of it when appropriate. Set a low default width and height (e.g. 3 lines height and keep the 225px width) and set resize: both;.

Event Timeline

thiemowmde raised the priority of this task from to Needs Triage.
thiemowmde updated the task description. (Show Details)
thiemowmde added a subscriber: thiemowmde.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 7 2015, 11:01 AM
thiemowmde set Security to None.May 7 2015, 1:38 PM
thiemowmde added subscribers: aude, hoo, daniel.
Anomie added a subscriber: Anomie.May 7 2015, 2:03 PM

This isn't technically blocked by T92893: Update ApiSandbox to MediaWiki appearance using OOjs UI and/or T89386: Merge ApiSandbox extension into core, but it's already a feature in the rewrite I'm doing to solve those two tasks and isn't very likely to be done by anyone outside of that.

Great to hear that! :-) Does this mean the ApiSandbox extension can be considered legacy code and it would be a waste of time to work on it? Is there a rough estimate for the release of your rewrite?

Anomie added a comment.May 7 2015, 4:31 PM

Great to hear that! :-) Does this mean the ApiSandbox extension can be considered legacy code and it would be a waste of time to work on it? Is there a rough estimate for the release of your rewrite?

I really should put the WIP in Gerrit. T92893 has a list of blockers before it can be feature-complete, then however long it takes to be reviewed.

Change 209570 had a related patch set uploaded (by Anomie):
WIP: Add Special:ApiSandbox

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

Lydia_Pintscher moved this task from incoming to monitoring on the Wikidata board.May 15 2015, 2:04 PM

You should be able to use 'text' as new type - https://gerrit.wikimedia.org/r/#/c/209569/
Maybe add a type json to move the validation of json to core (I did not know if that is useful in other extensions, but there is JsonContent with .json, so core has json support)

thiemowmde added a comment.EditedJun 15 2015, 8:24 AM

I tried and saw fields marked as 'text' rendered as (text). Simple reason: Don't forget to update the ApiSandbox extension. ;-)

thiemowmde closed this task as Resolved.Jun 15 2015, 8:30 AM
thiemowmde claimed this task.

Change 209570 merged by jenkins-bot:
Add Special:ApiSandbox

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

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptFeb 3 2016, 4:53 PM