Maddy/prompt password when different (#4537)

* Prompt for password once when the sql instance password doesn't work for hdfs. If the user provides the correct password, connect and continue, else show Unauthorized  node.

* Removed the hardcoded bad password

* Added check for empty folder scenarios

* Added ErrorStatusCode as property of TreeNode. Checking for the error code instead of the error string to avoid localization issues

* type fixed

* implemented hasExpansionError
This commit is contained in:
Maddy
2019-03-19 13:46:55 -07:00
committed by GitHub
parent 330fb6dff5
commit 5e72cd12d1
6 changed files with 64 additions and 13 deletions

View File

@@ -8,11 +8,15 @@
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { ITreeNode } from './types';
import { IFileSource } from './fileSources';
import { SqlClusterConnection } from './connection';
type TreeNodePredicate = (node: TreeNode) => boolean;
export abstract class TreeNode implements ITreeNode {
private _parent: TreeNode = undefined;
protected fileSource: IFileSource;
private _errorStatusCode: number;
public get parent(): TreeNode {
return this._parent;
@@ -22,6 +26,14 @@ export abstract class TreeNode implements ITreeNode {
this._parent = node;
}
public get errorStatusCode(): number {
return this._errorStatusCode;
}
public set errorStatusCode(error: number) {
this._errorStatusCode = error;
}
public generateNodePath(): string {
let path = undefined;
if (this.parent) {
@@ -66,6 +78,9 @@ export abstract class TreeNode implements ITreeNode {
return undefined;
}
public updateFileSource(connection: SqlClusterConnection): void{
this.fileSource = connection.createHdfsFileSource();
}
/**
* The value to use for this node in the node path
*/