Skip to content

Commit

Permalink
Merge pull request #65 from ezeep/feature/profile-defaults
Browse files Browse the repository at this point in the history
changed Profile property to Default
  • Loading branch information
tp-shery authored Mar 11, 2024
2 parents 433d243 + 626ef11 commit 471532a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/components/ezp-printer-selection/ezp-printer-selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class EzpPrinterSelection {
@State() selectedPrinter: Printer
@State() printerConfig: PrinterConfig[]
@State() selectedPrinterConfig: PrinterConfig = {
Profile: {
Default: {
Color: '',
Duplex: '',
Paper: '',
Expand Down Expand Up @@ -727,7 +727,7 @@ export class EzpPrinterSelection {
}
preSelected={
this.selectedPrinter.id
? this.selectedPrinterConfig.Profile?.Color == "color"
? this.selectedPrinterConfig.Default?.Color == "color"
? i18next.t('printer_selection.color_color')
: i18next.t('printer_selection.color_grayscale')
: null
Expand All @@ -746,11 +746,11 @@ export class EzpPrinterSelection {
type: 'duplex',
}))}
preSelected={
this.selectedPrinter.id && this.selectedPrinterConfig.Profile?.Duplex == "duplex_simplex"
this.selectedPrinter.id && this.selectedPrinterConfig.Default?.Duplex == "duplex_simplex"
? i18next.t('printer_selection.duplex_none')
: this.selectedPrinterConfig.Profile?.Duplex == "duplex_vertical"
: this.selectedPrinterConfig.Default?.Duplex == "duplex_vertical"
? i18next.t('printer_selection.duplex_long')
: this.selectedPrinterConfig.Profile?.Duplex == "duplex_horizontal"
: this.selectedPrinterConfig.Default?.Duplex == "duplex_horizontal"
? i18next.t('printer_selection.duplex_short')
: null}
disabled={!this.selectedPrinterConfig.DuplexSupported}
Expand All @@ -768,8 +768,8 @@ export class EzpPrinterSelection {
type: 'format',
}))}
preSelected={this.selectedPrinter.id && this.selectedPrinterConfig.PaperFormats?.find((el) =>
el.Name.includes(this.selectedPrinterConfig.Profile?.Paper))
? this.selectedPrinterConfig.Profile?.Paper
el.Name.includes(this.selectedPrinterConfig.Default?.Paper))
? this.selectedPrinterConfig.Default?.Paper
: null}
disabled={!(this.selectedPrinterConfig.PaperFormats?.length > 0)}
/>
Expand Down Expand Up @@ -820,8 +820,8 @@ export class EzpPrinterSelection {
meta: '',
type: 'quality',
}))}
preSelected={this.selectedPrinter.id && this.selectedPrinterConfig.Resolutions?.includes(this.selectedPrinterConfig.Profile.Resolution)
? this.selectedPrinterConfig.Profile.Resolution
preSelected={this.selectedPrinter.id && this.selectedPrinterConfig.Resolutions?.includes(this.selectedPrinterConfig.Default.Resolution)
? this.selectedPrinterConfig.Default.Resolution
: null}
disabled={!(this.selectedPrinterConfig.Resolutions?.length > 0)}
/>
Expand All @@ -840,8 +840,8 @@ export class EzpPrinterSelection {
})
)}
preSelected={this.selectedPrinter.id && this.selectedPrinterConfig.Trays?.find((el) =>
el.Name.includes(this.selectedPrinterConfig.Profile.Tray))
? this.selectedPrinterConfig.Profile.Tray
el.Name.includes(this.selectedPrinterConfig.Default.Tray))
? this.selectedPrinterConfig.Default.Tray
: null}
/> ) : null}
<ezp-input
Expand Down
2 changes: 1 addition & 1 deletion src/shared/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export interface Trays {
}

export interface PrinterConfig {
Profile?: {
Default?: {
Duplex?: string
Color?: string
Orientation?: string
Expand Down

0 comments on commit 471532a

Please sign in to comment.