Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/assets/images/product-chatbot-watson.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
203 changes: 203 additions & 0 deletions src/config/projectQuestions/generic_chatbot.v1.0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
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 for 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',
fieldName: 'description',
description: 'Brief Description',
title: 'Description',
type: 'textbox'
},
{
icon: 'question',
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',
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.',
description: '',
type: 'textbox',
fieldName: 'details.appDefinition.integrationSystems'
},
{
icon: 'question',
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',
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'
},
{
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 for 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',
validationError: 'Please provide a description',
description: 'Brief Description',
title: 'Description',
type: 'textbox'
},
{
icon: 'question',
required: true,
validationError: 'Please complete this section',
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,
validationError: 'Please complete this section',
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.',
description: '',
type: 'textbox',
fieldName: 'details.appDefinition.integrationSystems'
},
{
icon: 'question',
required: true,
validationError: 'Please complete this section',
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,
validationError: 'Please complete this section',
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'
}
]
}
]
1 change: 1 addition & 0 deletions src/config/projectSpecification/typeToSpecification.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"website_development": "app_dev.v1.0",
"application_development": "app_dev.v1.0",
"watson_chatbot": "ibm_chatbot.v1.0",
"generic_chatbot": "generic_chatbot.v1.0",
"generic_dev": "app_dev.v1.0",
"real_world_testing": "real_world_testing.v1.0",
"mobility_testing": "app_dev.v1.0",
Expand Down
17 changes: 12 additions & 5 deletions src/config/projectWizard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,22 @@ const products = {
},
Chatbot: {
icon: 'product-cat-chatbot',
info: 'Build a cognitive chat bot for your product',
info: 'Build, train and test a custom conversation for your chatbot',
question: 'What do you need to develop?',
id: 'chatbot',
hidden: true,
subtypes: {
'Watson Chatbot': {
brief: 'Watson Chatbot',
details: 'Build Chatbot using IBM Watson',
icon: 'product-chatbot-watson',
id: 'watson_chatbot',
hidden: true
},
Chatbot: {
brief: 'Chatbot',
details: 'Build, train and test a custom conversation for your chat bot',
icon: 'product-chatbot-chatbot',
id: 'watson_chatbot'
id: 'generic_chatbot'
}
}
},
Expand Down Expand Up @@ -196,12 +202,13 @@ export function findCategory(categoryId) {
return null
}

export function findProductsOfCategory(category) {
export function findProductsOfCategory(category, fetchHidden = true) {
for(const pType in products) {
if (products[pType].id === category) {
const ret = []
for(const prd in products[pType].subtypes) {
if (!products[pType].subtypes[prd].disabled) {
const product = products[pType].subtypes[prd]
if (!product.disabled && (fetchHidden || !product.hidden)) {
ret.push({ ...products[pType].subtypes[prd], name: prd })
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/projects/create/components/ProjectWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ProjectWizard extends Component {
updateProjectType(projectType) {
window.scrollTo(0, 0)
const { onStepChange, onProjectUpdate } = this.props
const products = findProductsOfCategory(projectType)
const products = findProductsOfCategory(projectType, false)
const updateQuery = { }
// restore common fields from dirty project
// this.restoreCommonDetails(products, updateQuery, detailsQuery)
Expand Down Expand Up @@ -287,7 +287,7 @@ class ProjectWizard extends Component {

handleStepChange(wizardStep) {
const { onStepChange } = this.props
const products = findProductsOfCategory(this.state.project.type)
const products = findProductsOfCategory(this.state.project.type, false)
// if project type has only one product, move one step back to select project type step
if (wizardStep === WZ_STEP_SELECT_PROD_TYPE && products && products.length === 1) {
wizardStep = WZ_STEP_SELECT_PROJ_TYPE
Expand Down
2 changes: 1 addition & 1 deletion src/projects/create/components/SelectProjectType.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function SelectProjectType(props) {
for (const key in config) {
const item = config[key]
const icon = <SVGIconImage filePath={item.icon} />
const products = findProductsOfCategory(item.id) || []
const products = findProductsOfCategory(item.id, false) || []
// don't render disabled items for selection
// don't render hidden items as well, hidden items can be reached via direct link though
if (item.disabled || item.hidden) continue
Expand Down