Commit Graph

1583 Commits

Author SHA1 Message Date
Anthony LC
d5d374c311 🛂(frontend) right pad editor
Manage the right on the pad editor.
If a use cannot edit a pad, the pad editor will
be read-only. It will not save automatically.
A message will be displayed to the user.
2024-05-27 10:20:20 +02:00
Jacques ROUSSEL
dd33c99532 💚(CI) add git hook
Add git hook to avoid secret leaks
2024-05-24 17:01:25 +02:00
Anthony LC
f4146fbe4e 🚚(frontend) rename pad to pad-editor
Rename the pad feature to pad-editor.
2024-05-24 16:12:45 +02:00
Anthony LC
dce040f4c3 🚚(frontend) move types and pad api hooks
Move types and pad api hooks to pad-management.
2024-05-24 16:12:45 +02:00
Anthony LC
3a68c75feb 🚚(frontend) rename pads-create to pad-management
Rename the pads-create feature to pad-management.
This feature will not only create but gives tools
to update and remove pads as well.
2024-05-24 16:12:45 +02:00
Anthony LC
29577c0419 (frontend) remove document
We can now remove a document from a modal.
2024-05-24 16:12:45 +02:00
Anthony LC
2813b2ca27 (frontend) update document
We can now update a pad from a modal.
2024-05-24 16:12:45 +02:00
Anthony LC
ef2f4d3250 💚(CI) remove trigger workflow on push tags
We were starting the workflow on push tags,
it is needed for the docker-hub workflow,
but the other workflows should not be triggered
on push tags.
2024-05-24 16:12:45 +02:00
Anthony LC
996cea49b4 ♻️(frontend) add PDF generation inside a modal
Refacto the pad tools, we will use modals to handle
the different actions on the pad. We start by
implementing the PDF generation inside a modal.
2024-05-24 16:12:45 +02:00
Anthony LC
eb2936f48b 🔐(helm) add djangoSuperUserEmail secret
To fit with the production environment, we need to add the
djangoSuperUserEmail secret to the staging environment.
2024-05-24 12:47:38 +02:00
Anthony LC
10c53d2a4e 🔖(minor) initial release to 0.1.0
Added
- Coming Soon page
- Impress, project to manage your documents easily
  and collaboratively
2024-05-24 10:49:09 +02:00
Anthony LC
5c9e4ab3e6 🏷️(backend) accept string as saved document
Saved documents has to be a string now.
Before it has to be a json object.
2024-05-24 10:27:34 +02:00
Anthony LC
7aeea18202 🗃️(frontend) add initial pad to webrtcserver
It is the webrtc server that will be responsible
for managing the data of the BlockNote Editor.

So to restore the data of a saved pads, we have to
add the initial pad to the room of the webrtc
server, it will then update the data of BlockNote
Editor.
The webrtc server accept Y.Doc, so we
convert our base64 data from Minio to make it
compatible with the server.

By doing so, we avoid the problem of
data lost when multiple users are connecting
and one user already updated the data of the
BlockNote Editor before saving it.
2024-05-24 10:27:34 +02:00
Anthony LC
64d508c260 (frontend) pad persistance
This commit manage the persistance of the pad.
We save the pad in different ways:
- when the user close the tab or the browser
- when the user leave the page (go to another pad
  by example)
- every 1 minute
----
- We save the pad only if the pad has been modified.
- Pads are collaborative, to not save multiple
  times the same pad, we save the pad only if
  the user is the last to have modified the pad.
----
Because of the collaborative aspect of the pads,
the best way to store our pad is to save the
Y.Doc, to do so the recommended way is to convert
the Y.Doc to a Uint8Array and then to a string
(base64). Our pad are saved as a string in a
object in a Minio bucket.
2024-05-24 10:27:34 +02:00
Anthony LC
d75649d18a 🏷️(frontend) adapt some types
Adapt some pad types.
2024-05-24 10:27:34 +02:00
Anthony LC
a851720441 (frontend) create useUpdatePad react query hook
Create a react query hook to update a pad.
PATCH /documents/:id
2024-05-24 10:27:34 +02:00
Anthony LC
29f13f5f4b 🚨(frontend) stop throwing errors on id pages
We stopped throwing errors on id pages, often
Next.js just need a rerender to get the id
from the router correctly.
2024-05-24 10:27:34 +02:00
Samuel Paccoud - DINUM
515b686795 (models/api) allow inviting external users to a document by their email
We want to be able to share a document with a person even if this person
does not have an account in impress yet.

This code is ported from https://github.com/numerique-gouv/people.
2024-05-24 08:20:28 +02:00
Samuel Paccoud - DINUM
125284456f 🐛(docker-compose) run node container as logged-in user
Running the container as root will install npm modules with root
access rights and generate issues when running the application with
the logged in user as we do it with Docker Compose.
2024-05-24 08:20:28 +02:00
Anthony LC
b7b3c6c058 🧑‍💻(backend) add document in django admin
Add document in django admin to be able
to manage the document in the admin panel.
2024-05-23 10:44:52 +02:00
Anthony LC
644920e732 (frontend) coming soon
Add a coming soon page bind to the
docs.numerique.gouv.fr domain.
2024-05-23 10:44:52 +02:00
Anthony LC
dc319578b6 👷(helm) production configuration
This PR adds the production configuration
for the helm chart.
2024-05-23 10:44:52 +02:00
Lebaud Antoine
abf08fe3b3 🔧(helm) setup logout flow from Agent Connect
Add the relevant environment configurations to make sure the backend
in dev and staging environments log out the user from Agent Connect.
2024-05-22 16:08:41 +02:00
Lebaud Antoine
76e50ac02f (backend) support Agent Connect Logout flow
The default Logout view provided by Mozilla Django OIDC is not suitable
for the Agent Connect Logout flow.

Previously, when a user was logging-out, only its Django session was ended.
However, its session in the OIDC provider was still active.

Agent Connect implements a 'session/end' endpoint, that allows services to
end user session when they logout.

Agent Connect logout triggers cannot work with the default views implemented
by the dependency Mozilla Django OIDC. In their implementation, they decided
to end Django Session before redirecting to the OIDC provider.

The Django session needs to be retained during the logout process.

An OIDC state is saved to the request session, pass to Agent Connect Logout
endpoint, and verified when the backend receives the Logout callback from Agent
Connect. It seems to follow OIDC specifications.

If for any reason, the Logout flow cannot be initiated with Agent Connect,
(missing ID token in cache, unauthenticated user, etc), the user is redirected
to the final URL, without interacting with Agent Connect.
2024-05-22 16:08:41 +02:00
Lebaud Antoine
5f7e3e620a 🚚(backend) create a dedicated authentication package
Prepare adding advanced authentication features. Create a dedicated
authentication Python package within the core app.

This code organization will be more extensible.
2024-05-22 16:08:41 +02:00
Anthony LC
004a4edfe7 (frontend) add logout button
Rework the header based on latest Johann's design, which introduced a
dropdown menu to manage user account.

In this menu, you can find a logout button, which ends up the backend
session by calling the logout endpoint. Please that automatic redirection
when receiving the backend response were disabled. We handle it in our
custom hook, which reload the page.

Has the session cookie have been cleared, on reloading the page, a new
loggin flow is initiated, and the user is redirected to the OIDC provider.
2024-05-22 16:08:41 +02:00
Anthony LC
d221ebe4f9 💚(CI) increase timeout e2e job
It can happen that the e2e job takes longer
than 10 minutes to finish, we increase the
timeout to 15 minutes to avoid the job to fail.
2024-05-14 16:30:49 +02:00
Anthony LC
9903b43b72 ♻️(app-desk) change header html structure
Change the html structure of the header
component to be more aligned.
Remove dummy profil picture.
2024-05-14 16:12:36 +02:00
Anthony LC
d23426679a 🐛(app-desk) fix fetchPriority warning
The upgrade to react@18.3.1 has a compatibility
issue with next@14.2.3. It creates a error warning
about the fetchPriority prop. This commit fixes the
issue by downgrading react to 18.2.0 as it was
before the last upgrade.
2024-05-14 16:12:36 +02:00
Anthony LC
e2e34a011d (app-impress) add La Gaufre
Add La Gaufre.
It is a button to access easily to the
La Suite products.
2024-05-14 16:12:36 +02:00
Anthony LC
c1dd34512b 🚸(app-impress) footer legales pages
- Add legales pages.
- Add links to the footer for the new pages.

Legales pages are based from
https://lasuite.numerique.gouv.fr/
2024-05-14 11:57:19 +02:00
Anthony LC
88d6d8977c (app-impress) add footer
Add footer to the impress app.
2024-05-14 11:57:19 +02:00
Anthony LC
4ffcf164d8 💄(app-impress) lighter border pad editor
Make border pad editor a bit lighter.
2024-05-14 11:04:45 +02:00
Anthony LC
c25814b060 ♻️(app-impress) add transition props Box component
Add transition props to Box component.
2024-05-14 11:04:45 +02:00
Anthony LC
f88d625622 💄(app-impress) move title document to the top
Move teh title document to the top of the pad editor.
We let the white card only for the pad content.
2024-05-14 11:04:45 +02:00
Anthony LC
a26ee3b868 💬(app-impress) replace recent with documents
Replace Recent literal by Documents.
2024-05-14 11:04:45 +02:00
Anthony LC
c0d919ae52 💄(app-impress) re-design icon close panel
We deleted the menu, so we have to retouch
a bit the icon close panel to fit the new design.
We change the icon to have something more
intuitive by using material icons.
2024-05-14 11:04:45 +02:00
Anthony LC
944385c83f 🔥(app-impress) remove menu
For the moment we only have 1 menu item,
so we can remove the menu.
2024-05-14 11:04:45 +02:00
Anthony LC
ccb6d4cb91 (app-impress) add @blocknote/mantine
The new version of blocknote dissociates
the ux from the @blocknote/react package.
It is now in a separate package @blocknote/mantine.
We add this package to the impress app.
We adapt the toolbar to fit the new package.
2024-05-13 17:21:58 +02:00
renovate[bot]
5853adb8eb ⬆️(dependencies) update js dependencies 2024-05-13 17:21:58 +02:00
Anthony LC
70994de914 💚(ci) improve secrets for createsuperuser
Avoid secrets to be visible from running deployments.
2024-05-13 12:12:52 +02:00
Anthony LC
df0ff61faf 👷(CI) configure Minio with the CI
Add the minio container to the CI on the
job test-back. Adapt the conf to have
Minio working with the backend.
2024-05-13 12:12:52 +02:00
Anthony LC
b94f08d275 🧑‍💻(helm) add minio in staging environment
Add minio in staging environment.
Set the env var for the backend.
2024-05-13 12:12:52 +02:00
Anthony LC
a764e5989c 🧑‍💻(helm) add minio in dev environment
Add minio in dev environment.
Set the env var for the backend.
2024-05-13 12:12:52 +02:00
Samuel Paccoud - DINUM
130e7a8c99 (documents) allow retrieving versions (list and detail)
Versions are retrieved directly from object storage and served on API
endpoints. We make sure a user who is given access to a document will
only see versions that were created after s.he gained access.
2024-05-13 12:12:52 +02:00
Samuel Paccoud - DINUM
8e262da8f5 (documents) add content field as an S3 object
The content field is a writable property on the model which is persisted
in object storage. We take advantage of the versioning, robustness and
scalability of S3.
2024-05-13 12:12:52 +02:00
Samuel Paccoud - DINUM
4956beb040 (docker-compose) add minio for object storage
We will need object storage to store our document content which comes
as a big json object. Storing it in object storage will offer us
versioning, robustness and scalability.
2024-05-13 12:12:52 +02:00
Samuel Paccoud - DINUM
397b9efbce (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-05-13 12:12:52 +02:00
Jacques ROUSSEL
7c6e48975d 💚(ci) improve local deployment with tilt
Change the way we start django app in order to be abble to use django
admin on local deployment
2024-05-13 11:15:43 +02:00
Anthony LC
f0a4de361e 👷(helm) command createsuperuser
We sometimes need a superuser in the Django
application, to fix eventual db issues.
This commit adds a superuser on the pods.
2024-05-13 11:15:43 +02:00