Skip to content

Commit

Permalink
frontend: EditButton: Remove duplicate ViewButton from table
Browse files Browse the repository at this point in the history
We remove a duplicate ViewButton icon from the row actions that was
previously visible.

Signed-off-by: Evangelos Skopelitis <[email protected]>
  • Loading branch information
skoeva committed Dec 10, 2024
1 parent 7344b4c commit 09cedde
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/components/common/Resource/EditButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function EditButton(props: EditButtonProps) {
const location = useLocation();
const { t } = useTranslation(['translation', 'resource']);
const dispatchHeadlampEditEvent = useEventCallback(HeadlampEventType.EDIT_RESOURCE);
const isDetailPage = location.pathname.includes(item.metadata.name);

function makeErrorMessage(err: any) {
const status: number = err.status;
Expand Down Expand Up @@ -86,7 +87,7 @@ export default function EditButton(props: EditButtonProps) {
return null;
}

if (isReadOnly) {
if (isReadOnly && isDetailPage) {
return <ViewButton item={item} />;
}

Expand Down

0 comments on commit 09cedde

Please sign in to comment.