Skip to content

Commit 9231e4f

Browse files
committed
fix: issue with getStarted modal
Signed-off-by: Amit Amrutiya <amitamrutiya2210@gmail.com>
1 parent da0293a commit 9231e4f

5 files changed

Lines changed: 11 additions & 15 deletions

File tree

src/custom/DashboardWidgets/GettingStartedWidget/ActionButtonCard.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ReactNode } from 'react';
22
import { Box, Button, Card, CardActions, CardContent, Typography } from '../../../base';
3-
import { styled, useTheme } from '../../../theme';
3+
import { styled } from '../../../theme';
44
import { PrecentageLabel, SliderDiv } from '../styles';
55

66
interface ActionButtonCardProps {
@@ -102,7 +102,6 @@ const ActionButtonCard = ({
102102
playgroundCardBackgroundImgSrc
103103
}: ActionButtonCardProps) => {
104104
const completed = completedSteps ? completedSteps.length : 0;
105-
const theme = useTheme();
106105

107106
const completedPercentage = (): number => {
108107
return Math.round((100 / totalSteps) * completed);
@@ -140,7 +139,7 @@ const ActionButtonCard = ({
140139
aria-label="Default"
141140
valueLabelDisplay="auto"
142141
/>
143-
<PrecentageLabel size="small" completedPercentage={percentage} theme={theme}>
142+
<PrecentageLabel size="small" completedPercentage={percentage}>
144143
{`${percentage}%`}
145144
</PrecentageLabel>
146145
</ProgressWrapper>
@@ -186,7 +185,7 @@ const ActionButtonCard = ({
186185
aria-label="Default"
187186
valueLabelDisplay="auto"
188187
/>
189-
<PrecentageLabel size="small" completedPercentage={percentage} theme={theme}>
188+
<PrecentageLabel size="small" completedPercentage={percentage}>
190189
{`${percentage}%`}
191190
</PrecentageLabel>
192191
</ProgressWrapper>

src/custom/DashboardWidgets/GettingStartedWidget/GetStartedModal.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
import { Grid2, SwipeableDrawer, Theme } from '@mui/material';
2+
import { Grid2, SwipeableDrawer } from '@mui/material';
33
import { useState } from 'react';
44
import {
55
Backdrop,
@@ -117,7 +117,6 @@ const CheckboxLabel = styled('div')(() => ({
117117

118118
interface CheckFieldProps {
119119
isVisit?: boolean;
120-
theme?: Theme;
121120
}
122121

123122
const CheckField = styled('div')<CheckFieldProps>(({ theme, isVisit }) => ({
@@ -247,7 +246,6 @@ const GetStartedModal: React.FC<GetStartedModalProps> = ({
247246
<PrecentageLabel
248247
size="medium"
249248
completedPercentage={percentage}
250-
theme={theme}
251249
>{`${completedPercentage()}%`}</PrecentageLabel>
252250
</DialogContent>
253251
<Grid2 sx={{ overflowY: 'auto', backgroundColor: theme.palette.background.surfaces }}>

src/custom/DashboardWidgets/GettingStartedWidget/InviteUserModal.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
33
// @ts-nocheck
44

5-
import { Theme } from '@mui/material';
65
import { useEffect, useState } from 'react';
76
import {
87
Box,
@@ -138,7 +137,7 @@ export default function UserInviteModal({
138137
}
139138
}, [currentOrgId, providerRolesData, organizationRolesData]);
140139

141-
function getSelectStyle(ele: string, arr: string[], theme: Theme) {
140+
function getSelectStyle(ele: string, arr: string[]) {
142141
return {
143142
fontWeight:
144143
arr.indexOf(ele) === -1
@@ -333,7 +332,7 @@ export default function UserInviteModal({
333332
)}
334333
>
335334
{availableOrgRoles.map((name) => (
336-
<MenuItem key={name} value={name} style={getSelectStyle(name, roles, theme)}>
335+
<MenuItem key={name} value={name} style={getSelectStyle(name, roles)}>
337336
{name}
338337
</MenuItem>
339338
))}
@@ -360,7 +359,7 @@ export default function UserInviteModal({
360359
)}
361360
>
362361
{availableProviderRoles.map((name) => (
363-
<MenuItem key={name} value={name} style={getSelectStyle(name, roles, theme)}>
362+
<MenuItem key={name} value={name} style={getSelectStyle(name, roles)}>
364363
{name}
365364
</MenuItem>
366365
))}

src/custom/DashboardWidgets/styles.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Slider, Theme } from '@mui/material';
1+
import { Slider } from '@mui/material';
22
import { styled } from '../../theme';
33

44
export const SliderDiv = styled(Slider)(({ theme, size }) => ({
@@ -22,7 +22,6 @@ export const SliderDiv = styled(Slider)(({ theme, size }) => ({
2222
interface PrecentageLabelProps {
2323
size: 'small' | 'medium' | 'large';
2424
completedPercentage: number;
25-
theme: Theme;
2625
}
2726

2827
export const PrecentageLabel = styled('div')<PrecentageLabelProps>(

src/custom/Workspaces/WorkspaceViewsTable.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { NameDiv } from '../CatalogDesignTable/style';
1010
import { RESOURCE_TYPES } from '../CatalogDetail/types';
1111
import { CustomColumnVisibilityControl } from '../CustomColumnVisibilityControl';
1212
import { CustomTooltip } from '../CustomTooltip';
13+
import { ErrorBoundary } from '../ErrorBoundary';
1314
import { ConditionalTooltip } from '../Helpers/CondtionalTooltip';
1415
import { useWindowDimensions } from '../Helpers/Dimension';
1516
import {
@@ -330,7 +331,7 @@ const WorkspaceViewsTable: React.FC<ViewsTableProps> = ({
330331
const [tableCols, updateCols] = useState(columns);
331332

332333
return (
333-
<>
334+
<ErrorBoundary>
334335
<TableHeader style={{ padding: '1rem' }}>
335336
<Box
336337
style={{
@@ -398,7 +399,7 @@ const WorkspaceViewsTable: React.FC<ViewsTableProps> = ({
398399
isAssignAllowed={isAssignAllowed}
399400
isRemoveAllowed={isRemoveAllowed}
400401
/>
401-
</>
402+
</ErrorBoundary>
402403
);
403404
};
404405

0 commit comments

Comments
 (0)