-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page Builder - enable the editor on New pages #172
Page Builder - enable the editor on New pages #172
Conversation
9bf4d97
to
afcdb7c
Compare
@@ -34,11 +34,15 @@ defmodule Beacon.LiveAdmin.PageEditorLive.New do | |||
end | |||
|
|||
defp build_new_page(site, [layout | _] = _layouts) do | |||
id = Ecto.UUID.generate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of pre populating dummy data here that will be rendered in the form, what if we populate the data (only if it's empty) on the actual call to build the page ast? (the page ast is used on the visual editor only)
%{data: builder_page} <- WebAPI.Page.show(page.site, page) do |
page
is resolved from the changeset so if the required fields are present (id, title, path) then it should work, otherwise we could fill with dummy data to make the visual editor work. This way user won't see the dummy data on the form.
Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I've been trying to see what changes with your suggestion. I think populating just to make it render is fine, however populating at the LiveView level is also important because it not only helps rendering the visual editor but it also provided an appropriate state to the assigns so that the page can be drafted, saved and also published.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leandrocp Please take a look to the updated demo, drag and drop functionality has now been enabled and feature is fully functional!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think populating just to make it render is fine
We can go with that for this version 👍🏻
31a5f3c
to
ca86272
Compare
2144401
to
ab3feda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ChristianTovar that looks good. What about changing the auto generated path with timestamp instead? (like you mentioned yesterday)
@@ -34,11 +34,15 @@ defmodule Beacon.LiveAdmin.PageEditorLive.New do | |||
end | |||
|
|||
defp build_new_page(site, [layout | _] = _layouts) do | |||
id = Ecto.UUID.generate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think populating just to make it render is fine
We can go with that for this version 👍🏻
55d1dde
to
8aeb0f7
Compare
c27e7a4
to
6df0229
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Demo
demo.4.34.50.PM.mov