Skip to content

Commit dcf4580

Browse files
author
Vikas Agarwal
committed
Github issue#1309, Remove budget fields and add description to QAaS project intake forms
— Remove budget estimate section from Website specification page
1 parent 636478b commit dcf4580

File tree

2 files changed

+332
-1
lines changed

2 files changed

+332
-1
lines changed
Lines changed: 331 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,331 @@
1+
import _ from 'lodash'
2+
import { Icons } from 'appirio-tech-react-components'
3+
import { findProduct} from '../projectWizard'
4+
5+
const isFileRequired = (project, subSections) => {
6+
const subSection = _.find(subSections, (s) => s.type === 'questions')
7+
const fields = _.filter(subSection.questions, q => q.type.indexOf('see-attached') > -1)
8+
// iterate over all seeAttached type fields to check
9+
// if any see attached is checked.
10+
return _.some(_.map(
11+
_.map(fields, 'fieldName'),
12+
fn => _.get(project, `${fn}.seeAttached`)
13+
))
14+
}
15+
16+
const sections = [
17+
{
18+
id: 'appDefinition',
19+
title: (project, showProduct) => {
20+
const product = _.get(project, 'details.products[0]')
21+
if (showProduct && product) {
22+
const prd = findProduct(product)
23+
if (prd) return prd.name
24+
}
25+
return 'Definition'
26+
},
27+
required: true,
28+
description: 'Please answer a few basic questions about your project. You can also provide the needed information in a supporting document--add a link in the notes section or upload it below.',
29+
subSections: [
30+
{
31+
id: 'projectName',
32+
required: true,
33+
validationError: 'Please provide a name for your project',
34+
fieldName: 'name',
35+
description: '',
36+
title: 'Project Name',
37+
type: 'project-name'
38+
},
39+
{
40+
id: 'questions',
41+
required: true,
42+
hideTitle: true,
43+
title: 'Questions',
44+
description: '',
45+
type: 'questions',
46+
questions: [
47+
{
48+
icon: 'question',
49+
title: 'Which is your primary device target?',
50+
description: 'Select only the device that you need to develop for. \
51+
In most cases limiting the scope of your project would result \
52+
in better final result. Topcoder recommends to always start \
53+
with the mobile phone view and expand to other devices as your \
54+
app matures.',
55+
fieldName: 'details.appDefinition.primaryTarget',
56+
type: 'tiled-radio-group',
57+
options: [
58+
{value: 'phone', title: 'Phone', icon: Icons.IconTechOutlineMobile, iconOptions: { fill: '#00000'}, desc: 'iOS, Android, Hybrid'},
59+
{value: 'tablet', title: 'Tablet', icon: Icons.IconTechOutlineTablet, iconOptions: { fill: '#00000'}, desc: 'iOS, Android, Hybrid'},
60+
{value: 'desktop', title: 'Desktop', icon: Icons.IconTechOutlineDesktop, iconOptions: { fill: '#00000'}, desc: 'all OS'},
61+
{value: 'wearable', title: 'Wearable', icon: Icons.IconTechOutlineWatchApple, iconOptions: { fill: '#00000'}, desc: 'Watch OS, Android Wear'}
62+
]
63+
},
64+
{
65+
id: 'projectInfo',
66+
// required is not needed if we specifiy validations
67+
// required: true,
68+
validations: 'isRequired,minLength:160',
69+
// providing default error message to handle isRequired validation
70+
// somehow, it is not picking up error message from validationErrors object
71+
validationError: 'Please provide a description',
72+
validationErrors: {
73+
isRequired : 'Please provide a description',
74+
minLength : 'Please enter at least 160 characters'
75+
},
76+
fieldName: 'description',
77+
description: 'Brief Description',
78+
title: 'Description',
79+
type: 'textbox'
80+
},
81+
{
82+
icon: 'question',
83+
title: 'What is the goal of your application? How will people use it?',
84+
description: 'Describe your objectives for creating this application',
85+
type: 'see-attached-textbox',
86+
fieldName: 'details.appDefinition.goal'
87+
},
88+
{
89+
icon: 'question',
90+
title: 'Who are the users of your application? ',
91+
description: 'Describe the roles and needs of your target users',
92+
type: 'see-attached-textbox',
93+
fieldName: 'details.appDefinition.users'
94+
},
95+
{
96+
icon: 'question',
97+
title: 'Feature requirements',
98+
description: 'Please list all the features you would like in your application. You can use our wizard to pick from common features or define your own.',
99+
type: 'see-attached-features',
100+
fieldName: 'details.appDefinition.features'
101+
}
102+
]
103+
},
104+
{
105+
id: 'notes',
106+
fieldName: 'details.appDefinition.notes',
107+
title: 'Notes',
108+
description: 'Add any other important information regarding your project (e.g., links to documents or existing applications)',
109+
type: 'notes'
110+
},
111+
{
112+
id: 'files',
113+
required: isFileRequired,
114+
title: (project) => `Project Files (${_.get(project, 'attachments', []).length})` || 'Files',
115+
description: '',
116+
type: 'files',
117+
fieldName: 'attachments'
118+
}
119+
]
120+
},
121+
{
122+
id: 'designSpecification',
123+
required: false,
124+
title: 'Design Specification',
125+
description: 'Define the visual style for your application or provide a style guide or brand guidelines. Skip this section (or particular questions) if you don\'t have any preferences or restrictions.',
126+
subSections: [
127+
{
128+
id: 'questions',
129+
required: false,
130+
title: 'Questions',
131+
description: '',
132+
type: 'questions',
133+
questions: [
134+
{
135+
icon: 'question',
136+
title: 'What font style do you prefer? (Pick one)',
137+
description: 'The typography used in your designs will fit within these broad font styles',
138+
type: 'tiled-radio-group',
139+
options: [
140+
{value: 'serif', title: 'Serif', icon: Icons.IconTcSpecTypeSerif, iconOptions: { fill: '#00000'}, desc: 'formal, old style'},
141+
{value: 'sanSerif', title: 'Sans Serif', icon: Icons.IconTcSpecTypeSansSerif, iconOptions: { fill: '#00000'}, desc: 'clean, modern, informal'}
142+
],
143+
fieldName: 'details.designSpecification.fontStyle'
144+
},
145+
{
146+
icon: 'question',
147+
title: 'What colors do you like? (Select all that apply)',
148+
description: 'Your preferred colors will be used to guide the shading in your designs',
149+
type: 'colors',
150+
defaultColors: [],
151+
fieldName: 'details.designSpecification.colors'
152+
},
153+
{
154+
icon: 'question',
155+
title: 'What icon style do you prefer? (Pick one)',
156+
description: 'Icons within your designs will follow these styles',
157+
type: 'tiled-radio-group',
158+
options: [
159+
{value: 'flatColor', title: 'Flat Color', icon: Icons.IconTcSpecIconTypeColorHome, iconOptions: { fill: '#00000'}, desc: 'playful'},
160+
{value: 'thinLine', title: 'Thin Line', icon: Icons.IconTcSpecIconTypeOutlineHome, iconOptions: { fill: '#00000'}, desc: 'modern'},
161+
{value: 'solidLine', title: 'Solid Line', icon: Icons.IconTcSpecIconTypeGlyphHome, iconOptions: { fill: '#00000'}, desc: 'classic'}
162+
],
163+
fieldName: 'details.designSpecification.iconStyle'
164+
}
165+
]
166+
},
167+
{
168+
id: 'notes',
169+
required: false,
170+
fieldName: 'details.designSpecification.notes',
171+
title: 'Notes',
172+
description: 'Add any other important information regarding your project (e.g., links to documents or existing applications, budget or timing constraints)',
173+
type: 'notes'
174+
}
175+
]
176+
},
177+
{
178+
id: 'devSpecification',
179+
title: 'Development Specification',
180+
description: 'Define some basic technical requirements for your application or provide any architecture or technical guidelines. Skip this section if you dont know what is required.',
181+
required: false,
182+
subSections: [
183+
{
184+
id: 'questions',
185+
required: false,
186+
title: 'Questions',
187+
description: '',
188+
type: 'questions',
189+
questions: [
190+
{
191+
icon: 'question',
192+
title: 'How should your application be built?',
193+
description: 'Choose the operating system/platform for your application',
194+
type: 'checkbox-group',
195+
options: [
196+
{value: 'ios', label: 'iOS'},
197+
{value: 'android', label: 'Android'},
198+
{value: 'web', label: 'Web'},
199+
{value: 'hybrid', label: 'Hybrid'}
200+
],
201+
fieldName: 'details.devSpecification.platform'
202+
},
203+
{
204+
icon: 'question',
205+
title: 'Is offline access required for your application?',
206+
description: 'Do your users need to use the application when they are unable to connect to the internet?',
207+
type: 'radio-group',
208+
options: [
209+
{value: 'true', label: 'Yes'},
210+
{value: 'false', label: 'No'}
211+
],
212+
fieldName: 'details.devSpecification.offlineAccess'
213+
},
214+
{
215+
icon: 'question',
216+
title: 'What level of security is needed for your application?',
217+
description: 'Do you expect to be storing or transmitting personal or sensitive information?',
218+
type: 'radio-group',
219+
options: [
220+
{value: 'standard', label: 'Standard - Nothing to do here'},
221+
{value: 'enhanced', label: 'Enhanced'},
222+
{value: 'maximumm', label: 'Maximum'}
223+
],
224+
fieldName: 'details.devSpecification.securityLevel'
225+
}
226+
]
227+
},
228+
{
229+
id: 'notes',
230+
required: false,
231+
fieldName: 'details.devSpecification.notes',
232+
title: 'Notes',
233+
description: 'Add any other important information regarding your project (e.g., links to documents or existing applications, budget or timing constraints)',
234+
type: 'notes'
235+
}
236+
]
237+
}
238+
]
239+
240+
export default sections
241+
242+
export const basicSections = [
243+
{
244+
id: 'appDefinition',
245+
title: '',
246+
required: true,
247+
description: 'Please answer a few basic questions about your project and, as an option, add links to supporting documents in the “Notes” section. If you have any files to upload, you’ll be able to do so later.',
248+
subSections: [
249+
{
250+
id: 'projectName',
251+
required: true,
252+
validationError: 'Please provide a name for your project',
253+
fieldName: 'name',
254+
description: '',
255+
title: 'Project Name',
256+
type: 'project-name'
257+
},
258+
{
259+
id: 'questions',
260+
required: true,
261+
hideTitle: true,
262+
title: 'Questions',
263+
description: '',
264+
type: 'questions',
265+
questions: [
266+
{
267+
icon: 'question',
268+
required: true,
269+
validationError: 'Please let us know the target device',
270+
title: 'Which is your primary device target?',
271+
description: 'Select only the device that you need to develop for. \
272+
In most cases limiting the scope of your project would result \
273+
in better final result. Topcoder recommends to always start \
274+
with the mobile phone view and expand to other devices as your \
275+
app matures.',
276+
fieldName: 'details.appDefinition.primaryTarget',
277+
type: 'tiled-radio-group',
278+
options: [
279+
{value: 'phone', title: 'Phone', icon: Icons.IconTechOutlineMobile, iconOptions: { fill: '#00000'}, desc: 'iOS, Android, Hybrid'},
280+
{value: 'tablet', title: 'Tablet', icon: Icons.IconTechOutlineTablet, iconOptions: { fill: '#00000'}, desc: 'iOS, Android, Hybrid'},
281+
{value: 'desktop', title: 'Desktop', icon: Icons.IconTechOutlineDesktop, iconOptions: { fill: '#00000'}, desc: 'all OS'},
282+
{value: 'wearable', title: 'Wearable', icon: Icons.IconTechOutlineWatchApple, iconOptions: { fill: '#00000'}, desc: 'Watch OS, Android Wear'}
283+
]
284+
},
285+
{
286+
id: 'projectInfo',
287+
// required is not needed if we specifiy validations
288+
// required: true,
289+
validations: 'isRequired,minLength:160',
290+
// providing default error message to handle isRequired validation
291+
// somehow, it is not picking up error message from validationErrors object
292+
validationError: 'Please provide a description',
293+
validationErrors: {
294+
isRequired : 'Please provide a description',
295+
minLength : 'Please enter at least 160 characters'
296+
},
297+
fieldName: 'description',
298+
description: 'Brief Description',
299+
title: 'Description',
300+
type: 'textbox'
301+
},
302+
{
303+
icon: 'question',
304+
required: true,
305+
validationError: 'Please let us know the goal of your application',
306+
title: 'What is the goal of your application? How will people use it?',
307+
description: 'Describe your objectives for creating this application',
308+
type: 'textbox',
309+
fieldName: 'details.appDefinition.goal.value'
310+
},
311+
{
312+
icon: 'question',
313+
required: true,
314+
validationError: 'Please let us know users of your application',
315+
title: 'Who are the users of your application? ',
316+
description: 'Describe the roles and needs of your target users',
317+
type: 'textbox',
318+
fieldName: 'details.appDefinition.users.value'
319+
}
320+
]
321+
},
322+
{
323+
id: 'notes',
324+
fieldName: 'details.appDefinition.notes',
325+
title: 'Notes',
326+
description: 'Add any other important information regarding your project (e.g., links to documents or existing applications)',
327+
type: 'notes'
328+
}
329+
]
330+
}
331+
]

src/config/projectSpecification/typeToSpecification.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"infographic": "avd.v1.0",
66
"generic_design": "topcoder.v1",
77
"visual_prototype": "app_dev.v1.0",
8-
"website_development": "app_dev.v1.0",
8+
"website_development": "website.v1.0",
99
"application_development": "app_dev.v1.0",
1010
"watson_chatbot": "ibm_chatbot.v1.0",
1111
"generic_chatbot": "generic_chatbot.v1.0",

0 commit comments

Comments
 (0)