From 265c67779dce9e4c8216e787cb629975627701a6 Mon Sep 17 00:00:00 2001 From: natalgar Date: Wed, 5 May 2021 00:34:17 -0700 Subject: [PATCH 1/7] Issue-7583: update copy for provision and publishing --- .../PublishTarget.test.tsx | 2 +- .../PublishProfileDialog.tsx | 23 +++++++----- .../ProvisionHandoff/ProvisionHandoff.tsx | 4 +- .../src/components/ChooseProvisionAction.tsx | 37 +++++++++++-------- .../src/components/azureProvisionDialog.tsx | 13 ++++--- .../azurePublish/src/node/resourceTypes.ts | 7 ++-- .../src/components/pvaDialog.spec.tsx | 2 +- .../pvaPublish/src/components/pvaDialog.tsx | 2 +- extensions/pvaPublish/src/node/index.ts | 2 +- 9 files changed, 49 insertions(+), 43 deletions(-) diff --git a/Composer/packages/client/__tests__/pages/botProjectsSettings/PublishTarget.test.tsx b/Composer/packages/client/__tests__/pages/botProjectsSettings/PublishTarget.test.tsx index 7507ead65c..07902a39da 100644 --- a/Composer/packages/client/__tests__/pages/botProjectsSettings/PublishTarget.test.tsx +++ b/Composer/packages/client/__tests__/pages/botProjectsSettings/PublishTarget.test.tsx @@ -43,6 +43,6 @@ describe('Publish Target', () => { act(() => { fireEvent.click(addNewPublishProfile); }); - expect(getByText('Add new publishing profile')).toBeInTheDocument(); + expect(getByText('Create a publishing profile')).toBeInTheDocument(); }); }); diff --git a/Composer/packages/client/src/pages/botProject/create-publish-profile/PublishProfileDialog.tsx b/Composer/packages/client/src/pages/botProject/create-publish-profile/PublishProfileDialog.tsx index ecd9d3f695..46fdb65948 100644 --- a/Composer/packages/client/src/pages/botProject/create-publish-profile/PublishProfileDialog.tsx +++ b/Composer/packages/client/src/pages/botProject/create-publish-profile/PublishProfileDialog.tsx @@ -54,14 +54,10 @@ export const PublishProfileDialog: React.FC = (props) const [page, setPage] = useState(Page.ProfileForm); const [publishSurfaceStyles, setStyles] = useState(defaultPublishSurface); const { provisionToTarget, addNotification } = useRecoilValue(dispatcherState); - - const [dialogTitle, setTitle] = useState({ - title: current ? formatMessage('Edit publishing profile') : formatMessage('Add new publishing profile'), - subText: formatMessage('A publishing profile provides the secure connectivity required to publish your bot. '), - }); - const [selectedType, setSelectType] = useState(); + const [dialogTitle, setTitle] = useState(formatDialogTitle()); + useEffect(() => { const ty = types.find((t) => t.name === current?.item.type); setSelectType(ty); @@ -89,10 +85,7 @@ export const PublishProfileDialog: React.FC = (props) PluginAPI.publish.closeDialog = closeDialog; PluginAPI.publish.onBack = () => { setPage(Page.ProfileForm); - setTitle({ - title: current ? formatMessage('Edit publishing profile') : formatMessage('Add new publishing profile'), - subText: formatMessage('A publishing profile provides the secure connectivity required to publish your bot. '), - }); + setTitle(formatDialogTitle()); }; PluginAPI.publish.getTokenFromCache = () => { return { @@ -131,6 +124,16 @@ export const PublishProfileDialog: React.FC = (props) } }, [current, projectId]); + function formatDialogTitle() { + return { + title: current ? formatMessage('Edit publishing profile') : formatMessage('Create a publishing profile'), + subText: formatMessage(`To test, run and publish your bot, it needs Azure resources such as app registration, + hosting and channels. Other resources, such as language understanding and storage are optional. + A publishing profile contains all of the information necessary to provision and publish your bot, + including its Azure resources. `), + }; + } + const savePublishTarget = useCallback( async (name: string, type: string, configuration: string) => { // check exist diff --git a/Composer/packages/lib/ui-shared/src/components/ProvisionHandoff/ProvisionHandoff.tsx b/Composer/packages/lib/ui-shared/src/components/ProvisionHandoff/ProvisionHandoff.tsx index ad0169667b..c1372011c9 100644 --- a/Composer/packages/lib/ui-shared/src/components/ProvisionHandoff/ProvisionHandoff.tsx +++ b/Composer/packages/lib/ui-shared/src/components/ProvisionHandoff/ProvisionHandoff.tsx @@ -59,9 +59,7 @@ export const ProvisionHandoff = (props: ProvisionHandoffProps) => { )}
- - {formatMessage('Instructions for your Azure admin')} - + {formatMessage('Instructions')} { {formatMessage('Step 2')} - - {formatMessage( - 'Select tenant and subscription, enter resource group name and resource name, and select region.' - )} - + {formatMessage('Select Azure subscription and resource group name')} {formatMessage('Step 3')} - - {formatMessage( - 'Review and create new resources. Once provisioned these resources will be available in your Azure portal.' - )} - + {formatMessage('Select and name your new resources')} + + + + {formatMessage('Step 4')} + + {formatMessage('Review and confirm resources to be created')} - - {formatMessage('Learn More')} - + + {formatMessage('Once provisioned, your new resources will be available in the Azure portal. ')} + + {formatMessage('Learn More')} + + ); }; @@ -125,15 +126,19 @@ const CreateActionContent = () => { const ImportActionContent = () => { return ( - {formatMessage('Import existing resources')} + {formatMessage('Use existing resources')}

- {formatMessage('Select this option to import existing Azure resources and publish a bot.')} + + {formatMessage( + 'Select this option if you have access to existing Azure resources and their associated values.' + )} +

{formatMessage( - 'Edit the JSON file in the Publish Configuration field. You will need to find the values of associated resources in your Azure portal. A list of required and optional resources may include:' + 'Copy and paste the JSON file containing the values of your existing Azure resources, from the Azure portal. This file includes values for some or all of the following:' )}

diff --git a/extensions/azurePublish/src/components/azureProvisionDialog.tsx b/extensions/azurePublish/src/components/azureProvisionDialog.tsx index 87609e4353..3d3a9ca3cc 100644 --- a/extensions/azurePublish/src/components/azureProvisionDialog.tsx +++ b/extensions/azurePublish/src/components/azureProvisionDialog.tsx @@ -167,9 +167,9 @@ const DialogTitle = { ), }, REVIEW: { - title: formatMessage('Review & create'), + title: formatMessage('Review resources to be created'), subText: formatMessage( - 'Please review the resources that will be created for your bot. Once these resources are provisioned, they will be available in your Azure portal.' + 'The following resources will be created and provisioned for your bot. Once provisioned, they will be available in the Azure portal. ' ), }, CONFIG_RESOURCES: { @@ -376,8 +376,9 @@ export const AzureProvisionDialog: React.FC = () => { } --createLuisResource=${createLuisResource} --createLuisAuthoringResource=${createLuisAuthoringResource} --createCosmosDb=${createCosmosDb} --createStorage=${createStorage} --createAppInsights=${createAppInsights} --createQnAResource=${createQnAResource}`; const instructions = formatMessage( - 'I am working on a Microsoft Bot Framework project, and I now require some Azure resources to be created.' + - ' Please follow the instructions below to create these resources and provide them to me.\n\n' + + 'I am creating a conversational experience using Microsoft Bot Framework project. For my project to work,' + + 'Azure resources, including app registration, hosting, channels, Language Understanding, and QnA Maker,' + + 'are required. Below are the steps to create these resources.' + '1. Follow the instructions at the link below to run the provisioning command (seen below)\n' + '2. Copy and paste the resulting JSON and securely share it with me.\n\n' + 'Provisoning Command:\n' + @@ -1315,12 +1316,12 @@ export const AzureProvisionDialog: React.FC = () => {