Review feedback changes. Changed 'Code' labelling to 'Scanned Code'
This commit is contained in:
parent
617d443890
commit
e251c914ff
|
@ -138,7 +138,7 @@ const fieldTypeToComponentMap = {
|
|||
attachment: "attachmentfield",
|
||||
link: "relationshipfield",
|
||||
json: "jsonfield",
|
||||
code: "codescanner",
|
||||
scannedcode: "codescanner",
|
||||
}
|
||||
|
||||
export function makeDatasourceFormComponents(datasource) {
|
||||
|
|
|
@ -261,7 +261,7 @@
|
|||
} else {
|
||||
return [
|
||||
FIELDS.STRING,
|
||||
FIELDS.CODE,
|
||||
FIELDS.SCANNEDCODE,
|
||||
FIELDS.LONGFORM,
|
||||
FIELDS.OPTIONS,
|
||||
FIELDS.DATETIME,
|
||||
|
|
|
@ -125,8 +125,8 @@
|
|||
value: FIELDS.ARRAY.type,
|
||||
},
|
||||
{
|
||||
label: "Code",
|
||||
value: FIELDS.CODE.type,
|
||||
label: "Scanned Code",
|
||||
value: FIELDS.SCANNEDCODE.type,
|
||||
},
|
||||
]
|
||||
</script>
|
||||
|
|
|
@ -51,7 +51,7 @@ const componentMap = {
|
|||
"field/link": FormFieldSelect,
|
||||
"field/array": FormFieldSelect,
|
||||
"field/json": FormFieldSelect,
|
||||
"field/code": FormFieldSelect,
|
||||
"field/scannedcode": FormFieldSelect,
|
||||
// Some validation types are the same as others, so not all types are
|
||||
// explicitly listed here. e.g. options uses string validation
|
||||
"validation/string": ValidationEditor,
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
let entries = Object.entries(schema ?? {})
|
||||
|
||||
let types = []
|
||||
if ((type === "field/options", type === "field/code")) {
|
||||
if ((type === "field/options", type === "field/scannedcode")) {
|
||||
// allow options to be used on both options and string fields
|
||||
types = [type, "field/string"]
|
||||
} else {
|
||||
|
|
|
@ -8,9 +8,9 @@ export const FIELDS = {
|
|||
presence: false,
|
||||
},
|
||||
},
|
||||
CODE: {
|
||||
name: "Code",
|
||||
type: "code",
|
||||
SCANNEDCODE: {
|
||||
name: "Scanned Code",
|
||||
type: "scannedcode",
|
||||
constraints: {
|
||||
type: "string",
|
||||
length: {},
|
||||
|
@ -157,7 +157,7 @@ export const ALLOWABLE_STRING_OPTIONS = [
|
|||
FIELDS.STRING,
|
||||
FIELDS.OPTIONS,
|
||||
FIELDS.LONGFORM,
|
||||
FIELDS.CODE,
|
||||
FIELDS.SCANNEDCODE,
|
||||
]
|
||||
export const ALLOWABLE_STRING_TYPES = ALLOWABLE_STRING_OPTIONS.map(
|
||||
opt => opt.type
|
||||
|
|
|
@ -3169,7 +3169,7 @@
|
|||
],
|
||||
"settings": [
|
||||
{
|
||||
"type": "field/code",
|
||||
"type": "field/scannedcode",
|
||||
"label": "Field",
|
||||
"key": "field",
|
||||
"required": true
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
export let field
|
||||
export let label
|
||||
export let type = "code"
|
||||
export let type = "scannedcode"
|
||||
export let disabled = false
|
||||
export let validation
|
||||
export let defaultValue = ""
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export const FieldTypes = {
|
||||
STRING: "string",
|
||||
CODE: "code",
|
||||
SCANNEDCODE: "scannedcode",
|
||||
LONGFORM: "longform",
|
||||
OPTIONS: "options",
|
||||
NUMBER: "number",
|
||||
|
|
|
@ -31,7 +31,7 @@ exports.NoEmptyFilterStrings = [
|
|||
|
||||
exports.FieldTypes = {
|
||||
STRING: "string",
|
||||
CODE: "code",
|
||||
SCANNEDCODE: "scannedcode",
|
||||
LONGFORM: "longform",
|
||||
OPTIONS: "options",
|
||||
NUMBER: "number",
|
||||
|
@ -52,7 +52,7 @@ exports.CanSwitchTypes = [
|
|||
exports.FieldTypes.STRING,
|
||||
exports.FieldTypes.OPTIONS,
|
||||
exports.FieldTypes.LONGFORM,
|
||||
exports.FieldTypes.CODE,
|
||||
exports.FieldTypes.SCANNEDCODE,
|
||||
],
|
||||
[exports.FieldTypes.BOOLEAN, exports.FieldTypes.NUMBER],
|
||||
]
|
||||
|
|
|
@ -40,7 +40,7 @@ function generateSchema(
|
|||
case FieldTypes.STRING:
|
||||
case FieldTypes.OPTIONS:
|
||||
case FieldTypes.LONGFORM:
|
||||
case FieldTypes.CODE:
|
||||
case FieldTypes.SCANNEDCODE:
|
||||
schema.text(key)
|
||||
break
|
||||
case FieldTypes.NUMBER:
|
||||
|
|
|
@ -4,7 +4,7 @@ const { FieldTypes } = require("../constants")
|
|||
const VALIDATORS = {
|
||||
[FieldTypes.STRING]: () => true,
|
||||
[FieldTypes.OPTIONS]: () => true,
|
||||
[FieldTypes.CODE]: () => true,
|
||||
[FieldTypes.SCANNEDCODE]: () => true,
|
||||
[FieldTypes.NUMBER]: attribute => {
|
||||
// allow not to be present
|
||||
if (!attribute) {
|
||||
|
|
|
@ -48,7 +48,7 @@ const TYPE_TRANSFORM_MAP = {
|
|||
[null]: "",
|
||||
[undefined]: undefined,
|
||||
},
|
||||
[FieldTypes.CODE]: {
|
||||
[FieldTypes.SCANNEDCODE]: {
|
||||
"": "",
|
||||
[null]: "",
|
||||
[undefined]: undefined,
|
||||
|
|
Loading…
Reference in New Issue