Closed ryan-woodruff closed 10 months ago
Yes - this is a winner, if we can just work out a way of not using ContentService or Datatype service directly.
what information is needed with these two ?
As far as i can see we are using content service to find a property on the Contenttype ?
I think we do that is the context. with GetDataTypeAlias
this returns the DatatypeAlias for a given ContentType and property. so we do probably have the info already? (i could be reading this wrong?)
Adds in some rough functionality to convert config and styles from the legacy grid to the BlockGrid & acts as a start for settings conversion. This implementation only handles the config/styles in the Layout layer (row) but perhaps similar implementations can be adopted for other layers.
It does this by:
Content Types
Nothing is done with modifier & prevalues as this is out of scope for me personally, but should definitely be included in a future update
Content Converts content by simply porting the string over or using a process defined by anything that implements
IGridSettingsMigrator
. This is tied to each "datatype" (view) using the ViewKey property. The process for the conversion is defined inConvertContentString
. I would have liked to make this more customisable, but this seems to do the job for now. TheNewDataTypeAlias
should already be created in Umbraco but perhaps a way to do this automatically based off of a description in theIGridSettingsMigrator
could be done to make this more programmatic? The setting "content" migrator does hook intoIContentTypeService
&IDataTypeService
which isn't great as that means it relies on the old data being present to work and goes against the idea of being able to go from old usync config -> new , on a fresh umbraco site/database.Note: One thing I would have liked to not do is pass the dataTypeProperty.DataTypeAlias around (specifically to layoutSettingsBlockHelper.AddGridSettings() & layoutBlockHelper.AddLayoutBlocks() ). I was considering putting in into a context but then realised that probbaly wouldnt work and/or be messier as that would involve just passing it to there and storing it there, which is probably an equally as bad solution. I'm more than happy for alternatives to this.
Some more default GridViewPropertyMigrators will be needed (they may need more customisable interfaces?) for the following:
radiobuttonlist mediapicker imagepicker booleantreepicker treesource multivalues