From f130c6acee68eb25f03f17b93f9908c6e93badfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Flatval?= <70905152+haakonflatval-cognite@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:15:07 +0100 Subject: [PATCH] fix(react-components): pois: disable row stripes and open comments and bump 0.70.1 (#4902) * fix(react-components): pois: disable row stripes and open comments * chore: bump to 0.70.1 * chore: lint fix --- react-components/package.json | 2 +- .../pointsOfInterest/PoiInfoPanelContent.tsx | 13 +++++++++++-- .../Architecture/pointsOfInterest/PoiList.tsx | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/react-components/package.json b/react-components/package.json index a31103c2256..8d558f49fef 100644 --- a/react-components/package.json +++ b/react-components/package.json @@ -1,6 +1,6 @@ { "name": "@cognite/reveal-react-components", - "version": "0.70.0", + "version": "0.70.1", "exports": { ".": { "import": "./dist/index.js", diff --git a/react-components/src/components/Architecture/pointsOfInterest/PoiInfoPanelContent.tsx b/react-components/src/components/Architecture/pointsOfInterest/PoiInfoPanelContent.tsx index 5ed4700d642..69ce1eedef8 100644 --- a/react-components/src/components/Architecture/pointsOfInterest/PoiInfoPanelContent.tsx +++ b/react-components/src/components/Architecture/pointsOfInterest/PoiInfoPanelContent.tsx @@ -15,7 +15,7 @@ import { import { Dropdown } from '@cognite/cogs-lab'; import { PoiSharePanel } from './PoiSharePanel'; import styled from 'styled-components'; -import { useMemo, type ReactNode } from 'react'; +import { useMemo, useState, type ReactNode } from 'react'; import { type PointOfInterest } from '../../../architecture'; import { type CommentProperties } from '../../../architecture/concrete/pointsOfInterest/models'; import { createButton } from '../CommandButtons'; @@ -69,13 +69,22 @@ export const CommentSection = (): ReactNode => { const poi = useSelectedPoi(); + const [open, setOpen] = useState(true); + const comments = useCommentsForPoiQuery(poi); if (poi === undefined) { return null; } return ( - + { + setOpen(expanded); + }}> {comments.data?.map((comment) => ( diff --git a/react-components/src/components/Architecture/pointsOfInterest/PoiList.tsx b/react-components/src/components/Architecture/pointsOfInterest/PoiList.tsx index bab44be4df1..3d4c8a9d91d 100644 --- a/react-components/src/components/Architecture/pointsOfInterest/PoiList.tsx +++ b/react-components/src/components/Architecture/pointsOfInterest/PoiList.tsx @@ -108,6 +108,7 @@ export const PoiList = ({ selectedRows={[JSON.stringify(selectedPoi?.id)]} pagination={false} disableColumnResize + disableRowStripes /> {hasMoreData && }