Modular logistics and supply chain operating system (LSOS)
JavaScript driver-appfleet-managementfreight-managementinfrastructureinventory-managementlast-mile-deliverylogisticsondemandopen-sourceorder-managementroute-optimizationsupply-chain-managementtracking-and-monitoringtransport-management-systemtransportationwarehouse-management
fix(custom-fields): store a signature as a file value type
Ronald A. Richardsonc96c665f2aca
diff --git a/console/app/models/custom-field.js b/console/app/models/custom-field.jsindex 01c92a00..ee1a9669 100644--- a/console/app/models/custom-field.js+++ b/console/app/models/custom-field.js@@ -32,7 +32,7 @@ export default class CustomFieldModel extends Model {/** @computed */@computed('type') get valueType() {- if (this.type === 'file-upload') return 'file';+ if (this.type === 'file-upload' || this.type === 'signature-pad') return 'file';if (this.type === 'date-time-input') return 'date';if (this.type === 'model-select') return 'model';diff --git a/console/tests/unit/models/custom-field-test.js b/console/tests/unit/models/custom-field-test.jsindex 5b07f01b..820b7a29 100644--- a/console/tests/unit/models/custom-field-test.js+++ b/console/tests/unit/models/custom-field-test.js@@ -21,6 +21,7 @@ module('Unit | Model | custom-field | valueType', function (hooks) {const field = (type) => store.createRecord('custom-field', { type }).valueType;assert.strictEqual(field('file-upload'), 'file');+ assert.strictEqual(field('signature-pad'), 'file', 'a signature is uploaded and stored as a file');assert.strictEqual(field('date-time-input'), 'date');assert.strictEqual(field('model-select'), 'model');assert.strictEqual(field('text-input'), 'text', 'anything else stores plain text');