Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upcoming: [DI-20800] - CSS for widget size control and feedbacks #10951

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f0b9207
upcoming: [DI-20585] - CSS for widget size control and feedbacks
venkat199501 Sep 16, 2024
b21c912
upcoming: [DI-20585] - Some simple updates for using styled wrapper a…
venkat199501 Sep 17, 2024
ed075c5
upcoming: [DI-20800] - SVG updates according to CDS 2.0
venkat199501 Sep 17, 2024
c4abd51
upcoming: [DI-20800] - Simple CSS minHeight updates
venkat199501 Sep 17, 2024
061860c
upcoming: [DI-20800] - Added changeset
venkat199501 Sep 17, 2024
291ba17
upcoming: [DI-20800] - CSS updates for button width
venkat199501 Sep 17, 2024
2423b65
upcoming: [DI-20800] - Widget level height corrections
venkat199501 Sep 17, 2024
489e9c1
upcoming: [DI-20800] - Mock update to have one more dimension
venkat199501 Sep 17, 2024
0ad7f9d
upcoming: [DI-20800] - Spacing improvement in grids
venkat199501 Sep 17, 2024
f73e9d4
Merge branch 'develop' of https://github.com/linode/manager into feat…
venkat199501 Sep 18, 2024
9c070d5
upcoming: [DI-20800] - Use Theme spacing and colors
venkat199501 Sep 18, 2024
561e9de
upcoming: [DI-20800] - Use calc for custom themes
venkat199501 Sep 18, 2024
40b390d
upcoming: [DI-20800] - Comments for height in px
venkat199501 Sep 18, 2024
d5db90c
upcoming: [DI-20800] - revert unwanted file changes to latest develop
venkat199501 Sep 18, 2024
c8615b2
upcoming: [DI-20800] - Use theme spacing wherever applicable
venkat199501 Sep 18, 2024
4c975e5
Revert "upcoming: [DI-20800] - Use theme spacing wherever applicable"
venkat199501 Sep 18, 2024
93941a0
upcoming: [DI-20800] - Placeholder value updates
venkat199501 Sep 18, 2024
ca1db73
upcoming: [DI-20800] - Style updates for widget
venkat199501 Sep 18, 2024
39b433c
upcoming: [DI-20800] - SVG fill color update
venkat199501 Sep 18, 2024
2ae688c
upcoming: [DI-20800] - useTheme values
venkat199501 Sep 19, 2024
5390037
upcoming: [DI-20800] - Reusable component padding updates
venkat199501 Sep 19, 2024
d4a1e15
upcoming: [DI-20800] - Simple refactoring
venkat199501 Sep 19, 2024
9255e2e
upcoming: [DI-20800] - Rename files
venkat199501 Sep 19, 2024
e7118f1
upcoming: [DI-20800] - PR comments addressed
venkat199501 Sep 19, 2024
7265a3a
upcoming: [DI-20800] - Removed styled widget wrapper
venkat199501 Sep 19, 2024
445a6dd
Update packages/manager/src/features/CloudPulse/Widget/CloudPulseWidg…
jaalah-akamai Sep 19, 2024
1561c53
Update packages/manager/.changeset/pr-10951-upcoming-features-1726561…
jaalah-akamai Sep 19, 2024
2a525aa
Update packages/manager/src/features/CloudPulse/shared/CloudPulseDash…
jaalah-akamai Sep 19, 2024
5365e6d
Update packages/manager/src/features/CloudPulse/shared/CloudPulseDash…
jaalah-akamai Sep 19, 2024
1b07842
upcoming: [DI-20800] - UT updates
venkat199501 Sep 20, 2024
5189b59
Merge branch 'feature/widget_size_controls' of github.com:venkymano/m…
venkat199501 Sep 20, 2024
1d69416
upcoming: [DI-20800] - UT updates
venkat199501 Sep 20, 2024
0b48797
Merge branch 'develop' of https://github.com/linode/manager into feat…
venkat199501 Sep 20, 2024
2ab97bd
upcoming: [DI-20800] - Reverting not needed changes
venkat199501 Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Enhance CSS for widget component and main bar component for cloudpulse ([#10951](https://github.com/linode/manager/pull/10951))
jaalah-akamai marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions packages/manager/src/assets/icons/cloudpulse_arrow_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/manager/src/assets/icons/cloudpulse_arrow_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions packages/manager/src/assets/icons/cloudpulse_reload.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions packages/manager/src/assets/icons/cloudpulse_zoomin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions packages/manager/src/assets/icons/cloudpulse_zoomout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const CloudPulseDashboard = (props: DashboardProperties) => {
// maintain a copy
const newDashboard: Dashboard = createObjectCopy(dashboard)!;
return (
<Grid columnSpacing={1} container item rowSpacing={2} xs={12}>
<Grid columnSpacing={1} container item rowSpacing={1} xs={12}>
{{ ...newDashboard }.widgets.map((widget, index) => {
// check if widget metric definition is available or not
if (widget) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const CloudPulseDashboardLanding = () => {
}

return (
<Grid container spacing={2}>
<Grid container paddingTop={'8px'} spacing={2}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use theme values instead of hardcoded values here?

Copy link
Contributor Author

@venkymano-akamai venkymano-akamai Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, changed to paddingTop={1} = 8px, also tried to use theme.spacing wherever possible

<Grid item xs={12}>
<Paper>
<GlobalFilters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Grid } from '@mui/material';
import { styled } from '@mui/material/styles';
import * as React from 'react';

import Reload from 'src/assets/icons/reload.svg';
import Reload from 'src/assets/icons/cloudpulse_reload.svg';
import { Divider } from 'src/components/Divider';

import { CloudPulseDashboardFilterBuilder } from '../shared/CloudPulseDashboardFilterBuilder';
Expand Down Expand Up @@ -72,43 +72,50 @@ export const GlobalFilters = React.memo((props: GlobalFilterProperties) => {
);

return (
<Grid container gap={1}>
<Grid
columnSpacing={2}
container
item
justifyContent="space-between"
mt={2}
px={2}
rowGap={2}
xs={12}
>
<Grid display={'flex'} item md={4} sm={5} xs={12}>
<CloudPulseDashboardSelect
handleDashboardChange={onDashboardChange}
/>
<Grid container>
<Grid container item m={'24px'} rowGap={1} xs={12}>
<Grid
columnSpacing={2}
container
item
justifyContent="space-between"
rowSpacing={2}
>
<Grid display={'flex'} item md={4} sm={5} xs={12}>
<CloudPulseDashboardSelect
handleDashboardChange={onDashboardChange}
/>
</Grid>
<Grid display="flex" gap={1} item md={4} sm={5} xs={12}>
<CloudPulseTimeRangeSelect
handleStatsChange={handleTimeRangeChange}
hideLabel
label="Select Time Range"
/>
<IconButton
sx={{
marginBlockEnd: 'auto',
}}
disabled={!selectedDashboard}
onClick={() => handleGlobalRefresh(selectedDashboard)}
size="small"
>
<StyledReload />
</IconButton>
</Grid>
</Grid>
<Grid display="flex" gap={1} item md={4} sm={5} xs={12}>
<CloudPulseTimeRangeSelect
handleStatsChange={handleTimeRangeChange}
hideLabel
label="Select Time Range"
/>
<IconButton
</Grid>
{selectedDashboard && (
<Grid item xs={12}>
<Divider
sx={{
marginBlockEnd: 'auto',
borderColor: '#F4F5F6',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpathipa , the color '#F4F5F6' is not present in themes, i have used grey5 that seems to be very similar, any chance here we can go with '#F4F5F6' this color itself

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gitkcosby/ @cpathipa We have got this color from Dominik( ACLP UX), Would you able to help us to provide the appropriate theme color for this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@venkymano-akamai Domink confirmed that we are good to use grey5 (#f7f7fa) as its almost same color. We can use the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!, grey5 we will go

margin: 0,
}}
disabled={!selectedDashboard}
onClick={() => handleGlobalRefresh(selectedDashboard)}
size="small"
>
<StyledReload />
</IconButton>
/>
</Grid>
</Grid>
<Grid item xs={12}>
<Divider />
</Grid>
)}

{selectedDashboard && (
<CloudPulseDashboardFilterBuilder
dashboard={selectedDashboard}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { styled } from '@mui/material';

import { Paper } from 'src/components/Paper';
import { isToday } from 'src/utilities/isToday';
import { getMetrics } from 'src/utilities/statMetrics';

Expand Down Expand Up @@ -331,3 +334,16 @@ export const isDataEmpty = (data: DataSet[]): boolean => {
thisSeries.data.every((thisPoint) => thisPoint[1] === null)
);
};

export const StyledWidgetWrapper = styled(Paper, {
label: 'StyledWidgetWrapper',
})(({ theme }) => ({
[theme.breakpoints.down('sm')]: {
maxHeight: '610px',
minHeight: '610px',
},
[theme.breakpoints.up('md')]: {
maxHeight: '540px',
minHeight: '540px',
},
}));
10 changes: 5 additions & 5 deletions packages/manager/src/features/CloudPulse/Utils/FilterConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const LINODE_CONFIG: Readonly<CloudPulseServiceTypeFilterMap> = {
isMultiSelect: true,
name: 'Resource',
neededInServicePage: false,
placeholder: 'Select Resources',
placeholder: 'Select a Resource',
priority: 2,
},
name: 'Resources',
Expand All @@ -42,7 +42,7 @@ export const LINODE_CONFIG: Readonly<CloudPulseServiceTypeFilterMap> = {
isMultiSelect: false,
name: TIME_DURATION,
neededInServicePage: false,
placeholder: 'Select Duration',
placeholder: 'Select a Duration',
priority: 3,
},
name: TIME_DURATION,
Expand Down Expand Up @@ -100,7 +100,7 @@ export const DBAAS_CONFIG: Readonly<CloudPulseServiceTypeFilterMap> = {
isMultiSelect: true,
name: 'Resource',
neededInServicePage: false,
placeholder: 'Select DB Cluster Names',
placeholder: 'Select a DB Cluster',
priority: 3,
},
name: 'Resources',
Expand All @@ -114,7 +114,7 @@ export const DBAAS_CONFIG: Readonly<CloudPulseServiceTypeFilterMap> = {
isMultiSelect: false,
name: TIME_DURATION,
neededInServicePage: false, // we will have a static time duration component, no need render from filter builder
placeholder: 'Select Duration',
placeholder: 'Select a Duration',
priority: 4,
},
name: TIME_DURATION,
Expand All @@ -138,7 +138,7 @@ export const DBAAS_CONFIG: Readonly<CloudPulseServiceTypeFilterMap> = {
label: 'Secondary',
},
],
placeholder: 'Select Node Type',
placeholder: 'Select a Node Type',
priority: 5,
type: CloudPulseSelectTypes.static,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Box, Grid, Paper, Stack, Typography } from '@mui/material';
import { Box, Grid, Stack, Typography } from '@mui/material';
import { DateTime } from 'luxon';
import React from 'react';

import { Divider } from 'src/components/Divider';
import { useFlags } from 'src/hooks/useFlags';
import { useCloudPulseMetricsQuery } from 'src/queries/cloudpulse/metrics';
import { useProfile } from 'src/queries/profile/profile';

import {
StyledWidgetWrapper,
generateGraphData,
getCloudPulseMetricRequest,
} from '../Utils/CloudPulseWidgetUtils';
Expand All @@ -26,12 +26,12 @@ import { ZoomIcon } from './components/Zoomer';

import type { FilterValueType } from '../Dashboard/CloudPulseDashboardLanding';
import type { CloudPulseResources } from '../shared/CloudPulseResourcesSelect';
import type { Widgets } from '@linode/api-v4';
import type {
AvailableMetrics,
TimeDuration,
TimeGranularity,
} from '@linode/api-v4';
import type { Widgets } from '@linode/api-v4';
import type { DataSet } from 'src/components/LineGraph/LineGraph';
import type { Metrics } from 'src/utilities/statMetrics';

Expand Down Expand Up @@ -289,28 +289,26 @@ export const CloudPulseWidget = (props: CloudPulseWidgetProperties) => {
const metricsApiCallError = error?.[0]?.reason;
return (
<Grid item lg={widget.size} xs={12}>
<Paper>
<Stack spacing={2}>
<Stack spacing={2}>
<StyledWidgetWrapper>
jaalah-akamai marked this conversation as resolved.
Show resolved Hide resolved
<Stack
alignItems={'center'}
direction={{ sm: 'row' }}
gap={{ sm: 0, xs: 2 }}
justifyContent={{ sm: 'space-between' }}
marginBottom={1}
padding={1}
>
<Typography
fontSize={{ sm: '1.5rem', xs: '2rem' }}
marginLeft={1}
variant="h1"
>
{convertStringToCamelCasesWithSpaces(widget.label)}{' '}
{!isLoading &&
`(${currentUnit}${unit.endsWith('ps') ? '/s' : ''})`}
<Typography marginLeft={1} variant="h2">
{convertStringToCamelCasesWithSpaces(widget.label)} ({currentUnit}
{unit.endsWith('ps') ? '/s' : ''})
</Typography>
<Stack
alignItems={'center'}
direction={{ sm: 'row' }}
gap={1}
maxHeight={'85px'}
overflow={'auto'}
jaalah-akamai marked this conversation as resolved.
Show resolved Hide resolved
width={{ sm: 'inherit', xs: '100%' }}
>
{availableMetrics?.scrape_interval && (
Expand Down Expand Up @@ -339,7 +337,6 @@ export const CloudPulseWidget = (props: CloudPulseWidgetProperties) => {
</Box>
</Stack>
</Stack>
<Divider />

<CloudPulseLineGraph
error={
Expand All @@ -356,13 +353,12 @@ export const CloudPulseWidget = (props: CloudPulseWidgetProperties) => {
formatTooltip={(value: number) => formatToolTip(value, unit)}
gridSize={widget.size}
loading={isLoading || metricsApiCallError === jweTokenExpiryError} // keep loading until we fetch the refresh token
nativeLegend
showToday={today}
timezone={timezone}
title={widget.label}
/>
</Stack>
</Paper>
</StyledWidgetWrapper>
</Stack>
</Grid>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export const CloudPulseLineGraph = React.memo((props: CloudPulseLineGraph) => {
'& .MuiTable-root': {
border: 0,
},
height: '115px',
maxHeight: '115px',
overflow: 'auto',
jaalah-akamai marked this conversation as resolved.
Show resolved Hide resolved
}}
ariaLabel={ariaLabel}
data={data}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import ZoomInMap from '@mui/icons-material/ZoomInMap';
import ZoomOutMap from '@mui/icons-material/ZoomOutMap';
import * as React from 'react';

import ZoomInMap from 'src/assets/icons/cloudpulse_zoomin.svg';
import ZoomOutMap from 'src/assets/icons/cloudpulse_zoomout.svg';

export interface ZoomIconProperties {
className?: string;
handleZoomToggle: (zoomIn: boolean) => void;
Expand Down
Loading