Skip to content

Commit

Permalink
fix setting layout
Browse files Browse the repository at this point in the history
  • Loading branch information
OliwiaGowor committed Aug 27, 2024
1 parent 4bb55b7 commit becb192
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/shared/components/ResourceGraph/DetailsCard/DetailsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { useUrl } from 'hooks/useUrl';
import { useRecoilValue } from 'recoil';
import { useRecoilState, useRecoilValue } from 'recoil';

import { Button } from '@ui5/webcomponents-react';
import { Labels } from 'shared/components/Labels/Labels';
Expand All @@ -12,6 +12,7 @@ import pluralize from 'pluralize';

import { spacing } from '@ui5/webcomponents-react-base';
import './DetailsCard.scss';
import { columnLayoutState } from 'state/columnLayoutAtom';

export function DetailsCard({
resource,
Expand All @@ -24,6 +25,7 @@ export function DetailsCard({
const navigate = useNavigate();
const { clusterUrl } = useUrl();
const nodes = useRecoilValue(allNodesSelector);
const [, setLayoutColumn] = useRecoilState(columnLayoutState);

return (
<div className="details-card-wrapper">
Expand Down Expand Up @@ -64,6 +66,12 @@ export function DetailsCard({
`${namespacePart}${node.resourceType}/${resource.metadata.name}`,
),
);

setLayoutColumn({
layout: 'OneColumn',
midColumn: null,
endColumn: null,
});
}}
>
{t('resource-graph.buttons.go-to-details')}
Expand Down

0 comments on commit becb192

Please sign in to comment.