U4-7748 - Models Builder - needs to be in control of the models-out-of-date status

Created by Shannon Deminick 15 Jan 2016, 12:27:29 Updated by Shannon Deminick 20 Jan 2016, 17:13:53

Tags: ModelsBuilder

Relates to: U4-7778

Relates to: U4-7799

Relates to: U4-7747

This cannot be part of Core... this needs to belong to Models Builder and none of this can be enabled when models builder is not enabled.

Comments

Shannon Deminick 19 Jan 2016, 13:30:32

Changes include:

  • Moving the models builder angular resource to MB core
  • Updating MB core to generate URLs correctly
  • Changed BuildModels to be a POST
  • Updates version to 3.0
  • Removes the uninstall web config transform from removing the appSettings - because when Nuget is upgraded, it first does an uninstall, so then all of these values are wiped
  • Creates new back office specific controller so that all XSRF security is handled and forces JSON compatible angular formats
  • Internalizes a few classes
  • flagOutOfDateModels is true by default - but this is only ever enabled if purelive = false


Shannon Deminick 19 Jan 2016, 15:09:53

Core PR: https://github.com/umbraco/Umbraco-CMS/pull/1034

MB PR: https://github.com/zpqrtbnk/Zbu.ModelsBuilder/pull/79

For testing:

  • Build the Umb Core and start it up
  • Build the MB project in Debug
  • Copy over the MB projects DLLs from: \Umbraco.ModelsBuilder.AspNet\bin\Debug (both the DLLs and PDBs)
  • Now you are working with the latest MB (don't build the Umb core proj or these DLLs will be overwritten)

Now to test, we need to test a few configs

Test1

<add key="Umbraco.ModelsBuilder.Enable" value="true" />
<add key="Umbraco.ModelsBuilder.EnableLiveModels" value="true" />
<add key="Umbraco.ModelsBuilder.EnableDllModels" value="false" />

== Pure live

  • Create a doc type with a template and a couple properties
  • Update the template to render out your properties like: @Model.Content.Property1, @Model.Content.Property2
  • Confirm that the Save button on the doc type doesn't have the Generate Models sub button
  • Create a content item at the root with this item
  • Fill in the properties
  • Render the page
  • Confirm it works

Test2

<add key="Umbraco.ModelsBuilder.Enable" value="true" />
<add key="Umbraco.ModelsBuilder.EnableLiveModels" value="false" />
<add key="Umbraco.ModelsBuilder.EnableDllModels" value="true" />

=== DLL models

  • (Based on the above content already created)
  • Go to the doc type
  • Confirm that the Save button on the doc type does have the Generate Models sub button
  • Click the generate models button
  • Confirm that it's successful
  • Go render the content page
  • Confirm that it works

Test3

<add key="Umbraco.ModelsBuilder.Enable" value="true" />
<add key="Umbraco.ModelsBuilder.EnableLiveModels" value="false" />
<add key="Umbraco.ModelsBuilder.EnableDllModels" value="true" />
<add key="Umbraco.ModelsBuilder.FlagOutOfDateModels" value="false" /> 
  • (Based on the doc type already created)
  • Go to the doc type
  • Confirm that the save button doesn't have any sub buttons

Test4

<add key="Umbraco.ModelsBuilder.Enable" value="true" />
<add key="Umbraco.ModelsBuilder.EnableLiveModels" value="false" />
<add key="Umbraco.ModelsBuilder.EnableDllModels" value="true" />
  • Go do the developer section
  • Go to the Model Builders dashboard
  • Confirm it is working and has information
  • Click the button to regenerate, confirm there are no errors


Stephan 19 Jan 2016, 16:20:03

Have merged the PR, still testing that it all works OK


Shannon Deminick 19 Jan 2016, 18:59:25

Have just pushed some more code to the Umb core branch to make sure that the build models button is available on the media type and member types too.


Stephan 20 Jan 2016, 12:51:49

Test1 update: should be and then it works as described.

Test2 update: should be and then it works as described.

QUESTION : the buttons says "generate models" -- does it save the current content type?

Test3 update: should be and then it works as described.

Test4 update, etc, works.


Stephan 20 Jan 2016, 13:04:11

I have pushed changes to temp-U4-7748 ''however'' I have not merged the Umbraco PR because that would mean Umbraco 7.4.0 depends on ModelsBuilder 3.0.0-beta001 which is not available yet. Re-assigning to Shannon.


Priority: Task - Pri 1

Type: Task

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.4.0

Due in version: 7.4.0

Sprint: Sprint 7

Story Points:

Cycle: