fix(basic.gblib): WA page bug removal.
This commit is contained in:
parent
4314a37916
commit
d902e14f78
4 changed files with 23 additions and 22 deletions
|
@ -228,7 +228,7 @@ export class DialogKeywords {
|
|||
*
|
||||
* @example x = TODAY
|
||||
*/
|
||||
public async getToday({}) {
|
||||
public async getToday({ }) {
|
||||
let d = new Date(),
|
||||
month = '' + (d.getMonth() + 1),
|
||||
day = '' + d.getDate(),
|
||||
|
@ -264,28 +264,28 @@ export class DialogKeywords {
|
|||
*
|
||||
* @example EXIT
|
||||
*/
|
||||
public async exit({}) {}
|
||||
public async exit({ }) { }
|
||||
|
||||
/**
|
||||
* Get active tasks.
|
||||
*
|
||||
* @example list = ACTIVE TASKS
|
||||
*/
|
||||
public async getActiveTasks({ pid }) {}
|
||||
public async getActiveTasks({ pid }) { }
|
||||
|
||||
/**
|
||||
* Creates a new deal.
|
||||
*
|
||||
* @example CREATE DEAL dealname,contato,empresa,amount
|
||||
*/
|
||||
public async createDeal({ pid, dealName, contact, company, amount }) {}
|
||||
public async createDeal({ pid, dealName, contact, company, amount }) { }
|
||||
|
||||
/**
|
||||
* Finds contacts in XRM.
|
||||
*
|
||||
* @example list = FIND CONTACT "Sandra"
|
||||
*/
|
||||
public async fndContact({ pid, name }) {}
|
||||
public async fndContact({ pid, name }) { }
|
||||
|
||||
public getContentLocaleWithCulture(contentLocale) {
|
||||
switch (contentLocale) {
|
||||
|
@ -488,7 +488,7 @@ export class DialogKeywords {
|
|||
* @example SAVE "contacts.xlsx", name, email, NOW
|
||||
*
|
||||
*/
|
||||
public async getNow({}) {
|
||||
public async getNow({ }) {
|
||||
const contentLocale = this.min.core.getParam<string>(
|
||||
this.min.instance,
|
||||
'Default Content Language',
|
||||
|
@ -724,7 +724,7 @@ export class DialogKeywords {
|
|||
* @example MENU
|
||||
*
|
||||
*/
|
||||
public async showMenu({}) {
|
||||
public async showMenu({ }) {
|
||||
// https://github.com/GeneralBots/BotServer/issues/237
|
||||
// return await beginDialog('/menu');
|
||||
}
|
||||
|
@ -828,7 +828,7 @@ export class DialogKeywords {
|
|||
const answer = min.cbMap[userId].promise;
|
||||
|
||||
if (kind === 'sheet') {
|
||||
|
||||
|
||||
// Retrieves the .xlsx file associated with the HEAR var AS file.xlsx.
|
||||
|
||||
let { baseUrl, client } = await GBDeployer.internalGetDriveClient(this.min);
|
||||
|
@ -864,12 +864,11 @@ export class DialogKeywords {
|
|||
let list = [];
|
||||
for (; index < results.text.length; index++) {
|
||||
if (results.text[index][0] !== '') {
|
||||
list.push( results.text[index][0]);
|
||||
list.push(results.text[index][0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Search the answer in one of valid list items loaded from sheeet.
|
||||
|
@ -1121,7 +1120,7 @@ export class DialogKeywords {
|
|||
/**
|
||||
* Talks to the user by using the specified text.
|
||||
*/
|
||||
public async getTalk({ pid, text }) {
|
||||
public async getTalk({ pid, text }): Promise<{ status: number }> {
|
||||
GBLog.info(`BASIC: TALK '${text}'.`);
|
||||
const { min, user } = await DialogKeywords.getProcessInfo(pid);
|
||||
|
||||
|
@ -1130,6 +1129,7 @@ export class DialogKeywords {
|
|||
|
||||
await min.conversationalService['sendOnConversation'](min, user, text);
|
||||
}
|
||||
return { status: 0 };
|
||||
}
|
||||
|
||||
private static getChannel(): string {
|
||||
|
|
|
@ -139,7 +139,7 @@ export class KeywordsExpressions {
|
|||
/^\s*open\s*(.*)/gim,
|
||||
($0, $1, $2) => {
|
||||
let sessionName;
|
||||
let kind = '';
|
||||
let kind = null;
|
||||
let pos;
|
||||
|
||||
if (pos = $1.match(/\s*AS\s*\#/)) {
|
||||
|
@ -655,7 +655,7 @@ export class KeywordsExpressions {
|
|||
// page is not string.
|
||||
// https://github.com/GeneralBots/BotServer/issues/310
|
||||
const params = this.getParams('page,' + $3, ['handle', 'frameOrSelector', 'selector']);
|
||||
return `await wa.click ({pid: pid, ${params}})`;
|
||||
return `await wa.getClick ({pid: pid, ${params}})`;
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -764,7 +764,7 @@ export class KeywordsExpressions {
|
|||
/^\s*set\s*(.*)/gim,
|
||||
($0, $1, $2) => {
|
||||
const params = this.getParams($1, ['file', 'address', 'value']);
|
||||
return `await sys.set ({pid: pid, ${params}})`;
|
||||
return `await sys.getSet ({pid: pid, handle:page, ${params}})`;
|
||||
}
|
||||
];
|
||||
keywords[i++] = [
|
||||
|
|
|
@ -488,14 +488,15 @@ export class SystemKeywords {
|
|||
* @example SET page, "elementHTMLSelector", "text"
|
||||
*
|
||||
*/
|
||||
public async set({ pid, file, address, value }): Promise<any> {
|
||||
public async getSet({ pid, page, file, address, value }): Promise<any> {
|
||||
const { min, user } = await DialogKeywords.getProcessInfo(pid);
|
||||
|
||||
// Handles calls for HTML stuff
|
||||
|
||||
if (file._javascriptEnabled) {
|
||||
const page = file;
|
||||
GBLog.info(`BASIC: Web automation setting ${page}' to '${value}' (SET). `);
|
||||
if (file.indexOf("#") != -1 ||
|
||||
file.indexOf("[") != -1 ) {
|
||||
value = address;
|
||||
GBLog.info(`BASIC: Web automation setting ${file}' to '${value}' (SET). `);
|
||||
await this.wa.setElementText({ page, selector: address, text: value });
|
||||
|
||||
return;
|
||||
|
@ -1694,7 +1695,7 @@ export class SystemKeywords {
|
|||
const address = `${cell}:${cell}`;
|
||||
|
||||
if (value !== found[columnName]) {
|
||||
await this.set({ pid, file, address, value });
|
||||
await this.getSet({ pid, file, page:null, address, value });
|
||||
merges++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@ export class WebAutomationServices {
|
|||
*
|
||||
* @example CLICK page,"#idElement"
|
||||
*/
|
||||
public async click({ pid, handle, frameOrSelector, selector }) {
|
||||
public async getClick({ pid, handle, frameOrSelector, selector }) {
|
||||
const page = this.getPageByHandle(handle);
|
||||
GBLog.info(`BASIC: Web Automation CLICK element: ${frameOrSelector}.`);
|
||||
if (selector) {
|
||||
|
|
Loading…
Add table
Reference in a new issue