Skip to content

Commit

Permalink
Create connector 404 (#92)
Browse files Browse the repository at this point in the history
CreateConnectorButton component moved to it's own file
  • Loading branch information
Nilumilak committed Feb 19, 2024
1 parent ce87157 commit 81cb57c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
27 changes: 27 additions & 0 deletions frontend/src/components/Connect/List/CreateConnectorButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import { clusterConnectorNewRelativePath } from 'lib/paths';
import { ActionButton } from 'components/common/ActionComponent';
import { Action, ResourceType } from 'generated-sources';

interface CreateConnectorButtonProps {
disabled?: boolean;
}

const CreateConnectorButton: React.FC<CreateConnectorButtonProps> = ({
disabled = false,
}) => (
<ActionButton
buttonType="primary"
buttonSize="M"
disabled={disabled}
to={clusterConnectorNewRelativePath}
permission={{
resource: ResourceType.CONNECT,
action: Action.CREATE,
}}
>
Create Connector
</ActionButton>
);

export default CreateConnectorButton;
27 changes: 3 additions & 24 deletions frontend/src/components/Connect/List/ListPage.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
import React, { Suspense } from 'react';
import useAppParams from 'lib/hooks/useAppParams';
import { clusterConnectorNewRelativePath, ClusterNameRoute } from 'lib/paths';
import { ClusterNameRoute } from 'lib/paths';
import ClusterContext from 'components/contexts/ClusterContext';
import Search from 'components/common/Search/Search';
import * as Metrics from 'components/common/Metrics';
import PageHeading from 'components/common/PageHeading/PageHeading';
import { ActionButton } from 'components/common/ActionComponent';
import Tooltip from 'components/common/Tooltip/Tooltip';
import { ControlPanelWrapper } from 'components/common/ControlPanel/ControlPanel.styled';
import PageLoader from 'components/common/PageLoader/PageLoader';
import { Action, ConnectorState, ResourceType } from 'generated-sources';
import { ConnectorState } from 'generated-sources';
import { useConnectors, useConnects } from 'lib/hooks/api/kafkaConnect';

import CreateConnectorButton from './CreateConnectorButton';
import List from './List';

interface CreateConnectorButtonProps {
disabled?: boolean;
}

const CreateConnectorButton: React.FC<CreateConnectorButtonProps> = ({
disabled = false,
}) => (
<ActionButton
buttonType="primary"
buttonSize="M"
disabled={disabled}
to={clusterConnectorNewRelativePath}
permission={{
resource: ResourceType.CONNECT,
action: Action.CREATE,
}}
>
Create Connector
</ActionButton>
);

const ListPage: React.FC = () => {
const { isReadOnly } = React.useContext(ClusterContext);
const { clusterName } = useAppParams<ClusterNameRoute>();
Expand Down

0 comments on commit 81cb57c

Please sign in to comment.