-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tachou/updateOrchCore
- Loading branch information
Showing
21 changed files
with
223 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Composer/packages/client/src/pages/publish/__tests__/pullConfirmationDialog.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import React from 'react'; | ||
import { fireEvent, render } from '@botframework-composer/test-utils'; | ||
|
||
import { PullConfirmationDialog } from '../pullConfirmationDialog'; | ||
|
||
describe('<PullConfirmationDialog />', () => { | ||
it('should render', async () => { | ||
const { findByText } = render(<PullConfirmationDialog onConfirm={jest.fn()} onDismiss={jest.fn()} />); | ||
await findByText( | ||
'You are about to pull project files from the selected publish profiles. The current project will be overwritten by the pulled files, and will be saved as a backup automatically. You will be able to retrieve the backup anytime in the future.' | ||
); | ||
}); | ||
|
||
it('should call onConfirm()', () => { | ||
const onConfirm = jest.fn(); | ||
const { getByTestId } = render(<PullConfirmationDialog onConfirm={onConfirm} onDismiss={jest.fn()} />); | ||
fireEvent.click(getByTestId('pull-confirm-button')); | ||
|
||
expect(onConfirm).toHaveBeenCalled(); | ||
}); | ||
|
||
it('should call onDismiss()', () => { | ||
const onDismiss = jest.fn(); | ||
const { getByTestId } = render(<PullConfirmationDialog onConfirm={jest.fn()} onDismiss={onDismiss} />); | ||
fireEvent.click(getByTestId('pull-cancel-button')); | ||
|
||
expect(onDismiss).toHaveBeenCalled(); | ||
}); | ||
}); |
44 changes: 44 additions & 0 deletions
44
Composer/packages/client/src/pages/publish/pullConfirmationDialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
/** @jsx jsx */ | ||
import { jsx } from '@emotion/core'; | ||
import formatMessage from 'format-message'; | ||
import { DefaultButton, PrimaryButton } from 'office-ui-fabric-react/lib/components/Button'; | ||
import { Dialog, DialogFooter } from 'office-ui-fabric-react/lib/Dialog'; | ||
import React from 'react'; | ||
|
||
type PullConfirmationDialogProps = { | ||
onConfirm: () => void; | ||
onDismiss: () => void; | ||
}; | ||
|
||
export const PullConfirmationDialog: React.FC<PullConfirmationDialogProps> = (props) => { | ||
const { onConfirm, onDismiss } = props; | ||
|
||
return ( | ||
<Dialog | ||
dialogContentProps={{ | ||
title: formatMessage('Pull from selected profile'), | ||
styles: { | ||
content: { | ||
fontSize: 16, | ||
}, | ||
}, | ||
}} | ||
hidden={false} | ||
minWidth={480} | ||
> | ||
<p> | ||
{formatMessage( | ||
'You are about to pull project files from the selected publish profiles. The current project will be overwritten by the pulled files, and will be saved as a backup automatically. You will be able to retrieve the backup anytime in the future.' | ||
)} | ||
</p> | ||
<p>{formatMessage('Do you want to proceed?')}</p> | ||
<DialogFooter> | ||
<DefaultButton data-testid="pull-cancel-button" text={formatMessage('Cancel')} onClick={onDismiss} /> | ||
<PrimaryButton data-testid="pull-confirm-button" text={formatMessage('Pull')} onClick={onConfirm} /> | ||
</DialogFooter> | ||
</Dialog> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.