Commit Graph

113 Commits

Author SHA1 Message Date
Anthony LC
e901103c8b 🔨(Tilt) add y-webrtc-signaling
Add docker_build config to build y-webrtc-signaling.
2024-04-19 12:41:06 +02:00
Anthony LC
f3f5f190a5 🚀(helm) webrtc helm chart
Make the webrtc helm chart.
The webrtc server is a simple websocket server
that forwards messages between clients.
The server uses the port 443 and the protocol wss.
local_url: wss://impress.127.0.0.1.nip.io/ws
2024-04-19 12:41:06 +02:00
Anthony LC
2dc2341052 🚚(docker) move frontend docker config
Move frontend docker config to
src/frontend/Dockerfile.
2024-04-19 12:41:06 +02:00
Anthony LC
c2fb55506d 🧱(docker) dockerhub lasuite/impress-y-webrtc-signaling
Add the signaling server to dockerhub.
We create a special image for the signaling server,
it will be easier for scaling and maintenance.
2024-04-19 12:41:06 +02:00
Anthony LC
428cd74366 🚚(k8s) move tilt config to bin
Move tilt config to bin directory
to keep the root directory clean.
Add makefile cmd about k8s.
2024-04-19 12:41:06 +02:00
Anthony LC
0575c0f086 (app-impress) can duplicate template
Template with mode "is_public" are not editable, except
for the owner. We give the possibility to duplicate a
template, so that the user can edit the new one.
2024-04-18 18:13:59 +02:00
Anthony LC
35d500c08b 👔(backend) display css and code in template endpoint
We would like to duplicate a template from the frontend.
For that we need to access the css and code of the template.
So we add the css and code to the template endpoint.
2024-04-18 18:13:59 +02:00
Anthony LC
bf83bf99b3 ♻️(app-impress) create TemplateTools component
A component that will be used to display
the tools for the template editor.
2024-04-18 18:13:59 +02:00
Anthony LC
964efe4c2f 💄(app-impress) simplify the template builder
Remove some features from the template builder
that are not necessary for the MVP.
2024-04-18 18:13:59 +02:00
Anthony LC
75801bf95f 🤡(backend) add template editor json in demo
For the demo to be compatible with the new template
editor, we need to add the json file that setup
correctly the editor.
We are able to read and use it, but not edit it,
because the demo is in is_public mode.
2024-04-18 18:13:59 +02:00
Anthony LC
4de79c2388 💫(ap-impress) improve transition
Improve transition on Box component.
2024-04-18 15:49:42 +02:00
Anthony LC
f61047dd6a 💄(app-impress) keep highlighting menu when sub menu
When sub menu was open, the parent menu was not
highlighted.
This commit fixes this issue.
2024-04-18 15:49:42 +02:00
Anthony LC
d3b4a576c8 🗑️(app-impress) clean the menu
- replace pad and template icon
- remove unused icons
- remove unused pages
- remove menu items
2024-04-18 15:49:42 +02:00
Anthony LC
7107caf50b 🚸(app-impress) warning when resource not editable
When a resource is public, the users can see it
but not edit it. This commit adds a warning message
to the user to tell them that the resource
is not editable.
2024-04-18 14:44:12 +02:00
Anthony LC
82463be8ec 🐛(app-impress) fix all the resources were public
All the resources were public.
We now update correctly depend the user's choice.
We add a test.
2024-04-18 14:44:12 +02:00
Anthony LC
64cc2a9f2b 🐛(app-impress) fix bug rerendering when empty data
If the data is empty, the editor kept the previous
data and didn't rerender correctly the current editor.
This commit fixes this issue.
2024-04-18 12:48:15 +02:00
Anthony LC
b687ad6974 🚚(app-impress) rename PrintToPDFButton to PDFButton
- rename PrintToPDFButton to PDFButton
- rename button "Print the pad" to "Generate PDF"
2024-04-18 12:48:15 +02:00
Anthony LC
5d6ae870fa (app-impress) select template on pad
We add a template select component to the pad toolbox.
This component is a dropdown that allows the user
to select a template for the pad to add in a PDF.
2024-04-18 12:48:15 +02:00
Anthony LC
ef2ebf596a 👔(app-impress) add is_public switch button
Add a switch button to the create pad form to
allow the user to set the pad as public or private.
2024-04-17 17:45:03 +02:00
Anthony LC
7463735a38 👔(backend) is_public in document and template serializer
Add is_public field to document and template serializer.
2024-04-17 17:45:03 +02:00
Anthony LC
d9cdeb5c68 🚸(app-impress) add warning when body tag not in template
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.
2024-04-17 17:15:53 +02:00
Anthony LC
5d25aed765 💫(app-desk) add effect prop on Box component
Add the effect prop on Box component.
2 effects are available: 'show' and 'hide'.
2024-04-17 17:15:53 +02:00
Anthony LC
a8248f10d2 👔(app-impress) button to save html and css of the template
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.
2024-04-17 17:15:53 +02:00
Anthony LC
faeb8d137b 👔(backend) add css and code in template serializer
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.
2024-04-17 17:15:53 +02:00
Anthony LC
5074b271ad 🐛(backend) add partial_update action to the abilities
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.
2024-04-17 17:15:53 +02:00
Anthony LC
e13ecdd38d 👔(app-impress) save the templates editor automatically
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.
2024-04-17 17:15:53 +02:00
Anthony LC
3aaa3e179d 👔(backend) add code_editor column on Template
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.
2024-04-17 17:15:53 +02:00
Anthony LC
7922c702cd 🚀(app-impress) add template builder editor
We add the template builder editor to
the template feature.
It will be used to create and edit templates.
2024-04-17 17:15:53 +02:00
Anthony LC
8d2a78cf8d (app-impress) create Templates feature
We created the features templates.
It will be used to create, edit and
delete templates.
It is a naive copy of pads.
2024-04-17 17:15:53 +02:00
Anthony LC
7fb8a62e63 🔥(app-impress) remove La Gauffre button
The web host of the La Gauffre app is down,
La Gauffre was not rendered correctly.
La Gauffre button is removed from the header
of the Impress app, in waiting for the
web host to be up again.
2024-04-16 15:01:05 +02:00
Anthony LC
45bf99178b (app-impress) button editor convert from markdown
Some people prefer to write in markdown,
or had already written stuff in markdown,
so this commit adds a button to the editor t
hat will convert the markdown to the editor's format.
2024-04-16 15:01:05 +02:00
Anthony LC
8305cfcf99 🏷️(app-impress) add body type on generate-document endpoint
Adapt the generate-document endpoint
to serve body as html as well.
We add a type to the body parameter to
specify the type of the body.
2024-04-16 13:03:25 +02:00
Anthony LC
1df7c43dd3 🏷️(backend) add body type on generate-document endpoint
We were converting from markdown to html, but the
frontend can provide the body in html format, so
wa can avoid the conversion.

Solution:
Add body type on generate-document endpoint
to allow to choose between markdown and html.
2024-04-16 13:03:25 +02:00
Anthony LC
f9705c6ce9 ♻️(backend) api resources list ordering
Give the possibility to order the resources
list by creation date (documents / templates).
By default the list is ordered by
creation date descending.
2024-04-16 11:37:11 +02:00
Anthony LC
db9c9ecfe3 🤡(app-impress) remove mock pad endpoints
The backend was updated to include the
pad endpoints.
The mock pad endpoints were removed
in favor of the real ones.
We adapted the types as well to match
the real ones.
2024-04-16 11:37:11 +02:00
Samuel Paccoud - DINUM
3e0739cd0a (models/api) add document model and API
We do this by making copies of existing Template and TemplateAccess
models and API. A little refactoring is done to try to limit duplicate
code.
2024-04-16 11:37:11 +02:00
Anthony LC
0024cc5814 🚨(backend) fix linting issue
Fix linting issue in the backend codebase.
2024-04-12 16:24:23 +02:00
Anthony LC
5587cf69dd 🔧(helm) add command create_demo
We need to get dummy data in the system
for the moment, it will insert a template
for the PDF endpoint.
We need to run this command after the
migration is made.
2024-04-12 16:24:23 +02:00
Anthony LC
68c130bd84 🔧(backend) activate https on oidc redirection
mozilla-django-oidc didn't add the https://
prefix to the redirect_uri.
We set the option SECURE_PROXY_SSL_HEADER to
('HTTP_X_FORWARDED_PROTO', 'https') in the
settings.py file to force the https prefix.
2024-04-12 16:24:23 +02:00
Anthony LC
22e79e7583 🔧(backend) activate container liveness probes
Enabled Dockerflow Django app by activating liveness probes. The previously
unavailable routes such as `__heartbeat__` and `__lbheartbeat__` are now
accessible. New endpoints include:
* GET /__version__
* GET /__heartbeat__
* GET /__lbheartbeat__
2024-04-12 16:24:23 +02:00
Anthony LC
056bad08a5 🔧(backend) configure RedisCache in production settings
In development, sessions are saved in local memory. It's working well,
however it doesn't adapt to a kubernetized setup. Several pods need
to access the current sessions, which need to be stored in a single
source of truth.

With a local memory cache, pods cannot read session saved in other pods.
We end up returning 401 errors, because we cannot authenticate the user.

I preferred setting up a proper cache than storing sessions in database,
because in the long run it would be a performance bottleneck. Cache will
decrease data access latency when reading current sessions.

I added a Redis cache backend to the production settings. Sessions would
be persisted to Redis. In K8s, a Redis operator will make sure the cached
data are not lost.

Two new dependencies were added, redis and django-redis.

I followed the installation guide of django-redis dependency. These
setting were tested deploying the app to a local K8s cluster.
2024-04-12 16:24:23 +02:00
Anthony LC
2f4dd4ee7a 🔐(impress) update impress oidc secrets
Update oidc secrets in dev and staging environments
to match agent connect with impress settings.
2024-04-12 16:24:23 +02:00
Anthony LC
51babc07af 🚚(project) rename desk occurences to impress
Rename desk occurences to impress.
2024-04-12 16:24:23 +02:00
Anthony LC
dbb592bc9a 🔨(CI) add Tilt
Tilt is a tool for local Kubernetes development.
It makes it easy to see your changes as you
make them, and it rebuilds and redeploys
your app as you change it.
It is a great tool for local development
and testing of Kubernetes applications.
2024-04-12 16:24:23 +02:00
Anthony LC
0dc1be4cc7 (e2e) test the pdf export of the impress app
Add a test to check the pdf export of the
impress app.
It intercept the download of the PDF and
read its content.
We can assert that the template is correctly
rendered, and that the pad text is present as
well.
2024-04-11 09:21:35 +02:00
Anthony LC
a772d8fc29 🤡(backend) demo template
Create the create_demo command.
It creates a demo template for the backend.
We add it in the makefile bootstrap.

We force the template id, this id is the same as
used in the frontend for the moment.
When the template feature will be created in
the frontend side we will not have to force
it anymore.
2024-04-11 09:21:35 +02:00
Anthony LC
c6c0c1355d 🙈(project) add .devcontainer in gitignore
.devcontainer is used to create virtual environment
for development. It is not necessary to be
included in the git repository.
2024-04-11 09:21:35 +02:00
Anthony LC
cc64b8c8b5 🐛(backend) format html when generate document
When we converted from markdown to html,
we didn't format the html, so it was displayed
like a string in our pdf.
We now format_html the html before we generate
the pdf.
2024-04-11 09:21:35 +02:00
Anthony LC
2665b707db (app-impress) print to pdf
Feature to print the pad to pdf.

It display a button in the pad toolbar,
when clicked it will convert the pad to markdown,
send the markdown with a template to the backend
to convert it to pdf and then download the pdf.
2024-04-11 09:21:35 +02:00
Anthony LC
e28a4294fa (app-desk) add useCreatePdfFromMarkdown
Add the hook useCreatePdfFromMarkdown,
it will be used to generate a pdf from a
a template and a markdown.
2024-04-11 09:21:35 +02:00