diff --git a/dashboards/src/context/DatasourceStoreProvider.test.tsx b/dashboards/src/context/DatasourceStoreProvider.test.tsx index bd72948..179549c 100644 --- a/dashboards/src/context/DatasourceStoreProvider.test.tsx +++ b/dashboards/src/context/DatasourceStoreProvider.test.tsx @@ -110,14 +110,7 @@ describe('DatasourceStoreProvider::useListDatasourceSelectItems', () => { { editLink: undefined, group: `Default Datasource Plugin for ${FAKE_PLUGIN_NAME}`, - items: [ - { - name: 'Default (localDatasourceA from dashboard)', - selector: { - kind: FAKE_PLUGIN_NAME, - }, - }, - ], + items: [], }, { editLink: undefined, @@ -297,15 +290,7 @@ describe('DatasourceStoreProvider::useListDatasourceSelectItems', () => { { editLink: undefined, group: `Default Datasource Plugin for ${FAKE_PLUGIN_NAME}`, - items: [ - { - // This is the default datasource because first of the list - name: 'Default (datasourceA from project)', - selector: { - kind: FAKE_PLUGIN_NAME, - }, - }, - ], + items: [], }, { editLink: '/projects/perses/datasources', @@ -458,14 +443,7 @@ describe('DatasourceStoreProvider::useListDatasourceSelectItems', () => { { editLink: undefined, group: `Default Datasource Plugin for ${FAKE_PLUGIN_NAME}`, - items: [ - { - name: 'Default (localDatasourceA from dashboard)', - selector: { - kind: FAKE_PLUGIN_NAME, - }, - }, - ], + items: [], }, { editLink: undefined, diff --git a/dashboards/src/context/DatasourceStoreProvider.tsx b/dashboards/src/context/DatasourceStoreProvider.tsx index 5852532..65e98cf 100644 --- a/dashboards/src/context/DatasourceStoreProvider.tsx +++ b/dashboards/src/context/DatasourceStoreProvider.tsx @@ -311,7 +311,7 @@ function buildDatasourceSelectItemGroups(pluginDisplayName: string): { usedNames.add(selectorName); const isExplicitDefault = !isOverridden && spec.default && !explicitDefaultAdded; - if (results[0] && (isFirst || isExplicitDefault)) { + if (results[0] && isExplicitDefault) { // If we haven't added a default yet and this is a default, add default option to the beginning of the results results[0].items = [ {