Skip to content

feat(broker-configs): adjust edit button state in read-only mode #608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
795cad7
feat(broker-configs): adjust edit button state in read-only mode
spartanns Oct 13, 2024
dcf4afb
fix(broker-configs): add empty lines between imports to pass the test
spartanns Oct 13, 2024
368e03e
fix(broker-configs): remove empty lines to satisfy the linter
spartanns Oct 13, 2024
b37888b
fix(broker-configs): add cluster context isReadOnly to InputCellViewM…
spartanns Oct 13, 2024
2bd6fca
fix(broker-configs): set isReadOnly as a prop
spartanns Oct 14, 2024
3a20d1c
fix(broker-configs): add necessary fixes to satisfy the tests
spartanns Oct 14, 2024
bfd0bc6
fix(broker-configs): add more fixes to satisfy the tests
spartanns Oct 14, 2024
271e618
fix(broker-configs): add/remove blank lines to satisfy the tests
spartanns Oct 14, 2024
0fb3841
feat(connectors): disable connector ActionsCell in cluster RO mode
spartanns Oct 17, 2024
849aa1c
Merge branch 'main' into feat/button-state-in-ro-mode
spartanns Oct 17, 2024
6f35c47
Merge branch 'main' into feat/button-state-in-ro-mode
spartanns Oct 20, 2024
e254bcf
fix: move isReadOnly check from dropdown to list items
spartanns Oct 21, 2024
1835be4
fix: move isReadOnly check from dropdown to list items
spartanns Oct 21, 2024
32df6dc
fix: remove old dropdown item
spartanns Mar 10, 2025
b267294
Merge branch 'main' into feat/button-state-in-ro-mode
spartanns Mar 10, 2025
21a91ce
fix: replace cluster ro property with row property
spartanns Mar 10, 2025
d682022
Merge branch 'feat/button-state-in-ro-mode' of https://github.com/spa…
spartanns Mar 10, 2025
4f70638
fix: remove unused useContext import
spartanns Mar 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions frontend/src/components/Connect/List/ActionsCell.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useContext } from 'react';
import {
Action,
ConnectorAction,
Expand All @@ -18,12 +18,14 @@ import {
import { useConfirm } from 'lib/hooks/useConfirm';
import { useIsMutating } from '@tanstack/react-query';
import { ActionDropdownItem } from 'components/common/ActionComponent';
import ClusterContext from 'components/contexts/ClusterContext';

const ActionsCell: React.FC<CellContext<FullConnectorInfo, unknown>> = ({
row,
}) => {
const { connect, name, status } = row.original;
const { clusterName } = useAppParams<ClusterNameRoute>();
const { isReadOnly } = useContext(ClusterContext);
const mutationsNumber = useIsMutating();
const isMutating = mutationsNumber > 0;
const confirm = useConfirm();
Expand Down Expand Up @@ -123,7 +125,7 @@ const ActionsCell: React.FC<CellContext<FullConnectorInfo, unknown>> = ({
)}
<ActionDropdownItem
onClick={restartConnectorHandler}
disabled={isMutating}
disabled={isMutating || isReadOnly}
permission={{
resource: ResourceType.CONNECT,
action: Action.RESTART,
Expand Down
Loading