-
Notifications
You must be signed in to change notification settings - Fork 749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add links to docs in UI #842
Conversation
AzureLoginSuccessDialogContainer, | ||
AzureLoginFailedDialogContainer)); | ||
AzureLoginPromptDialogContainer, | ||
{ ServiceTypes }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this line should be { serviceType: ServiceTypes.Luis }
.
AzureLoginSuccessDialogContainer, | ||
AzureLoginFailedDialogContainer)); | ||
AzureLoginPromptDialogContainer, | ||
{ ServiceTypes }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
AzureLoginSuccessDialogContainer, | ||
AzureLoginFailedDialogContainer)); | ||
AzureLoginPromptDialogContainer, | ||
{ ServiceTypes }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
function* launchConnectedServicePickList( | ||
action: ConnectedServiceAction<ConnectedServicePickerPayload>, | ||
availableServices: IConnectedService[], | ||
serviceType: ServiceTypes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing comma.
@@ -278,20 +286,21 @@ function openLuisDeepLink(luisService: ILuisService): Promise<any> { | |||
regionPrefix = ''; | |||
break; | |||
} | |||
const link = `https://www.${regionPrefix}luis.ai/applications/${appId}/versions/${version}/build`; | |||
const link = `https://www.${ regionPrefix }luis.ai/applications/${ appId }/versions/${ version }/build`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should always build links with cautions. Do something like https://www.${ encodeURI( regionPrefix ) }luis.ai/...
.
return CommandServiceImpl.remoteCall(SharedConstants.Commands.Electron.OpenExternal, link); | ||
} | ||
|
||
function openQnaMakerDeepLink(service: IQnAService): Promise<any> { | ||
const { kbId } = service; | ||
const link = `https://qnamaker.ai/Edit/KnowledgeBase?kbid=${kbId}`; | ||
const link = `https://qnamaker.ai/Edit/KnowledgeBase?kbid=${ kbId }`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use encodeURIComponent(kbId)
here.
encodeURI
is for path.
encodeURIComponent
is for values inside query params.
return CommandServiceImpl.remoteCall(SharedConstants.Commands.Electron.OpenExternal, link); | ||
} | ||
|
||
function openAzureBotServiceDeepLink(service: IBotService): Promise<any> { | ||
const { tenantId, subscriptionId, resourceGroup, id } = service; | ||
const thankYouTsLint = `https://ms.portal.azure.com/#@${tenantId}/resource/subscriptions/${subscriptionId}`; | ||
const link = `${thankYouTsLint}/resourceGroups/${resourceGroup}/providers/Microsoft.BotService/botServices/${id}`; | ||
const thankYouTsLint = `https://ms.portal.azure.com/#@${ tenantId }/resource/subscriptions/${ subscriptionId }`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
const thankYouTsLint = `https://ms.portal.azure.com/#@${tenantId}/resource/subscriptions/${subscriptionId}`; | ||
const link = `${thankYouTsLint}/resourceGroups/${resourceGroup}/providers/Microsoft.BotService/botServices/${id}`; | ||
const thankYouTsLint = `https://ms.portal.azure.com/#@${ tenantId }/resource/subscriptions/${ subscriptionId }`; | ||
const link = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
@@ -13,16 +14,30 @@ export class AzureLoginPromptDialog extends Component<AzureLoginPromptDialogProp | |||
<Dialog cancel={ this.props.cancel } title="Sign in with an Azure account"> | |||
<p>Use your Azure account to sign in to all your Azure services, such as Azure Bot Service, Dispatch, | |||
LUIS, ans QnA Maker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Optional) Try not to use as a space, it's different than a real space.
white-space: normal; | ||
text-decoration: none; | ||
|
||
&:hover { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
<TextField | ||
className={ styles.smallInput } | ||
inputClassName="bot-creation-input" | ||
value={ endpoint.appPassword } | ||
onChanged={ this.onChangeAppPw } | ||
label={ 'MSA app password' } placeholder={ 'Optional' } type={ 'password' }/> | ||
label={ 'MSA app password' } placeholder={ 'Optional' } type={ 'password' } /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label="MSA app password"
- Split it out into multiple lines
- (Optional) Sort the lines
className={ 'secret-checkbox' } | ||
checked={ secretEnabled } | ||
onChange={ this.onToggleSecret } | ||
label={ 'Encrypt keys store in your bot configuration.' } id={ 'bot-secret-checkbox' } /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label="Encrypt keys store in your bot configuration."
- (Optional) Can we not to use
id
? It pollute the environment
onChange={ this.onToggleSecret } | ||
label={ 'Encrypt keys store in your bot configuration.' } id={ 'bot-secret-checkbox' } /> | ||
| ||
<a className={ styles.link } href="https://aka.ms/about-bot-file">Learn more.</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
<Dialog | ||
cancel={ this.props.cancel } | ||
title="Connect your bot to a QnA Maker knowledge base"> | ||
<p>Sign in to your Azure account to select the QnA Maker knowledge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation, or split it out like
<p>
Sign to your Azure ...
bases you'd like
<a href="...">Learn more ...</a>
</p>
<Dialog | ||
cancel={ this.props.cancel } | ||
title="Connect your bot to a Dispatch model"> | ||
<p>Sign in to your Azure account to select the Dispatch model you'd like to associate with this bot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
cancel: () => DialogService.hideDialog(0), | ||
confirm: () => DialogService.hideDialog(1), | ||
addLuisAppManually: () => DialogService.hideDialog(2) | ||
addLuisAppManually: () => DialogService.hideDialog(2), | ||
onAnchorClick: (url) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Optional) No parenthesis for single argument for Lambda functions.
SecretPromptDialog: function mock() { | ||
return undefined; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentations.
@@ -23,7 +42,7 @@ describe('The GetStartedWithCSDialog component should', () => { | |||
mockStore = createStore(combineReducers({ azureAuth })); | |||
mockStore.dispatch(azureArmTokenDataChanged(mockArmToken)); | |||
parent = mount(<Provider store={ mockStore }> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Optional) Split this line into its own line.
parent = mount(
<Provider>
...
</Provider>
);
<a href="javascript:void(0);" onClick={ this.props.launchConnectedServiceEditor }> | ||
connect to a LUIS app manually | ||
</a> | ||
if you know the app ID, version, and authoring key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentations.
} | ||
private get dispatchContent(): JSX.Element { | ||
const { showNoModelsFoundContent, authenticatedUser } = this.props; | ||
if (!showNoModelsFoundContent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line after const
.
private get dispatchContent(): JSX.Element { | ||
const { showNoModelsFoundContent, authenticatedUser } = this.props; | ||
if (!showNoModelsFoundContent) { | ||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line before return
.
if you know the app ID, version, and authoring key. | ||
</> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Optional) Consider use else
here for clarity. I think Uglify will remove it for you for shorter code anyway.
</p> | ||
Alternatively, you can | ||
<a href="javascript:void(0);" onClick={ this.props.launchConnectedServiceEditor }> | ||
connect to a Dispatch app manually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
by entering this app ID and key. | ||
</p> | ||
<p> | ||
<a href="javascript:void(0)" onClick={ this.onLearnMoreDispatch }>Learn more about Dispatch models</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need the trailing
.
const [, payload] = token.split('.'); | ||
const pJson = JSON.parse(atob(payload)); | ||
return {...ownProps, user: (pJson.upn || pJson.unique_name || pJson.name || pJson.email) }; | ||
return { ...ownProps, user: (pJson.upn || pJson.unique_name || pJson.name || pJson.email) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line before return
and after const
.
const [, payload] = token.split('.'); | ||
const pJson = JSON.parse(atob(payload)); | ||
return {...ownProps, user: (pJson.upn || pJson.unique_name || pJson.name || pJson.email) }; | ||
return { ...ownProps, user: (pJson.upn || pJson.unique_name || pJson.name || pJson.email) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use parenthesis here. user: pJson.upn || pJson.unique_name || pJson.name || pJson.email
.
packages/app/client/src/ui/dialogs/getStartedWithCSDialog/getStartedWithCSDialogContainer.ts
Show resolved
Hide resolved
close: () => void; | ||
onAnchorClick: (url: string) => void; | ||
} | ||
export class PostMigrationDialog extends React.Component<PostMigrationDialogProps> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line after interface
and before class
.
<Dialog cancel={ this.onClose } className={ styles.postMigrationDialog } title="Migration complete!"> | ||
<p>We’ve copied your bot endpoints from Emulator v3 and saved them as <strong>.bot files</strong>. | ||
A <strong>.bot file</strong> stores metadata about different services your bot consumes | ||
and enables you to edit these services directly from the Emulator v4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentations.
</p> | ||
<p>You can move a bot to any location by right-clicking the bot’s name under My Bots. | ||
<a href="">Learn more developing locally.</a> | ||
<p>You can move a bot to any location by right-clicking the bot's name under My Bots. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Snap
</p>
back to the line - Do we need trailing
here?
import { PostMigrationDialog, PostMigrationDialogProps } from './postMigrationDialog'; | ||
import { SharedConstants } from '@bfemulator/app-shared'; | ||
|
||
const mapStateToProps = (ownProps: PostMigrationDialogProps) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Optional) Consider:
const mapStateToProps = (ownProps: PostMigrationDialogProps) => ownProps;
onClick={onNewBotClick}>create a new bot configuration.</button> | ||
<span>If you don’t have a bot configuration, | ||
<button className={ styles.ctaLink } | ||
onClick={ onNewBotClick }>create a new bot configuration.</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentations.
<div className={styles.recentBotActionBar}> | ||
<button data-index={index} onClick={this.onDeleteBotClick}></button> | ||
<li className={ styles.recentBot } key={ bot.path }> | ||
<button data-index={ index } onClick={ this.onBotClick } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put one prop on its own line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some minor suggestions. Otherwise looks good to me.
@justinwilaby Since this is a case where only markup was changed and no functionality changed, I think it's acceptable to overlook the minor decrease in code coverage. The drop was only caused due to an increase in markup. What are your thoughts?
...ges/app/client/src/ui/dialogs/connectLuisAppPromptDialog/connectLuisAppPromptDialog.spec.tsx
Outdated
Show resolved
Hide resolved
packages/app/client/src/ui/dialogs/connectLuisAppPromptDialog/connectLuisAppPromptDialog.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Resolves #816