diff --git a/package-lock.json b/package-lock.json index ccb571793..0a6bd5891 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,6 +70,7 @@ "storybook-mock-date-decorator": "^1.0.1", "svelte-check": "^3.6.0", "svelte-fast-dimension": "^1.1.0", + "sveltekit-flash-message": "^2.4.4", "vite": "^5.4.11", "vitest": "^v2.1.6" } @@ -24672,6 +24673,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/sveltekit-flash-message": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/sveltekit-flash-message/-/sveltekit-flash-message-2.4.4.tgz", + "integrity": "sha512-CFN03chH/FMEJcBZ/8zKm7RqGee/pwb57Spbbx8QCQPhe7N9ofZHd9iYV2vVy4E9glBo/oQ1IG7VQje6L092wg==", + "dev": true, + "peerDependencies": { + "@sveltejs/kit": "1.x || 2.x", + "svelte": "3.x || 4.x || >=5.0.0-next.51" + } + }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", diff --git a/package.json b/package.json index c551b81b4..9111b3ee7 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "storybook-mock-date-decorator": "^1.0.1", "svelte-check": "^3.6.0", "svelte-fast-dimension": "^1.1.0", + "sveltekit-flash-message": "^2.4.4", "vite": "^5.4.11", "vitest": "^v2.1.6" }, diff --git a/src/app.d.ts b/src/app.d.ts index a6cb12cf6..df09b3362 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -4,7 +4,13 @@ declare global { namespace App { // interface Error {} // interface Locals {} - // interface PageData {} + interface PageData { + flash?: { + message: string; + status?: "info" | "warning" | "success" | "error"; + lifespan?: number | null; + }; + } // interface PageState {} // interface Platform {} } diff --git a/src/config/config.js b/src/config/config.js index 3b4222aa2..3bde91587 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -86,7 +86,7 @@ export const PDF_SIZE_LIMIT_READABLE = "500 MB"; export const DOCUMENT_SIZE_LIMIT = 27262976; export const DOCUMENT_SIZE_LIMIT_READABLE = "25 MB"; -export const TOAST_LENGTH = 5000; +export const TOAST_LENGTH = 2500; export const TOAST_FADE = 800; export const LEGACY_CUT_OFF = 20000000; diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 1ed6a4643..a56eae4a1 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -22,7 +22,7 @@ export async function handleFetch({ event, request, fetch }) { if (request.url.startsWith(DC_BASE)) { // handle docker issues event.url.protocol = "https"; - request.headers.set("cookie", event.request.headers.get("cookie") ?? ""); + request.headers.append("cookie", event.request.headers.get("cookie") ?? ""); } return fetch(request); diff --git a/src/langs/json/en.json b/src/langs/json/en.json index 3db79b66e..117a32423 100644 --- a/src/langs/json/en.json +++ b/src/langs/json/en.json @@ -144,7 +144,9 @@ "uploading": "Uploading", "processing": "Processing", "done": "Done" - } + }, + "success": "Upload complete. Your documents will process in the background.", + "error": "Error during upload. See upload list for more details." }, "authSection": { "help": { @@ -407,7 +409,8 @@ "many": "Editing {n, plural, one {one document} other {# documents}}. This will add the same values to all selected documents.", "allowedHTML": "Limited HTML can be used for formatting. See API documentation for details.", "save": "Save", - "cancel": "Cancel" + "cancel": "Cancel", + "success": "Metadata saved" }, "annotate": { "title": "Annotate Document", @@ -433,6 +436,7 @@ "undo": "Undo", "cancel": "Discard", "cancelWarning": "You will lose unsaved redactions. Are you sure you want to cancel?", + "success": "Redactions saved", "error": "Error" }, "sections": { @@ -451,6 +455,7 @@ "continue": "Do you wish to continue?", "confirm": "Delete", "cancel": "Cancel", + "success": "{n, plural, one {Document deleted} other {Documents deleted}}", "error": "Error", "none": "No documents selected. Close this form and select at least one document first." }, @@ -490,11 +495,12 @@ "viewsource": "View Source", "selectionHelp": "Select individual documents or run a search for the documents you want, for example “+project:mueller-docs-200005”.", "selectionLearnMore": "Learn more about how Add-Ons work", - "editing": "Editing a previously dispatched addon", + "editing": "Editing a previously dispatched Add-On", "instructions": "Instructions", "dispatch": "Dispatch", "history": "History", - "noHistory": "You have not run this add-on before" + "noHistory": "You have not run this Add-On before", + "success": "Add-On dispatched" }, "addonBrowserDialog": { "title": "Browse Add-Ons", diff --git a/src/lib/components/common/Toast.svelte b/src/lib/components/common/Toast.svelte index 6ec44ea76..9b5d8e711 100644 --- a/src/lib/components/common/Toast.svelte +++ b/src/lib/components/common/Toast.svelte @@ -66,7 +66,7 @@ on:mouseenter={cancel} on:mouseleave={reset} role="dialog" - transition:fly={{ duration: 750, easing: quintOut, y: 20 }} + transition:fly={{ duration: 750, easing: quintOut, y: -20 }} >