From fc8a65273d2abb203c5d1d4da1277c674193f3e5 Mon Sep 17 00:00:00 2001 From: Teja Manthena Date: Tue, 12 Mar 2024 12:18:17 +0100 Subject: [PATCH] PrintNow shows only Grayscale but the printer is able to print with color. --- .../ezp-printer-selection.tsx | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/src/components/ezp-printer-selection/ezp-printer-selection.tsx b/src/components/ezp-printer-selection/ezp-printer-selection.tsx index 7026654..2d181cf 100644 --- a/src/components/ezp-printer-selection/ezp-printer-selection.tsx +++ b/src/components/ezp-printer-selection/ezp-printer-selection.tsx @@ -41,6 +41,16 @@ export class EzpPrinterSelection { title: i18next.t('printer_selection.duplex_short'), }, ] + public ColorOptions = [ + { + id: 1, + title: i18next.t('printer_selection.color_color'), + }, + { + id: 2, + title: i18next.t('printer_selection.color_grayscale'), + } + ] private printButton?: HTMLEzpTextButtonElement /** @@ -700,37 +710,17 @@ export class EzpPrinterSelection { icon="color" placeholder={i18next.t('printer_selection.select_color')} toggleFlow="horizontal" - options={ - this.selectedPrinterConfig.Color - ? [ - { - id: 1, - title: i18next.t('printer_selection.color_color'), - meta: '', - type: 'color', - }, - { - id: 0, - title: i18next.t('printer_selection.color_grayscale'), - meta: '', - type: 'color', - }, - ] - : [ - { - id: 0, - title: i18next.t('printer_selection.color_grayscale'), - meta: '', - type: 'color', - }, - ] - } + options={this.ColorOptions?.map((option) => ({ + id: option.id, + title: option.title, + meta: '', + type: 'color' + }))} preSelected={ this.selectedPrinter.id - ? this.selectedPrinterConfig.Default?.Color == "color" + && this.selectedPrinterConfig.Default?.Color == "color" ? i18next.t('printer_selection.color_color') : i18next.t('printer_selection.color_grayscale') - : null } disabled={!this.selectedPrinterConfig.ColorSupported} />