From 905fcfbbab2afc6e038f950b7cb156c7ae5ae951 Mon Sep 17 00:00:00 2001 From: Nils Petter Fremming <35219649+nilscognite@users.noreply.github.com> Date: Tue, 3 Sep 2024 07:34:27 +0200 Subject: [PATCH] Initial commit (#4737) --- .../base/domainObjects/DomainObject.ts | 4 +-- .../Architecture/DomainObjectPanel.tsx | 32 +++++++------------ 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/react-components/src/architecture/base/domainObjects/DomainObject.ts b/react-components/src/architecture/base/domainObjects/DomainObject.ts index b7f0d19e278..7708bfdc2c3 100644 --- a/react-components/src/architecture/base/domainObjects/DomainObject.ts +++ b/react-components/src/architecture/base/domainObjects/DomainObject.ts @@ -371,9 +371,9 @@ export abstract class DomainObject { public getPanelToolbar(): BaseCommand[] { return [ - new DeleteDomainObjectCommand(this), new CopyToClipboardCommand(), - new ToggleMetricUnitsCommand() + new ToggleMetricUnitsCommand(), + new DeleteDomainObjectCommand(this) ]; } diff --git a/react-components/src/components/Architecture/DomainObjectPanel.tsx b/react-components/src/components/Architecture/DomainObjectPanel.tsx index eddd9050b97..9ce86ac2691 100644 --- a/react-components/src/components/Architecture/DomainObjectPanel.tsx +++ b/react-components/src/components/Architecture/DomainObjectPanel.tsx @@ -1,7 +1,7 @@ /*! * Copyright 2024 Cognite AS */ -import { Icon, type IconType, Body } from '@cognite/cogs.js'; +import { Icon, type IconType, Body, Flex } from '@cognite/cogs.js'; import styled from 'styled-components'; import { useEffect, useMemo, useState, type ReactElement } from 'react'; import { @@ -21,7 +21,7 @@ import { type UnitSystem } from '../../architecture/base/renderTarget/UnitSystem import { type DomainObject } from '../../architecture/base/domainObjects/DomainObject'; const TEXT_SIZE = 'x-small'; -const HEADER_SIZE = 'small'; +const HEADER_SIZE = 'medium'; export const DomainObjectPanel = (): ReactElement => { const [currentDomainObjectInfo, setCurrentDomainObjectInfo] = useState< @@ -73,25 +73,15 @@ export const DomainObjectPanel = (): ReactElement => { margin: style.marginPx, padding: style.paddingPx }}> - - - - {icon !== undefined && ( - - - - )} - {text !== undefined && ( - - {text} - - )} - - - -
- -
+ + + {icon !== undefined && } + {text !== undefined && {text}} + + + + + {info.items.map((item, _i) => addTextWithNumber(item, unitSystem))}