Page MenuHomePhabricator

Allow for editing existing templates
Open, NormalPublic

Description

This is a follow-up from T191757: Investigation: Edit existing templates.

Value proposition:

As a user, I want to expand or modify existing template(s) in wikitext so that I can improve the page.

Expected behaviour:

  • When user places the cursor within an existing template:
    • The immediate surrounding template is used to pre-populate the wizard.
      • If the user edits the template and hits Insert, the existing template is updated.
      • If the user hits Trash, adds a new template and hits Insert, we insert the new template at the cursor position.
      • Note: We don't replace the original template because it is possible that the user never intended to modify the template but add a nested template instead - hence we don't replace anything to be on the safe side.
  • When user selects some text
    • We internally expand selection to the nearest surrounding template, if one. If none is found, we give them a blank wizard.
    • If we found a surrounding template, we populate the wizard with the template.
    • If user updates the template and hits Insert, we update the existing template.
    • If user hits Trash, then adds another template and then hits Insert - we then ask them what they want to do -
      • It seems like you are trying to insert a new template but you have selected text on the page. Do you want to replace the selected text or insert the new template without replacing text?
        1. Replace the selected text
        2. Insert template without replacing text -- This option inserts the new template at the end of selected text.

Needs QA?

Yes.

Event Timeline

Niharika created this task.Oct 8 2018, 11:09 PM
Niharika triaged this task as Normal priority.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 8 2018, 11:09 PM
Dalba awarded a token.Oct 27 2018, 6:01 PM
Niharika updated the task description. (Show Details)Nov 1 2018, 7:40 PM
Niharika renamed this task from [Draft] Allow for editing existing templates to Allow for editing existing templates.
Niharika added subscribers: Mooeypoo, eranroz.

@eranroz @Mooeypoo - take a look at the description. Does it seem fine to you? I'm eager to get this feature out. :)