fix(core.gbapp): Investigating BASIC broken.
This commit is contained in:
parent
4351b87973
commit
f0ec25eceb
3 changed files with 25 additions and 8 deletions
|
@ -496,6 +496,8 @@ export class GBMinService {
|
||||||
min.sandBoxMap[mainMethod].step = step;
|
min.sandBoxMap[mainMethod].step = step;
|
||||||
min.sandBoxMap[mainMethod][mainMethod].bind(min.sandBoxMap[mainMethod]);
|
min.sandBoxMap[mainMethod][mainMethod].bind(min.sandBoxMap[mainMethod]);
|
||||||
await min.sandBoxMap[mainMethod][mainMethod]();
|
await min.sandBoxMap[mainMethod][mainMethod]();
|
||||||
|
} else if (context.activity.text === 'Aprovar') {
|
||||||
|
await step.beginDialog('/oppt');
|
||||||
} else if (context.activity.text === 'admin') {
|
} else if (context.activity.text === 'admin') {
|
||||||
await step.beginDialog('/admin');
|
await step.beginDialog('/admin');
|
||||||
|
|
||||||
|
|
|
@ -259,15 +259,8 @@ export class GBVMService extends GBService {
|
||||||
async step => {
|
async step => {
|
||||||
const cbId = step.activeDialog.state.cbId;
|
const cbId = step.activeDialog.state.cbId;
|
||||||
const cb = min.cbMap[cbId];
|
const cb = min.cbMap[cbId];
|
||||||
step.activeDialog.state.cb = cb;
|
|
||||||
|
|
||||||
return await step.next();
|
|
||||||
},
|
|
||||||
async step => {
|
|
||||||
let cb = step.activeDialog.state.cb;
|
|
||||||
cb.bind({ step: step, context: step.context });
|
cb.bind({ step: step, context: step.context });
|
||||||
cb(step.result);
|
await cb(step.result);
|
||||||
|
|
||||||
return await step.next();
|
return await step.next();
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
|
@ -66,6 +66,9 @@ export class AskDialog extends IGBDialog {
|
||||||
min.dialogs.add(new WaterfallDialog('/answerEvent', AskDialog.getAnswerEventDialog(service, min)));
|
min.dialogs.add(new WaterfallDialog('/answerEvent', AskDialog.getAnswerEventDialog(service, min)));
|
||||||
min.dialogs.add(new WaterfallDialog('/answer', AskDialog.getAnswerDialog(min, service)));
|
min.dialogs.add(new WaterfallDialog('/answer', AskDialog.getAnswerDialog(min, service)));
|
||||||
min.dialogs.add(new WaterfallDialog('/ask', AskDialog.getAskDialog(min)));
|
min.dialogs.add(new WaterfallDialog('/ask', AskDialog.getAskDialog(min)));
|
||||||
|
min.dialogs.add(new WaterfallDialog('/oppt', AskDialog.getOPPT(min)));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getAskDialog(min: GBMinInstance) {
|
private static getAskDialog(min: GBMinInstance) {
|
||||||
|
@ -194,4 +197,23 @@ export class AskDialog extends IGBDialog {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static getOPPT(min: GBMinInstance) {
|
||||||
|
return [
|
||||||
|
async step => {
|
||||||
|
await step.context.sendActivity(`Os lançamentos pendentes de aprovação são:" ** \n` +
|
||||||
|
`01: 12/04 Compra de Impressora - R$ 490,05 \n` +
|
||||||
|
`02: 15/04 Almoço - R$ 49,00 \n` +
|
||||||
|
`03: 19/04 Transporte aéreo - R$ 793,10 \n` +
|
||||||
|
`04: 22/04 Despesa de hospedagem - R$ 690,40 \n` +
|
||||||
|
`05: 02/05 Despesa de correios AR - R$ 395,00 \n`);
|
||||||
|
return await step.prompt('textPrompt', '** Informe qual deseja aprovar ou T para aprovar todos" ** ');
|
||||||
|
}
|
||||||
|
, async step => {
|
||||||
|
await step.context.sendActivity('Pronto! Lançamento aprovado. Até a próxima!')
|
||||||
|
return await step.next();
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue