diff --git a/public/app/features/connections/pages/AddNewConnectionPage.tsx b/public/app/features/connections/pages/AddNewConnectionPage.tsx index e9431d4eca9..b250b670a3a 100644 --- a/public/app/features/connections/pages/AddNewConnectionPage.tsx +++ b/public/app/features/connections/pages/AddNewConnectionPage.tsx @@ -1,18 +1,29 @@ +import { css } from '@emotion/css'; import { useState } from 'react'; -import { PluginType } from '@grafana/data'; +import { PluginType, GrafanaTheme2 } from '@grafana/data'; +import { useStyles2 } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; +import { RoadmapLinks } from 'app/features/plugins/admin/components/RoadmapLinks'; import UpdateAllButton from 'app/features/plugins/admin/components/UpdateAllButton'; import UpdateAllModal from 'app/features/plugins/admin/components/UpdateAllModal'; import { useGetUpdatable } from 'app/features/plugins/admin/state/hooks'; import { AddNewConnection } from '../tabs/ConnectData'; +const getStyles = (theme: GrafanaTheme2) => ({ + pageContainer: css({ + height: '100vh', + overflow: 'hidden', + }), +}); + export function AddNewConnectionPage() { const { isLoading: areUpdatesLoading, updatablePlugins } = useGetUpdatable(); const updatableDSPlugins = updatablePlugins.filter((plugin) => plugin.type === PluginType.datasource); const [showUpdateModal, setShowUpdateModal] = useState(false); const disableUpdateAllButton = updatableDSPlugins.length <= 0 || areUpdatesLoading; + const styles = useStyles2(getStyles); const onUpdateAll = () => { setShowUpdateModal(true); @@ -27,9 +38,10 @@ export function AddNewConnectionPage() { ); return ( - + + { await userEvent.click(await screen.findByText('Sample data source')); expect(screen.queryByText(new RegExp(exampleSentenceInModal))).toBeInTheDocument(); }); - - test('Show request data source and roadmap links', async () => { - renderPage([getCatalogPluginMock(), mockCatalogDataSourcePlugin]); - - expect(await screen.findByText('Request a new data source')).toBeInTheDocument(); - expect(await screen.findByText('View roadmap')).toBeInTheDocument(); - }); }); diff --git a/public/app/features/connections/tabs/ConnectData/ConnectData.tsx b/public/app/features/connections/tabs/ConnectData/ConnectData.tsx index c2957147241..263cdc03042 100644 --- a/public/app/features/connections/tabs/ConnectData/ConnectData.tsx +++ b/public/app/features/connections/tabs/ConnectData/ConnectData.tsx @@ -9,7 +9,6 @@ import { LoadingPlaceholder, EmptyState, Field, RadioButtonGroup, Tooltip, Combo import { contextSrv } from 'app/core/core'; import { useQueryParams } from 'app/core/hooks/useQueryParams'; import { HorizontalGroup } from 'app/features/plugins/admin/components/HorizontalGroup'; -import { RoadmapLinks } from 'app/features/plugins/admin/components/RoadmapLinks'; import { SearchField } from 'app/features/plugins/admin/components/SearchField'; import { Sorters } from 'app/features/plugins/admin/helpers'; import { useHistory } from 'app/features/plugins/admin/hooks/useHistory'; @@ -23,6 +22,17 @@ import { CategoryHeader } from './CategoryHeader'; import { NoAccessModal } from './NoAccessModal'; const getStyles = (theme: GrafanaTheme2) => ({ + searchContainer: css({ + backgroundColor: theme.colors.background.primary, + paddingTop: theme.spacing(2), + paddingBottom: theme.spacing(2), + borderBottom: `1px solid ${theme.colors.border.weak}`, + marginBottom: theme.spacing(2), + }), + contentWrap: css({ + height: 'calc(100vh - 350px)', + overflowY: 'auto', + }), spacer: css({ height: theme.spacing(2), }), @@ -145,99 +155,105 @@ export function AddNewConnection() { return ( <> {focusedItem && } - - - - - - {/* Filter by installed / all */} - {remotePluginsAvailable ? ( - - - - ) : ( - -
- - - -
-
- )} - {/* Sorting */} - - +
+ + + - - + + {/* Filter by installed / all */} + {remotePluginsAvailable ? ( + + + + ) : ( + +
+ + + +
+
+ )} - {isLoading ? ( - - ) : !!error ? ( - - Error message: "{{ error: error.message }}" - - ) : ( - <> - {/* Data Sources Section */} - {dataSourcesPlugins.length > 0 && ( - <> - + - - - )} + +
+ +
+
+ {isLoading ? ( + + ) : !!error ? ( + + Error message: "{{ error: error.message }}" + + ) : ( + <> + {/* Data Sources Section */} + {dataSourcesPlugins.length > 0 && ( + <> + + + + )} - {/* Apps Section */} - {appsPlugins.length > 0 && ( - <> -
- - - - )} - - )} + {/* Apps Section */} + {appsPlugins.length > 0 && ( + <> +
+ + + + )} + + )} - {showNoResults && ( - - )} - + {showNoResults && ( + + )} +
); } diff --git a/public/app/features/plugins/admin/pages/Browse.tsx b/public/app/features/plugins/admin/pages/Browse.tsx index a8b0ee559e7..cbd3637fe55 100644 --- a/public/app/features/plugins/admin/pages/Browse.tsx +++ b/public/app/features/plugins/admin/pages/Browse.tsx @@ -94,57 +94,59 @@ export default function Browse() { ); return ( - + - - - - - - {/* Filter by type */} - - - ) : ( - -
- - - -
-
- )} + + {/* Filter by installed / all */} + {remotePluginsAvailable ? ( + + + + ) : ( + +
+ + + +
+
+ )} +
- +
@@ -161,14 +163,26 @@ export default function Browse() { } const getStyles = (theme: GrafanaTheme2) => ({ + pageContainer: css({ + height: '100vh', + overflow: 'hidden', + }), + searchContainer: css({ + backgroundColor: theme.colors.background.primary, + paddingTop: theme.spacing(2), + paddingBottom: theme.spacing(2), + borderBottom: `1px solid ${theme.colors.border.weak}`, + marginBottom: theme.spacing(2), + }), + listWrap: css({ + height: 'calc(100vh - 350px)', + overflowY: 'auto', + }), actionBar: css({ [theme.breakpoints.up('xl')]: { marginLeft: 'auto', }, }), - listWrap: css({ - marginTop: theme.spacing(2), - }), displayAs: css({ svg: { marginRight: 0,