Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrown authored Oct 13, 2021
2 parents 0b5dbbb + 55a432d commit 3bca958
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Composer/packages/electron-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@bfc/electron-server",
"license": "MIT",
"author": "Microsoft Corporation",
"version": "2.1.0",
"version": "2.1.1",
"description": "Electron wrapper around Composer that launches Composer as a desktop application.",
"main": "./build/main.js",
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const { log } = require('./common');
*/

let packageName = null;
const packageVersion = process.env.ONEAUTH_VERSION || '1.15.0';
const packageVersion = process.env.ONEAUTH_VERSION || '1.36.0';

switch (process.platform) {
case 'darwin':
Expand Down
55 changes: 31 additions & 24 deletions Composer/packages/lib/code-editor/src/JsonEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,40 @@ const JsonEditor: React.FC<JsonEditorProps> = (props) => {

const onInit: OnInit = (monaco) => {
const disposable = monaco.editor.onDidCreateModel((model) => {
const diagnosticOptions: any = {
validate: true,
enableSchemaRequest: true,
};
try {
const diagnosticOptions: any = {
validate: true,
enableSchemaRequest: true,
};

if (schema) {
const uri = typeof schema === 'object' ? btoa(JSON.stringify(schema)) : schema;
const otherSchemas = monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas || [];
const currentSchema = otherSchemas.find((s) => s.uri === uri);
if (schema) {
const uri =
typeof schema === 'object'
? URL.createObjectURL(new Blob([JSON.stringify(schema)], { type: 'application/json' }))
: schema;
const otherSchemas = monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas || [];
const currentSchema = otherSchemas.find((s) => s.uri === uri);

/**
* Because we mutate the global language settings, we need to
* add new schemas / new models to existing schemas.
* This lets us have multiple editors active using different schemas
* by taking advantage of the `fileMatch` property + the model's uri.
*/
diagnosticOptions.schemas = [
...otherSchemas.filter((s) => s.uri !== uri),
{
uri,
schema: typeof schema === 'object' ? schema : undefined,
fileMatch: [...(currentSchema?.fileMatch || []), model.uri.toString()],
},
];
}
/**
* Because we mutate the global language settings, we need to
* add new schemas / new models to existing schemas.
* This lets us have multiple editors active using different schemas
* by taking advantage of the `fileMatch` property + the model's uri.
*/
diagnosticOptions.schemas = [
...otherSchemas.filter((s) => s.uri !== uri),
{
uri,
schema: typeof schema === 'object' ? schema : undefined,
fileMatch: [...(currentSchema?.fileMatch || []), model.uri.toString()],
},
];
}

monaco.languages.json.jsonDefaults.setDiagnosticsOptions(diagnosticOptions);
monaco.languages.json.jsonDefaults.setDiagnosticsOptions(diagnosticOptions);
} catch (_err) {
// don't worry if we aren't able to set the schema
}

if (disposable) {
// only do this once per model being created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ export const checkExpression = (exp: any, required: boolean, types: number[]): n
break;
}
case 'string': {
returnType = checkStringExpression(exp, types.length === 1 && types[0] === ReturnType.String);
returnType = checkStringExpression(
exp,
types.some((type) => type & ReturnType.String)
);
break;
}
default:
Expand Down
22 changes: 21 additions & 1 deletion extensions/azurePublish/src/node/luisAndQnA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ async function getFiles(dir: string): Promise<string[]> {
return files;
}

const extractLuisErrorData = (err) => {
let errorMsg = '';
if (err.response?.data) {
errorMsg = `Response Status: ${err.response.status || 'Unknown'}; `;
if (err.response.data.error) {
errorMsg =
errorMsg +
`Error Code: ${err.response.data.error.code || 'Unknown'}; Error Message: ${
err.response.data.error.message || 'Unknown'
} `;
}
}
return errorMsg;
};

export async function publishLuisToPrediction(
name: string,
environment: string,
Expand Down Expand Up @@ -191,8 +206,13 @@ export async function publishLuisToPrediction(
);
}
}

const luisError = extractLuisErrorData(err);
const luisDebugInfo = `Luis App ID: ${luisAppId}; Luis Authoring Key: ${luisAuthoringKey}; AzureSubscriptionID: ${account.AzureSubscriptionId} ResourceGroup: ${account.ResourceGroup}; AccountName: ${account.AccountName}; Location: ${account.Location}`;
throw Error(
'Failed to bind luis prediction resource to luis applications. Please check if your luisResource is set to luis prediction service name in your publish profile.'
`Failed to bind luis prediction resource to luis applications. Please check if your luisResource is set to luis prediction service name in your publish profile.
${luisDebugInfo}.
${luisError}`
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/azurePublish/src/node/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const schema: JSONSchema7 = {
required: ['MicrosoftAppId', 'MicrosoftAppPassword'],
},
},
required: ['subscriptionID', 'publishName', 'provision'],
required: ['subscriptionId', 'name', 'settings', 'accessToken'],
default: {
name: '<unique name in your subscription>',
environment: 'dev',
Expand Down
27 changes: 27 additions & 0 deletions releases/2.1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 2.1.1

## Changelog

#### Added

- feat: Add ability to configure template feed ([#8553](https://github.com/microsoft/BotFramework-Composer/pull/8553)) ([@pavolum](https://github.com/pavolum))
- feat: support remote $refs in dialog schema. ([#8456](https://github.com/microsoft/BotFramework-Composer/pull/8456)) ([@a-b-r-o-w-n](https://github.com/a-b-r-o-w-n))
- Added support to import / publish flows for PVA GCC High env ([#8554](https://github.com/microsoft/BotFramework-Composer/pull/8554)) ([@tonyanziano](https://github.com/tonyanziano

#### Fixed

- fix: Add null check to avoid asserting on undefined process obj ([#8587](https://github.com/microsoft/BotFramework-Composer/pull/8587)) ([@pavolum](https://github.com/pavolum))
- fix: <Dropdown/> syntax error in form editor ([#8560](https://github.com/microsoft/BotFramework-Composer/pull/8560)) ([@lei9444](https://github.com/lei9444))
- fix: Update Orchestrator core and extensions Tar dependency to 6.1.6 ([#8537](https://github.com/microsoft/BotFramework-Composer/pull/8537)) ([@taicchoumsft](https://github.com/taicchoumsft))
- Issue 8427: give the qna maker service plan a unique name ([#8581](https://github.com/microsoft/BotFramework-Composer/pull/8581)) Natalie Garcia
- Fix bug where enumerations were not displayed. ([#8628](https://github.com/microsoft/BotFramework-Composer/pull/8628)) ([@chrimc62](https://github.com/chrimc62))
- fix #8188 - protect against missing field in npm feeds ([#8478](https://github.com/microsoft/BotFramework-Composer/pull/8478)) ([@benbrown](https://github.com/benbrown))
- Issue 8489: fix how we form the publishEndpoint. Check for undefined or empty scmHostDomain value. ([#8532](https://github.com/microsoft/BotFramework-Composer/pull/8532)) Natalie Garcia
- initial set endpoints: [] ([#8486](https://github.com/microsoft/BotFramework-Composer/pull/8486)) ([@alanlong9278](https://github.com/alanlong9278)

#### Other

- chore: add select all to select intents modal ([#8451](https://github.com/microsoft/BotFramework-Composer/pull/8451)) ([@alanlong9278](https://github.com/alanlong9278))
- docs: add ui schema documentation and examples ([#8440](https://github.com/microsoft/BotFramework-Composer/pull/8440)) ([@a-b-r-o-w-n](https://github.com/a-b-r-o-w-n))
- chore: Use check box to select items ux ([#7963](https://github.com/microsoft/BotFramework-Composer/pull/7963)) ([@alanlong9278](https://github.com/alanlong9278))
- Update CODEOWNERS ([#8619](https://github.com/microsoft/BotFramework-Composer/pull/8619)) ([@GeoffCoxMSFT](https://github.com/GeoffCoxMSFT)

0 comments on commit 3bca958

Please sign in to comment.