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
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 @@ -26,6 +26,7 @@ import { triggerNotSupported } from '../../utils/dialogValidator';
import { useFeatureFlag } from '../../utils/hooks';
import { LoadingSpinner } from '../LoadingSpinner';
import TelemetryClient from '../../telemetry/TelemetryClient';
import { dialog } from '../ErrorPopup/styles';

import { TreeItem } from './treeItem';
import { ExpandableNode } from './ExpandableNode';
Expand Down Expand Up @@ -499,12 +500,12 @@ export const ProjectTree: React.FC<Props> = ({
: renderTriggerList(dialog.triggers, dialog, projectId, dialogLink, 1);
};

const renderLgImport = (item: LanguageFileImport, projectId: string): React.ReactNode => {
const renderLgImport = (item: LanguageFileImport, projectId: string, dialogId: string): React.ReactNode => {
const link: TreeLink = {
projectId: rootProjectId,
skillId: projectId === rootProjectId ? undefined : projectId,
lgFileId: item.id,
dialogId: 'all',
dialogId,
displayName: item.displayName ?? item.id,
diagnostics: [],
isRoot: false,
Expand Down Expand Up @@ -532,17 +533,17 @@ export const ProjectTree: React.FC<Props> = ({
return lgImportsByProjectByDialog[projectId][dialog.id]
.filter((lgImport) => filterMatch(dialog.displayName) || filterMatch(lgImport.displayName))
.map((lgImport) => {
return renderLgImport(lgImport, projectId);
return renderLgImport(lgImport, projectId, dialog.id);
});
};

const renderLuImport = (item: LanguageFileImport, projectId: string): React.ReactNode => {
const renderLuImport = (item: LanguageFileImport, projectId: string, dialogId: string): React.ReactNode => {
const link: TreeLink = {
projectId: rootProjectId,
skillId: projectId === rootProjectId ? undefined : projectId,
luFileId: item.id,
displayName: item.displayName ?? item.id,
dialogId: 'all',
dialogId,
diagnostics: [],
isRoot: false,
isRemote: false,
Expand All @@ -569,7 +570,7 @@ export const ProjectTree: React.FC<Props> = ({
return luImportsByProjectByDialog[projectId][dialog.id]
.filter((luImport) => filterMatch(dialog.displayName) || filterMatch(luImport.displayName))
.map((luImport) => {
return renderLuImport(luImport, projectId);
return renderLuImport(luImport, projectId, dialog.id);
});
};

Expand All @@ -586,8 +587,12 @@ export const ProjectTree: React.FC<Props> = ({
);
const commonLink = options.showCommonLinks ? [renderCommonDialogHeader(projectId, 1)] : [];

const importedLgLinks = options.showLgImports ? lgImportsList.map((file) => renderLgImport(file, projectId)) : [];
const importedLuLinks = options.showLuImports ? luImportsList.map((file) => renderLuImport(file, projectId)) : [];
const importedLgLinks = options.showLgImports
? lgImportsList.map((file) => renderLgImport(file, projectId, dialog.id))
: [];
const importedLuLinks = options.showLuImports
? luImportsList.map((file) => renderLuImport(file, projectId, dialog.id))
: [];

return [
...commonLink,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,18 @@ const TableView: React.FC<TableViewProps> = (props) => {
[defaultLangFile, actualProjectId]
);

const getTemplatesMoreButtons = (item, index): IContextualMenuItem[] => {
const getTemplatesMoreButtons = (item, index, luFileId): IContextualMenuItem[] => {
const buttons = [
{
key: 'edit',
name: formatMessage('Edit'),
onClick: () => {
const { name, dialogId } = intents[index];
navigateTo(`${baseURL}language-understanding/${dialogId}/edit?t=${encodeURIComponent(name)}`);
navigateTo(
`${baseURL}language-understanding/${dialogId}${
luFileId ? `/item/${luFileId}/` : '/'
}edit?t=${encodeURIComponent(name)}`
);
},
},
];
Expand Down Expand Up @@ -373,7 +377,7 @@ const TableView: React.FC<TableViewProps> = (props) => {
menuIconProps={{ iconName: 'MoreVertical' }}
menuProps={{
shouldFocusOnMount: true,
items: getTemplatesMoreButtons(item, index),
items: getTemplatesMoreButtons(item, index, luFileId),
}}
styles={{ menuIcon: { color: NeutralColors.black, fontSize: FontSizes.size16 } }}
/>
Expand Down
3 changes: 0 additions & 3 deletions Composer/packages/client/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ const Routes = (props) => {
<Redirect noThrow from="/" to={resolveToBasePath(BASEPATH, 'home')} />
<ProjectRouter path="/bot/:projectId/skill/:skillId">
<DesignPage path="dialogs/:dialogId/*" />
<LUPage path="language-understanding/all/*" />
<LUPage path="language-understanding/:dialogId/item/:luFileId/*" />
<LUPage path="language-understanding/:dialogId/*" />
<LGPage path="language-generation/all/*" />
<LGPage path="language-generation/:dialogId/item/:lgFileId/*" />
<LGPage path="language-generation/:dialogId/*" />
<QnAPage path="knowledge-base/all/*" />
<QnAPage path="knowledge-base/:dialogId/item/:qnaFileId/*" />
<QnAPage path="knowledge-base/:dialogId/*" />
<BotProjectSettings path="botProjectsSettings" />
Expand All @@ -81,7 +79,6 @@ const Routes = (props) => {
</ProjectRouter>
<ProjectRouter path="/bot/:projectId">
<DesignPage path="dialogs/:dialogId/*" />
<LUPage path="language-understanding/all/*" />
<LUPage path="language-understanding/:dialogId/item/:luFileId/*" />
<LUPage path="language-understanding/:dialogId/*" />
<LGPage path="language-generation/all/*" />
Expand Down