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

chore: minor improvements and fixes #5012

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 8 additions & 5 deletions react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,22 @@
"peerDependencies": {
"@cognite/cogs-lab": "^9.0.0-alpha.153",
"@cognite/reveal": "4.23.2",
"@cognite/sdk": "^9.13.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't this cause trouble when linking to projects that have another SDK version? The newest SDK version is 10 (and it is used in Fusion, I believe)

"@cognite/signals": "^0.0.4",
"react": ">=18",
"react-dom": ">=18",
"styled-components": ">=5"
"react-router-dom": "^6.23.0",
"styled-components": ">=5",
"three": "0.165.0"
},
"dependencies": {
"@cognite/cogs.js": "^10.36.0",
"@cognite/signals": "^0.0.4",
"@tanstack/react-query": "^5.32.0",
"assert": "^2.1.0",
"lodash": "^4.17.21"
"lodash": "^4.17.21",
"react-draggable": "^4.4.6",
"react-resizable": "^3.0.5"
},
"devDependencies": {
"@cognite/cdf-i18n-utils": "^0.7.5",
Expand All @@ -66,7 +71,7 @@
"@types/node": "^22.0.0",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@types/react-resizable": "^3.0.7",
"@types/react-resizable": "^3.0.5",
"@types/three": "0.165.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@vitejs/plugin-react": "^4.2.1",
Expand All @@ -89,8 +94,6 @@
"prop-types": "^15.8.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-draggable": "^4.4.6",
"react-resizable": "^3.0.5",
"react-router-dom": "^6.23.0",
"storybook": "^8.3.5",
"style-loader": "^4.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const PoiSharePanel = (): ReactNode => {
<TextLabel text={t({ key: 'SHARE' })} />
</Flex>
<PoiVisibilityInfobox poiDomainObject={poiDomainObject} poiVisibility={poiVisibility} />
<Button icon=<LinkIcon /> disabled={poiVisibility === 'PRIVATE'} onClick={handleShare}>
<Button icon={<LinkIcon />} disabled={poiVisibility === 'PRIVATE'} onClick={handleShare}>
{t({ key: 'COPY_URL_TO_SHARE' })}
</Button>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function Image360Details({
{enableExitButton && (
<ExitButtonContainer>
<StyledExitButton
icon=<CloseLargeIcon />
icon={<CloseLargeIcon />}
type="tertiary"
onClick={exitImage360Image}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const AssetContextualizedButton = ({
<CogsTooltip content={t(tooltip)} placement="right">
<Button
type="ghost"
icon=<AssetsIcon />
icon={<AssetsIcon />}
toggled={enableContextualizedStyling}
aria-label="asset-labels-button"
onClick={onClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const FitModelsButton = (): ReactElement => {
<CogsTooltip content={t({ key: 'FIT_VIEW_TOOLTIP' })} placement="right">
<Button
type="ghost"
icon=<ExpandAlternativeIcon />
icon={<ExpandAlternativeIcon />}
aria-label="Fit camera to models"
onClick={updateCamera}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const LayersButton = ({
<Tooltip
content={<LabelWithShortcut label={t({ key: 'LAYERS_FILTER_TOOLTIP' })} />}
placement="right">
<Button icon=<LayersIcon /> type="ghost" />
<Button icon={<LayersIcon />} type="ghost" />
</Tooltip>
</SelectPanel.Trigger>
<SelectPanel.Body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const ResetCameraButton = ({
<CogsTooltip content={t({ key: 'RESET_CAMERA_TO_HOME' })} placement="bottom">
<Button
type="ghost"
icon=<HomeIcon />
icon={<HomeIcon />}
aria-label="Reset camera to home"
onClick={resetCameraToHomePosition}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const RuleBasedOutputsButton = ({
renderTrigger={(props: any) => (
<CogsTooltip content={t({ key: 'RULESET_SELECT_HEADER' })} placement="right">
<Button
icon=<ColorPaletteIcon />
icon={<ColorPaletteIcon />}
disabled={disabled}
aria-label="Select RuleSet"
type="ghost"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const SelectSceneButton = ({
floatingProps={{ middleware: [offset(TOOLBAR_HORIZONTAL_PANEL_OFFSET)] }}
renderTrigger={(props: any) => (
<CogsTooltip content={t({ key: 'SCENE_SELECT_HEADER' })}>
<Button icon=<WorldIcon /> aria-label="Select 3D location" type="ghost" {...props}>
<Button icon={<WorldIcon />} aria-label="Select 3D location" type="ghost" {...props}>
{orientation === 'horizontal' && sceneName}
</Button>
</CogsTooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const SettingsButton = ({
placement="right"
disabled={settingsActive}>
<Button
icon=<SettingsIcon />
icon={<SettingsIcon />}
type="ghost"
aria-label="Show settings"
toggled={settingsActive}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ShareButton = (): ReactElement => {

return (
<CogsTooltip content={t({ key: 'COPY_URL_TO_SHARE' })} placement="right">
<Button icon=<ShareIcon /> type="ghost" aria-label="share-button" onClick={handleShare} />
<Button icon={<ShareIcon />} type="ghost" aria-label="share-button" onClick={handleShare} />
</CogsTooltip>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const SlicerButton = (): ReactElement => {
floatingProps={{ middleware: [offset(TOOLBAR_HORIZONTAL_PANEL_OFFSET)] }}
renderTrigger={(props: any) => (
<CogsTooltip content={t({ key: 'SLICE_TOOLTIP' })} placement="right">
<Button {...props} type="ghost" icon=<SliceIcon /> aria-label="Slice models" />
<Button {...props} type="ghost" icon={<SliceIcon />} aria-label="Slice models" />
</CogsTooltip>
)}>
<StyledRangeSlider
Expand Down Expand Up @@ -147,5 +147,4 @@ const StyledRangeSlider = styled(RangeSlider)`
display: flex !important;
flex-direction: row !important;
justify-content: center !important;
}
`;
2 changes: 1 addition & 1 deletion react-components/src/components/Widgets/WindowWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const WindowWidget = ({
/>
</CogsTooltip>
<CogsTooltip content={t({ key: 'WIDGET_WINDOW_CLOSE' })} placement="top">
<Button type="ghost" icon=<CloseIcon /> onClick={handleClose} />
<Button type="ghost" icon={<CloseIcon />} onClick={handleClose} />
</CogsTooltip>
</Widget.Header>
<WidgetBody>{!isMinimized && <WidgetContent>{children}</WidgetContent>}</WidgetBody>
Expand Down
2 changes: 1 addition & 1 deletion react-components/stories/RuleBasedColoring.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const Main: Story = {
return (
<RevealStoryContext color={new Color(0x4a4a4a)}>
<RevealCanvas>
{resourceIsLoaded && <RevealToolbar toolBarContent=<RuleBasedOutputsButton /> />}
{resourceIsLoaded && <RevealToolbar toolBarContent={<RuleBasedOutputsButton />} />}
</RevealCanvas>
<RevealResourcesFitCameraOnLoad onResourcesAdded={onLoaded} resources={resources} />
</RevealStoryContext>
Expand Down
2 changes: 2 additions & 0 deletions react-components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export default defineConfig(({ command }) => {
test: {
include: ['src/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
reporters: ['default'],
isolate: false,
css: false,
coverage: {
reportsDirectory: '../coverage/reveal-react-components',
exclude: [
Expand Down
7 changes: 5 additions & 2 deletions react-components/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading