Skip to content

Commit

Permalink
Merge pull request #13 from Codeneos/feature/fix-switch-org-command
Browse files Browse the repository at this point in the history
Fix bug #12 - switch org command causing null ref exception
  • Loading branch information
Codeneos authored May 9, 2019
2 parents 4f1afed + 66687d7 commit 451d3ec
Show file tree
Hide file tree
Showing 8 changed files with 355 additions and 1,802 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
# Changelog Vlocode

## [0.10.1] - 2019-05-09
### Fixed
- Fix bug in switch org command causing null error.
- Prevent log to take focus for each line written; instead only focus on command start.

## [0.10.0] - 2019-05-01
### New
- Build parent key command
- Admin commands from Command Pallet
- Better detection of datapack types
### Changed
- Update vlocity tools to 1.9.4
- Update all dependent packages to their latest releases available from NPM

## [0.8.9] - 2018-12-19
### Changed
- Update vlocity tools to 1.7.11
- Update all dependend packages to their latest relases available from NPM
- Update all dependent packages to their latest releases available from NPM

## [0.8.8] - 2018-12-07
### Changed
Expand Down
2,115 changes: 326 additions & 1,789 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@
"retire": "^2.0.2",
"rimraf": "^2.6.3",
"rxjs": "^6.4.0",
"sfdx-node": "^42.0.0",
"sinon": "^7.3.1",
"terser-webpack-plugin": "^1.2.3",
"ts-loader": "^5.3.3",
Expand All @@ -374,7 +373,7 @@
"vsce": "^1.59.0",
"vscode": "^1.1.33",
"vscode-languageclient": "^5.2.1",
"webpack": "^4.29.6",
"webpack": "^4.31.0",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.2.1",
"webpack-glob-entry": "^2.1.1",
Expand All @@ -383,6 +382,7 @@
},
"dependencies": {
"jsforce": "^1.9.1",
"sfdx-node": "^1.3.2",
"salesforce-alm": "^45.12.0",
"vlocity": "^1.9.4"
}
Expand Down
8 changes: 4 additions & 4 deletions src/commands/selectOrgCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default class SelectOrgCommand extends CommandBase {
}

public validate() : void {
const validaionMessage = this.vloService.validateWorkspaceFolder();
if (validaionMessage) {
throw validaionMessage;
const validationMessage = this.vloService.validateWorkspaceFolder();
if (validationMessage) {
throw validationMessage;
}
}

Expand Down Expand Up @@ -105,7 +105,7 @@ export default class SelectOrgCommand extends CommandBase {
}

this.logger.error(`Unable to authorize at '${instanceUrl}': `, loginResult);
vscode.window.showErrorMessage('Failed to authorize with Salesforce, please verrify you are connected to the internet');
vscode.window.showErrorMessage('Failed to authorize with Salesforce, please verify you are connected to the internet');
return null;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/loggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export class OutputChannelWriter implements LogWriter {
}

public write(level: LogLevel, ...args: any[]) : void {
this.channel.show(true);
this.channel.appendLine(args[0]);
}
}
Expand Down
10 changes: 7 additions & 3 deletions src/services/commandRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import VlocodeService from 'services/vlocodeService';
import * as vscode from 'vscode';
import { Command, CommandMap } from "models/command";
import { VlocodeCommand } from '../constants';
import { isError, isObject, isFunction } from 'util';
import { CommandBase } from 'commands/commandBase';
import { isError } from 'util';

type CommandCtor = (new(name: string) => Command);

Expand Down Expand Up @@ -40,13 +39,18 @@ class CommandExecutor implements Command {
return this.command.name;
}

protected get logger() : Logger {
private get logger() : Logger {
return LogManager.get(CommandExecutor);
}

private get vlocode() : VlocodeService {
return container.get(VlocodeService);
}

public async execute(... args: any[]) : Promise<void> {
this.logger.verbose(`Invoke command ${this.name}`);
try {
this.vlocode.focusLog();
await this.command.execute.apply(this.command, args);
this.logger.verbose(`Execution of command ${this.name} done`);
} catch(err) {
Expand Down
1 change: 0 additions & 1 deletion src/services/salesforceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as jsforce from 'jsforce';
import { DescribeGlobalResult, DescribeSObjectResult } from 'jsforce/describe-result';
import * as path from 'path';
import * as process from 'process';
import * as sfdx from 'sfdx-node';
import * as constants from '../constants';
import * as l from '../loggers';
import * as s from '../serviceContainer';
Expand Down
2 changes: 1 addition & 1 deletion src/services/vlocodeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default class VlocodeService implements vscode.Disposable, JsForceConnect
}

public focusLog() : any {
this.outputChannel.show(false);
this.outputChannel.show(true);
}

public registerDisposable<T extends {dispose() : any}>(disposable: T) : T {
Expand Down

0 comments on commit 451d3ec

Please sign in to comment.