Skip to content

Commit

Permalink
Fix: form dialog view dialog action
Browse files Browse the repository at this point in the history
  • Loading branch information
sorgh committed Nov 3, 2020
1 parent 77ad8e1 commit eacbbd1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const ProjectTree: React.FC<Props> = ({
const doesLinkMatch = (linkInTree?: Partial<TreeLink>, selectedLink?: Partial<TreeLink>) => {
if (linkInTree == null || selectedLink == null) return false;
return (
linkInTree.skillId === selectedLink.skillId &&
(selectedLink.projectId === selectedLink.skillId || linkInTree.skillId === selectedLink.skillId) &&
linkInTree.dialogId === selectedLink.dialogId &&
linkInTree.trigger === selectedLink.trigger
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const EmptyView = styled(Stack)({
opacity: 0.5,
});

type Props = RouteComponentProps<{ projectId: string; schemaId: string }>;
type Props = RouteComponentProps<{ projectId: string; skillId: string; schemaId: string }>;

const FormDialogPage: React.FC<Props> = React.memo((props: Props) => {
const { projectId = '', schemaId = '' } = props;
const { projectId = '', skillId = '', schemaId = '' } = props;
const formDialogSchemaIds = useRecoilValue(formDialogSchemaIdsState(projectId));
const formDialogLibraryTemplates = useRecoilValue(formDialogLibraryTemplatesState);
const formDialogGenerationProgressing = useRecoilValue(formDialogGenerationProgressingState);
Expand Down Expand Up @@ -90,7 +90,7 @@ const FormDialogPage: React.FC<Props> = React.memo((props: Props) => {
const viewDialog = React.useCallback(
(schemaId: string) => {
if (schemaId) {
navigateToGeneratedDialog({ projectId, schemaId });
navigateToGeneratedDialog({ projectId, skillId, schemaId });
}
},
[navigateToGeneratedDialog, projectId]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ export const formDialogsDispatcher = () => {
}
);

const navigateToGeneratedDialog = ({ projectId, schemaId }) => {
navigate(`/bot/${projectId}/dialogs/${schemaId}`);
const navigateToGeneratedDialog = ({ projectId, skillId, schemaId }) => {
skillId = skillId || projectId;
navigate(`/bot/${projectId}/skill/${skillId}/dialogs/${schemaId}`);
};

const navigateToFormDialogSchema = ({ projectId, schemaId }) => {
Expand Down

0 comments on commit eacbbd1

Please sign in to comment.