diff --git a/circle.yml b/circle.yml index 726aa82bf..989533340 100644 --- a/circle.yml +++ b/circle.yml @@ -19,7 +19,7 @@ compile: deployment: development: - branch: dev + branch: [dev, feature/chatbot-product-type] owner: appirio-tech commands: - ./deploy.sh DEV diff --git a/src/assets/images/product-chatbot.svg b/src/assets/images/product-chatbot.svg new file mode 100644 index 000000000..05b1ea7b0 --- /dev/null +++ b/src/assets/images/product-chatbot.svg @@ -0,0 +1,21 @@ + + + + icon-product-app + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/config/projectQuestions/ibm_chatbot.v1.0.js b/src/config/projectQuestions/ibm_chatbot.v1.0.js new file mode 100644 index 000000000..92d361cc7 --- /dev/null +++ b/src/config/projectQuestions/ibm_chatbot.v1.0.js @@ -0,0 +1,257 @@ +import _ from 'lodash' +// import { Icons } from 'appirio-tech-react-components' +import { findProduct} from '../projectWizard' + +const isFileRequired = (project, subSections) => { + const subSection = _.find(subSections, (s) => s.type === 'questions') + const fields = _.filter(subSection.questions, q => q.type.indexOf('see-attached') > -1) + // iterate over all seeAttached type fields to check + // if any see attached is checked. + return _.some(_.map( + _.map(fields, 'fieldName'), + fn => _.get(project, `${fn}.seeAttached`) + )) +} + +const sections = [ + { + id: 'appDefinition', + title: (project, showProduct) => { + const product = _.get(project, 'details.products[0]') + if (showProduct && product) { + const prd = findProduct(product) + if (prd) return prd + } + return 'Definition' + }, + required: true, + 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.', + subSections: [ + { + id: 'projectName', + required: true, + validationError: 'Please provide a name to your project', + fieldName: 'name', + description: '', + title: 'Project Name', + type: 'project-name' + }, + { + id: 'questions', + required: true, + hideTitle: true, + title: 'Questions', + description: '', + type: 'questions', + questions: [ + { + icon: 'question', + title: 'Are you an existing Watson Virtual Assistant customer?', + description: '', + fieldName: 'details.appDefinition.existingWatsonCustomer', + type: 'checkbox', + options: [ + {value: 'true', title: 'Yes'}, + {value: 'false', title: 'No'}, + ] + }, + { + id: 'projectInfo', + required: true, + fieldName: 'description', + description: 'Brief Description', + title: 'Description', + type: 'textbox' + }, + { + icon: 'question', + title: 'Do you have an existing IBM Bluemix account?', + description: '', + type: 'radio-group', + fieldName: 'details.appDefinition.hasBluemixAccount', + options: [ + {value: 'true', label: 'Yes'}, + {value: 'false', label: 'No'} + ] + }, + { + icon: 'question', + title: 'What capabilities does the chatbot need to support? (check all that apply)', + description: '', + type: 'checkbox-group', + fieldName: 'details.appDefinition.capabilities', + options: [ + {value: 'order_management', label: 'Order Management'}, + {value: 'information', label: 'Information'}, + {value: 'help', label: 'Help'}, + {value: 'complaints', label: 'Complaints'}, + {value: 'billing', label: 'Billing'}, + {value: 'account_management', label: 'Account Management'}, + {value: 'custom', label: 'Custom'} + ], + }, + { + icon: 'question', + title: 'Will the chatbot need to provide data from any systems to support the capabilities you listed above?', + description: '', + type: 'radio-group', + fieldName: 'details.appDefinition.integrationSystems', + options: [ + {value: 'true', label: 'Yes'}, + {value: 'false', label: 'No'} + ] + }, + { + icon: 'question', + title: 'Do you have existing agent scripts?', + description: '', + type: 'radio-group', + fieldName: 'details.appDefinition.existingAgentScripts', + options: [ + {value: 'true', label: 'Yes'}, + {value: 'false', label: 'No'} + ] + }, + { + icon: 'question', + title: 'Are you planning to transfer conversations to human agents?', + description: '', + type: 'radio-group', + fieldName: 'details.appDefinition.transferToHumanAgents', + options: [ + {value: 'true', label: 'Yes'}, + {value: 'false', label: 'No'} + ] + } + ] + }, + { + id: 'notes', + fieldName: 'details.appDefinition.notes', + title: 'Notes', + description: 'Add any other important information regarding your project (e.g., links to documents or existing applications, budget or timing constraints)', + type: 'notes' + }, + { + id: 'files', + required: isFileRequired, + title: (project) => `Project Files (${_.get(project, 'attachments', []).length})` || 'Files', + description: '', + type: 'files', + fieldName: 'attachments' + } + ] + } +] + +export default sections + +export const basicSections = [ + { + id: 'appDefinition', + title: '', + required: true, + 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.', + subSections: [ + { + id: 'projectName', + required: true, + validationError: 'Please provide a name to your project', + fieldName: 'name', + description: '', + title: 'Project Name', + type: 'project-name' + }, + { + id: 'questions', + required: true, + hideTitle: true, + title: 'Questions', + description: '', + type: 'questions', + questions: [ + { + id: 'projectInfo', + required: true, + fieldName: 'description', + description: 'Brief Description', + title: 'Description', + type: 'textbox' + }, + { + icon: 'question', + required: true, + title: 'Are you an existing Watson Virtual Assistant customer?', + description: '', + fieldName: 'details.appDefinition.existingWatsonCustomer', + type: 'radio-group', + options: [ + {value: 'true', label: 'Yes'}, + {value: 'false', label: 'No'}, + ] + }, + { + icon: 'question', + required: true, + title: 'Do you have an existing IBM Bluemix account?', + description: '', + type: 'radio-group', + fieldName: 'details.appDefinition.hasBluemixAccount', + options: [ + {value: 'true', label: 'Yes'}, + {value: 'false', label: 'No'} + ] + }, + { + icon: 'question', + // required: true, + title: 'What capabilities does the chatbot need to support?', + description: '', + type: 'checkbox-group', + fieldName: 'details.appDefinition.capabilities', + options: [ + {value: 'order_management', label: 'Order management'}, + {value: 'information', label: 'Information'}, + {value: 'help', label: 'Help'}, + {value: 'complaints', label: 'Complaints'}, + {value: 'billing', label: 'Billing'}, + {value: 'account_management', label: 'Account management'}, + {value: 'custom', label: 'Custom (please explain in the Notes)'} + ], + }, + { + icon: 'question', + required: true, + title: 'Will the chatbot need to access data from any systems to support the capabilities you listed above? If so, please list the systems below. (Change to text box)', + description: '', + type: 'textbox', + fieldName: 'details.appDefinition.integrationSystems' + }, + { + icon: 'question', + required: true, + title: 'Do you have any example agent conversations you can provide? If so, please paste them or any links to documents below (you’ll be able to upload documents later).', + description: '', + type: 'textbox', + fieldName: 'details.appDefinition.existingAgentScripts' + }, + { + icon: 'question', + required: true, + title: 'Are you planning to transfer conversations to human agents? If so, please list the agents’ communication tools (e.g., Slack, LiveAgent, Intercom, etc.)', + description: '', + type: 'textbox', + fieldName: 'details.appDefinition.transferToHumanAgents' + } + ] + }, + { + id: 'notes', + fieldName: 'details.appDefinition.notes', + title: 'Notes', + description: 'Add any other important information regarding your project (e.g., links to documents or existing applications, budget or timing constraints)', + type: 'notes' + } + ] + } +] \ No newline at end of file diff --git a/src/config/projectSpecification/typeToSpecification.json b/src/config/projectSpecification/typeToSpecification.json index 1269df54f..832520070 100644 --- a/src/config/projectSpecification/typeToSpecification.json +++ b/src/config/projectSpecification/typeToSpecification.json @@ -7,5 +7,6 @@ "visual_prototype": "app_dev.v1.0", "website_development": "app_dev.v1.0", "application_development": "app_dev.v1.0", + "watson_chatbot": "ibm_chatbot.v1.0", "generic_dev": "app_dev.v1.0" } diff --git a/src/config/projectWizard/index.js b/src/config/projectWizard/index.js index 4570ff18d..f6e97c501 100644 --- a/src/config/projectWizard/index.js +++ b/src/config/projectWizard/index.js @@ -66,6 +66,13 @@ const products = { icon: 'product-app', id: 'application_development' }, + 'Watson Chatbot': { + brief: 'Watson Chatbot', + details: 'Build Chatbot using IBM Watson', + icon: 'product-chatbot', + id: 'watson_chatbot', + hidden: true + }, 'Software Development': { brief: 'Tasks or adhoc', details: 'Get help with any part of your development cycle', diff --git a/src/projects/create/components/SelectProduct.js b/src/projects/create/components/SelectProduct.js index e8bdd1c39..1d0af5a4c 100644 --- a/src/projects/create/components/SelectProduct.js +++ b/src/projects/create/components/SelectProduct.js @@ -15,7 +15,8 @@ function SelectProduct(props) { for(const subType in subTypes) { const item = subTypes[subType] // don't render disabled items for selection - if (item.disabled) continue + // don't render hidden items as well, hidden items can be reached via direct link though + if (item.disabled || item.hidden) continue const icon = cards.push(