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 { GBDeployer } from '../../core.gbapp/services/GBDeployer';
|
||||||
import { SecService } from '../../security.gbapp/services/SecService';
|
import { SecService } from '../../security.gbapp/services/SecService';
|
||||||
const request = require('request-promise-native');
|
const request = require('request-promise-native');
|
||||||
const MicrosoftGraph = require('@microsoft/microsoft-graph-client');
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const sgMail = require('@sendgrid/mail');
|
const sgMail = require('@sendgrid/mail');
|
||||||
|
|
||||||
|
|
|
@ -769,7 +769,7 @@ export class GBConversationalService {
|
||||||
const user = await min.userProfile.get(step.context, {});
|
const user = await min.userProfile.get(step.context, {});
|
||||||
const systemUser = user.systemUser;
|
const systemUser = user.systemUser;
|
||||||
|
|
||||||
if (text !== null) {
|
if (text && text !== "") {
|
||||||
text = await min.conversationalService.translate(
|
text = await min.conversationalService.translate(
|
||||||
min,
|
min,
|
||||||
text,
|
text,
|
||||||
|
|
|
@ -59,21 +59,29 @@ export class QualityDialog extends IGBDialog {
|
||||||
const service = new CSService();
|
const service = new CSService();
|
||||||
|
|
||||||
min.dialogs.add(new WaterfallDialog('/quality', [
|
min.dialogs.add(new WaterfallDialog('/quality', [
|
||||||
async step => {
|
async step => {
|
||||||
const locale = step.context.activity.locale;
|
const locale = step.context.activity.locale;
|
||||||
const user = await min.userProfile.get(step.context, {});
|
const user = await min.userProfile.get(step.context, {});
|
||||||
|
|
||||||
const score = step.result;
|
const score = step.result;
|
||||||
|
|
||||||
setTimeout(
|
|
||||||
() => min.conversationalService.sendEvent(min, step, 'stop', undefined),
|
|
||||||
400
|
|
||||||
);
|
|
||||||
|
|
||||||
if (score === 0) {
|
if (score === 0) {
|
||||||
await min.conversationalService.sendText(min, step, Messages[locale].im_sorry_lets_try);
|
await min.conversationalService.sendText(min, step, Messages[locale].im_sorry_lets_try);
|
||||||
|
|
||||||
|
return await step.next();
|
||||||
} else {
|
} else {
|
||||||
await min.conversationalService.sendText(min, step, Messages[locale].great_thanks);
|
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(
|
await service.insertQuestionAlternate(
|
||||||
min.instance.instanceId,
|
min.instance.instanceId,
|
||||||
|
@ -89,10 +97,8 @@ export class QualityDialog extends IGBDialog {
|
||||||
|
|
||||||
// Goes to the ask loop.
|
// 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 {
|
} else {
|
||||||
throw new Error('Invalid use of /ask');
|
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 => {
|
async step => {
|
||||||
if (step.result) {
|
if (step.result) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue