From 1f19bb861164e41bbeb72f23979e65fe0b96efdc Mon Sep 17 00:00:00 2001
From: JohnD <52716187+JDarke@users.noreply.github.com>
Date: Tue, 21 Apr 2020 10:38:18 +0100
Subject: [PATCH 1/4] npm yarn install
---
package.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/package.json b/package.json
index eb7b4e0d18..f3ef11b5b6 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,8 @@
"redux-thunk": "~2.3.0",
"shortid": "^2.2.15",
"typescript": "~3.8.2",
- "uuid": "^7.0.1"
+ "uuid": "^7.0.1",
+ "yarn": "~1.22.4"
},
"repository": {
"type": "git",
From 1d922c7c0dfa0537d3910c8ca2c4d9568c89190e Mon Sep 17 00:00:00 2001
From: JohnD <52716187+JDarke@users.noreply.github.com>
Date: Tue, 21 Apr 2020 12:31:19 +0100
Subject: [PATCH 2/4]
fix(src/components/input/textfieldwithlabelformgroup.tsx): update Label
Reason field on new appointment screen no longer a required field. Line 21, Label element now takes
isRequired attr from interface Props.
fix #1997
---
src/components/input/TextFieldWithLabelFormGroup.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/input/TextFieldWithLabelFormGroup.tsx b/src/components/input/TextFieldWithLabelFormGroup.tsx
index 86948b5760..3848ddf02a 100644
--- a/src/components/input/TextFieldWithLabelFormGroup.tsx
+++ b/src/components/input/TextFieldWithLabelFormGroup.tsx
@@ -14,11 +14,11 @@ interface Props {
}
const TextFieldWithLabelFormGroup = (props: Props) => {
- const { value, label, name, isEditable, isInvalid, feedback, onChange } = props
+ const { value, label, name, isEditable, isInvalid, isRequired, feedback, onChange } = props
const id = `${name}TextField`
return (
-
+
Date: Tue, 21 Apr 2020 18:35:26 +0100
Subject: [PATCH 3/4] revert(package.json): remove yarn listing
Previously added a listing for yarn in the dependencies in package.json. This commit undoes that.
re |
---
package.json | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/package.json b/package.json
index f3ef11b5b6..eb7b4e0d18 100644
--- a/package.json
+++ b/package.json
@@ -31,8 +31,7 @@
"redux-thunk": "~2.3.0",
"shortid": "^2.2.15",
"typescript": "~3.8.2",
- "uuid": "^7.0.1",
- "yarn": "~1.22.4"
+ "uuid": "^7.0.1"
},
"repository": {
"type": "git",
From 36b889eaec3e8542b21b5bfb7a42ccabfb33b28e Mon Sep 17 00:00:00 2001
From: JohnD <52716187+JDarke@users.noreply.github.com>
Date: Wed, 22 Apr 2020 19:14:38 +0100
Subject: [PATCH 4/4] test(textfieldwithlabelformgroup.test.tsx): add test to
Label isRequired
Added a test case to test if the Label receives the isRequired prop on required fields
re #2003
---
.../input/TextFieldWithLabelFormGroup.test.tsx | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/__tests__/components/input/TextFieldWithLabelFormGroup.test.tsx b/src/__tests__/components/input/TextFieldWithLabelFormGroup.test.tsx
index 8583fefdbc..f12db261e3 100644
--- a/src/__tests__/components/input/TextFieldWithLabelFormGroup.test.tsx
+++ b/src/__tests__/components/input/TextFieldWithLabelFormGroup.test.tsx
@@ -24,6 +24,24 @@ describe('text field with label form group', () => {
expect(label.prop('text')).toEqual(expectedName)
})
+ it('should render label as required if isRequired is true', () => {
+ const expectedName = 'test'
+ const wrapper = shallow(
+ ,
+ )
+
+ const label = wrapper.find(Label)
+ expect(label).toHaveLength(1)
+ expect(label.prop('isRequired')).toBeTruthy()
+ })
+
it('should render a text field', () => {
const expectedName = 'test'
const wrapper = shallow(