[x] Add a type column in the templates table of type ENUM(setting, form, page, collection).
[x] Set all multiple=1 templates to type collection
[x] Set all form=1 templates to type form
[x] Set all other template types to setting
[x] Drop form and multiple columns from templates
[x] Rename the records.section_id column to records.template_id
[x] Generate type=page template entries for each discovered /[^_]*.html file.
[x] Generate a default page record instance for each template entry
Template Parser Updates
[x] Use the Handlebars parser ASTs for improved template parsing, hash validation, template rewrites, partials support, and page rendering
[x] Discover all data paths that start with this. inside of page templates and add them to the page's template entry as fields.
[x] Discover all data paths with no context prefix and log a deprecation warning. Automatically insert general. as the path context to avoid this. conflicts.
[x] Discover all data paths with the _ pseudo-private prefix and log a deprecation warning. Automatically rewrite _ paths to @ for proper Handlebars data attribute rendering support.
[x] Add the {{#collection name as |value|}} block helper to the runtime and analyzer.
[x] Update the {{#section name multiple=true}} helper to analyze a type=collection
[ ] Deprecate and the {{#section name multiple=true}}
[ ] Rewrite the {{#section name multiple=true}} to {{#collection name as |value|}} (this is hard and requires children path rewrites... may not be reasonably possible.)
Dashboard Updates
[x] Display Pages in the admin dashboard as single records.
[ ] Allow users to create new Pages, selecting from the project Page templates as data structure options.
[ ] Allow users to delete Pages (including the default created ones)
[ ] Allow users to create new Collection instances, selecting from the available templates.
[ ] Allow users to delete Collection instances – including the default Collection created.
[ ] Add collection directive for the dashboard – users may select from a list of collections that use the same template.
Came up with an idea as I was working here: What if we allow {{#collection this.name as |value|}} (note: this.name instead of name). This would make a page-specific collection. It won't be shared between other pages and will show up as a direct child of the page in the dashboard. Essentially, each page instance will get a private collection to reference.
Began implementing https://github.com/vapid/vapid/issues/158 here so we can play with it and get a feel for the new data model features 🙂
Data Model Updates
sections
table totemplates
type
column in thetemplates
table of type ENUM(setting, form, page, collection).multiple=1
templates to typecollection
form=1
templates to typeform
setting
form
andmultiple
columns fromtemplates
records.section_id
column torecords.template_id
type=page
template entries for each discovered/[^_]*.html
file.record
instance for each template entryTemplate Parser Updates
this.
inside ofpage
templates and add them to the page's template entry as fields.general.
as the path context to avoidthis.
conflicts._
pseudo-private prefix and log a deprecation warning. Automatically rewrite_
paths to@
for proper Handlebars data attribute rendering support.{{#collection name as |value|}}
block helper to the runtime and analyzer.{{#section name multiple=true}}
helper to analyze atype=collection
{{#section name multiple=true}}
{{#section name multiple=true}}
to{{#collection name as |value|}}
(this is hard and requires children path rewrites... may not be reasonably possible.)Dashboard Updates
Page
s in the admin dashboard as single records.Page
s, selecting from the projectPage
templates as data structure options.Page
s (including the default created ones)Collection
instances, selecting from the available templates.Collection
instances – including the defaultCollection
created.collection
directive for the dashboard – users may select from a list of collections that use the same template.Came up with an idea as I was working here: What if we allow
{{#collection this.name as |value|}}
(note:this.name
instead ofname
). This would make a page-specific collection. It won't be shared between other pages and will show up as a direct child of the page in the dashboard. Essentially, each page instance will get a private collection to reference.