mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Sort endpoints (#7402)
This commit is contained in:
@@ -205,6 +205,18 @@ export class BdcDashboardOverviewPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.endpointsRowContainer.clearItems();
|
this.endpointsRowContainer.clearItems();
|
||||||
|
|
||||||
|
// Sort the endpoints. The sort method is that SQL Server Master is first - followed by all
|
||||||
|
// others in alphabetical order by endpoint
|
||||||
|
const sqlServerMasterEndpoints = endpoints.filter(e => e.name === Endpoint.sqlServerMaster);
|
||||||
|
endpoints = endpoints.filter(e => e.name !== Endpoint.sqlServerMaster)
|
||||||
|
.sort((e1, e2) => {
|
||||||
|
if (e1.endpoint < e2.endpoint) { return -1; }
|
||||||
|
if (e1.endpoint > e2.endpoint) { return 1; }
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
endpoints.unshift(...sqlServerMasterEndpoints);
|
||||||
|
|
||||||
endpoints.forEach((e, i) => {
|
endpoints.forEach((e, i) => {
|
||||||
createServiceEndpointRow(this.modelBuilder, this.endpointsRowContainer, e, this.model, hyperlinkedEndpoints.some(he => he === e.name), i === endpoints.length - 1);
|
createServiceEndpointRow(this.modelBuilder, this.endpointsRowContainer, e, this.model, hyperlinkedEndpoints.some(he => he === e.name), i === endpoints.length - 1);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -56,7 +56,14 @@ export function registerServiceEndpoints(context: vscode.ExtensionContext): void
|
|||||||
endpointsArray = endpointsArray.map(e => {
|
endpointsArray = endpointsArray.map(e => {
|
||||||
e.description = getEndpointDisplayText(e.serviceName, e.description);
|
e.description = getEndpointDisplayText(e.serviceName, e.description);
|
||||||
return e;
|
return e;
|
||||||
}).sort((a, b) => a.endpoint.localeCompare(b.endpoint));
|
});
|
||||||
|
|
||||||
|
// Sort the endpoints. The sort method is that SQL Server Master is first - followed by all
|
||||||
|
// others in alphabetical order by endpoint
|
||||||
|
const sqlServerMasterEndpoints = endpointsArray.filter(e => e.serviceName === Endpoint.sqlServerMaster);
|
||||||
|
endpointsArray = endpointsArray.filter(e => e.serviceName !== Endpoint.sqlServerMaster)
|
||||||
|
.sort((e1, e2) => e1.endpoint.localeCompare(e2.endpoint));
|
||||||
|
endpointsArray.unshift(...sqlServerMasterEndpoints);
|
||||||
|
|
||||||
const container = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%', alignItems: 'left' }).component();
|
const container = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%', alignItems: 'left' }).component();
|
||||||
endpointsArray.forEach(endpointInfo => {
|
endpointsArray.forEach(endpointInfo => {
|
||||||
|
|||||||
Reference in New Issue
Block a user