Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow manifest creation on root bot #5116

Merged
merged 6 commits into from
Dec 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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