Skip to content

Commit

Permalink
fix: Allow manifest creation on root bot (microsoft#5116)
Browse files Browse the repository at this point in the history
* Allow manifest creation on rootbot

Signed-off-by: Srinaath Ravichandran <srravich@microsoft.com>

* remove unused refs

Signed-off-by: Srinaath Ravichandran <srravich@microsoft.com>

Co-authored-by: Srinaath Ravichandran <srravich@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
  • Loading branch information
3 people committed Dec 6, 2020
1 parent 6c13ef1 commit 67f2296
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ type Props = {
onBotCreateDialog?: (projectId: string) => void;
onBotStart?: (projectId: string) => void;
onBotStop?: (projectId: string) => void;
onBotEditManifest?: (projectId: string, type: 'create' | 'edit') => void;
onBotEditManifest?: (projectId: string) => void;
onBotExportZip?: (projectId: string) => void;
onBotRemoveSkill?: (skillId: string) => void;
onDialogCreateTrigger?: (projectId: string, dialogId: string) => void;
Expand Down Expand Up @@ -341,10 +341,7 @@ export const ProjectTree: React.FC<Props> = ({
{
label: formatMessage('Create/edit skill manifest'),
onClick: () => {
onBotEditManifest(
bot.projectId,
bot.diagnostics.filter((d) => d.source === 'manifest.json').length ? 'create' : 'edit'
);
onBotEditManifest(bot.projectId);
},
},
{
Expand Down
12 changes: 2 additions & 10 deletions Composer/packages/client/src/pages/design/DesignPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ const DesignPage: React.FC<RouteComponentProps<{ dialogId: string; projectId: st
createTrigger,
deleteTrigger,
createQnATrigger,
displayManifestModal,
createDialogCancel,
} = useRecoilValue(dispatcherState);

Expand Down Expand Up @@ -651,15 +650,8 @@ const DesignPage: React.FC<RouteComponentProps<{ dialogId: string; projectId: st
setDialogModalInfo(projectId);
};

const handleDisplayManifestModal = (skillId: string, type: 'create' | 'edit') => {
if (type === 'create') {
setExportSkillModalInfo(skillId);
return;
}

const skillNameIdentifier = skillsByProjectId[skillId];
if (!skillNameIdentifier) return;
displayManifestModal(skillNameIdentifier);
const handleDisplayManifestModal = (currentProjectId: string) => {
setExportSkillModalInfo(currentProjectId);
};

const handleErrorClick = (projectId: string, skillId: string, diagnostic: Diagnostic) => {
Expand Down

0 comments on commit 67f2296

Please sign in to comment.