diff --git a/frontend/package.json b/frontend/package.json index 0c79c47b1d..25036d24fe 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -82,6 +82,7 @@ "react-drag-listview": "2.0.0", "react-error-boundary": "4.0.11", "react-force-graph": "^1.43.0", + "react-full-screen": "1.1.1", "react-grid-layout": "^1.3.4", "react-helmet-async": "1.3.0", "react-i18next": "^11.16.1", diff --git a/frontend/public/locales/en/dashboard.json b/frontend/public/locales/en/dashboard.json index 7c4b894e76..5602ec5592 100644 --- a/frontend/public/locales/en/dashboard.json +++ b/frontend/public/locales/en/dashboard.json @@ -17,6 +17,7 @@ "layout_saved_successfully": "Layout saved successfully", "add_panel": "Add Panel", "save_layout": "Save Layout", + "full_view": "Full Screen View", "variable_updated_successfully": "Variable updated successfully", "error_while_updating_variable": "Error while updating variable", "dashboard_has_been_updated": "Dashboard has been updated", diff --git a/frontend/src/container/GridCardLayout/GridCardLayout.styles.scss b/frontend/src/container/GridCardLayout/GridCardLayout.styles.scss new file mode 100644 index 0000000000..08de391e4c --- /dev/null +++ b/frontend/src/container/GridCardLayout/GridCardLayout.styles.scss @@ -0,0 +1,7 @@ +.fullscreen-grid-container { + overflow: auto; + + .react-grid-layout { + border: none !important; + } +} diff --git a/frontend/src/container/GridCardLayout/GridCardLayout.tsx b/frontend/src/container/GridCardLayout/GridCardLayout.tsx index e3a346ef82..19d7244f5e 100644 --- a/frontend/src/container/GridCardLayout/GridCardLayout.tsx +++ b/frontend/src/container/GridCardLayout/GridCardLayout.tsx @@ -1,3 +1,5 @@ +import './GridCardLayout.styles.scss'; + import { PlusOutlined, SaveFilled } from '@ant-design/icons'; import { SOMETHING_WENT_WRONG } from 'constants/api'; import { PANEL_TYPES } from 'constants/queryBuilder'; @@ -5,7 +7,9 @@ import { useUpdateDashboard } from 'hooks/dashboard/useUpdateDashboard'; import useComponentPermission from 'hooks/useComponentPermission'; import { useIsDarkMode } from 'hooks/useDarkMode'; import { useNotifications } from 'hooks/useNotifications'; +import { FullscreenIcon } from 'lucide-react'; import { useDashboard } from 'providers/Dashboard/Dashboard'; +import { FullScreen, useFullScreenHandle } from 'react-full-screen'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import { AppState } from 'store/reducers'; @@ -34,6 +38,7 @@ function GraphLayout({ onAddPanelHandler }: GraphLayoutProps): JSX.Element { isDashboardLocked, } = useDashboard(); const { data } = selectedDashboard || {}; + const handle = useFullScreenHandle(); const { widgets, variables } = data || {}; @@ -106,6 +111,15 @@ function GraphLayout({ onAddPanelHandler }: GraphLayoutProps): JSX.Element { <> {!isDashboardLocked && ( + + {saveLayoutPermission && (