Skip to content

Commit

Permalink
fix(basic.gblib): Impersonated SET MAX LINES.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Aug 28, 2022
1 parent 7e7fb27 commit 8f373f3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 20 deletions.
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"botbuilder-ai": "4.11.0",
"botbuilder-dialogs": "4.11.0",
"botframework-connector": "4.11.0",
"botlib": "1.10.8",
"botlib": "1.10.9",
"c3-chart-maker": "^0.2.8",
"cli-spinner": "0.2.10",
"core-js": "3.14.0",
Expand Down
18 changes: 14 additions & 4 deletions packages/basic.gblib/services/DialogKeywords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ export class DialogKeywords {

step: GBDialogStep;

/**
* SYSTEM account maxLines, when used with impersonated contexts (eg. running in SET SCHEDULE).
*/
maxLines: number = 2000;

public async getDeployer() {
return this.min.deployService;
}
Expand Down Expand Up @@ -729,10 +734,15 @@ export class DialogKeywords {
*
*/
public async setMaxLines(step, count) {
const user = await this.min.userProfile.get(step.context, {});
user.basicOptions.maxLines = count;
await this.min.userProfile.set(step.context, user);
this.user = user;
if (step) {
const user = await this.min.userProfile.get(step.context, {});
user.basicOptions.maxLines = count;
await this.min.userProfile.set(step.context, user);
this.user = user;
}
else {
await this.maxLines = count;
}
}


Expand Down
5 changes: 4 additions & 1 deletion packages/basic.gblib/services/SystemKeywords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,15 @@ export class SystemKeywords {

// MAX LINES property.

let maxLines = 1000;
let maxLines;
if (this.dk.user && this.dk.user.basicOptions && this.dk.user.basicOptions.maxLines) {
if (this.dk.user.basicOptions.maxLines.toString().toLowerCase() !== "default") {
maxLines = Number.parseInt(this.dk.user.basicOptions.maxLines).valueOf();
}
}
else {
maxLines = this.dk.maxLines;
}

// Choose data sources based on file type (HTML Table, data variable or sheet file)

Expand Down
2 changes: 1 addition & 1 deletion packages/core.gbapp/services/GBDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class GBDeployer implements IGBDeployer {
/**
* Deploys a new blank bot to the database, cognitive services and other services.
*/
public async deployBlankBot(botId: string, mobile: string = null, email: string = null) {
public async deployBlankBot(botId: string, mobile: string, email: string) {

// Creates a new row on the GuaribasInstance table.

Expand Down

0 comments on commit 8f373f3

Please sign in to comment.