From 3e7cdb9fa27e90f8406d83fbd0ab01d4dcf397a7 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Wed, 16 Dec 2020 14:01:27 -0500 Subject: [PATCH] Hides unused label layouts in a less janky way. --- src/app/config/defaults.ts | 49 +++++++++++++----------- src/app/models/labelLayout.interface.ts | 2 + src/app/settings/settings.component.html | 2 +- src/app/settings/settings.component.ts | 2 +- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/app/config/defaults.ts b/src/app/config/defaults.ts index 6799a15..6845283 100644 --- a/src/app/config/defaults.ts +++ b/src/app/config/defaults.ts @@ -18,29 +18,32 @@ export const labelLayouts = { pageWidth: 64, pageHeight: 32, }), - // rectangle_3x1_code128: new LabelLayout({ - // name: '3in x 1in Rectangular Label - CODE128', - // barcodeType: 'code128', - // id: 'rectangle_3x1_code128', - // pageWidth: 76.2 + labelMargin, - // pageHeight: 25.4 + labelMargin, - // delimiter: '', - // }), - // rectangle_code128: new LabelLayout({ - // name: '2.75in x 1.25in Rectangular Label - CODE128', - // barcodeType: 'code128', - // id: 'rectangle_code128', - // pageWidth: 69.9 + labelMargin, - // pageHeight: 31.8 + labelMargin, - // delimiter: '', - // }), - // rectangle_datamatrix: new LabelLayout({ - // name: '2in x 1in Rectangular Label - DataMatrix', - // barcodeType: 'datamatrix', - // id: 'rectangle_datamatrix', - // pageWidth: 50.8 + labelMargin, - // pageHeight: 25.4 + labelMargin, - // }), + rectangle_3x1_code128: new LabelLayout({ + name: '3in x 1in Rectangular Label - CODE128', + barcodeType: 'code128', + id: 'rectangle_3x1_code128', + pageWidth: 76.2 + labelMargin, + pageHeight: 25.4 + labelMargin, + delimiter: '', + hide: true, + }), + rectangle_code128: new LabelLayout({ + name: '2.75in x 1.25in Rectangular Label - CODE128', + barcodeType: 'code128', + id: 'rectangle_code128', + pageWidth: 69.9 + labelMargin, + pageHeight: 31.8 + labelMargin, + delimiter: '', + hide: true, + }), + rectangle_datamatrix: new LabelLayout({ + name: '2in x 1in Rectangular Label - DataMatrix', + barcodeType: 'datamatrix', + id: 'rectangle_datamatrix', + pageWidth: 50.8 + labelMargin, + pageHeight: 25.4 + labelMargin, + hide: true, + }), rectangle_datamatrixrectangular: new LabelLayout({ name: '2in x 1in Rectangular Label - DataMatrix Rectangular', barcodeType: 'datamatrixrectangular', diff --git a/src/app/models/labelLayout.interface.ts b/src/app/models/labelLayout.interface.ts index e4666a3..ff69930 100644 --- a/src/app/models/labelLayout.interface.ts +++ b/src/app/models/labelLayout.interface.ts @@ -8,6 +8,7 @@ export interface LayoutOptions { numCols?: number; numCopies?: number; delimiter?: string; + hide?: boolean; } export class LabelLayout { @@ -20,6 +21,7 @@ export class LabelLayout { numCols = 1; numCopies = 1; delimiter = '-'; + hide = false; constructor(private options: LayoutOptions) { if (options) { diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index 730b3d0..4539e6e 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -28,7 +28,7 @@ #labelLayoutSelect="matSelect" [formControl]="labelLayoutFormControl" > - {{selectedLabelLayout.name}} + {{selectedLabelLayout?.name}} !layout.hide); this._loadFakeData(); }