From fe7eb6ae4ba9b18f956e4d768d3dd607593b7077 Mon Sep 17 00:00:00 2001 From: David Zwart Date: Fri, 19 Apr 2024 00:09:24 +0200 Subject: [PATCH 1/6] chore --- src/components/Settings/SoftwareUpgradeSettings.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Settings/SoftwareUpgradeSettings.vue b/src/components/Settings/SoftwareUpgradeSettings.vue index 41f390b1..43379706 100644 --- a/src/components/Settings/SoftwareUpgradeSettings.vue +++ b/src/components/Settings/SoftwareUpgradeSettings.vue @@ -81,8 +81,7 @@ :disabled="isDisabledRelease(release)" :label="calculateLabelDisabledReason(release)" :value="release.tag_name" - > - + />
From 73188bf5bccf1e9bba8b314e0346b9e33c103549 Mon Sep 17 00:00:00 2001 From: David Zwart Date: Fri, 19 Apr 2024 15:08:27 +0200 Subject: [PATCH 2/6] fix: setup based printer create or update dialog with first short attempt at printer validation --- .../Dialogs/AddOrUpdatePrinterDialog.vue | 322 +++++++----------- 1 file changed, 129 insertions(+), 193 deletions(-) diff --git a/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue b/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue index 37e2bf7c..a3b2abe6 100644 --- a/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue +++ b/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue @@ -4,7 +4,7 @@ :max-width="showChecksPanel ? '900px' : '700px'" @escape="closeDialog()" > - + @@ -20,7 +20,7 @@ - + - + - + - + - - + - - + @@ -107,12 +107,12 @@ - + - From f0564e09822d390ecbd534e62c475c1f6c677f21 Mon Sep 17 00:00:00 2001 From: David Zwart Date: Fri, 19 Apr 2024 18:05:57 +0200 Subject: [PATCH 3/6] fix: add force save to printer, escape 424 in handler, add feedback saving --- src/backend/printers.service.ts | 10 ++-- .../Dialogs/AddOrUpdatePrinterDialog.vue | 56 ++++++++++++++----- src/shared/http-client.ts | 5 ++ src/store/printer.store.ts | 23 ++++---- 4 files changed, 65 insertions(+), 29 deletions(-) diff --git a/src/backend/printers.service.ts b/src/backend/printers.service.ts index 59cd17d2..0e8fbea7 100644 --- a/src/backend/printers.service.ts +++ b/src/backend/printers.service.ts @@ -85,8 +85,8 @@ export class PrintersService extends BaseService { return await this.postApi(path, axes); } - static async createPrinter(printer: CreatePrinter) { - const path = ServerApi.printerRoute; + static async createPrinter(printer: CreatePrinter, forceSave: boolean) { + const path = `${ServerApi.printerRoute}?forceSave=${forceSave}`; return (await this.postApi(path, printer)) as PrinterDto; } @@ -103,10 +103,10 @@ export class PrintersService extends BaseService { return await this.deleteApi(path); } - static async updatePrinter(printerId: IdType, printer: CreatePrinter) { + static async updatePrinter(printerId: IdType, printer: CreatePrinter, forceSave: boolean) { const path = ServerApi.getPrinterRoute(printerId); - - return (await this.patchApi(path, printer)) as PrinterDto; + const fullPath = `${path}?forceSave=${forceSave}`; + return (await this.patchApi(fullPath, printer)) as PrinterDto; } static async updatePrinterMaintenance(printerId: IdType, disabledReason: string | null = null) { diff --git a/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue b/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue index a3b2abe6..78ae6606 100644 --- a/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue +++ b/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue @@ -84,6 +84,14 @@ Hide checks + + {{ printerValidationError }} + + + + Validating printer + + * indicates required field @@ -112,7 +120,7 @@