mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 01:32:34 -05:00
CMS fit and finish (#5542)
* cms connections dont save * added value to enum * remove refresh and update provider name for cms * removed ownerUri from saved connection and contributed to array * removed owneruri * ownerUri not needed any more * removed AAD from cms * initial review * changed comments * add back saveProfile option for connectionProfile * review fixes and other UI improvements * fixed auth * added cms integration tests * added constants * removed utils from apiwrapper * changed connection type name * review comments * clearer code and addressed reviews
This commit is contained in:
@@ -20,7 +20,6 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class CmsResourceTreeNode extends CmsResourceTreeNodeBase {
|
||||
|
||||
private _id: string = undefined;
|
||||
private _serverGroupNodes: ServerGroupTreeNode[] = [];
|
||||
|
||||
public constructor(
|
||||
@@ -33,13 +32,15 @@ export class CmsResourceTreeNode extends CmsResourceTreeNodeBase {
|
||||
parent: TreeNode
|
||||
) {
|
||||
super(name, description, ownerUri, appContext, treeChangeHandler, parent);
|
||||
this._id = `cms_cmsServer_${this.name}`;
|
||||
}
|
||||
|
||||
public async getChildren(): Promise<TreeNode[]> {
|
||||
try {
|
||||
let nodes: TreeNode[] = [];
|
||||
return this.appContext.apiWrapper.createCmsServer(this.connection, this.name, this.description).then(async (result) => {
|
||||
let nodes: CmsResourceTreeNodeBase[] = [];
|
||||
if (!this.ownerUri) {
|
||||
this._ownerUri = await this.appContext.cmsUtils.getUriForConnection(this.connection);
|
||||
}
|
||||
return this.appContext.cmsUtils.createCmsServer(this.connection, this.name, this.description).then((result) => {
|
||||
if (result) {
|
||||
if (result.registeredServersList) {
|
||||
result.registeredServersList.forEach((registeredServer) => {
|
||||
@@ -70,7 +71,7 @@ export class CmsResourceTreeNode extends CmsResourceTreeNodeBase {
|
||||
}
|
||||
}
|
||||
if (nodes.length > 0) {
|
||||
return nodes;
|
||||
return nodes.sort((node1, node2) => node1.name > node2.name ? 1 : -1);
|
||||
} else {
|
||||
return [CmsResourceMessageTreeNode.create(CmsResourceTreeNode.noResourcesLabel, undefined)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user