Commit Graph

175 Commits

Author SHA1 Message Date
Anthony LC
d2888d0b9d (frontend) create hook useTransRole
Create the hook useTransRole to get a translated
role.
2024-07-05 19:02:01 +02:00
Anthony LC
e3fe647e5b 🔖(major) major release to 1.0.0
Added:
- 🛂(frontend) Manage the document's right (#75)
- (frontend) Update document (#68)
- (frontend) Remove document (#68)
- 🐳(docker) dockerize dev frontend (#63)
- 👔(backend) list users with email filtering (#79)
- (frontend) add user to a document (#52)
- (frontend) invite user to a document (#52)
- 🛂(frontend) manage members (update role / list / remove) (#81)
- (frontend) offline mode (#88)
- 🌐(frontend) translate cgu (#83)
- (service-worker) offline doc management (#94)
- ⚗️(frontend) Add beta tag on logo (#121)

Changed:
- ♻️(frontend) Change site from Impress to Docs (#76)
- (frontend) Generate PDF from a modal (#68)
- 🔧(helm) sticky session by request_uri for signaling server (#78)
- ♻️(frontend) change logo (#84)
- ♻️(frontend) pdf has title doc (#84)
- ️(e2e) unique login between tests (#80)
- ️(CI) improve e2e job (#86)
- ♻️(frontend) improve the error and message info ui (#93)
- ✏️(frontend) change all occurences of pad to doc (#99)

Fixed:
- 🐛(frontend) Fix the break line when generate PDF (#84)

Delete:
- 💚(CI) Remove trigger workflow on push tags on CI (#68)
- 🔥(frontend) Remove coming soon page (#121)
2024-07-03 17:08:59 +02:00
Anthony LC
8f5c413482 ️(e2e) remove unnecessary page.goto
Multiple page.goto can cause flakiness.
An page.goto is already called in the beforeEach,
so we don't need to call it again in the test.
2024-07-03 14:55:54 +02:00
Anthony LC
a66231d72e 🗃️(service-worker) cache successfull update in doc-item
When we updated the doc successfully then directly
pass offline, the cache was not updated.
It is because a successful update didn't
update the cache of the doc-item.
2024-07-03 11:49:53 +02:00
Anthony LC
2e0b6b2a2a ♻️(service-worker) admin NetworkOnly
We will use the NetworkOnly strategy
for the admin part.
2024-07-03 10:03:15 +02:00
Anthony LC
edffbbaf99 🐛(frontend) fix issue when no template
A bug occured when no template was
available. This commit fixes this issue.
2024-07-03 10:03:15 +02:00
Anthony LC
a393cd4df0 ♻️(service-worker) external url NetworkFirst
We will use the NetworkFirst strategy
for external URLs, if a patch is made from
the external resource, the resource will be
updated directly.
2024-07-03 10:03:15 +02:00
Anthony LC
e26b806965 🐛(service-worker) networkFirst on api request
Some api requests were served by the cache first,
which caused the data to be outdated.
This change makes sure that the api requests
are always served by the network first.
2024-07-03 10:03:15 +02:00
Anthony LC
b7bd7b7772 ⚗️(frontend) add Beta badge to header
We add a beta badge to the header to indicate
that the app is in beta.
2024-07-02 10:52:15 +02:00
Anthony LC
43ba36af61 🔥(frontend) remove coming-soon
Remove the coming-soon page and the redirection to it.
2024-07-02 10:52:15 +02:00
Anthony LC
9c19b22a66 ♻️(service-worker) create useSWRegister hook
Create useSWRegister hook, which will be used to
register the service worker in the app.
2024-06-28 11:07:21 +02:00
Anthony LC
d87c278cce 🚚(service-worker) move service worker to features
The service worker is now in the features folder.
It is more a feature than a core part of the app.
2024-06-28 11:07:21 +02:00
Anthony LC
287a5b3bff 🔧(service-worker) add conf file with dev urls
Add a conf files to the service worker to store
the development urls. If someone wants to change
the urls, they can do it in the conf file, it is
more intuitive than changing the urls in the
service worker file.
2024-06-28 11:07:21 +02:00
Anthony LC
cfb979a411 (service-worker) add unit tests
Add unit tests for:
- ApiPlugin
- RequestSerializer
- SyncManager
2024-06-28 11:07:21 +02:00
Anthony LC
d588ae847f 🐛(frontend) change saving behavior firefox
Firefox does not trigger the request everytime the
user leaves the page. Plus the request is not
intercepted by the service worker.
So we prevent the default behavior to have
the popup asking the user if he wants to leave the
page, by adding the popup, we let the time to the
request to be sent, and intercepted by the
service worker (for the offline part).

We also add a toast to inform the user that the
document has been saved, it will make it more obvious
that the document has been saved if a firefox user
come back from the popup to the page.
2024-06-28 11:07:21 +02:00
Anthony LC
08a39c7ebd 🔧(frontend) add a buildId to service worker
We add a buildId to the service worker to force
the browser to update the service worker when
the buildId changes.
Before we were on the tag version, but
the browser was not updating the service worker
easily on the staging environment.
2024-06-28 11:07:21 +02:00
Anthony LC
bf10fbd25f (service-worker) add offline docs delete
Add offline docs delete to the service worker.
We use the Network fisrt strategy, if
the network is down, we will delete the
doc in the indexDB.
When the connection is back, we will remove
the doc to the server.
2024-06-28 11:07:21 +02:00
Anthony LC
f5948959f2 (service-worker) add offline docs create
Add offline docs create to the service worker.
We use the Network fisrt strategy, if
the network is down, we will create the
doc in the indexDB and serve it from there.
When the connection is back, we will send
the doc to the server.
2024-06-28 11:07:21 +02:00
Anthony LC
a0644efb45 ♻️(service-worker) add DocsDB to store docs in indexedDB
Export the storage of docs to a separate
class `DocsDB` that will be responsible for
storing / retrieving / synching docs from indexedDB.
2024-06-28 11:07:21 +02:00
Anthony LC
b4e8db9050 (service-worker) add offline docs update
Add offline docs update to the service worker.
We use the Network fisrt strategy, if
the network is down, we will update the
doc in the indexDB and serve it from there.
When the connection is back, we will send
the doc to the server.
2024-06-28 11:07:21 +02:00
Anthony LC
96bfbfabec (service-worker) add service worker api to impress app
This commit adds the service worker api to the
impress app.
The service worker api will cache the api calls
in the indexdb. We are using the network first
strategy to fetch the data. If the network is
not available, we will fetch the data from the
indexdb.
To do that, we create a custom plugin (ApiPlugin).
2024-06-28 11:07:21 +02:00
Anthony LC
c2aa5be8ff 🧑‍💻(frontend) env var service-worker dev mode
Add a new environment variable to enable or disable
the service worker in development mode.
By default, the service worker is disabled
in development mode, it can cause problems
when developing the application with the hmr.
It can creates useless log in the console
as well.
We can easily enable it by setting
NEXT_PUBLIC_SW_DEACTIVATED to false in the
.env.development file.
We will use this new var to not use the service
worder with the CI as well.
2024-06-28 11:07:21 +02:00
Anthony LC
3b77e1254e 🔥(frontend) remove grapesjs dependencies
Some grapesjs dependencies were still present.
We don't use these anymore, so we can remove them.
2024-06-27 12:42:52 +02:00
Anthony LC
b436a418ff ⬆️(frontend) upgrade react to 18.3.1
A recent upgrade of next.js fixed the compatibility
issue with react 18.3.1.
2024-06-27 12:42:52 +02:00
Anthony LC
9fdf87b100 ⬇️(frontend) downgrading fetch-mock to 9.11.0
fetch-mock released the version 10, but it is
causing some issues with jest because of
esm support.
2024-06-27 12:42:52 +02:00
renovate[bot]
6943f2158a ⬆️(dependencies) update js dependencies 2024-06-27 12:42:52 +02:00
Anthony LC
c03e1ffe8b 💄(frontend) change docs logo
Change the docs logo to a more accurate one.
2024-06-25 15:38:40 +02:00
Anthony LC
5454da5c70 ✏️(frontend) change all occurences of pad to doc
The initial doc was named pad in reference to
the "NotePad de l'Etat", but we renamed it
doc to clearly dissociate the 2 sites.
Doc is also a small reference of google doc.
2024-06-25 15:07:36 +02:00
Anthony LC
5b3c91f6dd 🌐(app-impress) translate impress in french
Add french translation to impress.
2024-06-25 13:47:56 +02:00
Anthony LC
f1ac0954ed 🧑‍💻(i18n) run automatically prettier after import
After an import the translation file is now
automatically formatted with prettier.
2024-06-25 13:47:56 +02:00
Anthony LC
fc80c2ec2a 🌐(pages) translate legal pages to english
They should be translated to French using the i18n tooling and not
directly in the code.
2024-06-25 13:47:56 +02:00
renovate[bot]
8ba64322be ⬆️(dependencies) update ws to v8.17.1 [SECURITY] 2024-06-24 12:29:30 +02:00
Anthony LC
ae9555284d (e2e) remove some flakiness
Service worker added some flakiness, we
activate the sw only if not from the CI.
We add as well the email of the user added in a
doc to the toast message. This way we can check
if the user was added correctly, this will remove
some flakiness in some tests.
2024-06-14 12:26:04 +02:00
Anthony LC
14a91a5698 🐛(frontend) mismatch between yjs dependency
Mismatch between yjs dependency, we set the
dependency globally to not have this problem
anymore.
2024-06-14 12:26:04 +02:00
Anthony LC
9f6dac53d4 (frontend) add offline mode support
Add a offline mode support from a service worker.
The service worker will cache the assets and the
visited pages to be able to work offline.
Created a fallback page for when the user is offline
and tries to access a page that is not cached.
2024-06-14 12:26:04 +02:00
Anthony LC
5ba35dbc1d ♻️(frontend) improve the ui error and message info ui
Improve the ui error and message info ui:
- Can use a icon in TextErrors component
- use mode the Alert component to display message info
2024-06-14 11:50:13 +02:00
Anthony LC
62098ec753 🐛(frontend) fix bug multi ws connection
In collaborative mode, only the first document
connected was being shared. This was due to the
fact that the webrtc server was managing only
one connection at a time. This commit fixes this
bug by managing multiple connections.
2024-06-13 12:20:23 +02:00
Anthony LC
e7fe153a81 🐛(frontend) fix break line on firefox
On firefox with collaborative mode, the last
upgrade of ProseMirror added a new line when
a another user was typing. This commit fixes this
issue.
2024-06-10 13:28:38 +02:00
Anthony LC
8e0850b13e 🐛(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.
The next.js team is already aware of the issue and
it will be fixed in the next release.
2024-06-10 13:28:38 +02:00
Anthony LC
8fb18ed186 (frontend) add "@testing-library/dom
Recent update of @testing-library/react requires
@testing-library/dom to be installed as well.
2024-06-10 13:28:38 +02:00
renovate[bot]
bec6ff3d22 ⬆️(dependencies) update js dependencies 2024-06-10 13:28:38 +02:00
Anthony LC
4e4e2e23e3 ️(e2e) unique login between tests
We will cache the login token in the browser
storage and reuse it between tests.
This will speed up the tests and reduce the
load on the server.
2024-06-06 22:31:43 +02:00
Anthony LC
2f79d03acc ⬇️(frontend) downgrade @testing-library/react@16.0.0
downgrade @testing-library/react@16.0.0 to
@testing-library/react@15.0.7.

Some modules are not available in the latest
version, their documentation is not available yet.
2024-06-06 16:09:07 +02:00
Anthony LC
8762a7bc92 ♻️(frontend) adapt BlockNote to the last version
A recent relase of the BlockNote component
has changed the way it is used. This commit
adapts the BlockNoteEditor and BlockNoteToolbar
components to the new version of the BlockNote.
2024-06-06 16:09:07 +02:00
Anthony LC
589b0eab32 🐛(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.
The next.js team is already aware of the issue and
it will be fixed in the next release.
2024-06-06 16:09:07 +02:00
renovate[bot]
44f4a37814 ⬆️(dependencies) update js dependencies 2024-06-06 16:09:07 +02:00
Anthony LC
6c76f7faab ♻️(frontend) improve html for pdf
Blocknote json to html is not perfect, so we need
to improve it to provide a better html for
the pdf generation.
It is the first step to improve the html,
we will continue to improve it in the future.
We have now the break line.
It is e2e tested so if blocknote change the conversion
we will know it.
2024-06-06 12:43:25 +02:00
Anthony LC
201d776d1b ♻️(frontend) doc title as title for pdf export
Our pdf export was named impress-document.pdf,
now it is named after the document title.
We sanitize the title by removing special characters,
replacing spaces with underscores and putting it
in lowercase.
2024-06-06 12:43:25 +02:00
Anthony LC
e7f2317b41 ♻️(backend) simplify the template
For the first version, we will use a simple template.
Only the gouv logo will be displayed.
2024-06-06 12:43:25 +02:00
Anthony LC
206c7f11ae (e2e) flaky saves the doc when we quit pages
Stop to check "saves the doc when we quit pages"
with webkit browser. It is flaky.
2024-06-06 12:43:25 +02:00