U4-11126 - Update content angular editor for editing variants

Created by Shannon Deminick 19 Mar 2018, 11:23:11 Updated by Shannon Deminick 04 Apr 2018, 02:39:42

Subtask of: U4-11106

Prompt the user when switching variants if there are pending changes

and we also need to wire up the editor with the back end controller changes:

  • List all variants for a node
  • Get a variants property values by culture
  • Save/Publish a variant
  • Deal with validation issues (part of this can come from the server if a mandatory variant is not filled out)

1 Attachments

Download discard-changes-prompt.mp4

Comments

Mads Rasmussen 23 Mar 2018, 10:44:56

I have made a PR for showing the "discard changes"-prompt when changing variant. See video for short demo. The UI is still running with mocked data so all the wiring up still needs to be done. So when you change a variant now all you will see is the variant name update on the right side of the name input field.

PR for the prompt part is here: https://github.com/umbraco/Umbraco-CMS/pull/2538

How to test:

  • Create a node with a text string property on it.
  • Open the node and make sure you can change the variant.
  • Change the value of the text property
  • Try and change the variant again and make sure you see the "discard changes"-prompt
  • Click the "discard changes" button in the prompt and make sure the variant is changed.
  • Update the text property again. Change the variant. Click stay and make sure the variant isn't changed.


Mads Rasmussen 23 Mar 2018, 11:00:30

I will remove myself from the task as I am not working on it anymore. We will have to wait for the server side part to be done before we can wrap up the last things.


Warren Buckley 23 Mar 2018, 13:50:24

The UI work that @madsrasmussen has done all looks good codewise & test wise. The serverside stuff needs to be done before it can picked up again.


Shannon Deminick 03 Apr 2018, 16:07:24

@warren.buckley based on this WIP PR http://issues.umbraco.org/issue/U4-11127#comment=67-45754

you should now be able to test this with real data, but some caveats:

  • You'll need to start with a fresh database
  • The name and scheduled publishing data will not vary by culture, that is a diff task that stephane is working on
  • The publish status and URLs will not vary by culture, that is a diff task that stephane is working on

Known issues that perhaps you or @madsrasmussen can have a look at:

  • see src/common/directives/components/content/edit.controller.js ** where i have a note: "//fixme - need to fix something here if we are re-loading a content item that is in a split view" ** where i have a note: "// TODO: Make this real, but how do we deal with saving since currently we only save one variant at a time?!" ... split view isn't working right now but even if we made it work, we don't have a way to save both with a single button since we decided that we'd save each variant individually for now

Let's deal with the validation part in task U4-11127, not this one.


Mads Rasmussen 03 Apr 2018, 17:27:42

I don't think we should worry about the split view for now. It should be a task on its own to get that working. We need a way to select which variant to preview/save/publish.. So we can either leave everything as it is now or comment out the split view link (if it confusing)


Warren Buckley 03 Apr 2018, 21:10:35

@Shandem left you some notes/comments on the WIP PR https://github.com/umbraco/Umbraco-CMS/pull/2558#pullrequestreview-109095713

Also as this part is for the UI bits - is this task done/fixed then, as it's being worked on in the mega PR atm?


Priority: Normal

Type: Task

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 8.0.0

Sprint: Sprint 81

Story Points: 3

Cycle: 9