Skip to content

Commit a11fbcb

Browse files
committed
Fix linting and type errors in Demo admin
1 parent db31b70 commit a11fbcb

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

demo/admin/src/news/blocks/NewsListBlock.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export const NewsListBlock: BlockInterface<NewsListBlockData, State, NewsListBlo
6666
loading={loading}
6767
checkboxSelection
6868
keepNonExistentRowsSelected
69-
rowSelectionModel={state.ids}
69+
rowSelectionModel={{ type: "include", ids: new Set(state.ids) }}
7070
onRowSelectionModelChange={(newSelection) => {
71-
updateState({ ids: newSelection as string[] });
71+
updateState({ ids: Array.from(newSelection.ids).map((id) => String(id)) });
7272
}}
7373
/>
7474
</Box>

demo/admin/src/products/ProductsGrid.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function ProductsGridToolbar({ exportApi, selectionModel }: ProductsGridToolbarP
8585
label: "Publish",
8686
icon: <Online htmlColor={theme.palette.success.main} />,
8787
onClick: () => {
88-
for (const id of selectionModel) {
88+
for (const id of selectionModel.ids) {
8989
client.mutate<GQLUpdateProductStatusMutation, GQLUpdateProductStatusMutationVariables>({
9090
mutation: updateProductStatusMutation,
9191
variables: { id: id as string, status: "Published" },
@@ -101,7 +101,7 @@ function ProductsGridToolbar({ exportApi, selectionModel }: ProductsGridToolbarP
101101
label: "Unpublish",
102102
icon: <Disabled />,
103103
onClick: () => {
104-
for (const id of selectionModel) {
104+
for (const id of selectionModel.ids) {
105105
client.mutate<GQLUpdateProductStatusMutation, GQLUpdateProductStatusMutationVariables>({
106106
mutation: updateProductStatusMutation,
107107
variables: { id: id as string, status: "Unpublished" },
@@ -114,7 +114,7 @@ function ProductsGridToolbar({ exportApi, selectionModel }: ProductsGridToolbarP
114114
},
115115
},
116116
]}
117-
selectionSize={selectionModel.length}
117+
selectionSize={selectionModel.ids.size}
118118
/>
119119
<Button responsive startIcon={<AddIcon />} component={StackLink} pageName="add" payload="add">
120120
<FormattedMessage id="products.newProduct" defaultMessage="New Product" />
@@ -131,7 +131,7 @@ export function ProductsGrid() {
131131
const intl = useIntl();
132132
const theme = useTheme();
133133
const [selectionModel, setSelectionModel] = useState<GridRowSelectionModel>({
134-
type: 'include',
134+
type: "include",
135135
ids: new Set([]),
136136
});
137137

@@ -404,7 +404,8 @@ export function ProductsGrid() {
404404
onRowSelectionModelChange={(selectionModel) => {
405405
setSelectionModel(selectionModel);
406406
}}
407-
showToolbar />
407+
showToolbar
408+
/>
408409
);
409410
}
410411

packages/admin/cms-admin/src/blocks/DamVideoBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { gql, useApolloClient } from "@apollo/client";
22
import { Field, FieldContainer } from "@comet/admin";
33
import { Delete, MoreVertical, OpenNewTab, Video } from "@comet/admin-icons";
44
import { Box, Divider, Grid, IconButton, ListItemIcon, Menu, MenuItem, Typography } from "@mui/material";
5-
import { deepClone } from "@mui/x-data-grid/utils/utils";
5+
import { deepClone } from "@mui/x-data-grid/internals";
66
import { useState } from "react";
77
import { FormattedMessage } from "react-intl";
88

packages/admin/cms-admin/src/blocks/InternalLinkBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { gql } from "@apollo/client";
22
import { Field, FinalFormSelect } from "@comet/admin";
33
import { Box, Divider, MenuItem } from "@mui/material";
4-
import { deepClone } from "@mui/x-data-grid/utils/utils";
4+
import { deepClone } from "@mui/x-data-grid/internals";
55
import { FormattedMessage } from "react-intl";
66

77
import { type InternalLinkBlockData, type InternalLinkBlockInput } from "../blocks.generated";

packages/admin/cms-admin/src/blocks/PixelImageBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Field } from "@comet/admin";
33
import { Crop, Delete, MoreVertical, OpenNewTab } from "@comet/admin-icons";
44
import { ButtonBase, Divider, Grid, IconButton, ListItemIcon, Menu, MenuItem, Typography } from "@mui/material";
55
import { styled } from "@mui/material/styles";
6-
import { deepClone } from "@mui/x-data-grid/utils/utils";
6+
import { deepClone } from "@mui/x-data-grid/internals";
77
import { useCallback, useState } from "react";
88
import { FormattedMessage } from "react-intl";
99

packages/admin/cms-admin/src/blocks/SvgImageBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { gql, useApolloClient } from "@apollo/client";
22
import { Field } from "@comet/admin";
33
import { Delete, MoreVertical, OpenNewTab } from "@comet/admin-icons";
44
import { Box, Divider, Grid, IconButton, ListItemIcon, Menu, MenuItem, Typography } from "@mui/material";
5-
import { deepClone } from "@mui/x-data-grid/utils/utils";
5+
import { deepClone } from "@mui/x-data-grid/internals";
66
import { useState } from "react";
77
import { FormattedMessage } from "react-intl";
88

packages/admin/cms-admin/src/dam/blocks/DamFileDownloadLinkBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { gql } from "@apollo/client";
22
import { Field, FinalFormSelect, messages } from "@comet/admin";
33
import { Delete } from "@comet/admin-icons";
44
import { Box, Divider, MenuItem, Typography } from "@mui/material";
5-
import { deepClone } from "@mui/x-data-grid/utils/utils";
5+
import { deepClone } from "@mui/x-data-grid/internals";
66
import { FormattedMessage } from "react-intl";
77

88
import { type DamFileDownloadLinkBlockData, type DamFileDownloadLinkBlockInput } from "../../blocks.generated";

0 commit comments

Comments
 (0)