diff --git a/dashboard/client/dashboard.js b/dashboard/client/dashboard.js index 64086f3f4e..a5e991183e 100644 --- a/dashboard/client/dashboard.js +++ b/dashboard/client/dashboard.js @@ -72,8 +72,8 @@ Template.dashboard.helpers({ return instance.chartData.get(); }, proxyBackends () { - // Fetch proxy backends - const proxyBackends = ProxyBackends.find().fetch(); + // Fetch proxy backends and sort them by name + const proxyBackends = ProxyBackends.find({}, { sort: { 'apiUmbrella.name': 1 } }).fetch(); // Get the current selected backend const backendParameter = FlowRouter.getQueryParam('backend'); diff --git a/organizations/client/profile/apis/connect_api/connect_api.js b/organizations/client/profile/apis/connect_api/connect_api.js index 2325ebfba6..ed3abdd342 100644 --- a/organizations/client/profile/apis/connect_api/connect_api.js +++ b/organizations/client/profile/apis/connect_api/connect_api.js @@ -9,15 +9,10 @@ import OrganizationApis from '/organization_apis/collection'; Template.connectApiToOrganizationModal.onCreated(function () { const instance = this; - // Set status data is not ready - instance.dataIsReady = new ReactiveVar(false); instance.unlinkedApis = new ReactiveVar(); // Get data about apis without organization Meteor.call('getCurrentUserUnlinkedApis', (error, apis) => { - // Set status data is ready - instance.dataIsReady.set(true); - // Create array of unlinked API options for API select const unlinkedApiOptions = _.map(apis, (api) => { return { diff --git a/organizations/server/methods.js b/organizations/server/methods.js index 242ceb2788..2f8d7769c9 100644 --- a/organizations/server/methods.js +++ b/organizations/server/methods.js @@ -39,8 +39,8 @@ Meteor.methods({ queryParams.managerIds = userId; } - // Return cursor on unlinked apis - return Apis.find(queryParams).fetch(); + // Return sorted list of unlinked apis by name + return Apis.find(queryParams, { sort: { name: 1 } }).fetch(); } // Return undefined result for anonymous user