Skip to content

Commit 773d43c

Browse files
committed
GDCM-760 Allowed image field for the dynamic list field.
1 parent e8b907d commit 773d43c

File tree

6 files changed

+17590
-11326
lines changed

6 files changed

+17590
-11326
lines changed

package-lock.json

Lines changed: 17559 additions & 11322 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
"npm-run-all": "^4.1.5",
5050
"prettier": "^2.0.5",
5151
"react-scripts": "^3.4.1",
52-
"react": "^16.13.1",
53-
"react-dom": "^16.13.1",
5452
"user-event": "^4.0.0"
5553
},
5654
"files": [

src/DForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const DForm = ({
2828
renderDynamicListField,
2929
renderListItem
3030
}) => {
31-
// const dispatch = useDispatch();
31+
3232
const [currentSectionIndex, setCurrentSectionIndex] = useState(
3333
initialSectionIndex
3434
)

src/fields/DynamicFieldLineItem.js

Lines changed: 9 additions & 1 deletion
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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ test('list required validation', async () => {
188188
schema: {
189189
defaultValue: ''
190190
}
191+
},
192+
{
193+
id: 3,
194+
order: 2,
195+
fieldType: 'image',
196+
title: 'image',
197+
required: false,
198+
schema: {
199+
max: 100,
200+
}
191201
}
192202
]
193203
}

src/fields/type/FieldType.js

Lines changed: 11 additions & 0 deletions
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)