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

Commit 95cf692

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/dot-github/actions/conventional-pr/actions/core-1.9.1
2 parents 0b142e6 + 8628464 commit 95cf692

File tree

78 files changed

+2703
-1856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2703
-1856
lines changed

.config/tsaoptions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"azurePath": "Composer/Compliance",
3+
"notificationAliases": "[email protected]",
4+
"codebaseName": "TSABotFrameworkComposer",
5+
"ignoreBranchName": true
6+
}

Composer/packages/adaptive-flow/src/adaptive-flow-editor/AdaptiveFlowEditor.tsx

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,6 @@ const VisualDesigner: React.FC<VisualDesignerProps> = ({ onFocus, onBlur, schema
137137
editorEvent && handleEditorEvent(editorEvent.type, editorEvent.payload);
138138
};
139139

140-
const marqueeStyles = (_) => {
141-
return {
142-
root: {
143-
width: '100%',
144-
height: '100%',
145-
},
146-
};
147-
};
148140
return (
149141
<CacheProvider value={emotionCache}>
150142
<NodeRendererContext.Provider value={nodeContext}>
@@ -158,15 +150,15 @@ const VisualDesigner: React.FC<VisualDesignerProps> = ({ onFocus, onBlur, schema
158150
{...enableKeyboardCommandAttributes(handleCommand)}
159151
data-testid="visualdesigner-container"
160152
>
161-
<SelectionContext.Provider value={selectionContext}>
162-
<MarqueeSelection isDraggingConstrainedToRoot selection={selection} styles={marqueeStyles}>
163-
<FlowToolbar
164-
flowCommentsVisible={flowCommentsVisible}
165-
flowZoomRate={flowZoomRate}
166-
focusedId={focusedId}
167-
toggleFlowComments={toggleFlowComments}
168-
updateFlowZoomRate={updateFlowZoomRate}
169-
>
153+
<FlowToolbar
154+
flowCommentsVisible={flowCommentsVisible}
155+
flowZoomRate={flowZoomRate}
156+
focusedId={focusedId}
157+
toggleFlowComments={toggleFlowComments}
158+
updateFlowZoomRate={updateFlowZoomRate}
159+
>
160+
<SelectionContext.Provider value={selectionContext}>
161+
<MarqueeSelection isDraggingConstrainedToRoot selection={selection}>
170162
<div
171163
className="flow-editor-container"
172164
css={{
@@ -200,9 +192,9 @@ const VisualDesigner: React.FC<VisualDesignerProps> = ({ onFocus, onBlur, schema
200192
}}
201193
/>
202194
</div>
203-
</FlowToolbar>
204-
</MarqueeSelection>
205-
</SelectionContext.Provider>
195+
</MarqueeSelection>
196+
</SelectionContext.Provider>
197+
</FlowToolbar>
206198
</div>
207199
</SelfHostContext.Provider>
208200
</NodeRendererContext.Provider>

Composer/packages/client/src/recoilModel/dispatchers/__tests__/mocks/mockProjectResponse.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3085,7 +3085,7 @@
30853085
"title": "speak"
30863086
},
30873087
"inputHint": {
3088-
"description": "Indicates whether your bot is accepting,\nexpecting, or ignoring user input after the message is delivered to the client. Possible\nvalues include: 'acceptingInput', 'ignoringInput', 'expectingInput'",
3088+
"description": "Indicates whether your bot is accepting,\nexpecting, or ignoring user input after the message is delivered to the client. Possible\nvalues include: 'acceptingInput', 'ignoringInput', 'expectingInput', 'ignoringSpeechInput', 'ignoringNonSpeechInput'",
30893089
"type": "string",
30903090
"title": "inputHint"
30913091
},

Composer/packages/client/src/recoilModel/dispatchers/publisher.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ export const publisherDispatcher = () => {
102102
const { set, snapshot } = callbackHelpers;
103103
const { endpointURL, status, port } = data;
104104

105-
// remove job id in publish storage if published
106-
if (status === PUBLISH_SUCCESS || status === PUBLISH_FAILED) {
107-
const publishJobIds = publishStorage.get('jobIds') || {};
108-
delete publishJobIds[`${projectId}-${target.name}`];
109-
publishStorage.set('jobIds', publishJobIds);
110-
}
111105
// the action below only applies to when a bot is being started using the "start bot" button
112106
// a check should be added to this that ensures this ONLY applies to the "default" profile.
113107
if (target.name === defaultPublishConfig.name) {
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
const { ipcRenderer } = require('electron'); // eslint-disable-line
4+
const { ipcRenderer, contextBridge } = require('electron'); // eslint-disable-line
55

66
// expose ipcRenderer to the browser
7-
window.ipcRenderer = ipcRenderer;
7+
contextBridge.exposeInMainWorld('ipcRenderer', {
8+
send: (...args) => ipcRenderer.send(...args),
9+
on: (...args) => ipcRenderer.on(...args),
10+
});
11+
812
// flag to distinguish electron client from web app client
9-
window.__IS_ELECTRON__ = true;
13+
contextBridge.exposeInMainWorld('__IS_ELECTRON__', true);

Composer/packages/integration-tests/cypress/integration/LuisDeploy.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ context('Luis Deploy', () => {
3636
response: 'fixture:luPublish/success',
3737
});
3838
cy.findByTestId('startBotButton').click();
39-
cy.findByText(/^Starting bot../);
39+
cy.findAllByText(/^Starting bot../);
4040
cy.route('GET', '/api/publish/*/status/default', { endpointURL: 'anything', status: 200 });
4141
cy.route('PUT', '/api/projects/*/files/appsettings.json', { status: 200 });
4242
});

Composer/packages/integration-tests/cypress/support/commands.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
declare namespace Cypress {
77
interface Chainable {
8+
/**
9+
* Get CSRF token
10+
* @example cy.getCSRFToken().then(token => ...)
11+
*/
12+
getCSRFToken(): Chainable<string>;
813
/**
914
* Creates a bot based on empty bot.
1015
* @example cy.createBot('EmptySample', ()=> {})

Composer/packages/integration-tests/cypress/support/commands.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,49 @@ import '@testing-library/cypress/add-commands';
55

66
let TemplateBotProjectId = '';
77

8+
let csrfToken: string;
9+
10+
Cypress.Commands.add('getCSRFToken', () => {
11+
if (csrfToken) {
12+
return cy.wrap(csrfToken);
13+
}
14+
cy.visit('/');
15+
return cy
16+
.window()
17+
.its('__csrf__')
18+
.then((csrf) => {
19+
csrfToken = csrf;
20+
return csrf;
21+
});
22+
});
23+
24+
Cypress.Commands.overwrite('request', (originalFn, ...options) => {
25+
return cy.getCSRFToken().then((csrf) => {
26+
const headers = {
27+
'X-CSRF-Token': csrf,
28+
};
29+
30+
const optionsObject = options[0];
31+
32+
if (optionsObject === Object(optionsObject)) {
33+
optionsObject.headers = {
34+
...headers,
35+
...optionsObject.headers,
36+
};
37+
38+
return originalFn(optionsObject);
39+
}
40+
41+
const [method, url, body] = options;
42+
return originalFn({
43+
method,
44+
url,
45+
body,
46+
headers,
47+
});
48+
});
49+
});
50+
851
Cypress.Commands.add('createBot', (botName: string, callback?: (bot: any) => void) => {
952
const params = {
1053
description: '',
@@ -60,6 +103,7 @@ Cypress.Commands.add('createTestBot', (botName: string, callback?: (bot: any) =>
60103
storageId: 'default',
61104
};
62105

106+
cy.wrap(TemplateBotProjectId).should('not.be.empty');
63107
cy.request('post', `/api/projects/${TemplateBotProjectId}/project/saveAs`, params).then((res) => {
64108
callback?.(res.body);
65109
});

Composer/packages/integration-tests/cypress/support/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import './commands';
55

66
before(() => {
77
cy.exec('yarn clean-all');
8+
cy.getCSRFToken();
89
cy.createTemplateBot('EmptySample');
910
});
1011

Composer/packages/intellisense/src/hooks/useLanguageServer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export const useLanguageServer = (
5252
ws.current.onmessage = (messageText) => {
5353
handleMessage(messageText);
5454
};
55+
56+
return () => {
57+
ws.current.close();
58+
};
5559
}, [url]);
5660

5761
// If scopes change, update backend with info

0 commit comments

Comments
 (0)