Initial work for Manage Access dialog (#7483)

* Add width and height properties to checkbox component

* Initial work on manage access dialog

* Add missed change

* Add comments and clean up

* Initial work on manage access dialog

* Add missed change

* Add comments and clean up

* Add return type

* Address comments and use apiWrapper

* Fix compile error
This commit is contained in:
Charles Gagnon
2019-10-03 08:58:06 -07:00
committed by GitHub
parent 6582debd73
commit af24a9d002
13 changed files with 567 additions and 29 deletions

View File

@@ -21,6 +21,7 @@ import * as utils from '../utils';
import { AppContext } from '../appContext';
import { TreeNode } from './treeNodes';
import { MssqlObjectExplorerNodeProvider } from './objectExplorerNodeProvider';
import { ManageAccessDialog } from '../hdfs/ui/hdfsManageAccessDialog';
async function getSaveableUri(apiWrapper: ApiWrapper, fileName: string, isPreview?: boolean): Promise<vscode.Uri> {
let root = utils.getUserHome();
@@ -384,3 +385,24 @@ export class CopyPathCommand extends Command {
}
}
}
export class ManageAccessCommand extends Command {
constructor(appContext: AppContext) {
super('mssqlCluster.manageAccess', appContext);
}
async execute(context: ICommandViewContext | ICommandObjectExplorerContext, ...args: any[]): Promise<void> {
try {
let node = await getNode<HdfsFileSourceNode>(context, this.appContext);
if (node) {
new ManageAccessDialog(node.hdfsPath, node.fileSource, this.apiWrapper).openDialog();
} else {
this.apiWrapper.showErrorMessage(LocalizedConstants.msgMissingNodeContext);
}
} catch (err) {
this.apiWrapper.showErrorMessage(
localize('manageAccessError', "An unexpected error occurred while opening the Manage Access dialog: {0}", utils.getErrorMessage(err, true)));
}
}
}