Skip to content

Commit

Permalink
storage: Don't use StorageLink for navigation
Browse files Browse the repository at this point in the history
StorageLink is only for privileged operations. It will render as
nothing when the user has no admin privs.
  • Loading branch information
mvollmer committed Sep 15, 2023
1 parent a799f23 commit 3e505d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/storaged/content-views.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ import {
DropdownSeparator
} from '@patternfly/react-core/dist/esm/deprecated/components/Dropdown/index.js';
import { ExclamationTriangleIcon } from "@patternfly/react-icons";
import { Button } from "@patternfly/react-core/dist/esm/components/Button/index.js";

import { ListingTable } from "cockpit-components-table.jsx";
import { ListingPanel } from 'cockpit-components-listing-panel.jsx';
import { StorageButton, StorageLink, StorageBarMenu, StorageMenuItem, StorageUsageBar } from "./storage-controls.jsx";
import { StorageButton, StorageBarMenu, StorageMenuItem, StorageUsageBar } from "./storage-controls.jsx";
import * as PK from "packagekit.js";
import {
format_dialog, parse_options, extract_option, unparse_options
Expand Down Expand Up @@ -567,7 +568,7 @@ function append_row(client, rows, level, key, name, desc, tabs, job_object, opti
</span>)
},
{ title: desc.type },
{ title: desc.link ? <StorageLink onClick={() => cockpit.location.go(desc.link)}>{desc.used_for}</StorageLink> : desc.used_for },
{ title: desc.link ? <Button isInline variant="link" onClick={() => cockpit.location.go(desc.link)}>{desc.used_for}</Button> : desc.used_for },
{
title: desc.size.length
? <StorageUsageBar stats={desc.size} critical={desc.critical_size || 0.95} block={name} />
Expand Down
3 changes: 2 additions & 1 deletion pkg/storaged/stratis-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { DescriptionList, DescriptionListDescription, DescriptionListGroup, Desc
import { Flex, FlexItem } from "@patternfly/react-core/dist/esm/layouts/Flex/index.js";
import { List, ListItem } from "@patternfly/react-core/dist/esm/components/List/index.js";
import { PlusIcon, ExclamationTriangleIcon } from "@patternfly/react-icons";
import { Button } from "@patternfly/react-core/dist/esm/components/Button/index.js";

import { FilesystemTab, mounting_dialog, is_mounted, is_valid_mount_point, get_fstab_config } from "./fsys-tab.jsx";
import { ListingTable } from "cockpit-components-table.jsx";
Expand Down Expand Up @@ -663,7 +664,7 @@ export const StratisPoolDetails = ({ client, pool }) => {
variant="warning"
title={_("This pool is in a degraded state.")}>
<div className="storage_alert_action_buttons">
<StorageLink onClick={goToStratisLogs}>{_("View logs")}</StorageLink>
<Button variant="link" isInline onClick={goToStratisLogs}>{_("View logs")}</Button>
</div>
</Alert>);
}
Expand Down

0 comments on commit 3e505d5

Please sign in to comment.