From 8007843dd24088ea928e63fb3abd558dfb7bd953 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 17 Oct 2019 10:45:30 -0700 Subject: [PATCH 1/2] fix allow interruptions field --- .../src/Form/fields/PromptField/PromptSettings.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Composer/packages/extensions/obiformeditor/src/Form/fields/PromptField/PromptSettings.tsx b/Composer/packages/extensions/obiformeditor/src/Form/fields/PromptField/PromptSettings.tsx index 4b629c3da8..db9d382554 100644 --- a/Composer/packages/extensions/obiformeditor/src/Form/fields/PromptField/PromptSettings.tsx +++ b/Composer/packages/extensions/obiformeditor/src/Form/fields/PromptField/PromptSettings.tsx @@ -3,7 +3,7 @@ import { jsx } from '@emotion/core'; import formatMessage from 'format-message'; import { FieldProps } from '@bfcomposer/react-jsonschema-form'; -import { TextWidget, SelectWidget, CheckboxWidget } from '../../widgets'; +import { TextWidget, CheckboxWidget } from '../../widgets'; import { field, settingsFields, settingsFieldHalf, settingsFieldFull, settingsFieldInline } from './styles'; import { PromptFieldChangeHandler, GetSchema } from './types'; @@ -16,11 +16,6 @@ interface PromptSettingsrops extends FieldProps { export const PromptSettings: React.FC = props => { const { formData, idSchema, getSchema, onChange, errorSchema } = props; - const interruptionOptions = (getSchema('allowInterruptions').enum || []).map(o => ({ - label: o as string, - value: o as string, - })); - return (
@@ -46,7 +41,7 @@ export const PromptSettings: React.FC = props => { />
- = props => { label={formatMessage('Allow interruptions')} formContext={props.formContext} rawErrors={errorSchema.allowInterruptions && errorSchema.allowInterruptions.__errors} - options={{ enumOptions: interruptionOptions }} />
From c242893e681717541c6f46b39ae24e05f1327c71 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 17 Oct 2019 14:04:21 -0700 Subject: [PATCH 2/2] update allowInterruption schema to make it an expression --- Composer/packages/lib/shared/src/appschema.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Composer/packages/lib/shared/src/appschema.ts b/Composer/packages/lib/shared/src/appschema.ts index 2a788ebe5a..d586855f35 100644 --- a/Composer/packages/lib/shared/src/appschema.ts +++ b/Composer/packages/lib/shared/src/appschema.ts @@ -210,6 +210,7 @@ export const appschema: OBISchema = { examples: [false], }, allowInterruptions: { + $role: 'expression', type: 'string', title: 'Allow Interruptions', description: @@ -361,6 +362,7 @@ export const appschema: OBISchema = { examples: [false], }, allowInterruptions: { + $role: 'expression', type: 'string', title: 'Allow Interruptions', description: @@ -576,6 +578,7 @@ export const appschema: OBISchema = { examples: [false], }, allowInterruptions: { + $role: 'expression', type: 'string', title: 'Allow Interruptions', description: @@ -764,6 +767,7 @@ export const appschema: OBISchema = { examples: [false], }, allowInterruptions: { + $role: 'expression', type: 'string', title: 'Allow Interruptions', description: @@ -1814,6 +1818,7 @@ export const appschema: OBISchema = { examples: [false], }, allowInterruptions: { + $role: 'expression', type: 'string', title: 'Allow Interruptions', description: @@ -2805,6 +2810,7 @@ export const appschema: OBISchema = { examples: [false], }, allowInterruptions: { + $role: 'expression', type: 'string', title: 'Allow Interruptions', description: