mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
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:
@@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user