Skip to content

Commit

Permalink
Merge branch 'qika/skill' into julong/skill
Browse files Browse the repository at this point in the history
* qika/skill:
  tooltip
  fix: bot can't start or publish by cleaning unused code (#6816)
  fix: make composer support https proxy (#6766)
  • Loading branch information
alanlong9278 committed Apr 9, 2021
2 parents 313b668 + b57aac1 commit bc430c7
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 63 deletions.
37 changes: 24 additions & 13 deletions Composer/packages/client/src/pages/publish/BotStatusList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { ApiStatus } from '../../utils/publishStatusPollingUpdater';
import { PublishStatusList } from './PublishStatusList';
import { detailList, listRoot, tableView } from './styles';
import { BotPublishHistory, BotStatus } from './type';
import { TooltipHost } from 'office-ui-fabric-react/lib/Tooltip';
import { flexContentSpaceBetween } from '../language-understanding/styles';

const copiedCalloutStyles = {
root: {
Expand All @@ -32,25 +34,34 @@ const copiedCalloutStyles = {
};

type SkillManifestUrlFieldProps = {
url: string;
urls: string[];
};

const SkillManifestUrlField = ({ url }: SkillManifestUrlFieldProps) => {
const { isCopiedToClipboard, copyTextToClipboard, resetIsCopiedToClipboard } = useCopyToClipboard(url);
const SkillManifestUrlField = ({ urls }: SkillManifestUrlFieldProps) => {
const { isCopiedToClipboard, copyTextToClipboard, resetIsCopiedToClipboard } = useCopyToClipboard(urls[0]);

const calloutTarget = useRef<HTMLElement>();
return (
<Fragment>
<ActionButton
className="skill-manifest-copy-button"
title={url}
onClick={(e) => {
calloutTarget.current = e.target as HTMLElement;
copyTextToClipboard();
}}
<TooltipHost
content={urls.map((url) => (
<div key={url} style={{ display: 'flex' }}>
{url}
<IconButton iconProps={{ iconName: 'copy' }} onClick={() => navigator.clipboard.writeText(url)} />
</div>
))}
>
{formatMessage('Copy Skill Manifest URL')}
</ActionButton>
<ActionButton
className="skill-manifest-copy-button"
title={urls[0]}
onClick={(e) => {
calloutTarget.current = e.target as HTMLElement;
copyTextToClipboard();
}}
>
{formatMessage('Copy Skill Manifest URL')}
</ActionButton>
</TooltipHost>
{isCopiedToClipboard && (
<Callout
setInitialFocus
Expand Down Expand Up @@ -298,7 +309,7 @@ export const BotStatusList: React.FC<BotStatusListProps> = ({
maxWidth: 150,
data: 'string',
onRender: (item: BotStatus) => {
return item?.skillManifestUrl && <SkillManifestUrlField url={item.skillManifestUrl} />;
return item?.skillManifestUrls.length > 0 && <SkillManifestUrlField urls={item.skillManifestUrls} />;
},
isPadded: true,
},
Expand Down
11 changes: 6 additions & 5 deletions Composer/packages/client/src/pages/publish/publishPageUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ export const generateBotPropertyData = (botProjectData: BotProjectType[]) => {
return { botPropertyData, botList };
};

const findSkillManifestUrl = (skillManifests: SkillManifestFile[], hostname: string, appId: string) => {
const findSkillManifestUrl = (skillManifests: SkillManifestFile[], hostname: string, appId: string): string[] => {
const urls: string[] = [];
for (const skillManifest of skillManifests || []) {
for (const endpoint of skillManifest?.content?.endpoints || []) {
if (endpoint?.msAppId === appId) {
return `https://${hostname}.azurewebsites.net/manifests/${skillManifest.id}.json`;
urls.push(`https://${hostname}.azurewebsites.net/manifests/${skillManifest.id}.json`);
}
}
}

return undefined;
return urls;
};

export const generateBotStatusList = (
Expand All @@ -49,7 +50,7 @@ export const generateBotStatusList = (
botPublishHistoryList: BotPublishHistory
): BotStatus[] => {
const bots = botList.map((bot) => {
const botStatus: BotStatus = Object.assign({}, bot);
const botStatus: BotStatus = Object.assign({ skillManifestUrls: [] }, bot);
const publishTargets: PublishTarget[] = botPropertyData[bot.id].publishTargets;
const publishHistory = botPublishHistoryList[bot.id];
if (publishTargets.length > 0 && botStatus.publishTarget && publishHistory) {
Expand All @@ -67,7 +68,7 @@ export const generateBotStatusList = (
const config = JSON.parse(currentPublishTarget.configuration);
const appId = config?.settings?.MicrosoftAppId;
if (appId) {
botStatus.skillManifestUrl = findSkillManifestUrl(
botStatus.skillManifestUrls = findSkillManifestUrl(
botPropertyData[bot.id].skillManifests,
config.hostname,
appId
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/client/src/pages/publish/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type BotStatus = {
/**
* The skill manifest URL associated with the current publishTarget.
*/
skillManifestUrl?: string;
skillManifestUrls: string[];
};

export type Bot = {
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/indexers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"rimraf": "^2.6.3"
},
"dependencies": {
"@microsoft/bf-lu": "4.12.0-rc0",
"@microsoft/bf-lu": "4.14.0-dev.20210408.1a5070e",
"adaptive-expressions": "4.12.0-rc1",
"botbuilder-lg": "4.12.0-rc1",
"lodash": "^4.17.19"
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@microsoft/bf-dialog": "4.11.0-dev.20201025.69cf2b9",
"@microsoft/bf-dispatcher": "^4.11.0-beta.20201016.393c6b2",
"@microsoft/bf-generate-library": "^4.10.0-daily.20210317.224602",
"@microsoft/bf-lu": "4.12.0-rc0",
"@microsoft/bf-lu": "4.14.0-dev.20210408.1a5070e",
"@microsoft/bf-orchestrator": "4.13.0-rc0",
"applicationinsights": "^1.8.7",
"archiver": "^5.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@bfc/indexers": "*",
"@bfc/shared": "*",
"@microsoft/bf-cli-command": "^4.11.1",
"@microsoft/bf-lu": "4.12.0-rc0",
"@microsoft/bf-lu": "4.14.0-dev.20210408.1a5070e",
"express": "^4.15.2",
"monaco-languageclient": "^0.10.0",
"normalize-url": "^2.0.1",
Expand Down
29 changes: 18 additions & 11 deletions Composer/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4057,10 +4057,10 @@
seedrandom "~3.0.5"
swagger-parser "^8.0.4"

"@microsoft/bf-lu@4.12.0-rc0":
version "4.12.0-rc0"
resolved "https://registry.yarnpkg.com/@microsoft/bf-lu/-/bf-lu-4.12.0-rc0.tgz#9c1aa4cb7d22a0a49d4c16eb1bce5d5e222c40b1"
integrity sha512-bz5BPQsIh+BwXZ+YAMG15wTndF/Ug3EviSjOs0GtryRSkgJkmAqAhdpU0SRjVAVuy7XzTRpltxbMmSoiYVnHtA==
"@microsoft/bf-lu@4.13.0-rc0":
version "4.13.0-rc0"
resolved "https://registry.yarnpkg.com/@microsoft/bf-lu/-/bf-lu-4.13.0-rc0.tgz#117c6f86fc40e4afa022d48fe2050678e02084b3"
integrity sha512-JP105CuKZdCSevkKov183c1tJ1cyAjPv/X2TT6rTmzWq00sJcvBU1sv/k2Vg4MAVLO3RsJZbYixfOxKQ/s/bew==
dependencies:
"@azure/cognitiveservices-luis-authoring" "4.0.0-preview.1"
"@azure/ms-rest-azure-js" "2.0.1"
Expand All @@ -4079,15 +4079,15 @@
semver "^5.5.1"
tslib "^2.0.3"

"@microsoft/bf-lu@4.13.0-rc0":
version "4.13.0-rc0"
resolved "https://registry.yarnpkg.com/@microsoft/bf-lu/-/bf-lu-4.13.0-rc0.tgz#117c6f86fc40e4afa022d48fe2050678e02084b3"
integrity sha512-JP105CuKZdCSevkKov183c1tJ1cyAjPv/X2TT6rTmzWq00sJcvBU1sv/k2Vg4MAVLO3RsJZbYixfOxKQ/s/bew==
"@microsoft/bf-lu@4.14.0-dev.20210408.1a5070e":
version "4.14.0-dev.20210408.1a5070e"
resolved "https://registry.yarnpkg.com/@microsoft/bf-lu/-/bf-lu-4.14.0-dev.20210408.1a5070e.tgz#fb4b9f0d8e79c4f7f6bd90d3f40c8920250fc7c0"
integrity sha512-eqV0xvBAciD9bAgFe9GHK4wt9z/p0ZmhIG46MsyY7bN92N0/TKG+IQy9fxnz/zv9ssqap5gpO+qdOzXEVReg6A==
dependencies:
"@azure/cognitiveservices-luis-authoring" "4.0.0-preview.1"
"@azure/ms-rest-azure-js" "2.0.1"
"@types/node-fetch" "~2.5.5"
antlr4 "~4.8.0"
axios "~0.21.1"
axios-https-proxy "^0.1.1"
chalk "2.4.1"
console-stream "^0.1.1"
deep-equal "^1.0.1"
Expand Down Expand Up @@ -6722,7 +6722,14 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==

axios@^0.18.0, axios@^0.19.2, axios@^0.21.1:
axios-https-proxy@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/axios-https-proxy/-/axios-https-proxy-0.1.1.tgz#929ce6bbd669c940b025e0c7258318a63d66d5c4"
integrity sha512-slFaor1FTRhO6V6r2ewuWLBRIF33Lkg+wRmUVJPWRe0JRgBKevBSlgjDInp+AeKGKZjyT7k3l44l67CvEme1Cg==
dependencies:
https-proxy-agent "^2.2.1"

axios@^0.18.0, axios@^0.19.2, axios@^0.21.1, axios@~0.21.1:
version "0.21.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
Expand Down
2 changes: 0 additions & 2 deletions extensions/azurePublish/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
) => {
const { subscriptionID, accessToken, name, environment, hostname, luisResource, abs } = customizeConfiguration;

const mode = this.getRuntimeTemplateMode(runtime?.key);

// Create the BotProjectDeploy object, which is used to carry out the deploy action.
const azDeployer = new BotProjectDeploy({
logger: (msg: any, ...args: any[]) => {
Expand Down
28 changes: 14 additions & 14 deletions extensions/azurePublish/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4030,15 +4030,7 @@ domhandler@^4.0.0, domhandler@^4.1.0:
dependencies:
domelementtype "^2.2.0"

[email protected]:
version "1.5.1"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=
dependencies:
dom-serializer "0"
domelementtype "1"

domutils@^1.5.1:
domutils@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==
Expand Down Expand Up @@ -5203,16 +5195,16 @@ is-buffer@^1.1.5, is-buffer@~1.1.1:
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==

is-callable@^1.1.4, is-callable@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e"
integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==

is-buffer@^2.0.0:
version "2.0.5"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191"
integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==

is-callable@^1.1.4, is-callable@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9"
integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==

is-ci@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
Expand Down Expand Up @@ -6124,6 +6116,14 @@ lodash._getnative@^3.0.0:
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=

<<<<<<< HEAD
=======
lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=

>>>>>>> qika/skill
lodash.camelcase@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
Expand Down
14 changes: 0 additions & 14 deletions extensions/localPublish/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,9 @@ class LocalPublisher implements PublishPlugin<PublishConfig> {

await this.initBot(project);
await this.saveContent(botId, version, project.dataDir, user);
await runtime.setSkillManifest(
this.getBotRuntimeDir(botId),
project.fileStorage,
this.getManifestSrcDir(project.dataDir),
project.fileStorage,
'azurewebapp'
);
} else if (project.settings.runtime.path && project.settings.runtime.command) {
const runtimePath = project.getRuntimePath();
await runtime.build(runtimePath, project);
await runtime.setSkillManifest(
project.settings.runtime.path,
project.fileStorage,
this.getManifestSrcDir(project.dataDir),
project.fileStorage,
'azurewebapp'
);
} else {
throw new Error('Custom runtime settings are incomplete. Please specify path and command.');
}
Expand Down

0 comments on commit bc430c7

Please sign in to comment.