Page MenuHomePhabricator

[Story] Add Form to list of Forms (non-persistent)
Closed, ResolvedPublic

Description

We would like to have an 'Add' button beneath the list of Forms.
Clicking it I can provide a representation ( 'went' ) that is added to the list of Forms.

  • Cucumber:

    When I am on a Lexeme page
      And I click the Forms list add button
      And I enter a form representation
      And I save
     Then representation string should be displayed as Form in list of Forms

    Related Objects

    StatusSubtypeAssignedTask
    OpenNone
    ResolvedAddshore
    ResolvedAddshore
    ResolvedAddshore
    ResolvedLydia_Pintscher
    ResolvedLydia_Pintscher
    ResolvedLydia_Pintscher
    ResolvedLydia_Pintscher
    ResolvedLydia_Pintscher
    Resolveddaniel
    ResolvedLydia_Pintscher
    Resolveddaniel
    ResolvedNone
    Resolvedthiemowmde
    ResolvedJakob_WMDE
    ResolvedJakob_WMDE
    ResolvedWMDE-leszek
    ResolvedWMDE-leszek
    ResolvedWMDE-leszek
    DuplicateNone
    ResolvedWMDE-leszek

    Event Timeline

    Jonas renamed this task from Add Form to list of Forms to [Story] Add Form to list of Forms.Mar 15 2017, 2:26 PM

    @Jonas: Which software project should be associated to this task?

    • [Bug] Fix error in incurrent Lexeme view
      • It straight goes to edit mode when calling a Lexeme page, and editing does not work as expected
    • [Task] Write browser test as seen in the ticket
      • Including all support files.
      • Expectation is that the browser test runs without errors, with the new test failing.
      • This tasks includes comming up with a naming scheme for the HTML elements under test.
      • Suggestion is something like "wikibase-lexeme-…".
      • Decision: never use IDs in HTML, only class names.
      • Acceptance criteria is as follows: If I comment out the failing browser test line, the next should fail with a useful error message. And so on. If all are commented out, the test should succeed (with being empty).
    • [Task] Introduce HTML templates infrastructure
      • Key element is a new templates.php file, and a RessourceLoader module. Copy-paste from Wikibase.git.
      • Try to reuse code from Wikibase.git if it makes sense.
      • The templates list is (almost) empty, and the templating is unused at this point. Do not touch existing view code in this patch.
      • Add a comment that suggests a clean naming scheme, e.g. each template name starts with "wikibase-lexeme-…".
    • [Task] Move existing HTML from views to templates.php
      • Note: May not make sense for all HTML. Focus on extracting HTML that is actually needed in JS.
    • [Task] Create "formlist" widget for list of Forms
      • This is a subclass of the existing listview JS code.
      • Does not need to create it's own HTML. Keep it simple and do not implement this if it is not needed. Always instantiate on top of existing HTML pre-rendered via the backend.
      • This widget takes care of adding and displaying the Form added via "add".
      • This widget will later have a "remove" feature. Not part of the current story. Just keep this in mind.
    • [Task] Implement Form widget as shown in M210
      • Must support view as well as edit mode.
      • Should be able to instantiate on top of existing HTML pre-rendered via the backend, as well as create it's own HTML using a template.
      • Super-trivial with nothing but an input field for a single representation.
      • No input for gramatical role or anything.
      • No input for ID.
      • Note: We did investigation if existing JQuery UI modules can be reused for the new widgets. We had a look at ValueView as well as terms widgets. Conclusion: Create a new subclasses of EditableTemplatedWidget. Use labelview as a blueprint, but do not copy everything. Reuse elements that make sense. Start with a straight <input> field.
      • Note: We may use OOJS elements later. Do not do this for this story, but keep it in mind.
    • [Task] Create an "add" button to add a Form to a list of Forms
      • This uses the toolbar infrastructure.
      • In the first patch the button doesn't do anything.
      • Note: It might not be possible to split this from the next task that wires the add button.
      • Make sure the browser test succeeds at this step.
    • [Task] Make the "add" button display the "add Form" form
      • This patch creates the wiring to the Form widget previously created.
    • [Task] Make the "save" button add the new form to the list widget
      • This patch creates the wiring to the "FormList" widget previously created.
    • [Task] Assign an ID to each new Form
      • In the first patch this is allowed to reuse old numbers.

    I remember someone was complaining that we don't experiment.
    Statement like "This is a subclass of the existing listview JS code" or "This uses the toolbar infrastructure", as I see it, instantly throw away any opportunity to make things differently and everything will stay more or less the same.

    Correct me if I'm wrong.

    Thiemo and I sat together doing the investigation for this, so the person working on the ticket has some background and guidance.
    I think if there is a valid different approach we are open for that. Also if there is a need for more investigation we can still create a task for that.
    Does this address your concerns?

    Lydia_Pintscher renamed this task from [Story] Add Form to list of Forms to [Story] Add Form to list of Forms (non-persistent).May 8 2017, 1:53 PM
    Lydia_Pintscher closed this task as Resolved.