Skip to content

Commit

Permalink
Merge branch 'benbrown/429fixes' of https://github.com/microsoft/BotF…
Browse files Browse the repository at this point in the history
…ramework-Composer into benbrown/429fixes
  • Loading branch information
benbrown committed Apr 29, 2021
2 parents 0b6ae7b + 6601346 commit ac9d7a6
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 25 deletions.
5 changes: 4 additions & 1 deletion Composer/cypress/integration/HomePage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ context('Home Page ', () => {
});
});

it('can save as a new bot from an existing bot', () => {
// We are disabling this test since we are temporarily removing
// this feature in R13 since we don't have a clear definition or solution
// for copying parent bots and skills.
xit('can save as a new bot from an existing bot', () => {
cy.createTestBot('EmptySample', ({ id }) => {
cy.visit(`/bot/${id}`);
cy.findByTestId('LeftNav-CommandBarButtonHome').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const cardContainer = (show: boolean, ref?: HTMLDivElement | null) => () => {
animation-timing-function: ${show ? 'cubic-bezier(0.1, 0.9, 0.2, 1)' : 'linear'};
animation-fill-mode: both;
animation-name: ${show ? fadeIn : fadeOut(height)};
pointer-events: auto;
`;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const container = css`
position: absolute;
right: 0px;
padding: 6px;
pointer-events: none;
`;

const layerStyles = { root: { zIndex: zIndices.notificationContainer } };
Expand Down
57 changes: 34 additions & 23 deletions Composer/packages/client/src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ import { useRecoilValue } from 'recoil';
import { Toolbar, IToolbarItem } from '@bfc/ui-shared';

import { CreationFlowStatus } from '../../constants';
import { dispatcherState, botDisplayNameState } from '../../recoilModel';
import { dispatcherState } from '../../recoilModel';
import {
recentProjectsState,
feedState,
templateIdState,
currentProjectIdState,
warnAboutDotNetState,
warnAboutFunctionsState,
} from '../../recoilModel/atoms/appState';
Expand Down Expand Up @@ -69,11 +67,17 @@ const resources = [
];

const Home: React.FC<RouteComponentProps> = () => {
const projectId = useRecoilValue<string>(currentProjectIdState);
const botName = useRecoilValue<string>(botDisplayNameState(projectId));
// These variables are used in the save as method which is currently disabled until we
// determine the appropriate save as behavior for parent bots and skills. Since we are
// planning to add the feature back in the next release, I am commenting out this section
// of code instead of removing it. See comment below for more details.
//
// const projectId = useRecoilValue<string>(currentProjectIdState);
// const botName = useRecoilValue<string>(botDisplayNameState(projectId));
// const templateId = useRecoilValue<string>(templateIdState);

const recentProjects = useRecoilValue(recentProjectsState);
const feed = useRecoilValue(feedState);
const templateId = useRecoilValue<string>(templateIdState);
const {
openProject,
setCreationFlowStatus,
Expand Down Expand Up @@ -134,23 +138,30 @@ const Home: React.FC<RouteComponentProps> = () => {
dataTestid: 'homePage-Toolbar-Open',
disabled: false,
},
{
type: 'action',
text: formatMessage('Save as'),
buttonProps: {
iconProps: {
iconName: 'Save',
},
onClick: () => {
setCreationFlowStatus(CreationFlowStatus.SAVEAS);
navigate(`projects/${projectId}/${templateId}/save`);
TelemetryClient.track('ToolbarButtonClicked', { name: 'saveAs' });
},
styles: home.toolbarButtonStyles,
},
align: 'left',
disabled: botName ? false : true,
},
// We are temporarily disabling the save as button until we can
// determine what the appropriate save as behavior should be for both
// parent bots and skills.
//
// Associated issue:
// https://github.com/microsoft/BotFramework-Composer/issues/6808#issuecomment-828758688
//
// {
// type: 'action',
// text: formatMessage('Save as'),
// buttonProps: {
// iconProps: {
// iconName: 'Save',
// },
// onClick: () => {
// setCreationFlowStatus(CreationFlowStatus.SAVEAS);
// navigate(`projects/${projectId}/${templateId}/save`);
// TelemetryClient.track('ToolbarButtonClicked', { name: 'saveAs' });
// },
// styles: home.toolbarButtonStyles,
// },
// align: 'left',
// disabled: botName ? false : true,
// },
];
return (
<div css={home.outline}>
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/indexers/src/botIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const checkSkillSetting = (assets: { dialogs: DialogInfo[]; botProjectFile: BotP
const skillName = getSkillNameFromSetting(skillId) || skillId;
diagnostics.push(
new Diagnostic(
`The skill '${skillName}' does not exist in bot project file`,
`'${skillName}' does not exist in this project and is currently referenced in '${dialog.displayName}'.`,
dialog.id,
DiagnosticSeverity.Error
)
Expand Down

0 comments on commit ac9d7a6

Please sign in to comment.