Skip to content

Commit aa81a30

Browse files
committed
GDCM-760 Allowed image field for the dynamic list field.
1 parent d089b2b commit aa81a30

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/fields/DynamicFieldLineItem.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import React, { useMemo, useCallback } from 'react'
22
import PropTypes from 'prop-types'
33
import FieldsList from './FieldsList'
4+
import * as FieldTypes from './type/FieldType'
45

5-
const allowedTypes = ['text', 'number', 'select', 'date']
6+
const allowedTypes = [
7+
FieldTypes.TEXT,
8+
FieldTypes.NUMBER,
9+
FieldTypes.SELECT,
10+
FieldTypes.DATE,
11+
FieldTypes.SIGNATURE,
12+
FieldTypes.IMAGE,
13+
]
614

715
export const DynamicFieldLineItem = ({
816
index,

src/fields/DynamicListField.test.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,20 @@ test('list required validation', async () => {
189189
fieldType: 'text',
190190
title: 'field',
191191
schema: {
192-
defaultValue: '',
193-
},
192+
defaultValue: ''
193+
}
194194
},
195-
],
195+
{
196+
id: 3,
197+
order: 2,
198+
fieldType: 'image',
199+
title: 'image',
200+
required: false,
201+
schema: {
202+
max: 100,
203+
}
204+
}
205+
]
196206
}
197207
renderForm(field)
198208
await waitFor(() =>

src/fields/type/FieldType.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const TEXT = 'text';
2+
export const SELECT = 'select';
3+
export const NUMBER = 'number';
4+
export const DATE = 'date';
5+
export const IMAGE = 'image';
6+
export const CODE = 'code';
7+
export const GPS = 'gps';
8+
export const SIGNATURE = 'signature';
9+
export const DYNAMIC_LIST = 'dynamicList';
10+
export const TOTALIZER = 'totalizer';
11+

0 commit comments

Comments
 (0)