Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit cccbd86

Browse files
author
Srinaath Ravichandran
committed
Merge branch 'main' of https://github.com/microsoft/BotFramework-Composer into release/2.1.0
2 parents 3951352 + 3eeeccc commit cccbd86

File tree

7 files changed

+39
-75
lines changed

7 files changed

+39
-75
lines changed

Composer/packages/server/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
"ts-node": "^8.4.1"
6767
},
6868
"dependencies": {
69-
"@apidevtools/json-schema-ref-parser": "^9.0.9",
7069
"@azure/cognitiveservices-qnamaker": "^3.2.0",
7170
"@bfc/client": "*",
7271
"@bfc/extension": "*",

Composer/packages/server/src/models/bot/botProject.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { DefaultSettingManager } from '../settings/defaultSettingManager';
3232
import log from '../../logger';
3333
import { BotProjectService } from '../../services/project';
3434
import AssetService from '../../services/asset';
35-
import { bundleSchema } from '../utilities/bundleSchema';
3635

3736
import {
3837
BotStructureFilesPatterns,
@@ -203,8 +202,6 @@ export class BotProject implements IBotProject {
203202
this.settings = await this.getEnvSettings(false);
204203
this.files = await this._getFiles();
205204
this.readme = await this._getReadme();
206-
207-
await this._bundleSchemas();
208205
};
209206

210207
public getProject = () => {
@@ -1105,25 +1102,4 @@ export class BotProject implements IBotProject {
11051102
}
11061103
}
11071104
};
1108-
1109-
private _bundleSchemas = async () => {
1110-
const schemas: FileInfo[] = [];
1111-
this.files.forEach((file) => {
1112-
if (file.name.endsWith('.schema')) {
1113-
schemas.push(file);
1114-
}
1115-
});
1116-
1117-
debug('Bundling %d schemas.', schemas.length);
1118-
1119-
await Promise.all(
1120-
schemas.map(async (s) => {
1121-
const bundled = await bundleSchema(s.path);
1122-
1123-
if (bundled) {
1124-
s.content = bundled;
1125-
}
1126-
})
1127-
);
1128-
};
11291105
}

Composer/packages/server/src/models/utilities/bundleSchema.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

Composer/packages/ui-plugins/luis/src/LuisIntentEditor.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ const LuisIntentEditor: React.FC<FieldProps<string>> = (props) => {
8383
return;
8484
}
8585

86+
if (newValue === placeholder || newValue === inlineModePlaceholder) return;
87+
8688
const newIntent = { Name: intentName, Body: newValue };
8789
shellApi
8890
.debouncedUpdateLuIntent(luIntent?.fileId ?? luFile.id, intentName, newIntent)

Composer/packages/ui-plugins/schema-editor/src/Fields/ValueRefField.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ import { valueTypeDefinitions } from '../schema';
1111

1212
export const ValueRefField: React.FC<FieldProps> = ({ description, id, label, value, required, onChange }) => {
1313
const options = useMemo<IDropdownOption[]>(() => {
14-
return Object.entries(valueTypeDefinitions || {})
15-
.filter(([key]) => key !== 'equalsExpression') // a value must be a type, not just an expression
16-
.map(([key, value]) => ({
17-
key: `#/definitions/${key}`,
18-
text: value?.title || startCase(key),
19-
}));
14+
return Object.entries(valueTypeDefinitions || {}).map(([key, value]) => ({
15+
key: `#/definitions/${key}`,
16+
text: value?.title || startCase(key),
17+
}));
2018
}, []);
2119

2220
const handleChange = (_: React.FormEvent<HTMLDivElement>, option?: IDropdownOption) => {

Composer/packages/ui-plugins/schema-editor/src/schema.ts

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ export const schema = (): JSONSchema7 => ({
5252
});
5353

5454
export const valueTypeDefinitions: { [key: string]: JSONSchema7 } = {
55+
expression: {
56+
$role: 'expression',
57+
type: 'string',
58+
title: formatMessage('Expression'),
59+
description: formatMessage('Expression to evaluate.'),
60+
pattern: '^.*\\S.*',
61+
examples: ['user.age > 13'],
62+
},
5563
equalsExpression: {
5664
$role: 'expression',
5765
type: 'string',
@@ -60,9 +68,26 @@ export const valueTypeDefinitions: { [key: string]: JSONSchema7 } = {
6068
pattern: '^=.*\\S.*',
6169
examples: ['=user.name'],
6270
},
71+
condition: {
72+
$role: 'expression',
73+
title: formatMessage('Boolean condition'),
74+
description: formatMessage('Boolean constant or expression to evaluate.'),
75+
oneOf: [
76+
{
77+
$ref: '#/definitions/expression',
78+
},
79+
{
80+
type: 'boolean',
81+
title: formatMessage('Boolean'),
82+
description: formatMessage('Boolean value.'),
83+
default: true,
84+
examples: [false],
85+
},
86+
],
87+
},
6388
booleanExpression: {
6489
$role: 'expression',
65-
title: formatMessage('Boolean'),
90+
title: formatMessage('Boolean or expression'),
6691
description: formatMessage('Boolean constant or expression to evaluate.'),
6792
oneOf: [
6893
{
@@ -80,7 +105,7 @@ export const valueTypeDefinitions: { [key: string]: JSONSchema7 } = {
80105
},
81106
numberExpression: {
82107
$role: 'expression',
83-
title: formatMessage('Number'),
108+
title: formatMessage('Number or expression'),
84109
description: formatMessage('Number constant or expression to evaluate.'),
85110
oneOf: [
86111
{
@@ -98,7 +123,7 @@ export const valueTypeDefinitions: { [key: string]: JSONSchema7 } = {
98123
},
99124
integerExpression: {
100125
$role: 'expression',
101-
title: formatMessage('Integer'),
126+
title: formatMessage('Integer or expression'),
102127
description: formatMessage('Integer constant or expression to evaluate.'),
103128
oneOf: [
104129
{
@@ -116,7 +141,7 @@ export const valueTypeDefinitions: { [key: string]: JSONSchema7 } = {
116141
},
117142
stringExpression: {
118143
$role: 'expression',
119-
title: formatMessage('String'),
144+
title: formatMessage('String or expression'),
120145
description: formatMessage('Interpolated string or expression to evaluate.'),
121146
oneOf: [
122147
{
@@ -134,7 +159,7 @@ export const valueTypeDefinitions: { [key: string]: JSONSchema7 } = {
134159
},
135160
arrayExpression: {
136161
$role: 'expression',
137-
title: formatMessage('Array'),
162+
title: formatMessage('Array or expression'),
138163
description: formatMessage('Array or expression to evaluate.'),
139164
oneOf: [
140165
{
@@ -149,7 +174,7 @@ export const valueTypeDefinitions: { [key: string]: JSONSchema7 } = {
149174
},
150175
objectExpression: {
151176
$role: 'expression',
152-
title: formatMessage('Object'),
177+
title: formatMessage('Object or expression'),
153178
description: formatMessage('Object or expression to evaluate.'),
154179
oneOf: [
155180
{
@@ -164,7 +189,7 @@ export const valueTypeDefinitions: { [key: string]: JSONSchema7 } = {
164189
},
165190
valueExpression: {
166191
$role: 'expression',
167-
title: formatMessage('Any'),
192+
title: formatMessage('Any or expression'),
168193
description: formatMessage('Any constant or expression to evaluate.'),
169194
oneOf: [
170195
{

Composer/yarn.lock

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@
3030
call-me-maybe "^1.0.1"
3131
js-yaml "^3.13.1"
3232

33-
"@apidevtools/json-schema-ref-parser@^9.0.9":
34-
version "9.0.9"
35-
resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#d720f9256e3609621280584f2b47ae165359268b"
36-
integrity sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==
37-
dependencies:
38-
"@jsdevtools/ono" "^7.1.3"
39-
"@types/json-schema" "^7.0.6"
40-
call-me-maybe "^1.0.1"
41-
js-yaml "^4.1.0"
42-
4333
"@apidevtools/openapi-schemas@^2.0.4":
4434
version "2.1.0"
4535
resolved "https://botbuilder.myget.org/F/botframework-cli/npm/@apidevtools/openapi-schemas/-/@apidevtools/openapi-schemas-2.1.0.tgz#9fa08017fb59d80538812f03fc7cac5992caaa17"
@@ -5330,7 +5320,7 @@
53305320
jest-diff "^26.0.0"
53315321
pretty-format "^26.0.0"
53325322

5333-
"@types/json-schema@*", "@types/json-schema@^7.0.6":
5323+
"@types/json-schema@*":
53345324
version "7.0.7"
53355325
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
53365326
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
@@ -15575,13 +15565,6 @@ js-yaml@^3.13.1:
1557515565
argparse "^1.0.7"
1557615566
esprima "^4.0.0"
1557715567

15578-
js-yaml@^4.1.0:
15579-
version "4.1.0"
15580-
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
15581-
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
15582-
dependencies:
15583-
argparse "^2.0.1"
15584-
1558515568
jsbn@~0.1.0:
1558615569
version "0.1.1"
1558715570
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"

0 commit comments

Comments
 (0)