Skip to content

Commit 49cd75e

Browse files
authored
Merge pull request #89 from CodeYourFuture/staging
Merge QA config and Capgemini employer issue into Production
2 parents c2ca54b + ad3a90e commit 49cd75e

File tree

9 files changed

+76
-6
lines changed

9 files changed

+76
-6
lines changed

.circleci/config.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
- run:
4444
name: Set env variables
4545
command: echo 'export VERSION=$(echo $CIRCLE_SHA1 | cut -c -7)' >> $BASH_ENV
46+
- run:
47+
name: build qa
48+
command: REACT_APP_NODE_ENV=QA yarn build:qa
4649
- run:
4750
name: build staging
4851
command: REACT_APP_NODE_ENV=STAGING yarn build:staging
@@ -52,15 +55,37 @@ jobs:
5255
- persist_to_workspace:
5356
root: .
5457
paths:
58+
- qa
5559
- staging
5660
- production
5761

62+
deploy_qa:
63+
docker:
64+
- image: circleci/python:3.6-jessie
65+
working_directory: ~/deploy
66+
environment:
67+
PUBLIC_URL: https://forms.qa.codeyourfuture.io
68+
steps:
69+
- attach_workspace:
70+
at: .
71+
- run:
72+
name: Set env variables
73+
command: echo 'export VERSION=$(echo $CIRCLE_SHA1 | cut -c -7)' >> $BASH_ENV
74+
- run:
75+
name: Install awscli
76+
command: sudo pip install awscli
77+
- s3deploy:
78+
dir: qa
79+
to: 'forms.qa.codeyourfuture.io'
80+
cf_distribution_id: E2VFUDC8YCDBKS
81+
82+
5883
deploy_staging:
5984
docker:
6085
- image: circleci/python:3.6-jessie
6186
working_directory: ~/deploy
6287
environment:
63-
PUBLIC_URL: https://staging.forms.codeyourfuture.io
88+
PUBLIC_URL: https://forms.staging.codeyourfuture.io
6489
steps:
6590
- attach_workspace:
6691
at: .
@@ -72,8 +97,8 @@ jobs:
7297
command: sudo pip install awscli
7398
- s3deploy:
7499
dir: staging
75-
to: 'staging.forms.codeyourfuture.io'
76-
cf_distribution_id: E3MJAA9E60TZUB
100+
to: 'forms.staging.codeyourfuture.io'
101+
cf_distribution_id: E1SJFMKKCNFUGI
77102

78103
deploy_production:
79104
docker:
@@ -101,6 +126,14 @@ workflows:
101126
jobs:
102127
- build:
103128
context: build
129+
- deploy_qa:
130+
context: deployments_qa
131+
requires:
132+
- build
133+
filters:
134+
branches:
135+
only:
136+
- qa
104137
- deploy_staging:
105138
context: deployments_staging
106139
requires:

e2e/integration/journey.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ const generateExpected = data => ({
3434
guidePeople: data.guidePeople || [],
3535
techSkill: data.techSkill || [],
3636
otherSkill: data.otherSkill || [],
37-
userId: ''
37+
userId: '',
38+
agreeToReceiveCommunication: true,
39+
agreeToTOU: true
3840
})
3941

4042
it('can submit a minimal form', () => {

e2e/support/commands.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Cypress.Commands.add('fillInitialForm', data => {
2323
}
2424

2525
// submission
26-
cy.get('[name="acknowledgement"]').click()
26+
cy.get('[name="agreeToTOU"]').check()
27+
cy.get('[name="agreeToReceiveCommunication"]').check()
2728
cy.get('button')
2829
.contains('Submit')
2930
.click()

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"scripts": {
3535
"start": "REACT_APP_NODE_ENV=LOCAL react-scripts start",
3636
"build": "react-scripts build && yarn run delete-maps",
37+
"build:qa": "REACT_APP_NODE_ENV=QA react-scripts build && yarn run delete-maps && mv build qa",
3738
"build:staging": "REACT_APP_NODE_ENV=STAGING react-scripts build && yarn run delete-maps && mv build staging",
3839
"build:production": "REACT_APP_NODE_ENV=PRODUCTION react-scripts build && yarn run delete-maps && mv build production",
3940
"delete-maps": "yarn run delete-map-files && yarn run delete-references-to-map-files",

src/Components/forms/data.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
{ "name": "Transport and Logistics", "_id": "Transport and Logistics" },
3636
{ "name": "Other", "_id": "Other" }
3737
],
38+
3839
"hearAboutCYFList": [
40+
{ "name": "Employer", "_id": "Employer" },
3941
{ "name": "Search engine", "_id": "Search engine" },
4042
{ "name": "Colleague or friend", "_id": "Colleague or friend" },
4143
{ "name": "Conference", "_id": "Conference" },
@@ -45,11 +47,17 @@
4547
{ "name": "Other", "_id": "Other" }
4648
],
4749

50+
"employerList": [
51+
{ "name": "Capgemini", "_id": "Capgemini" },
52+
{ "name": "Other", "_id": "Other" }
53+
],
54+
4855
"radioButtonList": [
4956
{ "value": "None", "_id": "None" },
5057
{ "value": "Some", "_id": "Some" },
5158
{ "value": "Professional experience", "_id": "Professional experience" }
5259
],
60+
5361
"guidePeopleSkillList": [
5462
{
5563
"id": "98y439hf934",
@@ -64,6 +72,7 @@
6472
"label": "Help people learn public speaking"
6573
}
6674
],
75+
6776
"techSkillList": [
6877
{
6978
"id": "8976tygsbhj3e",

src/Components/forms/helper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export const initialState = {
1010
interestedInCYF: '',
1111
industry: '',
1212
hearAboutCYF: '',
13+
hearAboutCYFFromEmployer: false,
14+
employer: '',
1315
guidePeople: ListsData.guidePeopleSkillList,
1416
techSkill: ListsData.techSkillList,
1517
otherSkill: ListsData.otherSkillList,

src/Components/forms/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ class Forms extends Component {
100100
err: null
101101
})
102102
}
103+
if (name === 'hearAboutCYF') {
104+
this.setState({ hearAboutCYFFromEmployer: value === 'Employer' })
105+
}
103106
}
104107

105108
validateForm = values => {
@@ -154,6 +157,8 @@ class Forms extends Component {
154157
interestedInCYF,
155158
industry,
156159
hearAboutCYF,
160+
hearAboutCYFFromEmployer,
161+
employer,
157162
guidePeople,
158163
techSkill,
159164
otherSkill,
@@ -167,6 +172,7 @@ class Forms extends Component {
167172
lastName,
168173
email,
169174
cityId,
175+
employer: hearAboutCYFFromEmployer ? employer : true,
170176
interestedInVolunteer,
171177
tel,
172178
agreeToTOU,
@@ -191,6 +197,7 @@ class Forms extends Component {
191197
interestedInCYF,
192198
industry,
193199
hearAboutCYF,
200+
employer: hearAboutCYFFromEmployer ? employer : '',
194201
guidePeople: filterEmptyValue(guidePeople),
195202
techSkill: filterEmptyValue(techSkill),
196203
otherSkill: filterEmptyValue(otherSkill),

src/Components/forms/inputs/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ export default class VolunteerForm extends Component {
2424
interestedInCYF,
2525
industry,
2626
hearAboutCYF,
27+
hearAboutCYFFromEmployer,
2728
onChangeCheckList,
2829
guidePeople,
2930
techSkill,
30-
otherSkill
31+
otherSkill,
32+
employer
3133
} = this.props
3234

3335
return (
@@ -109,6 +111,7 @@ export default class VolunteerForm extends Component {
109111
isEmpty={errors.industry}
110112
label="What industry are you in?"
111113
/>
114+
112115
<DropDown
113116
onChange={onChange}
114117
value={hearAboutCYF}
@@ -117,6 +120,16 @@ export default class VolunteerForm extends Component {
117120
isEmpty={errors.hearAboutCYF}
118121
label="Where did you hear about Code Your Future?"
119122
/>
123+
{hearAboutCYFFromEmployer && (
124+
<DropDown
125+
onChange={onChange}
126+
value={employer}
127+
name="employer"
128+
arrayList={ListsData.employerList}
129+
isEmpty={errors.employer}
130+
label="Who is your employer? *"
131+
/>
132+
)}
120133
<span className="contact-interested">
121134
<span>
122135
What would you like help Code Your Future with, and what is your

src/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export const domain = () => {
55
switch (env) {
66
case 'LOCAL':
77
return 'http://localhost:3001'
8+
case 'QA':
9+
return 'https://cyf-api.qa.codeyourfuture.io'
810
case 'STAGING':
911
return 'https://cyf-api.staging.codeyourfuture.io'
1012
case 'PRODUCTION':

0 commit comments

Comments
 (0)