diff --git a/package.json b/package.json index 25d0f602..17a2daa5 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,9 @@ "@mui/lab": "^6.0.0-beta.14", "@mui/material": "^6.1.6", "@mui/system": "^6.1.6", - "@mui/x-charts-pro": "^7.0.0-beta.6", - "@mui/x-data-grid-premium": "^7.22.1", - "@mui/x-date-pickers-pro": "^7.22.1", + "@mui/x-charts-pro": "^7.0.0-beta.7", + "@mui/x-data-grid-premium": "^7.22.2", + "@mui/x-date-pickers-pro": "^7.22.2", "@mui/x-tree-view": "^7.22.1", "@tanstack/react-query": "^5.59.20", "@uidotdev/usehooks": "^2.4.1", @@ -115,8 +115,8 @@ "typescript": "^5.6.3", "typescript-eslint": "^8.13.0", "unique-names-generator": "^4.7.1", - "uuid": "^11.0.2", - "vite": "^5.4.10", + "uuid": "^11.0.3", + "vite": "^5.4.11", "vite-plugin-html": "^3.2.2", "vite-plugin-mock-dev-server": "^1.8.0", "vite-plugin-svgr": "^4.3.0", diff --git a/src/locales/de-DE/messages.po b/src/locales/de-DE/messages.po index 5a544504..ae9cd309 100644 --- a/src/locales/de-DE/messages.po +++ b/src/locales/de-DE/messages.po @@ -188,7 +188,7 @@ msgstr "<0>Fix unterstützt die Volltextsuche, indem der Suchbegriff in Anführu msgid "<0>Open Your Authenticator App: Head over to your authenticator app and choose to add a new account manually.<1>Enter Account Details: You'll need to type in your account's email address or username, and the key provided below.<2>Your Key: <3/><4>Verification Type: Make sure to select \"Time-based\" as the verification type.<5>Enter the Code: Once your account is added manually, the app will show a 6-digit code. Pop that code into the box below and hit \"Activate\"." msgstr "<0>Öffnen Sie Ihre Authenticator-App: Gehe zu deiner Authenticator-App und wähle, ein neues Konto manuell hinzuzufügen.<1>Gib Kontodetails ein: Du musst deine E-Mail-Adresse oder Benutzernamen des Kontos eingeben und den untenstehenden Schlüssel verwenden.<2>Dein Schlüssel: <3/><4>Verifizierungstyp: Stelle sicher, dass du \"Zeitbasiert\" als Verifizierungstyp auswählst.<5>Gib den Code ein: Sobald dein Konto manuell hinzugefügt ist, zeigt die App einen 6-stelligen Code an. Gib diesen Code in das untenstehende Feld ein und drücke auf \"Aktivieren\"." -#: src/pages/panel/inventory/getSlides.tsx:59 +#: src/pages/panel/inventory/slides.tsx:59 msgid "<0>Resource Categories are logical groupings of cloud resources by their principal functionality.<1>Categories make it easy to filter the inventory to get an overview of all resources within a category, irrespective of their cloud provider. For example, an Amazon EC2 instance and a Google Cloud Function are both resource kinds within the \"Compute\" category. A resource can only be part of one category, and one category only.<2>Categories are a quicker way to identify the resource kinds in use, and investigate further to detect misconfigurations and compliance issues. You can easily see what cloud and account a specific resource is running in." msgstr "" @@ -204,11 +204,11 @@ msgstr "" msgid "<0>The Infrastructure Overview dashboard provides a high-level snapshot of your multi-cloud environment, helping you understand your resource distribution and recent changes. You get a bird's eye view of the state of your infrastructure and can quickly assess the scale and complexity of your cloud(s).<1><2>The dashboard has three components:<3><4>Asset summary by cloud<5>Resources over time<6>Assets by region<7>With the Infrastructure Overview, you can maintain a comprehensive view of your multi-cloud environment, enabling better decision-making for security, compliance, and optimization efforts.<8>Click <9>\"next\" to learn more about each component." msgstr "" -#: src/pages/panel/inventory/getSlides.tsx:16 +#: src/pages/panel/inventory/slides.tsx:16 msgid "<0>The Inventory in Fix provides visibility into all cloud services in use across your infrastructure. Fix scans cloud APIs to get a complete snapshot of your cloud infrastructure, which helps achieve two goals:<1><2><3>Understand cloud usage<4>Prevent shadow IT<5>Shadow IT is the unauthorized use of cloud services by your developers, bypassing official IT channels and potentially creating security, compliance, and management challenges. Full visibility into your inventory makes for better governance over what cloud services can and cannot be used, along with enforcement of related security policies.<6>Fix provides coverage of over 300 cloud services across AWS, Microsoft Azure and Google Cloud. For a full list of services, please visit our documentation.<7><8>AWS: <9>{awsDocUrl}<10>Google Cloud: <11>{gcpDocUrl}<12>Microsoft Azure: <13>{azureDocUrl}" msgstr "" -#: src/pages/panel/inventory/getSlides.tsx:80 +#: src/pages/panel/inventory/slides.tsx:80 msgid "<0>The resource list is a complete snapshot of the resources in your cloud infrastructure, aggregated by resource kind.<1>A resource \"kind\" is an individual resource type, for example an Amazon S3 Bucket, or an Azure Virtual Machine. For more context on each resource kind, click on the kind in the list and a window with a resource detail view will appear.<2>In addition to individual kinds, Fix also uses abstractions for common cloud services such as storage buckets, databases, or IP addresses. These \"multi-cloud kinds\" are an easy way to search for a specific type of services across clouds.<3>For example, searching for \"bucket\" in the Explorer tab will surface storage buckets for every cloud: Amazon S3, Google Cloud Storage and Azure Blob Storage." msgstr "" @@ -299,7 +299,7 @@ msgstr "" msgid "Account: {0}" msgstr "Konto: {0}" -#: src/pages/panel/inventory/InventoryPage.tsx:266 +#: src/pages/panel/inventory/InventoryPage.tsx:227 msgid "accounts" msgstr "" @@ -566,7 +566,7 @@ msgstr "" msgid "Back" msgstr "" -#: src/pages/panel/inventory/InventoryPage.tsx:273 +#: src/pages/panel/inventory/InventoryPage.tsx:234 msgid "Base kind" msgstr "" @@ -797,7 +797,7 @@ msgstr "Schließen" #: src/pages/panel/benchmark-detail/BenchmarkDetailCheckDetail.tsx:163 #: src/pages/panel/inventory-search/inventory-form/InventoryFormCloudValues.tsx:62 #: src/pages/panel/inventory-search/inventory-form/InventoryFormMore.tsx:92 -#: src/pages/panel/inventory/InventoryPage.tsx:273 +#: src/pages/panel/inventory/InventoryPage.tsx:234 #: src/pages/panel/resource-detail/ResourceDetailView.tsx:252 msgid "Cloud" msgstr "Cloud" @@ -815,7 +815,7 @@ msgstr "" msgid "Cloud Inventory" msgstr "Cloud Inventar" -#: src/pages/panel/inventory/InventoryPage.tsx:265 +#: src/pages/panel/inventory/InventoryPage.tsx:226 msgid "clouds" msgstr "" @@ -1597,8 +1597,8 @@ msgstr "" msgid "Invalid Value" msgstr "Ungültiger Wert" -#: src/pages/panel/inventory/getSlides.tsx:13 -#: src/pages/panel/inventory/InventoryPage.tsx:223 +#: src/pages/panel/inventory/InventoryPage.tsx:213 +#: src/pages/panel/inventory/slides.tsx:13 #: src/shared/layouts/panel-layout/menuList.tsx:19 msgid "Inventory" msgstr "Inventar" @@ -1625,7 +1625,7 @@ msgstr "" msgid "Kind" msgstr "Art" -#: src/pages/panel/inventory/InventoryPage.tsx:268 +#: src/pages/panel/inventory/InventoryPage.tsx:229 msgid "kinds" msgstr "" @@ -1654,7 +1654,7 @@ msgstr "" msgid "Last used" msgstr "" -#: src/shared/right-slider/HelpSlider.tsx:30 +#: src/shared/right-slider/HelpSlider.tsx:45 msgid "Learn more" msgstr "" @@ -1849,8 +1849,8 @@ msgstr "Neue Sicherheitsprobleme entdeckt" msgid "New to Fix? <0>Create an account" msgstr "" -#: src/pages/panel/inventory/DataGridPagination.tsx:61 -#: src/shared/right-slider/HelpSlider.tsx:114 +#: src/pages/panel/inventory/DataGridPagination.tsx:62 +#: src/shared/right-slider/HelpSlider.tsx:129 msgid "Next" msgstr "" @@ -2143,8 +2143,8 @@ msgstr "" msgid "Press: Create Service and fill out the form." msgstr "" -#: src/pages/panel/inventory/DataGridPagination.tsx:61 -#: src/shared/right-slider/HelpSlider.tsx:98 +#: src/pages/panel/inventory/DataGridPagination.tsx:62 +#: src/shared/right-slider/HelpSlider.tsx:113 msgid "Previous" msgstr "" @@ -2232,7 +2232,7 @@ msgstr "Regenerieren" msgid "Region" msgstr "Region" -#: src/pages/panel/inventory/InventoryPage.tsx:267 +#: src/pages/panel/inventory/InventoryPage.tsx:228 msgid "regions" msgstr "" @@ -2279,7 +2279,7 @@ msgstr "Passwort zurücksetzen" msgid "Resource" msgstr "" -#: src/pages/panel/inventory/getSlides.tsx:56 +#: src/pages/panel/inventory/slides.tsx:56 msgid "Resource Categories" msgstr "" @@ -2309,7 +2309,7 @@ msgstr "Ressource gelöscht" msgid "Resource kind" msgstr "" -#: src/pages/panel/inventory/getSlides.tsx:77 +#: src/pages/panel/inventory/slides.tsx:77 msgid "Resource List" msgstr "" diff --git a/src/locales/en-US/messages.po b/src/locales/en-US/messages.po index 16f65e49..a5a83c00 100644 --- a/src/locales/en-US/messages.po +++ b/src/locales/en-US/messages.po @@ -188,7 +188,7 @@ msgstr "<0>Fix supports full text search by encasing the search term in double q msgid "<0>Open Your Authenticator App: Head over to your authenticator app and choose to add a new account manually.<1>Enter Account Details: You'll need to type in your account's email address or username, and the key provided below.<2>Your Key: <3/><4>Verification Type: Make sure to select \"Time-based\" as the verification type.<5>Enter the Code: Once your account is added manually, the app will show a 6-digit code. Pop that code into the box below and hit \"Activate\"." msgstr "<0>Open Your Authenticator App: Head over to your authenticator app and choose to add a new account manually.<1>Enter Account Details: You'll need to type in your account's email address or username, and the key provided below.<2>Your Key: <3/><4>Verification Type: Make sure to select \"Time-based\" as the verification type.<5>Enter the Code: Once your account is added manually, the app will show a 6-digit code. Pop that code into the box below and hit \"Activate\"." -#: src/pages/panel/inventory/getSlides.tsx:59 +#: src/pages/panel/inventory/slides.tsx:59 msgid "<0>Resource Categories are logical groupings of cloud resources by their principal functionality.<1>Categories make it easy to filter the inventory to get an overview of all resources within a category, irrespective of their cloud provider. For example, an Amazon EC2 instance and a Google Cloud Function are both resource kinds within the \"Compute\" category. A resource can only be part of one category, and one category only.<2>Categories are a quicker way to identify the resource kinds in use, and investigate further to detect misconfigurations and compliance issues. You can easily see what cloud and account a specific resource is running in." msgstr "<0>Resource Categories are logical groupings of cloud resources by their principal functionality.<1>Categories make it easy to filter the inventory to get an overview of all resources within a category, irrespective of their cloud provider. For example, an Amazon EC2 instance and a Google Cloud Function are both resource kinds within the \"Compute\" category. A resource can only be part of one category, and one category only.<2>Categories are a quicker way to identify the resource kinds in use, and investigate further to detect misconfigurations and compliance issues. You can easily see what cloud and account a specific resource is running in." @@ -204,11 +204,11 @@ msgstr "<0>The assets by region is a world map that displays active regions and msgid "<0>The Infrastructure Overview dashboard provides a high-level snapshot of your multi-cloud environment, helping you understand your resource distribution and recent changes. You get a bird's eye view of the state of your infrastructure and can quickly assess the scale and complexity of your cloud(s).<1><2>The dashboard has three components:<3><4>Asset summary by cloud<5>Resources over time<6>Assets by region<7>With the Infrastructure Overview, you can maintain a comprehensive view of your multi-cloud environment, enabling better decision-making for security, compliance, and optimization efforts.<8>Click <9>\"next\" to learn more about each component." msgstr "<0>The Infrastructure Overview dashboard provides a high-level snapshot of your multi-cloud environment, helping you understand your resource distribution and recent changes. You get a bird's eye view of the state of your infrastructure and can quickly assess the scale and complexity of your cloud(s).<1><2>The dashboard has three components:<3><4>Asset summary by cloud<5>Resources over time<6>Assets by region<7>With the Infrastructure Overview, you can maintain a comprehensive view of your multi-cloud environment, enabling better decision-making for security, compliance, and optimization efforts.<8>Click <9>\"next\" to learn more about each component." -#: src/pages/panel/inventory/getSlides.tsx:16 +#: src/pages/panel/inventory/slides.tsx:16 msgid "<0>The Inventory in Fix provides visibility into all cloud services in use across your infrastructure. Fix scans cloud APIs to get a complete snapshot of your cloud infrastructure, which helps achieve two goals:<1><2><3>Understand cloud usage<4>Prevent shadow IT<5>Shadow IT is the unauthorized use of cloud services by your developers, bypassing official IT channels and potentially creating security, compliance, and management challenges. Full visibility into your inventory makes for better governance over what cloud services can and cannot be used, along with enforcement of related security policies.<6>Fix provides coverage of over 300 cloud services across AWS, Microsoft Azure and Google Cloud. For a full list of services, please visit our documentation.<7><8>AWS: <9>{awsDocUrl}<10>Google Cloud: <11>{gcpDocUrl}<12>Microsoft Azure: <13>{azureDocUrl}" msgstr "<0>The Inventory in Fix provides visibility into all cloud services in use across your infrastructure. Fix scans cloud APIs to get a complete snapshot of your cloud infrastructure, which helps achieve two goals:<1><2><3>Understand cloud usage<4>Prevent shadow IT<5>Shadow IT is the unauthorized use of cloud services by your developers, bypassing official IT channels and potentially creating security, compliance, and management challenges. Full visibility into your inventory makes for better governance over what cloud services can and cannot be used, along with enforcement of related security policies.<6>Fix provides coverage of over 300 cloud services across AWS, Microsoft Azure and Google Cloud. For a full list of services, please visit our documentation.<7><8>AWS: <9>{awsDocUrl}<10>Google Cloud: <11>{gcpDocUrl}<12>Microsoft Azure: <13>{azureDocUrl}" -#: src/pages/panel/inventory/getSlides.tsx:80 +#: src/pages/panel/inventory/slides.tsx:80 msgid "<0>The resource list is a complete snapshot of the resources in your cloud infrastructure, aggregated by resource kind.<1>A resource \"kind\" is an individual resource type, for example an Amazon S3 Bucket, or an Azure Virtual Machine. For more context on each resource kind, click on the kind in the list and a window with a resource detail view will appear.<2>In addition to individual kinds, Fix also uses abstractions for common cloud services such as storage buckets, databases, or IP addresses. These \"multi-cloud kinds\" are an easy way to search for a specific type of services across clouds.<3>For example, searching for \"bucket\" in the Explorer tab will surface storage buckets for every cloud: Amazon S3, Google Cloud Storage and Azure Blob Storage." msgstr "<0>The resource list is a complete snapshot of the resources in your cloud infrastructure, aggregated by resource kind.<1>A resource \"kind\" is an individual resource type, for example an Amazon S3 Bucket, or an Azure Virtual Machine. For more context on each resource kind, click on the kind in the list and a window with a resource detail view will appear.<2>In addition to individual kinds, Fix also uses abstractions for common cloud services such as storage buckets, databases, or IP addresses. These \"multi-cloud kinds\" are an easy way to search for a specific type of services across clouds.<3>For example, searching for \"bucket\" in the Explorer tab will surface storage buckets for every cloud: Amazon S3, Google Cloud Storage and Azure Blob Storage." @@ -299,7 +299,7 @@ msgstr "Account usage" msgid "Account: {0}" msgstr "Account: {0}" -#: src/pages/panel/inventory/InventoryPage.tsx:266 +#: src/pages/panel/inventory/InventoryPage.tsx:227 msgid "accounts" msgstr "accounts" @@ -566,7 +566,7 @@ msgstr "Azure Service Management" msgid "Back" msgstr "Back" -#: src/pages/panel/inventory/InventoryPage.tsx:273 +#: src/pages/panel/inventory/InventoryPage.tsx:234 msgid "Base kind" msgstr "Base kind" @@ -797,7 +797,7 @@ msgstr "Close" #: src/pages/panel/benchmark-detail/BenchmarkDetailCheckDetail.tsx:163 #: src/pages/panel/inventory-search/inventory-form/InventoryFormCloudValues.tsx:62 #: src/pages/panel/inventory-search/inventory-form/InventoryFormMore.tsx:92 -#: src/pages/panel/inventory/InventoryPage.tsx:273 +#: src/pages/panel/inventory/InventoryPage.tsx:234 #: src/pages/panel/resource-detail/ResourceDetailView.tsx:252 msgid "Cloud" msgstr "Cloud" @@ -815,7 +815,7 @@ msgstr "Cloud Accounts" msgid "Cloud Inventory" msgstr "Cloud Inventory" -#: src/pages/panel/inventory/InventoryPage.tsx:265 +#: src/pages/panel/inventory/InventoryPage.tsx:226 msgid "clouds" msgstr "clouds" @@ -1597,8 +1597,8 @@ msgstr "Invalid file, Please follow the step-by-step instructions {0}." msgid "Invalid Value" msgstr "Invalid Value" -#: src/pages/panel/inventory/getSlides.tsx:13 -#: src/pages/panel/inventory/InventoryPage.tsx:223 +#: src/pages/panel/inventory/InventoryPage.tsx:213 +#: src/pages/panel/inventory/slides.tsx:13 #: src/shared/layouts/panel-layout/menuList.tsx:19 msgid "Inventory" msgstr "Inventory" @@ -1625,7 +1625,7 @@ msgstr "kind" msgid "Kind" msgstr "Kind" -#: src/pages/panel/inventory/InventoryPage.tsx:268 +#: src/pages/panel/inventory/InventoryPage.tsx:229 msgid "kinds" msgstr "kinds" @@ -1654,7 +1654,7 @@ msgstr "Last scanned: {0} ago" msgid "Last used" msgstr "Last used" -#: src/shared/right-slider/HelpSlider.tsx:30 +#: src/shared/right-slider/HelpSlider.tsx:45 msgid "Learn more" msgstr "Learn more" @@ -1849,8 +1849,8 @@ msgstr "New security issues detected" msgid "New to Fix? <0>Create an account" msgstr "New to Fix? <0>Create an account" -#: src/pages/panel/inventory/DataGridPagination.tsx:61 -#: src/shared/right-slider/HelpSlider.tsx:114 +#: src/pages/panel/inventory/DataGridPagination.tsx:62 +#: src/shared/right-slider/HelpSlider.tsx:129 msgid "Next" msgstr "Next" @@ -2143,8 +2143,8 @@ msgstr "Press the submit button, and Done. 🎉🎊" msgid "Press: Create Service and fill out the form." msgstr "Press: Create Service and fill out the form." -#: src/pages/panel/inventory/DataGridPagination.tsx:61 -#: src/shared/right-slider/HelpSlider.tsx:98 +#: src/pages/panel/inventory/DataGridPagination.tsx:62 +#: src/shared/right-slider/HelpSlider.tsx:113 msgid "Previous" msgstr "Previous" @@ -2232,7 +2232,7 @@ msgstr "Regenerate" msgid "Region" msgstr "Region" -#: src/pages/panel/inventory/InventoryPage.tsx:267 +#: src/pages/panel/inventory/InventoryPage.tsx:228 msgid "regions" msgstr "regions" @@ -2279,7 +2279,7 @@ msgstr "Reset Password" msgid "Resource" msgstr "Resource" -#: src/pages/panel/inventory/getSlides.tsx:56 +#: src/pages/panel/inventory/slides.tsx:56 msgid "Resource Categories" msgstr "Resource Categories" @@ -2309,7 +2309,7 @@ msgstr "Resource deleted" msgid "Resource kind" msgstr "Resource kind" -#: src/pages/panel/inventory/getSlides.tsx:77 +#: src/pages/panel/inventory/slides.tsx:77 msgid "Resource List" msgstr "Resource List" diff --git a/src/pages/panel/inventory/DataGridPagination.tsx b/src/pages/panel/inventory/DataGridPagination.tsx index bd539205..69ab218b 100644 --- a/src/pages/panel/inventory/DataGridPagination.tsx +++ b/src/pages/panel/inventory/DataGridPagination.tsx @@ -20,7 +20,7 @@ export const DataGridPagination = () => { return ( - {page * size}-{(page + 1) * size > total ? total : (page + 1) * size}{' '} + {page * size + 1}-{(page + 1) * size > total ? total : (page + 1) * size}{' '} of {total} results @@ -31,6 +31,7 @@ export const DataGridPagination = () => { variant="outlined" shape="rounded" page={page + 1} + sx={{ ul: { flexWrap: 'nowrap' } }} count={pageCount} renderItem={(props2) => { return ['start-ellipsis', 'end-ellipsis', 'page'].includes(props2.type) ? ( diff --git a/src/pages/panel/inventory/InventoryPage.tsx b/src/pages/panel/inventory/InventoryPage.tsx index 00d62497..8f96caa7 100644 --- a/src/pages/panel/inventory/InventoryPage.tsx +++ b/src/pages/panel/inventory/InventoryPage.tsx @@ -1,6 +1,6 @@ import { t, Trans } from '@lingui/macro' import { useLingui } from '@lingui/react' -import { Box, ButtonBase, Divider, Stack, Typography } from '@mui/material' +import { Box, ButtonBase, Stack } from '@mui/material' import { GridRow, GridRowProps } from '@mui/x-data-grid-premium' import { useSuspenseQueries } from '@tanstack/react-query' import { Dispatch, ReactNode, SetStateAction, useCallback, useMemo, useState, useTransition } from 'react' @@ -10,17 +10,17 @@ import { useUserProfile } from 'src/core/auth' import { getWorkspaceInventoryModelQuery, postWorkspaceInventoryDescendantSummaryQuery } from 'src/pages/panel/shared/queries' import { useAbsoluteNavigate } from 'src/shared/absolute-navigate' import { CloudToIcon } from 'src/shared/cloud-avatar' +import { PanelLeftMenuLayout } from 'src/shared/layouts/panel-left-menu-layout' import { LoadingSuspenseFallback } from 'src/shared/loading' -import { HelpSlider } from 'src/shared/right-slider' import { ResourceComplexKind } from 'src/shared/types/server-shared' import { getAccountCloudName } from 'src/shared/utils/getAccountCloudName' import { getString } from 'src/shared/utils/getString' import { DataGridPagination } from './DataGridPagination' import { DownloadCSVButton } from './DownloadCSVButton' import { getColumns, RowType } from './getColumns' -import { getSlides } from './getSlides' import { GridFilterItem } from './GridFilterItem' import { postWorkspaceInventorySearchForInventoryQuery } from './postWorkspaceInventorySearchForInventory.query' +import { slides } from './slides' import { StyledDataGrid } from './StyledDataGrid' function useTransitionState( @@ -209,59 +209,20 @@ export default function InventoryPage() { const columns = useMemo(() => getColumns(locale), [locale]) return ( <> - `calc(100% + ${spacing(6)})`} - width={({ spacing }) => `calc(100% + ${spacing(6)})`} - flex={1} - overflow="hidden" + Inventory} + helpSliderProps={{ slides: slides }} + menuList={groups.map(({ Icon, id, name, resources }) => ({ + Icon, + id, + label: name, + count: resources, + selected: id === groupFilter, + onClick: () => setGroupFilter(id), + }))} > - - - - Inventory - - - - - {groups.map(({ Icon, id, name, resources }) => ( - setGroupFilter(id)} - > - - - {name} - - - {resources.toLocaleString(locale)} - - - ))} - - - - - + + @@ -284,7 +245,7 @@ export default function InventoryPage() { /> - + {pendingTransition ? ( ) : ( @@ -298,7 +259,8 @@ export default function InventoryPage() { columns={columns} rows={rows} pagination - autoPageSize + disableAutosize + disableVirtualization rowHeight={62} disableAggregation disableRowGrouping @@ -330,7 +292,7 @@ export default function InventoryPage() { )} - + ) diff --git a/src/pages/panel/inventory/StyledDataGrid.tsx b/src/pages/panel/inventory/StyledDataGrid.tsx index 78277af1..94e4aa62 100644 --- a/src/pages/panel/inventory/StyledDataGrid.tsx +++ b/src/pages/panel/inventory/StyledDataGrid.tsx @@ -3,9 +3,16 @@ import { DataGridPremium, gridClasses } from '@mui/x-data-grid-premium' export const StyledDataGrid = styled(DataGridPremium)(({ theme }) => ({ border: 'none', + '--DataGrid-containerBackground': theme.palette.common.white, + height: '100%', + width: '100%', + flex: 1, ['--DataGrid-rowBorderColor']: theme.palette.divider, + [`.${gridClasses.root}`]: { + height: '100%', + minHeight: 0, + }, [`.${gridClasses.columnHeader}`]: { - backgroundColor: theme.palette.common.white, color: theme.palette.text.secondary, ...theme.typography.subtitle1, }, diff --git a/src/pages/panel/inventory/getSlides.tsx b/src/pages/panel/inventory/slides.tsx similarity index 99% rename from src/pages/panel/inventory/getSlides.tsx rename to src/pages/panel/inventory/slides.tsx index 317a1f33..34391c39 100644 --- a/src/pages/panel/inventory/getSlides.tsx +++ b/src/pages/panel/inventory/slides.tsx @@ -8,7 +8,7 @@ const awsDocUrl = `${env.docsUrl}/resources/aws` const gcpDocUrl = `${env.docsUrl}/resources/google-cloud` const azureDocUrl = `${env.docsUrl}/resources/azure` -export const getSlides = [ +export const slides = [ { header: Inventory, content: ( diff --git a/src/shared/layouts/panel-layout/PanelContent.tsx b/src/shared/layouts/panel-layout/PanelContent.tsx index 31f559fb..afe8392f 100644 --- a/src/shared/layouts/panel-layout/PanelContent.tsx +++ b/src/shared/layouts/panel-layout/PanelContent.tsx @@ -11,7 +11,7 @@ export const PanelContent = forwardRef(({ c return ( + id?: Key + onClick?: () => void + count?: number + selected?: boolean +} + +interface PanelLeftMenuLayoutProps extends PropsWithChildren { + helpSliderProps?: HelpSliderProps + title?: ReactNode + menuList: MenuItem[] +} + +export const PanelLeftMenuLayout = ({ menuList, helpSliderProps, title, children }: PanelLeftMenuLayoutProps) => { + const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('lg')) + return ( + `calc(100% + ${spacing(6)})`} + width={({ spacing }) => `calc(100% + ${spacing(6)})`} + flex={1} + overflow="auto" + > + + + {helpSliderProps ? ( + + {isDesktop ? title : null} + + ) : ( + title + )} + + + + {menuList.map(({ Icon, id, label, count, onClick, selected }, index) => { + const buttonContent = ( + + + {isDesktop ? ( + + {label} + + ) : null} + {count ? ( + + {count} + + ) : null} + + ) + return ( + + ) + })} + + + + {children} + + ) +} diff --git a/src/shared/layouts/panel-left-menu-layout/index.ts b/src/shared/layouts/panel-left-menu-layout/index.ts new file mode 100644 index 00000000..b06018f2 --- /dev/null +++ b/src/shared/layouts/panel-left-menu-layout/index.ts @@ -0,0 +1 @@ +export { PanelLeftMenuLayout } from './PanelLeftMenuLayout' diff --git a/src/shared/right-slider/HelpSlider.tsx b/src/shared/right-slider/HelpSlider.tsx index 28976d20..8cb91fa8 100644 --- a/src/shared/right-slider/HelpSlider.tsx +++ b/src/shared/right-slider/HelpSlider.tsx @@ -1,5 +1,17 @@ import { Trans } from '@lingui/macro' -import { Box, Button, Divider, IconButton, LinearProgress, linearProgressClasses, Slide, Stack, Tooltip, Typography } from '@mui/material' +import { + Box, + Button, + Divider, + IconButton, + IconButtonProps, + LinearProgress, + linearProgressClasses, + Slide, + Stack, + Tooltip, + Typography, +} from '@mui/material' import { PropsWithChildren, ReactNode, useCallback, useMemo, useRef, useState } from 'react' import { ArrowBackIcon, ArrowForwardIcon, HelpIcon } from 'src/assets/icons' import { panelUI } from 'src/shared/constants' @@ -10,11 +22,14 @@ interface HelpSliderPropsPageItem { content: ReactNode } -interface HelpSliderProps extends PropsWithChildren { +export interface HelpSliderProps extends PropsWithChildren { slides: HelpSliderPropsPageItem[] | ((onClose: () => void) => HelpSliderPropsPageItem[]) + slotProps?: { + iconButtonProps?: IconButtonProps + } } -export const HelpSlider = ({ children, slides }: HelpSliderProps) => { +export const HelpSlider = ({ children, slides, slotProps: { iconButtonProps } = {} }: HelpSliderProps) => { const [open, setOpen] = useState(false) const [slide, setSlide] = useState(1) const handleClose = useCallback(() => { @@ -26,9 +41,9 @@ export const HelpSlider = ({ children, slides }: HelpSliderProps) => { return ( <> - {children} + {children ? {children} : null} Learn more} arrow> - setOpen(true)}> + setOpen(true)} {...iconButtonProps}> diff --git a/src/shared/right-slider/index.ts b/src/shared/right-slider/index.ts index 10883508..e2a9accd 100644 --- a/src/shared/right-slider/index.ts +++ b/src/shared/right-slider/index.ts @@ -1,2 +1,3 @@ export { HelpSlider } from './HelpSlider' +export type { HelpSliderProps } from './HelpSlider' export { RightSlider } from './RightSlider' diff --git a/yarn.lock b/yarn.lock index 54934fbf..70ca6755 100644 --- a/yarn.lock +++ b/yarn.lock @@ -842,9 +842,9 @@ integrity sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ== "@eslint/plugin-kit@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz#8712dccae365d24e9eeecb7b346f85e750ba343d" - integrity sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig== + version "0.2.3" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz#812980a6a41ecf3a8341719f92a6d1e784a2e0e8" + integrity sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA== dependencies: levn "^0.4.1" @@ -1299,14 +1299,14 @@ prop-types "^15.8.1" react-is "^18.3.1" -"@mui/x-charts-pro@^7.0.0-beta.6": - version "7.0.0-beta.6" - resolved "https://registry.yarnpkg.com/@mui/x-charts-pro/-/x-charts-pro-7.0.0-beta.6.tgz#d37aaa1c5842955815c5fe48bcc014ac75377cb0" - integrity sha512-YPLC+fs2pJPpt6aTNHzTQq/h2P/EM5c46LC1ggl/SUGT2EVmZIoKZFc5t9xBbkkaRnrrgo/kKDZBNIFN9LQoAg== +"@mui/x-charts-pro@^7.0.0-beta.7": + version "7.0.0-beta.7" + resolved "https://registry.yarnpkg.com/@mui/x-charts-pro/-/x-charts-pro-7.0.0-beta.7.tgz#5173b5ed9d2769da5148bb15ffd917f0e9a52709" + integrity sha512-arwMABGKFKmgSsbakHk52x2td7rSneMyPvXN2rArVR3OARFv2giG3EdskXY7e9lk5KF2Qk+4bEp+fTYD2htYsg== dependencies: "@babel/runtime" "^7.25.7" "@mui/utils" "^5.16.6 || ^6.0.0" - "@mui/x-charts" "7.22.0" + "@mui/x-charts" "7.22.2" "@mui/x-charts-vendor" "7.20.0" "@mui/x-internals" "7.21.0" "@mui/x-license" "7.21.0" @@ -1336,10 +1336,10 @@ delaunator "^5.0.1" robust-predicates "^3.0.2" -"@mui/x-charts@7.22.0": - version "7.22.0" - resolved "https://registry.yarnpkg.com/@mui/x-charts/-/x-charts-7.22.0.tgz#b4b7237e6e7d42607c1084c9ed106dc3c30eca22" - integrity sha512-B70ix8keyww9CpfdwbsHygQGsgEySCXuHhGrDRiVyFgK+Be4edBWNswbL3ngIp37CHBbWegaYkPp/Q9GDas0AA== +"@mui/x-charts@7.22.2": + version "7.22.2" + resolved "https://registry.yarnpkg.com/@mui/x-charts/-/x-charts-7.22.2.tgz#9768629d1b5bf949cd4f86da8e1c423dfbf36729" + integrity sha512-0Y2du4Ed7gOT53l8vVJ4vKT+Jz4Dh/iHnLy8TtL3+XhbPH9Ndu9Q30WwyyzOn84yt37hSUru/njQ1BWaSvVPHw== dependencies: "@babel/runtime" "^7.25.7" "@mui/utils" "^5.16.6 || ^6.0.0" @@ -1350,15 +1350,15 @@ clsx "^2.1.1" prop-types "^15.8.1" -"@mui/x-data-grid-premium@^7.22.1": - version "7.22.1" - resolved "https://registry.yarnpkg.com/@mui/x-data-grid-premium/-/x-data-grid-premium-7.22.1.tgz#b162a8c86f8278f62f2b172645e63b318f729ce0" - integrity sha512-Pdd2nCM+1cMprIO3PotKNWvXqu/ePjDfsVM2h/JLOkpeWvwv/PJRuaB87s/bKawXeqXosY67WKkYwIeoqG4/lQ== +"@mui/x-data-grid-premium@^7.22.2": + version "7.22.2" + resolved "https://registry.yarnpkg.com/@mui/x-data-grid-premium/-/x-data-grid-premium-7.22.2.tgz#f5ff97c03d143ac779ee504bee36944669c0c33d" + integrity sha512-HgofS4yodKXhFeiC/JwEG60KneNRiVI29piBsDcYLTsmn6kE1n9n48tPESKls6uYyqcM4upWc2WepizlNUIryw== dependencies: "@babel/runtime" "^7.25.7" "@mui/utils" "^5.16.6 || ^6.0.0" - "@mui/x-data-grid" "7.22.1" - "@mui/x-data-grid-pro" "7.22.1" + "@mui/x-data-grid" "7.22.2" + "@mui/x-data-grid-pro" "7.22.2" "@mui/x-internals" "7.21.0" "@mui/x-license" "7.21.0" "@types/format-util" "^1.0.4" @@ -1367,14 +1367,14 @@ prop-types "^15.8.1" reselect "^5.1.1" -"@mui/x-data-grid-pro@7.22.1": - version "7.22.1" - resolved "https://registry.yarnpkg.com/@mui/x-data-grid-pro/-/x-data-grid-pro-7.22.1.tgz#3e4e3abeb4089aaca3100f4c998c2c47cb875b18" - integrity sha512-zKvPxfnovqrMCUrmraTTG7Mr/pGaYjlUTeyp9pptbIrxqpjiD2d+LQF1L7qhOdbRHTqucqFUVy1hhxwlkkzNHw== +"@mui/x-data-grid-pro@7.22.2": + version "7.22.2" + resolved "https://registry.yarnpkg.com/@mui/x-data-grid-pro/-/x-data-grid-pro-7.22.2.tgz#f139ffc2e66dd182c69bfba1f4ad68e83bb16a35" + integrity sha512-i6GlRDzP0ySqKUxuPo3rw3L8AZkXUvU3xuoHd+Cpi5OJoQWyrOG2IkTjj3weyemFkUcaJZU5r8hDBD5WjEyguQ== dependencies: "@babel/runtime" "^7.25.7" "@mui/utils" "^5.16.6 || ^6.0.0" - "@mui/x-data-grid" "7.22.1" + "@mui/x-data-grid" "7.22.2" "@mui/x-internals" "7.21.0" "@mui/x-license" "7.21.0" "@types/format-util" "^1.0.4" @@ -1382,10 +1382,10 @@ prop-types "^15.8.1" reselect "^5.1.1" -"@mui/x-data-grid@7.22.1": - version "7.22.1" - resolved "https://registry.yarnpkg.com/@mui/x-data-grid/-/x-data-grid-7.22.1.tgz#de1b711cf314fedadacfeb30ce5ec049c12355f4" - integrity sha512-YHF96MEv7ACG/VuiycZjEAPH7cZLNuV2+bi/MyR1t/e6E6LTolYFykvjSFq+Imz1mYbW4+9mEvrHZsIKL5KKIQ== +"@mui/x-data-grid@7.22.2": + version "7.22.2" + resolved "https://registry.yarnpkg.com/@mui/x-data-grid/-/x-data-grid-7.22.2.tgz#2c7fce281b25785cde1af07698c4e555028d46d9" + integrity sha512-yfy2s5A6tbajQZiEdsba49T4FYb9F0WPrzbbG30dl1+sIiX4ZRX7ma44UIDGPZrsZv8xkkE+p8qeJxZ7OaMteA== dependencies: "@babel/runtime" "^7.25.7" "@mui/utils" "^5.16.6 || ^6.0.0" @@ -1394,24 +1394,24 @@ prop-types "^15.8.1" reselect "^5.1.1" -"@mui/x-date-pickers-pro@^7.22.1": - version "7.22.1" - resolved "https://registry.yarnpkg.com/@mui/x-date-pickers-pro/-/x-date-pickers-pro-7.22.1.tgz#88c3ae4343bbcf9370607eb20f98b66bad910c11" - integrity sha512-emulNSSUlEQXYYexf9MwMMusi9d980Oj0Sp3V6pl96QBcz9jGAcizzqzAPBUQ+aw8CtIdzDjo4/IPVuJMKpfSQ== +"@mui/x-date-pickers-pro@^7.22.2": + version "7.22.2" + resolved "https://registry.yarnpkg.com/@mui/x-date-pickers-pro/-/x-date-pickers-pro-7.22.2.tgz#e7f25ef1637c57393490fb6728fb6fd645cfe032" + integrity sha512-nyCdTYqYTU+QiVLeBIpzuMvAXAH49Pobj+8Gb2GwG4M0lHbUr2uJVh0QYIzxg6Ah2eeJhOj9pjB4nJ1K5k+FIw== dependencies: "@babel/runtime" "^7.25.7" "@mui/utils" "^5.16.6 || ^6.0.0" - "@mui/x-date-pickers" "7.22.1" + "@mui/x-date-pickers" "7.22.2" "@mui/x-internals" "7.21.0" "@mui/x-license" "7.21.0" clsx "^2.1.1" prop-types "^15.8.1" react-transition-group "^4.4.5" -"@mui/x-date-pickers@7.22.1": - version "7.22.1" - resolved "https://registry.yarnpkg.com/@mui/x-date-pickers/-/x-date-pickers-7.22.1.tgz#3abe7ad0b5816051fdcef4ffbe5343965e7dfc8e" - integrity sha512-VBgicE+7PvJrdHSL6HyieHT6a/0dENH8RaMIM2VwUFrGoZzvik50WNwY5U+Hip1BwZLIEvlqtNRQIIj6kgBR6Q== +"@mui/x-date-pickers@7.22.2": + version "7.22.2" + resolved "https://registry.yarnpkg.com/@mui/x-date-pickers/-/x-date-pickers-7.22.2.tgz#99ebf6ff3d5f926c8bceb43324c9d91022d79852" + integrity sha512-1KHSlIlnSoY3oHm820By8X344pIdGYqPvCCvfVHrEeeIQ/pHdxDD8tjZFWkFl4Jgm9oVFK90fMcqNZAzc+WaCw== dependencies: "@babel/runtime" "^7.25.7" "@mui/utils" "^5.16.6 || ^6.0.0" @@ -3186,9 +3186,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001541: - version "1.0.30001620" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz" - integrity sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew== + version "1.0.30001680" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz" + integrity sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA== ccount@^2.0.0: version "2.0.1" @@ -7636,10 +7636,10 @@ util@^0.12.5: is-typed-array "^1.1.3" which-typed-array "^1.1.2" -uuid@^11.0.2: - version "11.0.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-11.0.2.tgz#a8d68ba7347d051e7ea716cc8dcbbab634d66875" - integrity sha512-14FfcOJmqdjbBPdDjFQyk/SdT4NySW4eM0zcG+HqbHP5jzuH56xO3J1DGhgs/cEMCfwYi3HQI1gnTO62iaG+tQ== +uuid@^11.0.3: + version "11.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-11.0.3.tgz#248451cac9d1a4a4128033e765d137e2b2c49a3d" + integrity sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg== uuid@^8.3.0: version "8.3.2" @@ -7754,10 +7754,10 @@ vite@^5.0.0: optionalDependencies: fsevents "~2.3.3" -vite@^5.4.10: - version "5.4.10" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.10.tgz#d358a7bd8beda6cf0f3b7a450a8c7693a4f80c18" - integrity sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ== +vite@^5.4.11: + version "5.4.11" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.11.tgz#3b415cd4aed781a356c1de5a9ebafb837715f6e5" + integrity sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q== dependencies: esbuild "^0.21.3" postcss "^8.4.43"