From 3d45b5ba73d9a50e2f12ad56690a05be4d82c25e Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 30 Nov 2018 09:48:59 +0100 Subject: [PATCH] make getAll return array instead of object --- public/app/features/explore/Explore.tsx | 2 +- public/app/features/plugins/datasource_srv.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/app/features/explore/Explore.tsx b/public/app/features/explore/Explore.tsx index 4bc9dd31f12..1c609897995 100644 --- a/public/app/features/explore/Explore.tsx +++ b/public/app/features/explore/Explore.tsx @@ -144,7 +144,7 @@ export class Explore extends React.PureComponent { if (!datasourceSrv) { throw new Error('No datasource service passed as props.'); } - const datasources = Object['values'](datasourceSrv.getAll()); + const datasources = datasourceSrv.getAll(); const exploreDatasources = datasources.map(ds => ({ value: ds.name, label: ds.name, diff --git a/public/app/features/plugins/datasource_srv.ts b/public/app/features/plugins/datasource_srv.ts index 9a3a5227586..d5e4c247073 100644 --- a/public/app/features/plugins/datasource_srv.ts +++ b/public/app/features/plugins/datasource_srv.ts @@ -74,7 +74,8 @@ export class DatasourceSrv { } getAll() { - return config.datasources; + const { datasources } = config; + return Object.keys(datasources).map(name => datasources[name]); } getAnnotationSources() {