= ({
+ link,
+ isActive = false,
+ icon,
+ dialogName,
+ forceIndent: shiftOut,
+ onSelect,
+ menu = [],
+}) => {
+ const a11yLabel = `${dialogName ?? '$Root'}_${link.displayName}`;
+
+ const overflowMenu = menu.map(renderTreeMenuItem(link));
+
+ const linkString = `${link.projectId}_DialogTreeItem${link.dialogName}_${link.trigger ?? ''}`;
return (
{
- onSelect(link.id);
+ onSelect?.(link);
}}
onKeyDown={(e) => {
if (e.key === 'Enter') {
- onSelect(link.id);
+ onSelect?.(link);
}
}}
>
@@ -225,25 +271,19 @@ export const TreeItem: React.FC = (props) => {
//remove this at that time
doNotContainWithinFocusZone
css={overflowSet}
- data-testid={`DialogTreeItem${link.id}`}
+ data-testid={linkString}
items={[
{
- key: link.id,
- depth,
+ key: linkString,
+ icon,
...link,
},
]}
- overflowItems={[
- {
- key: 'delete',
- name: formatMessage('Delete'),
- onClick: () => onDelete(link.id),
- },
- ]}
+ overflowItems={overflowMenu}
role="row"
styles={{ item: { flex: 1 } }}
onRenderItem={onRenderItem}
- onRenderOverflowButton={onRenderOverflowButton(link.isRoot, isActive)}
+ onRenderOverflowButton={onRenderOverflowButton(!!isActive)}
/>
);
diff --git a/Composer/packages/client/src/components/Split/LeftRightSplit.tsx b/Composer/packages/client/src/components/Split/LeftRightSplit.tsx
index 8b88b48e3d..50f5bb550c 100644
--- a/Composer/packages/client/src/components/Split/LeftRightSplit.tsx
+++ b/Composer/packages/client/src/components/Split/LeftRightSplit.tsx
@@ -33,6 +33,7 @@ const Left = styled.div`
outline: none;
overflow: hidden;
grid-area: left;
+ label: LeftSplit;
`;
const Split = styled.div`
@@ -65,6 +66,7 @@ const Right = styled.div`
outline: none;
overflow: hidden;
grid-area: right;
+ label: SplitRight;
`;
// ensures a value can be used in gridTemplateColumns
diff --git a/Composer/packages/client/src/pages/design/DesignPage.tsx b/Composer/packages/client/src/pages/design/DesignPage.tsx
index e2bd82afd3..9947337650 100644
--- a/Composer/packages/client/src/pages/design/DesignPage.tsx
+++ b/Composer/packages/client/src/pages/design/DesignPage.tsx
@@ -48,6 +48,7 @@ import {
showCreateDialogModalState,
showAddSkillDialogModalState,
localeState,
+ rootBotProjectIdSelector,
qnaFilesState,
} from '../../recoilModel';
import { CreateQnAModal } from '../../components/QnA';
@@ -124,6 +125,7 @@ const DesignPage: React.FC {
if (location && props.dialogId && props.projectId) {
const { dialogId, projectId } = props;
+
+ // TODO: swap to the commented-out block once we're working on skills for real (issue #4429)
+ // let { skillId } = props;
+ // if (skillId == null) skillId = projectId;
+
const params = new URLSearchParams(location.search);
const dialogMap = dialogs.reduce((acc, { content, id }) => ({ ...acc, [id]: content }), {});
const dialogData = getDialogData(dialogMap, dialogId);
@@ -218,7 +225,7 @@ const DesignPage: React.FC {
if (newDialog) {
- navTo(projectId, newDialog, []);
+ navTo(projectId, null, newDialog, []);
}
};
@@ -455,7 +462,7 @@ const DesignPage: React.FC triggerApi.deleteTrigger(id, trigger));
+ async function handleDeleteTrigger(dialogId: string, index: number) {
+ const content = deleteTrigger(dialogs, dialogId, index, (trigger) => triggerApi.deleteTrigger(dialogId, trigger));
if (content) {
- updateDialog({ id, content, projectId });
+ updateDialog({ id: dialogId, content, projectId });
const match = /\[(\d+)\]/g.exec(selected);
const current = match && match[1];
if (!current) return;
@@ -545,14 +552,14 @@ const DesignPage: React.FC= 0) {
//if the deleted node is selected and the selected one is not the first one, navTo the previous trigger;
- selectTo(projectId, createSelectedPath(currentIdx - 1));
+ selectTo(projectId, null, dialogId, createSelectedPath(currentIdx - 1));
} else {
//if the deleted node is selected and the selected one is the first one, navTo the first trigger;
- navTo(projectId, id, []);
+ navTo(projectId, null, dialogId, []);
}
} else if (index < currentIdx) {
//if the deleted node is at the front, navTo the current one;
- selectTo(projectId, createSelectedPath(currentIdx - 1));
+ selectTo(projectId, null, dialogId, createSelectedPath(currentIdx - 1));
}
}
}
@@ -590,9 +597,6 @@ const DesignPage: React.FC
handleSelect(projectId, ...props)}
diff --git a/Composer/packages/client/src/pages/knowledge-base/QnAPage.tsx b/Composer/packages/client/src/pages/knowledge-base/QnAPage.tsx
index 9ab350edaa..e3a7bdaa32 100644
--- a/Composer/packages/client/src/pages/knowledge-base/QnAPage.tsx
+++ b/Composer/packages/client/src/pages/knowledge-base/QnAPage.tsx
@@ -104,6 +104,10 @@ const QnAPage: React.FC = (props) => {
[dialogId, projectId, edit]
);
+ useEffect(() => {
+ actions.setCurrentPageMode('qna');
+ }, []);
+
const toolbarItems = [
{
type: 'element',
diff --git a/Composer/packages/client/src/pages/notifications/Notifications.tsx b/Composer/packages/client/src/pages/notifications/Notifications.tsx
index d449358bb5..89d0377eed 100644
--- a/Composer/packages/client/src/pages/notifications/Notifications.tsx
+++ b/Composer/packages/client/src/pages/notifications/Notifications.tsx
@@ -47,7 +47,7 @@ const Notifications: React.FC> = (pro
//path is like main.trigers[0].actions[0]
//uri = id?selected=triggers[0]&focused=triggers[0].actions[0]
const { projectId, id, dialogPath } = item;
- const uri = convertPathToUrl(projectId, id, dialogPath);
+ const uri = convertPathToUrl(projectId, id, dialogPath ?? '');
navigateTo(uri);
},
[NotificationType.SKILL]: (item: INotification) => {
diff --git a/Composer/packages/client/src/pages/publish/Publish.tsx b/Composer/packages/client/src/pages/publish/Publish.tsx
index ac89b47bbe..fd02c2523a 100644
--- a/Composer/packages/client/src/pages/publish/Publish.tsx
+++ b/Composer/packages/client/src/pages/publish/Publish.tsx
@@ -48,6 +48,7 @@ const Publish: React.FC {
+ setCurrentPageMode('notifications');
+ }, []);
+
return (