Skip to content

Commit 946da5e

Browse files
authored
Merge branch 'main' into southworks/fix/alerts
2 parents 8f7e8f8 + d1d0d4d commit 946da5e

File tree

27 files changed

+120
-69
lines changed

27 files changed

+120
-69
lines changed

Composer/packages/adaptive-form/src/components/CollapseField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const styles = {
2929
display: flex;
3030
margin: 4px -18px;
3131
align-items: center;
32-
width: 100%;
32+
width: auto;
3333
`,
3434
};
3535

Composer/packages/client/src/components/Page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ const Page: React.FC<IPageProps> = (props) => {
187187
resetOnDoubleClick
188188
initialPrimarySize="20%"
189189
minPrimarySize="200px"
190-
minSecondarySize="800px"
190+
minSecondarySize="750px"
191191
renderSplitter={renderThinSplitter}
192192
onMeasuredSizesChanged={onMeasuredSizesChanged}
193193
>

Composer/packages/client/src/components/WebChat/WebChatPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { WebChatHeader } from './WebChatHeader';
2222
import { WebChatComposer } from './WebChatComposer';
2323
import { BotSecret, ChatData, RestartOption } from './types';
2424

25-
const BASEPATH = process.env.PUBLIC_URL || 'http://localhost:3000/';
25+
const BASEPATH = process.env.PUBLIC_URL || `http://${location.hostname}:3000/`;
2626
// TODO: Refactor to include Webchat header component as a part of WebchatComposer to avoid this variable.
2727
const webChatHeaderHeight = '85px';
2828

@@ -67,7 +67,7 @@ export const WebChatPanel: React.FC<WebChatPanelProps> = ({
6767
const conversationServerPort = await conversationService.setUpConversationServer();
6868
try {
6969
// set up Web Chat traffic listener
70-
webChatTrafficChannel.current = new WebSocket(`ws://localhost:${conversationServerPort}/ws/traffic`);
70+
webChatTrafficChannel.current = new WebSocket(`ws://${location.hostname}:${conversationServerPort}/ws/traffic`);
7171
if (webChatTrafficChannel.current) {
7272
webChatTrafficChannel.current.onmessage = (event) => {
7373
const data:

Composer/packages/client/src/components/WebChat/utils/conversationService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class ConversationService {
8080
secret,
8181
domain: `${this.directlineHostUrl}/v3/directline`,
8282
webSocket: true,
83-
streamUrl: `ws://localhost:${this.restServerForWSPort}/ws/conversation/${conversationId}`,
83+
streamUrl: `ws://${location.hostname}:${this.restServerForWSPort}/ws/conversation/${conversationId}`,
8484
});
8585
return directLine;
8686
}

Composer/packages/client/src/constants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ export const defaultTeamsManifest: TeamsManifest = {
527527
};
528528

529529
export const defaultBotPort = 3979;
530-
export const defaultBotEndpoint = `http://localhost:${defaultBotPort}/api/messages`;
530+
export const defaultBotEndpoint = `http://${location.hostname}:${defaultBotPort}/api/messages`;
531531

532532
const DAYS_IN_MS = 1000 * 60 * 60 * 24;
533533
export const SURVEY_PARAMETERS = {

Composer/packages/client/src/pages/botProject/adapters/ExternalAdapterSettings.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License.
33

44
/** @jsx jsx */
5-
import { jsx } from '@emotion/react';
5+
import { jsx, css } from '@emotion/react';
66
import { useState, Fragment } from 'react';
77
import formatMessage from 'format-message';
88
import { useRecoilValue } from 'recoil';
@@ -29,6 +29,10 @@ type Package = {
2929
packageName?: string;
3030
};
3131

32+
const tableOverflowStyle = css`
33+
overflow: hidden;
34+
`;
35+
3236
const ExternalAdapterSettings = (props: Props) => {
3337
const { projectId } = props;
3438

@@ -54,7 +58,7 @@ const ExternalAdapterSettings = (props: Props) => {
5458
if (schemaDefinitions == null) return null;
5559

5660
const externalServices = (schemas: (JSONSchema7 & Package)[]) => (
57-
<div role="table">
61+
<div css={tableOverflowStyle} role="table">
5862
<div css={tableHeaderRow} role="row">
5963
<div css={tableColumnHeader(columnSizes[0])} role="columnheader">
6064
{formatMessage('Name')}

Composer/packages/client/src/pages/design/DebugPanel/TabExtensions/RuntimeOutputLog/OutputTabContent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ export const OutputsTabContent: React.FC<DebugPanelTabHeaderProps> = ({ isActive
112112
>
113113
<Split
114114
resetOnDoubleClick
115-
initialPrimarySize="200px"
116-
minPrimarySize="250px"
117-
minSecondarySize="600px"
115+
initialPrimarySize="20%"
116+
minPrimarySize="200px"
117+
minSecondarySize="700px"
118118
renderSplitter={renderThinSplitter}
119119
splitterSize="5px"
120120
>

Composer/packages/client/src/pages/design/DesignPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const DesignPage: React.FC<RouteComponentProps<{ dialogId: string; projectId: st
4747
resetOnDoubleClick
4848
initialPrimarySize="20%"
4949
minPrimarySize="200px"
50-
minSecondarySize="800px"
50+
minSecondarySize="750px"
5151
renderSplitter={renderThinSplitter}
5252
splitterSize="5px"
5353
onMeasuredSizesChanged={onMeasuredSizesChanged}
@@ -67,8 +67,8 @@ const DesignPage: React.FC<RouteComponentProps<{ dialogId: string; projectId: st
6767
<Split
6868
resetOnDoubleClick
6969
initialPrimarySize="65%"
70-
minPrimarySize="500px"
71-
minSecondarySize="350px"
70+
minPrimarySize="450px"
71+
minSecondarySize="300px"
7272
renderSplitter={renderThinSplitter}
7373
>
7474
<VisualPanel projectId={activeBot} />

Composer/packages/client/src/pages/design/styles.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ export const splitPaneWrapper = css`
7676
flex-grow: 1;
7777
overflow: hidden;
7878
height: 100%;
79-
@media screen and (max-width: 1080px) {
80-
.secondary {
81-
padding-right: 40px;
82-
}
83-
}
8479
`;
8580

8681
export const visualPanel = css`

Composer/packages/client/src/pages/form-dialog/FormDialogPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const FormDialogPage: React.FC<Props> = React.memo((props: Props) => {
198198
resetOnDoubleClick
199199
initialPrimarySize="320px"
200200
minPrimarySize="320px"
201-
minSecondarySize="800px"
201+
minSecondarySize="630px"
202202
renderSplitter={renderThinSplitter}
203203
onMeasuredSizesChanged={onMeasuredSizesChanged}
204204
>

Composer/packages/client/src/pages/home/styles.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,18 @@ export const leftPage = css`
2929
padding: 0 24px 24px 24px;
3030
display: flex;
3131
flex-direction: column;
32+
max-width: 100%;
33+
overflow: hidden;
3234
`;
3335

3436
export const rightPage = css`
3537
flex: 1;
3638
padding-right: 24px;
3739
display: flex;
3840
flex-direction: column;
39-
position: sticky;
40-
left: 0;
41+
@media (max-width: 1024px) {
42+
flex: 50%;
43+
}
4144
`;
4245

4346
export const title = css`
@@ -64,6 +67,9 @@ export const introduction = css`
6467
export const rowContainer = css`
6568
display: flex;
6669
margin-top: 12px;
70+
overflow-x: auto;
71+
padding-bottom: 12px;
72+
gap: 12px;
6773
`;
6874

6975
export const recentBotsContainer = css`
@@ -88,9 +94,11 @@ export const pivotContainer = css`
8894
`;
8995

9096
export const tabRowContainer = css`
91-
flex-wrap: wrap;
9297
display: flex;
9398
clear: both;
99+
overflow-x: auto;
100+
padding-bottom: 12px;
101+
gap: 12px;
94102
`;
95103

96104
export const tabRowViewMore = css`
@@ -109,7 +117,8 @@ export const tabRowViewMore = css`
109117

110118
export const cardWrapper = css`
111119
display: flex;
112-
margin-right: 12px;
120+
flex-basis: 25%;
121+
min-width: ${ImageCoverWidth}px;
113122
`;
114123

115124
export const itemContainerWrapper = (disabled?: boolean) => css`
@@ -188,16 +197,7 @@ export const newsDescription = css`
188197
export const cardItem = {
189198
container: css`
190199
font-size: ${fonts.medium.fontSize};
191-
margin: 12px 0 0 12px;
192-
&:first-child {
193-
margin-left: 0;
194-
}
195200
padding: 12px;
196-
min-width: ${ImageCoverWidth}px;
197-
width: 17vw;
198-
@media (max-width: 1416px) {
199-
width: 20vw;
200-
}
201201
text-align: left;
202202
border: 1px #efedeb solid;
203203
box-shadow: ${Depths.depth4};
@@ -329,9 +329,8 @@ export const whatsNewsContainer = css`
329329
border-radius: 5px;
330330
margin: 20px 0 24px 0;
331331
background: #f6f6f6;
332-
@media (max-width: 1416px) {
332+
@media (max-width: 1024px) {
333333
background: none;
334-
min-width: 200px;
335334
margin: 15px 0 0 0;
336335
}
337336
`;

Composer/packages/client/src/pages/publish/Publish.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Licensed under the MIT License.
33

44
/** @jsx jsx */
5-
import { jsx } from '@emotion/react';
6-
import { useState, useEffect, useMemo, Fragment, useRef } from 'react';
5+
import { jsx, css } from '@emotion/react';
6+
import { useState, useEffect, useMemo, useRef } from 'react';
77
import { navigate, RouteComponentProps } from '@reach/router';
88
import formatMessage from 'format-message';
99
import { useRecoilValue } from 'recoil';
@@ -55,6 +55,19 @@ const SKILL_PUBLISH_STATUS = {
5555
PUBLISHED: 'published',
5656
CANCEL: 'cancel',
5757
};
58+
59+
const publishContainerStyle = css`
60+
display: flex;
61+
flex-flow: column nowrap;
62+
height: calc(100% - 1px);
63+
`;
64+
65+
const publishPivotStyle = css`
66+
flex: auto;
67+
display: flex;
68+
flex-flow: column nowrap;
69+
`;
70+
5871
const Publish: React.FC<RouteComponentProps<{ projectId: string; targetName?: string }>> = (props) => {
5972
const { projectId = '' } = props;
6073
const botProjectData = useRecoilValue(localBotsDataSelector);
@@ -425,7 +438,7 @@ const Publish: React.FC<RouteComponentProps<{ projectId: string; targetName?: st
425438
};
426439

427440
return (
428-
<Fragment>
441+
<div css={publishContainerStyle}>
429442
{publishDialogVisible && (
430443
<PublishDialog
431444
items={selectedBots.filter((bot) => !!bot.publishTarget)}
@@ -461,8 +474,9 @@ const Publish: React.FC<RouteComponentProps<{ projectId: string; targetName?: st
461474
</div>
462475

463476
<Pivot
477+
css={publishPivotStyle}
464478
selectedKey={activeTab}
465-
styles={{ root: { marginLeft: 12 } }}
479+
styles={{ root: { marginLeft: 12 }, itemContainer: { flex: 'auto', '> div': { height: '100%' } } }}
466480
onLinkClick={(link) => {
467481
setActiveTab(link?.props?.itemKey || '');
468482
if (link?.props.itemKey) {
@@ -488,7 +502,7 @@ const Publish: React.FC<RouteComponentProps<{ projectId: string; targetName?: st
488502
</div>
489503
</PivotItem>
490504
<PivotItem headerText={formatMessage('Publishing profile')} itemKey={'addNewPublishProfile'}>
491-
<Stack horizontal verticalFill styles={{ root: { borderTop: '1px solid #CCC' } }}>
505+
<Stack horizontal verticalFill styles={{ root: { borderTop: '1px solid #CCC', height: '100%' } }}>
492506
{botProjectData && botProjectData.length > 1 && (
493507
<Stack.Item styles={{ root: { width: '175px', borderRight: '1px solid #CCC' } }}>
494508
<ProjectList
@@ -504,7 +518,7 @@ const Publish: React.FC<RouteComponentProps<{ projectId: string; targetName?: st
504518
</Stack>
505519
</PivotItem>
506520
</Pivot>
507-
</Fragment>
521+
</div>
508522
);
509523
};
510524

Composer/packages/client/src/pages/setting/SettingsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const pageWrapper = css`
3737
overflow: auto;
3838
height: 100%;
3939
> div {
40-
min-width: 1030px;
40+
min-width: 960px;
4141
min-height: 400px;
4242
}
4343
`;

Composer/packages/client/src/router.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const projectWrapper = css`
174174

175175
const projectStyle = css`
176176
flex: auto;
177-
min-width: 1030px;
177+
min-width: 960px;
178178
min-height: 400px;
179179
180180
& > div {

Composer/packages/electron-server/locales/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@
122122
"zoom_out_dc7d60d2": {
123123
"message": "Zoom Out"
124124
}
125-
}
125+
}

Composer/packages/electron-server/src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ const waitForMainWindowToShow = new Promise((resolve) => {
4141

4242
// webpack dev server runs on :3000
4343
const getBaseUrl = () => {
44+
const host = process.env.COMPOSER_HOST ?? 'localhost';
4445
if (isDevelopment) {
45-
return 'http://localhost:3000/';
46+
return `http://${host}:3000/`;
4647
}
4748
if (!serverPort) {
4849
throw new Error('getBaseUrl() called before serverPort is defined.');
4950
}
50-
return `http://localhost:${serverPort}/`;
51+
return `http://${host}:${serverPort}/`;
5152
};
5253

5354
// set production flag

Composer/packages/server/src/controllers/publisher.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import AssetService from '../services/asset';
1515
import logger from '../logger';
1616
import { LocationRef } from '../models/bot/interface';
1717
import { TelemetryService } from '../services/telemetry';
18+
import { serverListenHost, serverHostname } from '../settings/env';
1819

1920
const log = logger.extend('publisher-controller');
2021

@@ -318,7 +319,7 @@ export const PublishController = {
318319
const pluginMethod = ExtensionContext.extensions.publish[extensionName].methods.setupRuntimeLogServer;
319320
if (typeof pluginMethod === 'function') {
320321
try {
321-
const runtimeLogUrl = await pluginMethod.call(null, projectId);
322+
const runtimeLogUrl = await pluginMethod.call(null, projectId, serverHostname, serverListenHost);
322323
return res.status(200).send(runtimeLogUrl);
323324
} catch (ex) {
324325
res.status(400).json({

Composer/packages/server/src/directline/store/dlServerState.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4+
import { serverHostname } from '../../settings/env';
5+
46
import { BotEndpoint } from './entities/botEndpoint';
57
import { Attachments } from './entities/attachments';
68
import { ConversationSet } from './entities/conversationSet';
@@ -27,7 +29,7 @@ class DLServerContext {
2729
conversations: new ConversationSet(),
2830
endpoints: new EndpointSet(),
2931
attachments: new Attachments(),
30-
serviceUrl: serverPort ? `http://localhost:${serverPort}` : '',
32+
serviceUrl: serverPort ? `http://${serverHostname}:${serverPort}` : '',
3133
dispatchers: {
3234
getDefaultEndpoint: this.getDefaultEndpoint,
3335
updateConversation: this.updateConversation,

Composer/packages/server/src/directline/utils/webSocketServer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
ConversationNetworkTrafficItem,
1414
} from '@botframework-composer/types';
1515

16+
import { serverListenHost } from '../../settings/env';
17+
1618
import log from './logger';
1719

1820
const socketTrafficChannelKey = 'DL_TRAFFIC_SOCKET';
@@ -87,7 +89,7 @@ export class WebSocketServer {
8789
});
8890
this.port = port;
8991
log(`Using ${port} port for directline`);
90-
this.restServer.listen(port);
92+
this.restServer.listen(port, serverListenHost);
9193

9294
app.use('/ws/conversation/:conversationId', (req: express.Request, res: express.Response) => {
9395
if (!(req as any).claimUpgrade) {

0 commit comments

Comments
 (0)