generated from betagouv/template-nextjs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace electricsql with powersync (#42)
* fix: display correct status * fix: edit banner spacings * feat: set edit banner sticky on mobile * fix: return arrow size * feat: set menu title position to sticky * fix: some styles * fix: simplify header * fix: show reports on 2 columns from 6 items * feat: add info messages * feat: display report item on 3 rows * fix: new colors * fix: informative message mb * fix: set printable colors * fix(pdf): set header sticky on desktop * fix: recipients textarea styles * fix: menu header padding and more * fix: remove * * fix: form labels * fix: date picker * fix: margins * gitignore * fix: pdf styles can now be italic and bold * fix: align tab title with content on firefox * fix: report search columns styles * fix: more report search styles * fix: use createdBy along with redactedBy to allow user to edit a report * refactor: add useCanEdit hook * fix: mail carriage return * wip: add version to env * feat: add version at build time * feat: add version component * fix: menu title padding * feat: add "city" and "zipcode" within the search params * Mep pictures (#39) * feat: add pictures table + button * feat: add pictures to db * feat: add input file with capture prop * feat: add report pictures * wip * feat: display pictures in app and in pdf * big wip * alos peut être ? * types? * wip: service worker * alors peut être ? * feat: background image upload * feat: cleanup local pictures when uploaded * fix: use local picture data if it exists * fix: correctly display pdf images * feat: add pictures on backend pdf gen * fix: add react import * fix: add pictures to backend pdf gen * fix(SW): use idb instead of electric * fix(SW): set env vars in self object * add logs * more logs * feat: set url in idb so SW can use it * fix: little oopsie * fix: safe parse env * feat: store uploading status for each picture * fix: sw updates * maybe * feat: listen to upload status in app * fix: cache every page * fix: manifest * fix: use minio for image upload * fix: correctly set bg url * fix: remove capture attribute * fix: correctly clear images on delete * fix: merge * wip * fix: correctly sync pictures * remove top badge * add logs * fix: disable sentry if no dsn * add logs * feat: add tmp_pictures table and make backend create pictures * feat: add pic status badges * fix: initial pic status * fix(SW): remove throw from sync request * fix: sort pictures + delete * feat: reset SW on local data deletion * cleanup * wip: drawing canvas * feat: remove auto retry * wip: draw on picture * maybe? * fix: try to upload image within main process * fix: offline upload * feat(pdf): break page before pictures * fix(pdf): blank page * feat: add picture_lines in db and save lines * feat: draw on canvas and sync with backend and pdf * fix: picture lines migration * fix: service worker and offline sync * fix: dockerfile * fix: backend dockerfile * should be ok now * feat: add marianne font * wip: add powersync * fix(pdf): rollback to helvetica * fix: display correct status * fix: status * feat(picture edition): add desktop layout * wip: add powersync auth * wip: database * fix(image canvas): set max height * feat: working select queries * wip: buckets (V2) * wip: migrate user service to kysely and add user tests * wip * wip: big wip 2 * wip: schema translation * wip: writing changes * wip: remove electric-client * wip * clean up * wip: status * fix: clauses * fix: all reports page * feat: migrate pictures to powersync * cleanup * feat: add failed_transactions table to track errors * fix: rename failed_transactions to transactions and record everything * cleanup migrations * fix: set service instructeur id to string * fix: record every transaction * fix: set delegations id to string * fix: set correct status to banner * fix: clause CRUD with powersync * fix: dockerfile * fix: docker compose and env
- Loading branch information
Showing
138 changed files
with
2,190 additions
and
26,611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import dotenv from "dotenv"; | ||
import dotenvExpand from "dotenv-expand"; | ||
import { execSync } from "child_process"; | ||
|
||
dotenvExpand.expand(dotenv.config()); | ||
|
||
const databaseUrl = process.env.DATABASE_URL; | ||
if (!databaseUrl) { | ||
throw new Error("DATABASE_URL is not set"); | ||
} | ||
|
||
const command = `pnpm pg-migrations apply --database "${databaseUrl}" --ignore-error migration_file_edited --directory ./db/migrations`; | ||
|
||
try { | ||
execSync(command, { stdio: "inherit" }); | ||
} catch (e) { | ||
console.error("Migration failed:", e); | ||
process.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
CREATE TABLE IF NOT EXISTS service_instructeurs ( | ||
id INTEGER NOT NULL PRIMARY KEY, | ||
id TEXT NOT NULL PRIMARY KEY, | ||
full_name TEXT NOT NULL, | ||
short_name TEXT NOT NULL, | ||
email TEXT, | ||
tel TEXT, | ||
udap_id TEXT | ||
); | ||
|
||
ALTER PUBLICATION powersync ADD TABLE "service_instructeurs"; | ||
|
||
ALTER TABLE service_instructeurs ENABLE ELECTRIC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CREATE TABLE IF NOT EXISTS transactions ( | ||
id TEXT PRIMARY KEY, | ||
op_id INTEGER NOT NULL, | ||
tx_id INTEGER, | ||
entity_id TEXT NOT NULL, | ||
type TEXT NOT NULL, | ||
op TEXT NOT NULL, | ||
data TEXT, | ||
user_id TEXT NOT NULL, | ||
created_at TIMESTAMP, | ||
error TEXT | ||
); | ||
|
||
ALTER PUBLICATION powersync ADD TABLE "transactions"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.