new(customer-satisfaction): New behaviour while liking content.
This commit is contained in:
parent
3ef4d69c47
commit
ba7f54cac0
4 changed files with 22 additions and 19 deletions
|
@ -38,7 +38,6 @@ import { GBAdminService } from '../../admin.gbapp/services/GBAdminService';
|
|||
import { GBDeployer } from '../../core.gbapp/services/GBDeployer';
|
||||
import { SecService } from '../../security.gbapp/services/SecService';
|
||||
const request = require('request-promise-native');
|
||||
const MicrosoftGraph = require('@microsoft/microsoft-graph-client');
|
||||
const path = require('path');
|
||||
const sgMail = require('@sendgrid/mail');
|
||||
|
||||
|
|
|
@ -769,7 +769,7 @@ export class GBConversationalService {
|
|||
const user = await min.userProfile.get(step.context, {});
|
||||
const systemUser = user.systemUser;
|
||||
|
||||
if (text !== null) {
|
||||
if (text && text !== "") {
|
||||
text = await min.conversationalService.translate(
|
||||
min,
|
||||
text,
|
||||
|
|
|
@ -65,15 +65,23 @@ export class QualityDialog extends IGBDialog {
|
|||
|
||||
const score = step.result;
|
||||
|
||||
setTimeout(
|
||||
() => min.conversationalService.sendEvent(min, step, 'stop', undefined),
|
||||
400
|
||||
);
|
||||
|
||||
if (score === 0) {
|
||||
await min.conversationalService.sendText(min, step, Messages[locale].im_sorry_lets_try);
|
||||
|
||||
return await step.next();
|
||||
} else {
|
||||
await min.conversationalService.sendText(min, step, Messages[locale].great_thanks);
|
||||
await min.conversationalService.sendEvent(min, step, 'play', {
|
||||
playerType: 'markdown',
|
||||
data: {
|
||||
content: Messages[locale].great_thanks,
|
||||
}
|
||||
});
|
||||
let sleep = ms => {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(resolve, ms);
|
||||
});
|
||||
};
|
||||
|
||||
await service.insertQuestionAlternate(
|
||||
min.instance.instanceId,
|
||||
|
@ -89,10 +97,8 @@ export class QualityDialog extends IGBDialog {
|
|||
|
||||
// Goes to the ask loop.
|
||||
|
||||
await step.replaceDialog('/ask', { isReturning: true });
|
||||
return await step.replaceDialog('/ask', { emptyPrompt: true });
|
||||
}
|
||||
|
||||
return await step.next();
|
||||
}
|
||||
]));
|
||||
}
|
||||
|
|
|
@ -100,11 +100,9 @@ export class AskDialog extends IGBDialog {
|
|||
} else {
|
||||
throw new Error('Invalid use of /ask');
|
||||
}
|
||||
if (text.length > 0) {
|
||||
return await min.conversationalService.prompt(min, step, text);
|
||||
}
|
||||
|
||||
return await step.next();
|
||||
return await min.conversationalService.prompt(min, step, text);
|
||||
|
||||
},
|
||||
async step => {
|
||||
if (step.result) {
|
||||
|
|
Loading…
Add table
Reference in a new issue