Skip to content

Commit 03ba80b

Browse files
committed
Remove request links OCMUI-3869
1 parent 5293193 commit 03ba80b

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

src/components/clusters/ClusterListMultiRegion/ClusterList.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ const ClusterList = ({
374374
<PageSection hasBodyWrapper={false}>
375375
<GlobalErrorBox />
376376
<div data-ready>
377-
<ClusterListEmptyState />
377+
<ClusterListEmptyState showTabbedView={showTabbedView} />
378378
</div>
379379
</PageSection>
380380
</AppPage>
@@ -432,7 +432,7 @@ const ClusterList = ({
432432
/>
433433
</ToolbarItem>
434434
)}
435-
<ClusterListActions />
435+
<ClusterListActions showTabbedView={showTabbedView} />
436436
<ViewOnlyMyClustersToggle
437437
view={CLUSTERS_VIEW}
438438
bodyContent="Show only the clusters you previously created, or all clusters in your organization."

src/components/clusters/ClusterListMultiRegion/components/ClusterListActions/ClusterListActions.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,13 @@ const useItems = (isDashboardView, showClusterRequest) => {
140140
return [dropdownItems, toolbarItems];
141141
};
142142

143-
const ClusterListActions = ({ className, isDashboardView }) => {
143+
const ClusterListActions = ({ className, isDashboardView, showTabbedView }) => {
144144
const showClusterRequest = useFeatureGate(AUTO_CLUSTER_TRANSFER_OWNERSHIP);
145145
const [isOpen, setIsOpen] = useState(false);
146-
const [dropdownItems, toolbarItems] = useItems(isDashboardView, showClusterRequest);
146+
const [dropdownItems, toolbarItems] = useItems(
147+
isDashboardView,
148+
showClusterRequest && !showTabbedView,
149+
);
147150
const toggleRef = useRef();
148151

149152
if (isDashboardView) {
@@ -231,6 +234,7 @@ const ClusterListActions = ({ className, isDashboardView }) => {
231234
ClusterListActions.propTypes = {
232235
className: PropTypes.string,
233236
isDashboardView: PropTypes.bool,
237+
showTabbedView: PropTypes.bool,
234238
};
235239

236240
export default ClusterListActions;

src/components/clusters/ClusterListMultiRegion/components/ClusterListEmptyState.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ClusterListEmptyState is the empty state (no clusters) for ClusterList
22
import React from 'react';
3+
import PropTypes from 'prop-types';
34

45
import {
56
Button,
@@ -13,7 +14,7 @@ import { PlusCircleIcon } from '@patternfly/react-icons/dist/esm/icons/plus-circ
1314

1415
import { Link } from '~/common/routing';
1516

16-
function ClusterListEmptyState() {
17+
function ClusterListEmptyState({ showTabbedView }) {
1718
return (
1819
<EmptyState
1920
headingLevel="h4"
@@ -41,9 +42,11 @@ function ClusterListEmptyState() {
4142
<Link to="/archived">
4243
<Button variant="link">View cluster archives</Button>
4344
</Link>
44-
<Link to="/cluster-request">
45-
<Button variant="link">View cluster requests</Button>
46-
</Link>
45+
{!showTabbedView && (
46+
<Link to="/cluster-request">
47+
<Button variant="link">View cluster requests</Button>
48+
</Link>
49+
)}
4750
<Link to="/assisted-installer">
4851
<Button variant="link">Assisted Installer clusters</Button>
4952
</Link>
@@ -53,4 +56,8 @@ function ClusterListEmptyState() {
5356
);
5457
}
5558

59+
ClusterListEmptyState.propTypes = {
60+
showTabbedView: PropTypes.bool,
61+
};
62+
5663
export default ClusterListEmptyState;

0 commit comments

Comments
 (0)