Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
e5c2ed8
add skill select profile component
Mar 23, 2021
c86693e
manifest file cud api
alanlong9278 Mar 24, 2021
0873dfc
add skill select page and publish logic
Mar 25, 2021
4d7cc96
folder rename
alanlong9278 Mar 25, 2021
b51339e
add lu files writing logic
Mar 25, 2021
b92eafa
add redirect to publishing page action
Mar 25, 2021
45be7cd
change folder name
Mar 25, 2021
97584b1
add lu file parsing and intents filtering
Mar 26, 2021
8cebf58
Merge remote-tracking branch 'origin' into qika/skill
Mar 30, 2021
73a802a
Support .lu and .qna for static files
luhan2017 Mar 23, 2021
b4da411
'notification'
alanlong9278 Mar 30, 2021
9c56475
manifest file name
alanlong9278 Mar 31, 2021
6739924
add skill add callers logic
Mar 31, 2021
914484d
Merge branch 'qika/skill' of https://github.com/microsoft/BotFramewor…
Mar 31, 2021
4fdd237
Merge branch 'julong/skill' into qika/skill
alanlong9278 Mar 31, 2021
5426207
add manifest path to BotStructureFilesPatterns
alanlong9278 Mar 31, 2021
63a04c6
fix e2e
Mar 31, 2021
10c31c4
Merge branch 'qika/skill' of https://github.com/microsoft/BotFramewor…
Mar 31, 2021
11be116
notification
alanlong9278 Mar 31, 2021
9a4ed99
add publish skill settings update
Apr 1, 2021
f81a1a4
Merge branch 'qika/skill' of https://github.com/microsoft/BotFramewor…
Apr 1, 2021
46e6817
pop auth
alanlong9278 Apr 1, 2021
87261fb
add skill hostendpoint
Apr 2, 2021
ff68438
Merge branch 'qika/skill' of https://github.com/microsoft/BotFramewor…
Apr 2, 2021
62b2be5
fix comments
Apr 6, 2021
ac3d987
Merge remote-tracking branch 'origin' into qika/skill
Apr 6, 2021
46bb687
Merge branch 'main' into qika/skill
Apr 6, 2021
f03067a
title change
alanlong9278 Apr 7, 2021
ebbcd1c
fix copy url wrong
alanlong9278 Apr 7, 2021
98e3d5c
fix filtered lu files
Apr 7, 2021
4b1f128
merge selectManifest & fetchManifest & description popup
alanlong9278 Apr 7, 2021
defdfc0
Merge branch 'qika/skill' of https://github.com/microsoft/BotFramewor…
alanlong9278 Apr 7, 2021
7a23ae9
next bugfix
alanlong9278 Apr 7, 2021
7ced73d
bugfix
alanlong9278 Apr 8, 2021
a9ee69f
Merge branch 'main' into qika/skill
alanlong9278 Apr 8, 2021
7e602eb
merge main & popup err
alanlong9278 Apr 8, 2021
6ba07c2
Fix endpoint not update issue
luhan2017 Apr 9, 2021
d3a0396
Fix new adaptive runtime copy skill manifests to wwwroot folder
luhan2017 Apr 9, 2021
4ba00b2
skip step revert
alanlong9278 Apr 9, 2021
318c7d4
Merge branch 'main' into qika/skill
alanlong9278 Apr 9, 2021
77950bc
Merge branch 'main' into qika/skill
alanlong9278 Apr 9, 2021
b57aac1
tooltip
alanlong9278 Apr 9, 2021
52f06ac
add back button & fix url color
alanlong9278 Apr 9, 2021
77cfd5c
Merge branch 'main' into qika/skill
luhan2017 Apr 12, 2021
2c51c07
Update the logic of updating skill host endpoint
luhan2017 Apr 12, 2021
9314af5
callers set
alanlong9278 Apr 12, 2021
143178d
Merge branch 'qika/skill' of https://github.com/microsoft/BotFramewor…
alanlong9278 Apr 12, 2021
a634daa
remove the physical file provider
luhan2017 Apr 12, 2021
b29bdfb
back button
alanlong9278 Apr 12, 2021
fc14b0c
Merge branch 'qika/skill' of https://github.com/microsoft/BotFramewor…
alanlong9278 Apr 12, 2021
8bd1ff5
default select publish profie
alanlong9278 Apr 12, 2021
897e6d7
disabled generated & publish button when no profie
alanlong9278 Apr 12, 2021
ec3dd79
url wrong
alanlong9278 Apr 12, 2021
42ff19e
Merge branch 'qika/skill' of https://github.com/microsoft/BotFramewor…
alanlong9278 Apr 12, 2021
07f0ebb
default publish target
alanlong9278 Apr 12, 2021
738a163
callers error
alanlong9278 Apr 12, 2021
b2e5301
add create publish profile dialog
alanlong9278 Apr 12, 2021
2beddcf
Merge branch 'main' into qika/skill
luhan2017 Apr 13, 2021
39c6543
comments
alanlong9278 Apr 13, 2021
c45e63b
callers
alanlong9278 Apr 13, 2021
517286f
lint
alanlong9278 Apr 13, 2021
ff5ef57
lint fix
alanlong9278 Apr 13, 2021
c9777ac
Merge branch 'main' into qika/skill
alanlong9278 Apr 14, 2021
c1539fa
lint ignore
alanlong9278 Apr 14, 2021
a56ec8c
test case
alanlong9278 Apr 14, 2021
4a8b25c
remove manifest folder from read patterns
alanlong9278 Apr 14, 2021
08335a3
Merge branch 'main' into qika/skill
cwhitten Apr 14, 2021
6ff0cdf
comments
alanlong9278 Apr 15, 2021
3c56e61
Merge branch 'main' into qika/skill
alanlong9278 Apr 15, 2021
79ac9cf
comments & conflict
alanlong9278 Apr 15, 2021
ecd2711
type
alanlong9278 Apr 15, 2021
3d7937c
Merge branch 'main' into qika/skill
hatpick Apr 15, 2021
56e1a13
bugfix
alanlong9278 Apr 16, 2021
3132e03
Merge branch 'qika/skill' of https://github.com/microsoft/BotFramewor…
alanlong9278 Apr 16, 2021
7aa94b4
Merge branch 'main' into qika/skill
alanlong9278 Apr 16, 2021
72855ea
Fix the logic of updating skill settings
luhan2017 Apr 16, 2021
bec3056
delete duplicate manifest url
alanlong9278 Apr 16, 2021
ea9372e
add profile popup logic
alanlong9278 Apr 16, 2021
0e8711b
Merge branch 'main' into qika/skill
luhan2017 Apr 16, 2021
0d50e5b
Merge branch 'main' into qika/skill
luhan2017 Apr 19, 2021
98604c8
Merge branch 'main' into qika/skill
cwhitten Apr 19, 2021
92fec91
Merge branch 'main' into qika/skill
cwhitten Apr 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const ProjectHeader = (props: ProjectHeaderProps) => {
onClick: () => {},
},
{
label: formatMessage('Create/edit skill manifest'),
label: formatMessage('Share as a skill'),
onClick: () => {
onBotEditManifest(projectId);
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

/** @jsx jsx */
import React, { Fragment, useState, useEffect } from 'react';
import { jsx } from '@emotion/core';
import { useRecoilValue } from 'recoil';
import { PublishTarget } from '@bfc/shared';
import formatMessage from 'format-message';
import { ActionButton, DefaultButton } from 'office-ui-fabric-react/lib/Button';
import { useBoolean } from '@uifabric/react-hooks';
import Dialog, { DialogFooter } from 'office-ui-fabric-react/lib/Dialog';

import { dispatcherState, settingsState, publishTypesState } from '../../recoilModel';
import { AuthDialog } from '../../components/Auth/AuthDialog';
import { isShowAuthDialog } from '../../utils/auth';

import { PublishProfileDialog } from './create-publish-profile/PublishProfileDialog';
import { actionButton } from './styles';

// -------------------- CreatePublishProfileDialog -------------------- //

type CreatePublishProfileDialogProps = {
projectId: string;
};

export const CreatePublishProfileDialog: React.FC<CreatePublishProfileDialogProps> = (props) => {
const { projectId } = props;
const { publishTargets } = useRecoilValue(settingsState(projectId));
const { getPublishTargetTypes, setPublishTargets } = useRecoilValue(dispatcherState);
const publishTypes = useRecoilValue(publishTypesState(projectId));

const [dialogHidden, setDialogHidden] = useState(true);
const [showAuthDialog, setShowAuthDialog] = useState(false);
const [hideDialog, { toggle: toggleHideDialog }] = useBoolean(false);

const dialogTitle = {
title: formatMessage('Create a publish profile to continue'),
subText: formatMessage(
'To make your bot available as a remote skill you will need to provision Azure resources . This process may take a few minutes depending on the resources you select.'
),
};
const [currentPublishProfile, setCurrentPublishProfile] = useState<{ index: number; item: PublishTarget } | null>(
null
);

useEffect(() => {
if (projectId) {
getPublishTargetTypes(projectId);
}
}, [projectId]);

return (
<Fragment>
<Dialog
dialogContentProps={{
title: dialogTitle.title,
subText: dialogTitle.subText,
}}
hidden={hideDialog}
minWidth={960}
modalProps={{
isBlocking: true,
}}
onDismiss={toggleHideDialog}
>
<div css={{ height: '430px' }}>
<ActionButton
data-testid={'addNewPublishProfile'}
styles={actionButton}
onClick={() => {
isShowAuthDialog(true) ? setShowAuthDialog(true) : setDialogHidden(false);
toggleHideDialog();
}}
>
{formatMessage('Create new publish profile')}
</ActionButton>
</div>
<DialogFooter>
<DefaultButton text={formatMessage('Cancel')} onClick={toggleHideDialog} />
</DialogFooter>
</Dialog>
{showAuthDialog && (
<AuthDialog
needGraph
next={() => {
setDialogHidden(false);
}}
onDismiss={() => {
setShowAuthDialog(false);
}}
/>
)}
{!dialogHidden ? (
<PublishProfileDialog
closeDialog={() => {
setDialogHidden(true);
setCurrentPublishProfile(null);
}}
current={currentPublishProfile}
projectId={projectId}
setPublishTargets={setPublishTargets}
targets={publishTargets || []}
types={publishTypes}
/>
) : null}
</Fragment>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ import {
generateDispatchModels,
} from '../generateSkillManifest';

const projectId = '42345.23432';
const currentTarget = {
configuration:
'{\n "name": "test",\n "environment": "composer",\n "tenantId": "aaa",\n "subscriptionId": "aaa",\n "resourceGroup": "testGroup",\n "botName": "test",\n "hostname": "test",\n "luisResource": "test",\n "runtimeIdentifier": "win-x64",\n "region": "westus",\n "settings": {\n "applicationInsights": {},\n "luis": {"authoringKey":"aaa", "endpointKey": "aaa",\n "endpoint": "https://westus.api.cognitive.microsoft.com/"\n },\n "qna": {},\n "MicrosoftAppId": "aaa",\n "MicrosoftAppPassword": "aaa"\n }\n}',
name: 'test',
type: 'azurePublish',
lastPublished: new Date('2021-04-08T08:38:17.566Z'),
};
const dialogSchema = {
id: 'test',
content: {
Expand Down Expand Up @@ -188,7 +196,15 @@ describe('generateDispatchModels', () => {
const selectedTriggers = [];
const luFiles = [];
const qnaFiles = [];
const result = generateDispatchModels(schema, dialogs, selectedTriggers, luFiles, qnaFiles);
const result = generateDispatchModels(
schema,
dialogs,
selectedTriggers,
luFiles,
qnaFiles,
currentTarget,
projectId
);
expect(result).toEqual({});
});

Expand All @@ -201,7 +217,15 @@ describe('generateDispatchModels', () => {
{ id: 'test.fr-FR', empty: false },
];
const qnaFiles = [];
const result = generateDispatchModels(schema, dialogs, selectedTriggers, luFiles, qnaFiles);
const result = generateDispatchModels(
schema,
dialogs,
selectedTriggers,
luFiles,
qnaFiles,
currentTarget,
projectId
);
expect(result).toEqual({});
});

Expand All @@ -214,7 +238,15 @@ describe('generateDispatchModels', () => {
{ id: 'test.fr-FR', empty: false },
];
const qnaFiles = [];
const result = generateDispatchModels(schema, dialogs, selectedTriggers, luFiles, qnaFiles);
const result = generateDispatchModels(
schema,
dialogs,
selectedTriggers,
luFiles,
qnaFiles,
currentTarget,
projectId
);
expect(result).toEqual({});
});

Expand All @@ -227,37 +259,45 @@ describe('generateDispatchModels', () => {
{ id: 'test.fr-FR', empty: false },
];
const qnaFiles: any = [{ id: 'test.es-es', empty: false }];
const result = generateDispatchModels(schema, dialogs, selectedTriggers, luFiles, qnaFiles);
const result = generateDispatchModels(
schema,
dialogs,
selectedTriggers,
luFiles,
qnaFiles,
currentTarget,
projectId
);
expect(result).toEqual(
expect.objectContaining({
dispatchModels: {
intents: ['testIntent'],
languages: {
'en-us': [
{
name: 'test',
contentType: 'application/lu',
url: `<test.en-us.lu url>`,
description: '<description>',
name: 'test',
url: 'https://test.azurewebsites.net/manifests/skill-test.en-us.lu',
},
],
'fr-FR': [
'es-es': [
{
name: 'test',
contentType: 'application/lu',
url: `<test.fr-FR.lu url>`,
contentType: 'application/qna',
description: '<description>',
name: 'test',
url: 'https://test.azurewebsites.net/manifests/skill-test.es-es.qna',
},
],
'es-es': [
'fr-FR': [
{
name: 'test',
contentType: 'application/qna',
url: `<test.es-es.qna url>`,
contentType: 'application/lu',
description: '<description>',
name: 'test',
url: 'https://test.azurewebsites.net/manifests/skill-test.fr-FR.lu',
},
],
},
intents: ['testIntent'],
},
})
);
Expand Down
Loading