Skip to content
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

✨(frontend) Template builder #37

Merged
merged 9 commits into from
Apr 17, 2024
Merged

✨(frontend) Template builder #37

merged 9 commits into from
Apr 17, 2024

Conversation

AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented Apr 16, 2024

Purpose

The pads editors edit inside a template, but until now we couldn't easily create and edit this template.
We had to add it manually in the database, it was not suited for a real situation.

Proposal

  • add a template builder (see: https://grapesjs.com/)
  • adapt backend to save the data template editor
  • save the editor data (frontend)
  • save the html and css of the template
  • tests

@AntoLC AntoLC self-assigned this Apr 16, 2024
@AntoLC AntoLC force-pushed the feature/template-builder branch 2 times, most recently from b5a6100 to e28b915 Compare April 17, 2024 11:19
We created the features templates.
It will be used to create, edit and
delete templates.
It is a naive copy of pads.
We add the template builder editor to
the template feature.
It will be used to create and edit templates.
To save the template code editor content,
we need to add a new column on the Template model.
It is a JSONField that will store the code editor content.

We could in the future make an implementation to
save the code editor content in Minio.
On almost each change in the code editor,
the template is saved automatically.
It will restore as well the editor when we arrive
on the template editor page.
partial_update action was missing for the permission.
So when we were patching the template,
it was not working.
This commit adds the partial_update action
to the abilities.
We want to be able to update the css and code of
a template from the update endpoint.
This commit adds the css and code fields to the
TemplateSerializer.
We created a button to save the template's html and css.
With the template saved we will be able to use it
in the near future with our pads.
Add the effect prop on Box component.
2 effects are available: 'show' and 'hide'.
@AntoLC AntoLC force-pushed the feature/template-builder branch 2 times, most recently from 5d03577 to bb0ab50 Compare April 17, 2024 14:35
In order to work with the pad, the body tag
must be in the template.
This commit adds a warning to the template editor
when the body tag is not in the template.
@AntoLC AntoLC merged commit d9cdeb5 into main Apr 17, 2024
15 of 16 checks passed
@AntoLC AntoLC deleted the feature/template-builder branch April 17, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant