Skip to content

Commit 0fb3841

Browse files
committed
feat(connectors): disable connector ActionsCell in cluster RO mode
1 parent 271e618 commit 0fb3841

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

frontend/src/components/Connect/List/ActionsCell.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { useContext } from 'react';
22
import {
33
Action,
44
ConnectorAction,
@@ -17,12 +17,14 @@ import {
1717
import { useConfirm } from 'lib/hooks/useConfirm';
1818
import { useIsMutating } from '@tanstack/react-query';
1919
import { ActionDropdownItem } from 'components/common/ActionComponent';
20+
import ClusterContext from 'components/contexts/ClusterContext';
2021

2122
const ActionsCell: React.FC<CellContext<FullConnectorInfo, unknown>> = ({
2223
row,
2324
}) => {
2425
const { connect, name, status } = row.original;
2526
const { clusterName } = useAppParams<ClusterNameRoute>();
27+
const { isReadOnly } = useContext(ClusterContext);
2628
const mutationsNumber = useIsMutating();
2729
const isMutating = mutationsNumber > 0;
2830
const confirm = useConfirm();
@@ -59,7 +61,7 @@ const ActionsCell: React.FC<CellContext<FullConnectorInfo, unknown>> = ({
5961
stateMutation.mutateAsync(ConnectorAction.RESTART_FAILED_TASKS);
6062

6163
return (
62-
<Dropdown>
64+
<Dropdown disabled={isReadOnly}>
6365
{status.state === ConnectorState.PAUSED && (
6466
<ActionDropdownItem
6567
onClick={resumeConnectorHandler}

0 commit comments

Comments
 (0)