From 3320e02aee3a732a3299a2d395da0361680f6cf0 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Thu, 10 Aug 2017 17:18:07 +0530 Subject: [PATCH 1/6] =?UTF-8?q?Github=20issue#1106,=20Add=20IBM=20chatbot?= =?UTF-8?q?=20as=20a=20project=20type=20=E2=80=94=20Initial=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/images/product-chatbot.svg | 21 ++ .../projectQuestions/ibm_chatbot.v1.0.js | 269 ++++++++++++++++++ .../typeToSpecification.json | 1 + src/config/projectWizard/index.js | 6 + 4 files changed, 297 insertions(+) create mode 100644 src/assets/images/product-chatbot.svg create mode 100644 src/config/projectQuestions/ibm_chatbot.v1.0.js 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..14e9c1e12 --- /dev/null +++ b/src/config/projectQuestions/ibm_chatbot.v1.0.js @@ -0,0 +1,269 @@ +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 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 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'} + ], + }, + { + icon: 'question', + required: true, + 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', + required: true, + 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', + required: true, + 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' + } + ] + } +] \ No newline at end of file diff --git a/src/config/projectSpecification/typeToSpecification.json b/src/config/projectSpecification/typeToSpecification.json index 1269df54f..385ea90dc 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", + "ibm_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 8e1341b27..26eae56ce 100644 --- a/src/config/projectWizard/index.js +++ b/src/config/projectWizard/index.js @@ -63,6 +63,12 @@ const products = { icon: 'product-app', id: 'application_development' }, + ChatBot: { + brief: 'ChatBot', + details: 'Build ChatBot using IBM Watson', + icon: 'product-chatbot', + id: 'ibm_chatbot' + }, 'Software Development': { brief: 'Tasks or adhoc', details: 'Get help with any part of your development cycle', From 1c023af759489e1b347fa3be4e0bcadaf55d9125 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Thu, 10 Aug 2017 17:19:30 +0530 Subject: [PATCH 2/6] Temp deploy to dev --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 9dc19c9ee40ed81accf7de218e05571fbc6f50fa Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Thu, 10 Aug 2017 17:33:29 +0530 Subject: [PATCH 3/6] fixed lint error --- src/config/projectQuestions/ibm_chatbot.v1.0.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/projectQuestions/ibm_chatbot.v1.0.js b/src/config/projectQuestions/ibm_chatbot.v1.0.js index 14e9c1e12..01acc30d7 100644 --- a/src/config/projectQuestions/ibm_chatbot.v1.0.js +++ b/src/config/projectQuestions/ibm_chatbot.v1.0.js @@ -1,5 +1,5 @@ import _ from 'lodash' -import { Icons } from 'appirio-tech-react-components' +// import { Icons } from 'appirio-tech-react-components' import { findProduct} from '../projectWizard' const isFileRequired = (project, subSections) => { From 24fd5a196216114ed2442eee6a3f65cc1a89f91e Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Fri, 11 Aug 2017 10:07:18 +0530 Subject: [PATCH 4/6] =?UTF-8?q?Github=20issue#1106,=20Add=20IBM=20chatbot?= =?UTF-8?q?=20as=20a=20project=20type=20=E2=80=94=20copy=20changes=20?= =?UTF-8?q?=E2=80=94=20question=20type=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectQuestions/ibm_chatbot.v1.0.js | 36 +++++++------------ src/config/projectWizard/index.js | 9 ++--- .../create/components/SelectProduct.js | 3 +- 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/src/config/projectQuestions/ibm_chatbot.v1.0.js b/src/config/projectQuestions/ibm_chatbot.v1.0.js index 01acc30d7..3d917f1d4 100644 --- a/src/config/projectQuestions/ibm_chatbot.v1.0.js +++ b/src/config/projectQuestions/ibm_chatbot.v1.0.js @@ -210,50 +210,38 @@ export const basicSections = [ type: 'checkbox-group', fieldName: 'details.appDefinition.capabilities', options: [ - {value: 'order_management', label: 'Order Management'}, + {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'} + {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 provide data from any systems to support the capabilities you listed above?', + 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: 'radio-group', - fieldName: 'details.appDefinition.integrationSystems', - options: [ - {value: 'true', label: 'Yes'}, - {value: 'false', label: 'No'} - ] + type: 'textbox', + fieldName: 'details.appDefinition.integrationSystems' }, { icon: 'question', required: true, - title: 'Do you have existing agent scripts?', + 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: 'radio-group', - fieldName: 'details.appDefinition.existingAgentScripts', - options: [ - {value: 'true', label: 'Yes'}, - {value: 'false', label: 'No'} - ] + type: 'textbox', + fieldName: 'details.appDefinition.existingAgentScripts' }, { icon: 'question', required: true, - title: 'Are you planning to transfer conversations to human agents?', + 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: 'radio-group', - fieldName: 'details.appDefinition.transferToHumanAgents', - options: [ - {value: 'true', label: 'Yes'}, - {value: 'false', label: 'No'} - ] + type: 'textbox', + fieldName: 'details.appDefinition.transferToHumanAgents' } ] }, diff --git a/src/config/projectWizard/index.js b/src/config/projectWizard/index.js index 26eae56ce..44e42bf93 100644 --- a/src/config/projectWizard/index.js +++ b/src/config/projectWizard/index.js @@ -63,11 +63,12 @@ const products = { icon: 'product-app', id: 'application_development' }, - ChatBot: { - brief: 'ChatBot', - details: 'Build ChatBot using IBM Watson', + 'IBM Chatbot': { + brief: 'IBM Chatbot', + details: 'Build Chatbot using IBM Watson', icon: 'product-chatbot', - id: 'ibm_chatbot' + id: 'ibm_chatbot', + hidden: true }, 'Software Development': { brief: 'Tasks or adhoc', 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( Date: Mon, 14 Aug 2017 22:17:21 +0530 Subject: [PATCH 5/6] IBM => Watson --- src/config/projectSpecification/typeToSpecification.json | 2 +- src/config/projectWizard/index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config/projectSpecification/typeToSpecification.json b/src/config/projectSpecification/typeToSpecification.json index 385ea90dc..832520070 100644 --- a/src/config/projectSpecification/typeToSpecification.json +++ b/src/config/projectSpecification/typeToSpecification.json @@ -7,6 +7,6 @@ "visual_prototype": "app_dev.v1.0", "website_development": "app_dev.v1.0", "application_development": "app_dev.v1.0", - "ibm_chatbot": "ibm_chatbot.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 3e91483b5..f6e97c501 100644 --- a/src/config/projectWizard/index.js +++ b/src/config/projectWizard/index.js @@ -66,11 +66,11 @@ const products = { icon: 'product-app', id: 'application_development' }, - 'IBM Chatbot': { - brief: 'IBM Chatbot', + 'Watson Chatbot': { + brief: 'Watson Chatbot', details: 'Build Chatbot using IBM Watson', icon: 'product-chatbot', - id: 'ibm_chatbot', + id: 'watson_chatbot', hidden: true }, 'Software Development': { From 39903e8dc58405d0f2441ee3397f4d1a85297e9a Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Wed, 16 Aug 2017 11:33:19 +0530 Subject: [PATCH 6/6] copy change for watson chatbot --- src/config/projectQuestions/ibm_chatbot.v1.0.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/projectQuestions/ibm_chatbot.v1.0.js b/src/config/projectQuestions/ibm_chatbot.v1.0.js index 3d917f1d4..92d361cc7 100644 --- a/src/config/projectQuestions/ibm_chatbot.v1.0.js +++ b/src/config/projectQuestions/ibm_chatbot.v1.0.js @@ -46,7 +46,7 @@ const sections = [ questions: [ { icon: 'question', - title: 'Are you an existing Watson Assistant customer?', + title: 'Are you an existing Watson Virtual Assistant customer?', description: '', fieldName: 'details.appDefinition.existingWatsonCustomer', type: 'checkbox', @@ -181,7 +181,7 @@ export const basicSections = [ { icon: 'question', required: true, - title: 'Are you an existing Watson Assistant customer?', + title: 'Are you an existing Watson Virtual Assistant customer?', description: '', fieldName: 'details.appDefinition.existingWatsonCustomer', type: 'radio-group',