fix(customer-satisfaction.gbapp): New param Feedback Improve Message added.
This commit is contained in:
parent
3320c518ff
commit
ec1ec20175
2 changed files with 14 additions and 8 deletions
|
@ -72,6 +72,9 @@ export class LanguageDialog extends IGBDialog {
|
||||||
{ name: 'english', code: 'en' },
|
{ name: 'english', code: 'en' },
|
||||||
{ name: 'inglês', code: 'en' },
|
{ name: 'inglês', code: 'en' },
|
||||||
{ name: 'portuguese', code: 'pt' },
|
{ name: 'portuguese', code: 'pt' },
|
||||||
|
{ name: 'français', code: 'fr' },
|
||||||
|
{ name: 'francês', code: 'fr' },
|
||||||
|
{ name: 'french', code: 'fr' },
|
||||||
{ name: 'português', code: 'pt' },
|
{ name: 'português', code: 'pt' },
|
||||||
{ name: 'spanish', code: 'es' },
|
{ name: 'spanish', code: 'es' },
|
||||||
{ name: 'espanõl', code: 'es' },
|
{ name: 'espanõl', code: 'es' },
|
||||||
|
|
|
@ -138,21 +138,24 @@ export class FeedbackDialog extends IGBDialog {
|
||||||
},
|
},
|
||||||
async step => {
|
async step => {
|
||||||
const minBoot = GBServer.globals.minBoot as any;
|
const minBoot = GBServer.globals.minBoot as any;
|
||||||
|
const user = await min.userProfile.get(step.context, {});
|
||||||
|
|
||||||
const locale = step.context.activity.locale;
|
|
||||||
const rate = await AzureText.getSentiment(
|
const rate = await AzureText.getSentiment(
|
||||||
minBoot.instance.textAnalyticsKey ?
|
minBoot.instance.textAnalyticsKey ? minBoot.instance.textAnalyticsKey : minBoot.instance.textAnalyticsKey,
|
||||||
minBoot.instance.textAnalyticsKey : minBoot.instance.textAnalyticsKey,
|
minBoot.instance.textAnalyticsEndpoint ? minBoot.instance.textAnalyticsEndpoint : minBoot.instance.textAnalyticsEndpoint,
|
||||||
minBoot.instance.textAnalyticsEndpoint ?
|
user.systemUser.locale,
|
||||||
minBoot.instance.textAnalyticsEndpoint : minBoot.instance.textAnalyticsEndpoint,
|
|
||||||
min.conversationalService.getCurrentLanguage(step),
|
|
||||||
step.result
|
step.result
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const fixedLocale= 'en-US';
|
||||||
if (rate > 0.5) {
|
if (rate > 0.5) {
|
||||||
await min.conversationalService.sendText(min, step, Messages[locale].glad_you_liked);
|
await min.conversationalService.sendText(min, step, Messages[fixedLocale].glad_you_liked);
|
||||||
} else {
|
} else {
|
||||||
await min.conversationalService.sendText(min, step, Messages[locale].we_will_improve);
|
|
||||||
|
const message = min.core.getParam<string>(min.instance, "Feedback Improve Message",
|
||||||
|
Messages[fixedLocale].we_will_improve); // TODO: Improve to be multi-language.
|
||||||
|
|
||||||
|
await min.conversationalService.sendText(min, step, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await step.replaceDialog('/ask', { isReturning: true });
|
return await step.replaceDialog('/ask', { isReturning: true });
|
||||||
|
|
Loading…
Add table
Reference in a new issue