From a29fe5b1682ab286c8fec053f03b1670a1fe84a2 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 27 Apr 2024 11:17:44 +0200 Subject: [PATCH] fix: fix output for single point entries Signed-off-by: Stefan Dej --- .../dialogs/HistoryListPanelDetailMaintenance.vue | 1 + .../HistoryListPanelDetailMaintenanceHistoryEntry.vue | 6 ++++++ src/locales/en.json | 1 + 3 files changed, 8 insertions(+) diff --git a/src/components/dialogs/HistoryListPanelDetailMaintenance.vue b/src/components/dialogs/HistoryListPanelDetailMaintenance.vue index ac089db0f..0b1601fcd 100644 --- a/src/components/dialogs/HistoryListPanelDetailMaintenance.vue +++ b/src/components/dialogs/HistoryListPanelDetailMaintenance.vue @@ -111,6 +111,7 @@ export default class HistoryListPanelDetailMaintenance extends Mixins(BaseMixin) } get outputFirstPointOfHistory() { + if (this.item.reminder.type === null) return this.$t('History.EntrySince') if (this.item.end_time === null) return this.$t('History.EntryNextPerform') return this.$t('History.EntryPerformedAt', { date: this.formatDateTime(this.item.end_time * 1000) }) diff --git a/src/components/dialogs/HistoryListPanelDetailMaintenanceHistoryEntry.vue b/src/components/dialogs/HistoryListPanelDetailMaintenanceHistoryEntry.vue index d9131b1e3..bae264a1f 100644 --- a/src/components/dialogs/HistoryListPanelDetailMaintenanceHistoryEntry.vue +++ b/src/components/dialogs/HistoryListPanelDetailMaintenanceHistoryEntry.vue @@ -54,6 +54,8 @@ export default class HistoryListPanelDetailMaintenanceHistoryEntry extends Mixin } get showGoals() { + if (this.item.reminder.type === null) return false + return this.current && this.item.end_time === null } @@ -112,6 +114,8 @@ export default class HistoryListPanelDetailMaintenanceHistoryEntry extends Mixin const value = this.item.reminder.printtime?.value ?? 0 if (!this.showGoals) return `${this.restPrinttime.toFixed(1)} h` + if (!this.item.reminder.printtime.bool) return false + return `${this.restPrinttime.toFixed(1)} / ${value} h` } @@ -143,6 +147,8 @@ export default class HistoryListPanelDetailMaintenanceHistoryEntry extends Mixin if (!this.showGoals) return `${this.restDays.toFixed(0)} days` + if (!this.item.reminder.date.bool) return false + return `${this.restDays.toFixed(0)} / ${value} days` } diff --git a/src/locales/en.json b/src/locales/en.json index 40549b793..083051868 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -375,6 +375,7 @@ "EntryCreatedAt": "Created at {date}.", "EntryNextPerform": "Next perform:", "EntryPerformedAt": "Performed at {date}.", + "EntrySince": "Used since:", "EstimatedFilament": "Estimated Filament", "EstimatedFilamentWeight": "Estimated Filament Weight", "EstimatedTime": "Estimated Time",