Improve eslint configuration (#385)
Co-authored-by: Oleg Shuralev <workshur@gmail.com>
This commit is contained in:
parent
c86c955ace
commit
083e3f7de0
97 changed files with 137 additions and 82 deletions
|
@ -33,7 +33,14 @@
|
||||||
"jsx-a11y/label-has-associated-control": "off",
|
"jsx-a11y/label-has-associated-control": "off",
|
||||||
"import/prefer-default-export": "off",
|
"import/prefer-default-export": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "error",
|
"@typescript-eslint/no-explicit-any": "error",
|
||||||
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }]
|
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
|
||||||
|
"import/no-cycle": "error",
|
||||||
|
"import/order": ["error", {
|
||||||
|
"groups": ["builtin", "external", "parent", "sibling", "index"],
|
||||||
|
"newlines-between": "always"
|
||||||
|
}],
|
||||||
|
"import/no-relative-parent-imports": "error",
|
||||||
|
"no-debugger": "warn"
|
||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import { Alert as AlertProps } from 'redux/interfaces';
|
import { Alert as AlertProps } from 'redux/interfaces';
|
||||||
import * as actions from 'redux/actions/actions';
|
import * as actions from 'redux/actions/actions';
|
||||||
import Alert from '../Alert';
|
import Alert from 'components/Alert/Alert';
|
||||||
|
|
||||||
const id = 'test-id';
|
const id = 'test-id';
|
||||||
const title = 'My Alert Title';
|
const title = 'My Alert Title';
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import './App.scss';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
import { Cluster } from 'generated-sources';
|
import { Cluster } from 'generated-sources';
|
||||||
import { Switch, Route, useLocation } from 'react-router-dom';
|
import { Switch, Route, useLocation } from 'react-router-dom';
|
||||||
import { GIT_TAG, GIT_COMMIT } from 'lib/constants';
|
import { GIT_TAG, GIT_COMMIT } from 'lib/constants';
|
||||||
import { Alerts } from 'redux/interfaces';
|
import { Alerts } from 'redux/interfaces';
|
||||||
import Nav from './Nav/Nav';
|
import Nav from 'components/Nav/Nav';
|
||||||
import PageLoader from './common/PageLoader/PageLoader';
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
||||||
import Dashboard from './Dashboard/Dashboard';
|
import Dashboard from 'components/Dashboard/Dashboard';
|
||||||
import ClusterPage from './Cluster/Cluster';
|
import ClusterPage from 'components/Cluster/Cluster';
|
||||||
import Version from './Version/Version';
|
import Version from 'components/Version/Version';
|
||||||
import Alert from './Alert/Alert';
|
import Alert from 'components/Alert/Alert';
|
||||||
|
import 'components/App.scss';
|
||||||
|
|
||||||
export interface AppProps {
|
export interface AppProps {
|
||||||
isClusterListFetched?: boolean;
|
isClusterListFetched?: boolean;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
} from 'redux/reducers/clusters/selectors';
|
} from 'redux/reducers/clusters/selectors';
|
||||||
import { getAlerts } from 'redux/reducers/alerts/selectors';
|
import { getAlerts } from 'redux/reducers/alerts/selectors';
|
||||||
import { RootState } from 'redux/interfaces';
|
import { RootState } from 'redux/interfaces';
|
||||||
import App from './App';
|
import App from 'components/App';
|
||||||
|
|
||||||
const mapStateToProps = (state: RootState) => ({
|
const mapStateToProps = (state: RootState) => ({
|
||||||
isClusterListFetched: getIsClusterListFetched(state),
|
isClusterListFetched: getIsClusterListFetched(state),
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
getUnderReplicatedPartitionCount,
|
getUnderReplicatedPartitionCount,
|
||||||
getDiskUsage,
|
getDiskUsage,
|
||||||
} from 'redux/reducers/brokers/selectors';
|
} from 'redux/reducers/brokers/selectors';
|
||||||
import Brokers from './Brokers';
|
import Brokers from 'components/Brokers/Brokers';
|
||||||
|
|
||||||
const mapStateToProps = (state: RootState) => ({
|
const mapStateToProps = (state: RootState) => ({
|
||||||
isFetched: getIsBrokerListFetched(state),
|
isFetched: getIsBrokerListFetched(state),
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { ClusterFeaturesEnum } from 'generated-sources';
|
||||||
import { fetchClusterListAction } from 'redux/actions';
|
import { fetchClusterListAction } from 'redux/actions';
|
||||||
import configureStore from 'redux/store/configureStore';
|
import configureStore from 'redux/store/configureStore';
|
||||||
import { onlineClusterPayload } from 'redux/reducers/clusters/__test__/fixtures';
|
import { onlineClusterPayload } from 'redux/reducers/clusters/__test__/fixtures';
|
||||||
import Cluster from '../Cluster';
|
import Cluster from 'components/Cluster/Cluster';
|
||||||
|
|
||||||
const store = configureStore();
|
const store = configureStore();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Switch, Route } from 'react-router-dom';
|
import { Switch, Route } from 'react-router-dom';
|
||||||
import { clusterConnectorsPath } from 'lib/paths';
|
import { clusterConnectorsPath } from 'lib/paths';
|
||||||
import ListContainer from './List/ListContainer';
|
import ListContainer from 'components/Connect/List/ListContainer';
|
||||||
|
|
||||||
const Connect: React.FC = () => (
|
const Connect: React.FC = () => (
|
||||||
<Switch>
|
<Switch>
|
||||||
|
|
|
@ -7,7 +7,7 @@ import ClusterContext from 'components/contexts/ClusterContext';
|
||||||
import Indicator from 'components/common/Dashboard/Indicator';
|
import Indicator from 'components/common/Dashboard/Indicator';
|
||||||
import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper';
|
import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper';
|
||||||
import PageLoader from 'components/common/PageLoader/PageLoader';
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
||||||
import ListItem from './ListItem';
|
import ListItem from 'components/Connect/List/ListItem';
|
||||||
|
|
||||||
export interface ListProps {
|
export interface ListProps {
|
||||||
areConnectsFetching: boolean;
|
areConnectsFetching: boolean;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
getAreConnectsFetching,
|
getAreConnectsFetching,
|
||||||
getAreConnectorsFetching,
|
getAreConnectorsFetching,
|
||||||
} from 'redux/reducers/connect/selectors';
|
} from 'redux/reducers/connect/selectors';
|
||||||
import List from './List';
|
import List from 'components/Connect/List/List';
|
||||||
|
|
||||||
const mapStateToProps = (state: RootState) => ({
|
const mapStateToProps = (state: RootState) => ({
|
||||||
areConnectsFetching: getAreConnectsFetching(state),
|
areConnectsFetching: getAreConnectsFetching(state),
|
||||||
|
|
|
@ -10,7 +10,7 @@ import Dropdown from 'components/common/Dropdown/Dropdown';
|
||||||
import DropdownDivider from 'components/common/Dropdown/DropdownDivider';
|
import DropdownDivider from 'components/common/Dropdown/DropdownDivider';
|
||||||
import DropdownItem from 'components/common/Dropdown/DropdownItem';
|
import DropdownItem from 'components/common/Dropdown/DropdownItem';
|
||||||
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
|
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
|
||||||
import StatusTag from '../StatusTag';
|
import StatusTag from 'components/Connect/StatusTag';
|
||||||
|
|
||||||
export interface ListItemProps {
|
export interface ListItemProps {
|
||||||
clusterName: ClusterName;
|
clusterName: ClusterName;
|
||||||
|
|
|
@ -8,9 +8,8 @@ import ClusterContext, {
|
||||||
ContextProps,
|
ContextProps,
|
||||||
initialValue,
|
initialValue,
|
||||||
} from 'components/contexts/ClusterContext';
|
} from 'components/contexts/ClusterContext';
|
||||||
|
import ListContainer from 'components/Connect/List/ListContainer';
|
||||||
import ListContainer from '../ListContainer';
|
import List, { ListProps } from 'components/Connect/List/List';
|
||||||
import List, { ListProps } from '../List';
|
|
||||||
|
|
||||||
const store = configureStore();
|
const store = configureStore();
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Provider } from 'react-redux';
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
import { connectorsPayload } from 'redux/reducers/connect/__test__/fixtures';
|
import { connectorsPayload } from 'redux/reducers/connect/__test__/fixtures';
|
||||||
import configureStore from 'redux/store/configureStore';
|
import configureStore from 'redux/store/configureStore';
|
||||||
import ListItem, { ListItemProps } from '../ListItem';
|
import ListItem, { ListItemProps } from 'components/Connect/List/ListItem';
|
||||||
|
|
||||||
const store = configureStore();
|
const store = configureStore();
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,9 @@ import { connect } from 'react-redux';
|
||||||
import { fetchConsumerGroupsList } from 'redux/actions';
|
import { fetchConsumerGroupsList } from 'redux/actions';
|
||||||
import { RootState, ClusterName } from 'redux/interfaces';
|
import { RootState, ClusterName } from 'redux/interfaces';
|
||||||
import { RouteComponentProps } from 'react-router-dom';
|
import { RouteComponentProps } from 'react-router-dom';
|
||||||
|
import { getIsConsumerGroupsListFetched } from 'redux/reducers/consumerGroups/selectors';
|
||||||
|
|
||||||
import ConsumerGroups from './ConsumerGroups';
|
import ConsumerGroups from './ConsumerGroups';
|
||||||
import { getIsConsumerGroupsListFetched } from '../../redux/reducers/consumerGroups/selectors';
|
|
||||||
|
|
||||||
interface RouteProps {
|
interface RouteProps {
|
||||||
clusterName: ClusterName;
|
clusterName: ClusterName;
|
||||||
|
|
|
@ -8,8 +8,8 @@ import {
|
||||||
ConsumerGroupDetails,
|
ConsumerGroupDetails,
|
||||||
ConsumerTopicPartitionDetail,
|
ConsumerTopicPartitionDetail,
|
||||||
} from 'generated-sources';
|
} from 'generated-sources';
|
||||||
|
|
||||||
import PageLoader from 'components/common/PageLoader/PageLoader';
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
||||||
|
|
||||||
import ListItem from './ListItem';
|
import ListItem from './ListItem';
|
||||||
|
|
||||||
interface Props extends ConsumerGroup, ConsumerGroupDetails {
|
interface Props extends ConsumerGroup, ConsumerGroupDetails {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
} from 'redux/reducers/consumerGroups/selectors';
|
} from 'redux/reducers/consumerGroups/selectors';
|
||||||
import { ConsumerGroupID } from 'redux/interfaces/consumerGroup';
|
import { ConsumerGroupID } from 'redux/interfaces/consumerGroup';
|
||||||
import { fetchConsumerGroupDetails } from 'redux/actions/thunks';
|
import { fetchConsumerGroupDetails } from 'redux/actions/thunks';
|
||||||
|
|
||||||
import Details from './Details';
|
import Details from './Details';
|
||||||
|
|
||||||
interface RouteProps {
|
interface RouteProps {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import { ClusterName } from 'redux/interfaces';
|
import { ClusterName } from 'redux/interfaces';
|
||||||
import { ConsumerGroup } from 'generated-sources';
|
import { ConsumerGroup } from 'generated-sources';
|
||||||
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
||||||
|
|
||||||
import ListItem from './ListItem';
|
import ListItem from './ListItem';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { connect } from 'react-redux';
|
||||||
import { ClusterName, RootState } from 'redux/interfaces';
|
import { ClusterName, RootState } from 'redux/interfaces';
|
||||||
import { getConsumerGroupsList } from 'redux/reducers/consumerGroups/selectors';
|
import { getConsumerGroupsList } from 'redux/reducers/consumerGroups/selectors';
|
||||||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||||
|
|
||||||
import List from './List';
|
import List from './List';
|
||||||
|
|
||||||
interface RouteProps {
|
interface RouteProps {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { chunk } from 'lodash';
|
import { chunk } from 'lodash';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
|
|
||||||
import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper';
|
import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper';
|
||||||
import Indicator from 'components/common/Dashboard/Indicator';
|
import Indicator from 'components/common/Dashboard/Indicator';
|
||||||
import { Cluster } from 'generated-sources';
|
import { Cluster } from 'generated-sources';
|
||||||
|
|
||||||
import ClusterWidget from './ClusterWidget';
|
import ClusterWidget from './ClusterWidget';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {
|
||||||
getOfflineClusters,
|
getOfflineClusters,
|
||||||
} from 'redux/reducers/clusters/selectors';
|
} from 'redux/reducers/clusters/selectors';
|
||||||
import { RootState } from 'redux/interfaces';
|
import { RootState } from 'redux/interfaces';
|
||||||
|
|
||||||
import ClustersWidget from './ClustersWidget';
|
import ClustersWidget from './ClustersWidget';
|
||||||
|
|
||||||
const mapStateToProps = (state: RootState) => ({
|
const mapStateToProps = (state: RootState) => ({
|
||||||
|
|
|
@ -2,7 +2,8 @@ import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import { ServerStatus } from 'generated-sources';
|
import { ServerStatus } from 'generated-sources';
|
||||||
import { clusterBrokersPath, clusterTopicsPath } from 'lib/paths';
|
import { clusterBrokersPath, clusterTopicsPath } from 'lib/paths';
|
||||||
import ClusterWidget from '../ClusterWidget';
|
import ClusterWidget from 'components/Dashboard/ClustersWidget/ClusterWidget';
|
||||||
|
|
||||||
import { offlineCluster, onlineCluster } from './fixtures';
|
import { offlineCluster, onlineCluster } from './fixtures';
|
||||||
|
|
||||||
describe('ClusterWidget', () => {
|
describe('ClusterWidget', () => {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
||||||
|
|
||||||
import ClustersWidgetContainer from './ClustersWidget/ClustersWidgetContainer';
|
import ClustersWidgetContainer from './ClustersWidget/ClustersWidgetContainer';
|
||||||
|
|
||||||
const Dashboard: React.FC = () => (
|
const Dashboard: React.FC = () => (
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
clusterSchemasPath,
|
clusterSchemasPath,
|
||||||
clusterConnectorsPath,
|
clusterConnectorsPath,
|
||||||
} from 'lib/paths';
|
} from 'lib/paths';
|
||||||
|
|
||||||
import DefaultClusterIcon from './DefaultClusterIcon';
|
import DefaultClusterIcon from './DefaultClusterIcon';
|
||||||
import ClusterStatusIcon from './ClusterStatusIcon';
|
import ClusterStatusIcon from './ClusterStatusIcon';
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
import { Cluster } from 'generated-sources';
|
import { Cluster } from 'generated-sources';
|
||||||
|
|
||||||
import ClusterMenu from './ClusterMenu';
|
import ClusterMenu from './ClusterMenu';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { mount } from 'enzyme';
|
||||||
import { StaticRouter } from 'react-router';
|
import { StaticRouter } from 'react-router';
|
||||||
import { Cluster, ClusterFeaturesEnum } from 'generated-sources';
|
import { Cluster, ClusterFeaturesEnum } from 'generated-sources';
|
||||||
import { onlineClusterPayload } from 'redux/reducers/clusters/__test__/fixtures';
|
import { onlineClusterPayload } from 'redux/reducers/clusters/__test__/fixtures';
|
||||||
import ClusterMenu from '../ClusterMenu';
|
import ClusterMenu from 'components/Nav/ClusterMenu';
|
||||||
|
|
||||||
describe('ClusterMenu', () => {
|
describe('ClusterMenu', () => {
|
||||||
const setupComponent = (cluster: Cluster) => (
|
const setupComponent = (cluster: Cluster) => (
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import { ServerStatus } from 'generated-sources';
|
import { ServerStatus } from 'generated-sources';
|
||||||
import ClusterStatusIcon from '../ClusterStatusIcon';
|
import ClusterStatusIcon from 'components/Nav/ClusterStatusIcon';
|
||||||
|
|
||||||
describe('ClusterStatusIcon', () => {
|
describe('ClusterStatusIcon', () => {
|
||||||
it('matches snapshot', () => {
|
it('matches snapshot', () => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import { onlineClusterPayload } from 'redux/reducers/clusters/__test__/fixtures';
|
import { onlineClusterPayload } from 'redux/reducers/clusters/__test__/fixtures';
|
||||||
import Nav from '../Nav';
|
import Nav from 'components/Nav/Nav';
|
||||||
|
|
||||||
describe('Nav', () => {
|
describe('Nav', () => {
|
||||||
it('renders loader', () => {
|
it('renders loader', () => {
|
||||||
|
|
|
@ -3,10 +3,11 @@ import { useHistory } from 'react-router';
|
||||||
import { SchemaSubject } from 'generated-sources';
|
import { SchemaSubject } from 'generated-sources';
|
||||||
import { ClusterName, SchemaName } from 'redux/interfaces';
|
import { ClusterName, SchemaName } from 'redux/interfaces';
|
||||||
import { clusterSchemasPath } from 'lib/paths';
|
import { clusterSchemasPath } from 'lib/paths';
|
||||||
|
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
||||||
import ClusterContext from 'components/contexts/ClusterContext';
|
import ClusterContext from 'components/contexts/ClusterContext';
|
||||||
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
|
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
|
||||||
import PageLoader from 'components/common/PageLoader/PageLoader';
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
||||||
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
|
||||||
import SchemaVersion from './SchemaVersion';
|
import SchemaVersion from './SchemaVersion';
|
||||||
import LatestVersionItem from './LatestVersionItem';
|
import LatestVersionItem from './LatestVersionItem';
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
getSortedSchemaVersions,
|
getSortedSchemaVersions,
|
||||||
} from 'redux/reducers/schemas/selectors';
|
} from 'redux/reducers/schemas/selectors';
|
||||||
import { fetchSchemaVersions, deleteSchema } from 'redux/actions';
|
import { fetchSchemaVersions, deleteSchema } from 'redux/actions';
|
||||||
|
|
||||||
import Details from './Details';
|
import Details from './Details';
|
||||||
|
|
||||||
interface RouteProps {
|
interface RouteProps {
|
||||||
|
|
|
@ -4,8 +4,9 @@ import { shallow, mount, ReactWrapper } from 'enzyme';
|
||||||
import configureStore from 'redux/store/configureStore';
|
import configureStore from 'redux/store/configureStore';
|
||||||
import { StaticRouter } from 'react-router';
|
import { StaticRouter } from 'react-router';
|
||||||
import ClusterContext from 'components/contexts/ClusterContext';
|
import ClusterContext from 'components/contexts/ClusterContext';
|
||||||
import DetailsContainer from '../DetailsContainer';
|
import DetailsContainer from 'components/Schemas/Details/DetailsContainer';
|
||||||
import Details, { DetailsProps } from '../Details';
|
import Details, { DetailsProps } from 'components/Schemas/Details/Details';
|
||||||
|
|
||||||
import { schema, versions } from './fixtures';
|
import { schema, versions } from './fixtures';
|
||||||
|
|
||||||
const clusterName = 'testCluster';
|
const clusterName = 'testCluster';
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount, shallow } from 'enzyme';
|
import { mount, shallow } from 'enzyme';
|
||||||
|
import LatestVersionItem from 'components/Schemas/Details/LatestVersionItem';
|
||||||
|
|
||||||
import { schema } from './fixtures';
|
import { schema } from './fixtures';
|
||||||
import LatestVersionItem from '../LatestVersionItem';
|
|
||||||
|
|
||||||
describe('LatestVersionItem', () => {
|
describe('LatestVersionItem', () => {
|
||||||
it('renders latest version of schema', () => {
|
it('renders latest version of schema', () => {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import SchemaVersion from '../SchemaVersion';
|
import SchemaVersion from 'components/Schemas/Details/SchemaVersion';
|
||||||
|
|
||||||
import { versions } from './fixtures';
|
import { versions } from './fixtures';
|
||||||
|
|
||||||
describe('SchemaVersion', () => {
|
describe('SchemaVersion', () => {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { ClusterName } from 'redux/interfaces';
|
||||||
import PageLoader from 'components/common/PageLoader/PageLoader';
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
||||||
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
||||||
import ClusterContext from 'components/contexts/ClusterContext';
|
import ClusterContext from 'components/contexts/ClusterContext';
|
||||||
|
|
||||||
import ListItem from './ListItem';
|
import ListItem from './ListItem';
|
||||||
|
|
||||||
export interface ListProps {
|
export interface ListProps {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {
|
||||||
getIsSchemaListFetching,
|
getIsSchemaListFetching,
|
||||||
getSchemaList,
|
getSchemaList,
|
||||||
} from 'redux/reducers/schemas/selectors';
|
} from 'redux/reducers/schemas/selectors';
|
||||||
|
|
||||||
import List from './List';
|
import List from './List';
|
||||||
|
|
||||||
const mapStateToProps = (state: RootState) => ({
|
const mapStateToProps = (state: RootState) => ({
|
||||||
|
|
|
@ -4,8 +4,9 @@ import { Provider } from 'react-redux';
|
||||||
import { StaticRouter } from 'react-router';
|
import { StaticRouter } from 'react-router';
|
||||||
import configureStore from 'redux/store/configureStore';
|
import configureStore from 'redux/store/configureStore';
|
||||||
import ClusterContext from 'components/contexts/ClusterContext';
|
import ClusterContext from 'components/contexts/ClusterContext';
|
||||||
import ListContainer from '../ListContainer';
|
import ListContainer from 'components/Schemas/List/ListContainer';
|
||||||
import List, { ListProps } from '../List';
|
import List, { ListProps } from 'components/Schemas/List/List';
|
||||||
|
|
||||||
import { schemas } from './fixtures';
|
import { schemas } from './fixtures';
|
||||||
|
|
||||||
describe('List', () => {
|
describe('List', () => {
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import { BrowserRouter as Router } from 'react-router-dom';
|
import { BrowserRouter as Router } from 'react-router-dom';
|
||||||
|
import ListItem from 'components/Schemas/List/ListItem';
|
||||||
|
|
||||||
import { schemas } from './fixtures';
|
import { schemas } from './fixtures';
|
||||||
import ListItem from '../ListItem';
|
|
||||||
|
|
||||||
describe('ListItem', () => {
|
describe('ListItem', () => {
|
||||||
const wrapper = mount(
|
const wrapper = mount(
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { connect } from 'react-redux';
|
||||||
import { RootState } from 'redux/interfaces';
|
import { RootState } from 'redux/interfaces';
|
||||||
import { createSchema } from 'redux/actions';
|
import { createSchema } from 'redux/actions';
|
||||||
import { getSchemaCreated } from 'redux/reducers/schemas/selectors';
|
import { getSchemaCreated } from 'redux/reducers/schemas/selectors';
|
||||||
|
|
||||||
import New from './New';
|
import New from './New';
|
||||||
|
|
||||||
const mapStateToProps = (state: RootState) => ({
|
const mapStateToProps = (state: RootState) => ({
|
||||||
|
|
|
@ -3,8 +3,8 @@ import configureStore from 'redux/store/configureStore';
|
||||||
import { mount, shallow } from 'enzyme';
|
import { mount, shallow } from 'enzyme';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { StaticRouter } from 'react-router-dom';
|
import { StaticRouter } from 'react-router-dom';
|
||||||
import NewContainer from '../NewContainer';
|
import NewContainer from 'components/Schemas/New/NewContainer';
|
||||||
import New, { NewProps } from '../New';
|
import New, { NewProps } from 'components/Schemas/New/New';
|
||||||
|
|
||||||
describe('New', () => {
|
describe('New', () => {
|
||||||
describe('Container', () => {
|
describe('Container', () => {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {
|
||||||
clusterSchemaPath,
|
clusterSchemaPath,
|
||||||
clusterSchemasPath,
|
clusterSchemasPath,
|
||||||
} from 'lib/paths';
|
} from 'lib/paths';
|
||||||
|
|
||||||
import ListContainer from './List/ListContainer';
|
import ListContainer from './List/ListContainer';
|
||||||
import DetailsContainer from './Details/DetailsContainer';
|
import DetailsContainer from './Details/DetailsContainer';
|
||||||
import NewContainer from './New/NewContainer';
|
import NewContainer from './New/NewContainer';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import { StaticRouter } from 'react-router-dom';
|
import { StaticRouter } from 'react-router-dom';
|
||||||
import Schemas from '../Schemas';
|
import Schemas from 'components/Schemas/Schemas';
|
||||||
|
|
||||||
describe('Schemas', () => {
|
describe('Schemas', () => {
|
||||||
const pathname = `/ui/clusters/clusterName/schemas`;
|
const pathname = `/ui/clusters/clusterName/schemas`;
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { FetchTopicsListParams } from 'redux/actions';
|
||||||
import ClusterContext from 'components/contexts/ClusterContext';
|
import ClusterContext from 'components/contexts/ClusterContext';
|
||||||
import PageLoader from 'components/common/PageLoader/PageLoader';
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
||||||
import Pagination from 'components/common/Pagination/Pagination';
|
import Pagination from 'components/common/Pagination/Pagination';
|
||||||
|
|
||||||
import ListItem from './ListItem';
|
import ListItem from './ListItem';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {
|
||||||
getAreTopicsFetching,
|
getAreTopicsFetching,
|
||||||
getTopicListTotalPages,
|
getTopicListTotalPages,
|
||||||
} from 'redux/reducers/topics/selectors';
|
} from 'redux/reducers/topics/selectors';
|
||||||
|
|
||||||
import List from './List';
|
import List from './List';
|
||||||
|
|
||||||
const mapStateToProps = (state: RootState) => ({
|
const mapStateToProps = (state: RootState) => ({
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import { StaticRouter } from 'react-router-dom';
|
import { StaticRouter } from 'react-router-dom';
|
||||||
import ClusterContext from 'components/contexts/ClusterContext';
|
import ClusterContext from 'components/contexts/ClusterContext';
|
||||||
import List from '../List';
|
import List from 'components/Topics/List/List';
|
||||||
|
|
||||||
describe('List', () => {
|
describe('List', () => {
|
||||||
describe('when it has readonly flag', () => {
|
describe('when it has readonly flag', () => {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
externalTopicPayload,
|
externalTopicPayload,
|
||||||
internalTopicPayload,
|
internalTopicPayload,
|
||||||
} from 'redux/reducers/topics/__test__/fixtures';
|
} from 'redux/reducers/topics/__test__/fixtures';
|
||||||
import ListItem, { ListItemProps } from '../ListItem';
|
import ListItem, { ListItemProps } from 'components/Topics/List/ListItem';
|
||||||
|
|
||||||
const mockDelete = jest.fn();
|
const mockDelete = jest.fn();
|
||||||
const clusterName = 'local';
|
const clusterName = 'local';
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ClusterName, TopicName, TopicFormDataRaw } from 'redux/interfaces';
|
import { ClusterName, TopicName, TopicFormDataRaw } from 'redux/interfaces';
|
||||||
import { useForm, FormProvider } from 'react-hook-form';
|
import { useForm, FormProvider } from 'react-hook-form';
|
||||||
|
|
||||||
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb';
|
||||||
import { clusterTopicsPath } from 'lib/paths';
|
import { clusterTopicsPath } from 'lib/paths';
|
||||||
import TopicForm from 'components/Topics/shared/Form/TopicForm';
|
import TopicForm from 'components/Topics/shared/Form/TopicForm';
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { createTopic, createTopicAction } from 'redux/actions';
|
||||||
import { getTopicCreated } from 'redux/reducers/topics/selectors';
|
import { getTopicCreated } from 'redux/reducers/topics/selectors';
|
||||||
import { clusterTopicPath } from 'lib/paths';
|
import { clusterTopicPath } from 'lib/paths';
|
||||||
import { ThunkDispatch } from 'redux-thunk';
|
import { ThunkDispatch } from 'redux-thunk';
|
||||||
|
|
||||||
import New from './New';
|
import New from './New';
|
||||||
|
|
||||||
interface RouteProps {
|
interface RouteProps {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {
|
||||||
} from 'lib/paths';
|
} from 'lib/paths';
|
||||||
import ClusterContext from 'components/contexts/ClusterContext';
|
import ClusterContext from 'components/contexts/ClusterContext';
|
||||||
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
|
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
|
||||||
|
|
||||||
import OverviewContainer from './Overview/OverviewContainer';
|
import OverviewContainer from './Overview/OverviewContainer';
|
||||||
import MessagesContainer from './Messages/MessagesContainer';
|
import MessagesContainer from './Messages/MessagesContainer';
|
||||||
import SettingsContainer from './Settings/SettingsContainer';
|
import SettingsContainer from './Settings/SettingsContainer';
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import 'react-datepicker/dist/react-datepicker.css';
|
import 'react-datepicker/dist/react-datepicker.css';
|
||||||
import React, { useCallback, useEffect, useRef } from 'react';
|
import React, { useCallback, useEffect, useRef } from 'react';
|
||||||
import { groupBy, map, concat, maxBy } from 'lodash';
|
import { groupBy, map, concat, maxBy } from 'lodash';
|
||||||
|
import DatePicker from 'react-datepicker';
|
||||||
import MultiSelect from 'react-multi-select-component';
|
import MultiSelect from 'react-multi-select-component';
|
||||||
import { Option } from 'react-multi-select-component/dist/lib/interfaces';
|
import { Option } from 'react-multi-select-component/dist/lib/interfaces';
|
||||||
import { useDebouncedCallback } from 'use-debounce';
|
import { useDebouncedCallback } from 'use-debounce';
|
||||||
|
@ -11,7 +12,7 @@ import {
|
||||||
} from 'redux/interfaces';
|
} from 'redux/interfaces';
|
||||||
import { TopicMessage, Partition, SeekType } from 'generated-sources';
|
import { TopicMessage, Partition, SeekType } from 'generated-sources';
|
||||||
import PageLoader from 'components/common/PageLoader/PageLoader';
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
||||||
import DatePicker from 'react-datepicker';
|
|
||||||
import MessagesTable from './MessagesTable';
|
import MessagesTable from './MessagesTable';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { TopicMessage } from 'generated-sources';
|
import { TopicMessage } from 'generated-sources';
|
||||||
import CustomParamButton from 'components/Topics/shared/Form/CustomParams/CustomParamButton';
|
import CustomParamButton from 'components/Topics/shared/Form/CustomParams/CustomParamButton';
|
||||||
|
|
||||||
import MessageItem from './MessageItem';
|
import MessageItem from './MessageItem';
|
||||||
|
|
||||||
export interface MessagesTableProp {
|
export interface MessagesTableProp {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import MessageItem from 'components/Topics/Topic/Details/Messages/MessageItem';
|
import MessageItem from 'components/Topics/Topic/Details/Messages/MessageItem';
|
||||||
|
|
||||||
import { messages } from './fixtures';
|
import { messages } from './fixtures';
|
||||||
|
|
||||||
jest.mock('date-fns', () => ({
|
jest.mock('date-fns', () => ({
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { shallow } from 'enzyme';
|
||||||
import MessagesTable, {
|
import MessagesTable, {
|
||||||
MessagesTableProp,
|
MessagesTableProp,
|
||||||
} from 'components/Topics/Topic/Details/Messages/MessagesTable';
|
} from 'components/Topics/Topic/Details/Messages/MessagesTable';
|
||||||
|
|
||||||
import { messages } from './fixtures';
|
import { messages } from './fixtures';
|
||||||
|
|
||||||
jest.mock('date-fns', () => ({
|
jest.mock('date-fns', () => ({
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { RootState, TopicName, ClusterName } from 'redux/interfaces';
|
||||||
import { getTopicByName } from 'redux/reducers/topics/selectors';
|
import { getTopicByName } from 'redux/reducers/topics/selectors';
|
||||||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||||
import { clearTopicMessages } from 'redux/actions';
|
import { clearTopicMessages } from 'redux/actions';
|
||||||
import Overview from './Overview';
|
import Overview from 'components/Topics/Topic/Details/Overview/Overview';
|
||||||
|
|
||||||
interface RouteProps {
|
interface RouteProps {
|
||||||
clusterName: ClusterName;
|
clusterName: ClusterName;
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
getTopicConfig,
|
getTopicConfig,
|
||||||
getTopicConfigFetched,
|
getTopicConfigFetched,
|
||||||
} from 'redux/reducers/topics/selectors';
|
} from 'redux/reducers/topics/selectors';
|
||||||
|
|
||||||
import Settings from './Settings';
|
import Settings from './Settings';
|
||||||
|
|
||||||
interface RouteProps {
|
interface RouteProps {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { connect } from 'react-redux';
|
||||||
import { RootState } from 'redux/interfaces';
|
import { RootState } from 'redux/interfaces';
|
||||||
import { fetchTopicDetails } from 'redux/actions';
|
import { fetchTopicDetails } from 'redux/actions';
|
||||||
import { getIsTopicDetailsFetching } from 'redux/reducers/topics/selectors';
|
import { getIsTopicDetailsFetching } from 'redux/reducers/topics/selectors';
|
||||||
|
|
||||||
import Topic from './Topic';
|
import Topic from './Topic';
|
||||||
|
|
||||||
const mapStateToProps = (state: RootState) => ({
|
const mapStateToProps = (state: RootState) => ({
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {
|
||||||
clusterTopicPath,
|
clusterTopicPath,
|
||||||
clusterTopicsPath,
|
clusterTopicsPath,
|
||||||
} from 'lib/paths';
|
} from 'lib/paths';
|
||||||
|
|
||||||
import ListContainer from './List/ListContainer';
|
import ListContainer from './List/ListContainer';
|
||||||
import TopicContainer from './Topic/TopicContainer';
|
import TopicContainer from './Topic/TopicContainer';
|
||||||
import NewContainer from './New/NewContainer';
|
import NewContainer from './New/NewContainer';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import CustomParamButton from './CustomParamButton';
|
import CustomParamButton from './CustomParamButton';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { useFormContext } from 'react-hook-form';
|
||||||
import { TopicConfigValue } from 'redux/interfaces';
|
import { TopicConfigValue } from 'redux/interfaces';
|
||||||
import { ErrorMessage } from '@hookform/error-message';
|
import { ErrorMessage } from '@hookform/error-message';
|
||||||
import { TOPIC_CUSTOM_PARAMS } from 'lib/constants';
|
import { TOPIC_CUSTOM_PARAMS } from 'lib/constants';
|
||||||
|
|
||||||
import { INDEX_PREFIX } from './CustomParams';
|
import { INDEX_PREFIX } from './CustomParams';
|
||||||
|
|
||||||
export interface CustomParamSelectProps {
|
export interface CustomParamSelectProps {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { omit, reject, reduce, remove } from 'lodash';
|
import { omit, reject, reduce, remove } from 'lodash';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
TopicFormCustomParams,
|
TopicFormCustomParams,
|
||||||
TopicConfigByName,
|
TopicConfigByName,
|
||||||
TopicConfigParams,
|
TopicConfigParams,
|
||||||
} from 'redux/interfaces';
|
} from 'redux/interfaces';
|
||||||
|
|
||||||
import CustomParamButton from './CustomParamButton';
|
import CustomParamButton from './CustomParamButton';
|
||||||
import CustomParamField from './CustomParamField';
|
import CustomParamField from './CustomParamField';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { RootState, TopicConfigByName } from 'redux/interfaces';
|
import { RootState, TopicConfigByName } from 'redux/interfaces';
|
||||||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||||
|
|
||||||
import CustomParams from './CustomParams';
|
import CustomParams from './CustomParams';
|
||||||
|
|
||||||
interface OwnProps extends RouteComponentProps {
|
interface OwnProps extends RouteComponentProps {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useForm, FormProvider } from 'react-hook-form';
|
||||||
import { TOPIC_CUSTOM_PARAMS } from 'lib/constants';
|
import { TOPIC_CUSTOM_PARAMS } from 'lib/constants';
|
||||||
import CustomParamSelect, {
|
import CustomParamSelect, {
|
||||||
CustomParamSelectProps,
|
CustomParamSelectProps,
|
||||||
} from '../CustomParamSelect';
|
} from 'components/Topics/shared/Form/CustomParams/CustomParamSelect';
|
||||||
|
|
||||||
const existingFields = [
|
const existingFields = [
|
||||||
'leader.replication.throttled.replicas',
|
'leader.replication.throttled.replicas',
|
||||||
|
|
|
@ -2,8 +2,8 @@ import React from 'react';
|
||||||
import prettyMilliseconds from 'pretty-ms';
|
import prettyMilliseconds from 'pretty-ms';
|
||||||
import { useFormContext } from 'react-hook-form';
|
import { useFormContext } from 'react-hook-form';
|
||||||
import { ErrorMessage } from '@hookform/error-message';
|
import { ErrorMessage } from '@hookform/error-message';
|
||||||
|
|
||||||
import { MILLISECONDS_IN_WEEK, MILLISECONDS_IN_SECOND } from 'lib/constants';
|
import { MILLISECONDS_IN_WEEK, MILLISECONDS_IN_SECOND } from 'lib/constants';
|
||||||
|
|
||||||
import TimeToRetainBtns from './TimeToRetainBtns';
|
import TimeToRetainBtns from './TimeToRetainBtns';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { MILLISECONDS_IN_DAY } from 'lib/constants';
|
import { MILLISECONDS_IN_DAY } from 'lib/constants';
|
||||||
|
|
||||||
import TimeToRetainBtn from './TimeToRetainBtn';
|
import TimeToRetainBtn from './TimeToRetainBtn';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { useFormContext } from 'react-hook-form';
|
||||||
import { TOPIC_NAME_VALIDATION_PATTERN, BYTES_IN_GB } from 'lib/constants';
|
import { TOPIC_NAME_VALIDATION_PATTERN, BYTES_IN_GB } from 'lib/constants';
|
||||||
import { TopicName, TopicConfigByName } from 'redux/interfaces';
|
import { TopicName, TopicConfigByName } from 'redux/interfaces';
|
||||||
import { ErrorMessage } from '@hookform/error-message';
|
import { ErrorMessage } from '@hookform/error-message';
|
||||||
|
|
||||||
import CustomParamsContainer from './CustomParams/CustomParamsContainer';
|
import CustomParamsContainer from './CustomParams/CustomParamsContainer';
|
||||||
import TimeToRetain from './TimeToRetain';
|
import TimeToRetain from './TimeToRetain';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import Version from '../Version';
|
import Version from 'components/Version/Version';
|
||||||
|
|
||||||
const tag = 'v1.0.1-SHAPSHOT';
|
const tag = 'v1.0.1-SHAPSHOT';
|
||||||
const commit = '123sdf34';
|
const commit = '123sdf34';
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import { mount, shallow } from 'enzyme';
|
import { mount, shallow } from 'enzyme';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StaticRouter } from 'react-router-dom';
|
import { StaticRouter } from 'react-router-dom';
|
||||||
import Breadcrumb, { BreadcrumbItem } from '../Breadcrumb';
|
import Breadcrumb, {
|
||||||
|
BreadcrumbItem,
|
||||||
|
} from 'components/common/Breadcrumb/Breadcrumb';
|
||||||
|
|
||||||
describe('Breadcrumb component', () => {
|
describe('Breadcrumb component', () => {
|
||||||
const links: BreadcrumbItem[] = [
|
const links: BreadcrumbItem[] = [
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import BytesFormatted, { sizes } from '../BytesFormatted';
|
import BytesFormatted, {
|
||||||
|
sizes,
|
||||||
|
} from 'components/common/BytesFormatted/BytesFormatted';
|
||||||
|
|
||||||
describe('BytesFormatted', () => {
|
describe('BytesFormatted', () => {
|
||||||
it('renders Bytes correctly', () => {
|
it('renders Bytes correctly', () => {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { mount, ReactWrapper } from 'enzyme';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ConfirmationModal, {
|
import ConfirmationModal, {
|
||||||
ConfirmationModalProps,
|
ConfirmationModalProps,
|
||||||
} from '../ConfirmationModal';
|
} from 'components/common/ConfirmationModal/ConfirmationModal';
|
||||||
|
|
||||||
const confirmMock = jest.fn();
|
const confirmMock = jest.fn();
|
||||||
const cancelMock = jest.fn();
|
const cancelMock = jest.fn();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Indicator from '../Indicator';
|
import Indicator from 'components/common/Dashboard/Indicator';
|
||||||
|
|
||||||
describe('Indicator', () => {
|
describe('Indicator', () => {
|
||||||
it('matches the snapshot', () => {
|
it('matches the snapshot', () => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import MetricsWrapper from '../MetricsWrapper';
|
import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper';
|
||||||
|
|
||||||
describe('MetricsWrapper', () => {
|
describe('MetricsWrapper', () => {
|
||||||
it('correctly adds classes', () => {
|
it('correctly adds classes', () => {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import Dropdown, { DropdownProps } from '../Dropdown';
|
import Dropdown, { DropdownProps } from 'components/common/Dropdown/Dropdown';
|
||||||
import DropdownItem from '../DropdownItem';
|
import DropdownItem from 'components/common/Dropdown/DropdownItem';
|
||||||
import DropdownDivider from '../DropdownDivider';
|
import DropdownDivider from 'components/common/Dropdown/DropdownDivider';
|
||||||
|
|
||||||
const dummyLable = 'My Test Label';
|
const dummyLable = 'My Test Label';
|
||||||
const dummyChildren = (
|
const dummyChildren = (
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import DropdownItem from '../DropdownItem';
|
import DropdownItem from 'components/common/Dropdown/DropdownItem';
|
||||||
|
|
||||||
const onClick = jest.fn();
|
const onClick = jest.fn();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount, shallow } from 'enzyme';
|
import { mount, shallow } from 'enzyme';
|
||||||
import DynamicTextButton from '../DynamicTextButton';
|
import DynamicTextButton from 'components/common/DynamicTextButton/DynamicTextButton';
|
||||||
|
|
||||||
describe('DynamicButton', () => {
|
describe('DynamicButton', () => {
|
||||||
const mockCallback = jest.fn();
|
const mockCallback = jest.fn();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import JSONTree from 'react-json-tree';
|
import JSONTree from 'react-json-tree';
|
||||||
import theme from './themes/google';
|
import theme from 'components/common/JSONViewer/themes/google';
|
||||||
|
|
||||||
interface JSONViewerProps {
|
interface JSONViewerProps {
|
||||||
data: Record<string, string>;
|
data: Record<string, string>;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PageLoader from '../PageLoader';
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
||||||
|
|
||||||
describe('PageLoader', () => {
|
describe('PageLoader', () => {
|
||||||
it('matches the snapshot', () => {
|
it('matches the snapshot', () => {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import usePagination from 'lib/hooks/usePagination';
|
||||||
import { range } from 'lodash';
|
import { range } from 'lodash';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import PageControl from './PageControl';
|
import PageControl from 'components/common/Pagination/PageControl';
|
||||||
|
|
||||||
export interface PaginationProps {
|
export interface PaginationProps {
|
||||||
totalPages: number;
|
totalPages: number;
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount, shallow } from 'enzyme';
|
import { mount, shallow } from 'enzyme';
|
||||||
import { StaticRouter } from 'react-router';
|
import { StaticRouter } from 'react-router';
|
||||||
import PageControl, { PageControlProps } from '../PageControl';
|
import PageControl, {
|
||||||
|
PageControlProps,
|
||||||
|
} from 'components/common/Pagination/PageControl';
|
||||||
|
|
||||||
const page = 138;
|
const page = 138;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import { StaticRouter } from 'react-router';
|
import { StaticRouter } from 'react-router';
|
||||||
import Pagination, { PaginationProps } from '../Pagination';
|
import Pagination, {
|
||||||
|
PaginationProps,
|
||||||
|
} from 'components/common/Pagination/Pagination';
|
||||||
|
|
||||||
describe('Pagination', () => {
|
describe('Pagination', () => {
|
||||||
const setupWrapper = (search = '', props: Partial<PaginationProps> = {}) => (
|
const setupWrapper = (search = '', props: Partial<PaginationProps> = {}) => (
|
||||||
|
|
|
@ -2,10 +2,10 @@ import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import './theme/index.scss';
|
import * as serviceWorker from 'serviceWorker';
|
||||||
import AppContainer from './components/AppContainer';
|
import configureStore from 'redux/store/configureStore';
|
||||||
import * as serviceWorker from './serviceWorker';
|
import AppContainer from 'components/AppContainer';
|
||||||
import configureStore from './redux/store/configureStore';
|
import 'theme/index.scss';
|
||||||
|
|
||||||
const store = configureStore();
|
const store = configureStore();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { GIT_REPO_LINK } from 'lib/constants';
|
import { GIT_REPO_LINK } from 'lib/constants';
|
||||||
import * as paths from '../paths';
|
import * as paths from 'lib/paths';
|
||||||
|
|
||||||
describe('Paths', () => {
|
describe('Paths', () => {
|
||||||
it('gitCommitPath', () => {
|
it('gitCommitPath', () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import useDataSaver from '../useDataSaver';
|
import useDataSaver from 'lib/hooks/useDataSaver';
|
||||||
|
|
||||||
describe('useDataSaver hook', () => {
|
describe('useDataSaver hook', () => {
|
||||||
const content = {
|
const content = {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { ClusterName, SchemaName, TopicName } from 'redux/interfaces';
|
import { ClusterName, SchemaName, TopicName } from 'redux/interfaces';
|
||||||
|
|
||||||
import { GIT_REPO_LINK } from './constants';
|
import { GIT_REPO_LINK } from './constants';
|
||||||
|
|
||||||
export const gitCommitPath = (commit: string) =>
|
export const gitCommitPath = (commit: string) =>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {
|
||||||
clusterSchemasPayload,
|
clusterSchemasPayload,
|
||||||
schemaVersionsPayload,
|
schemaVersionsPayload,
|
||||||
} from 'redux/reducers/schemas/__test__/fixtures';
|
} from 'redux/reducers/schemas/__test__/fixtures';
|
||||||
import * as actions from '../actions';
|
import * as actions from 'redux/actions';
|
||||||
|
|
||||||
describe('Actions', () => {
|
describe('Actions', () => {
|
||||||
describe('fetchClusterStatsAction', () => {
|
describe('fetchClusterStatsAction', () => {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import * as actions from 'redux/actions/actions';
|
||||||
import * as thunks from 'redux/actions/thunks';
|
import * as thunks from 'redux/actions/thunks';
|
||||||
import * as schemaFixtures from 'redux/reducers/schemas/__test__/fixtures';
|
import * as schemaFixtures from 'redux/reducers/schemas/__test__/fixtures';
|
||||||
import mockStoreCreator from 'redux/store/configureStore/mockStoreCreator';
|
import mockStoreCreator from 'redux/store/configureStore/mockStoreCreator';
|
||||||
import * as fixtures from '../fixtures';
|
import * as fixtures from 'redux/actions/__test__/fixtures';
|
||||||
|
|
||||||
const store = mockStoreCreator;
|
const store = mockStoreCreator;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { BrokersApi, Configuration } from 'generated-sources';
|
import { BrokersApi, Configuration } from 'generated-sources';
|
||||||
import { PromiseThunkResult, ClusterName, BrokerId } from 'redux/interfaces';
|
import { PromiseThunkResult, ClusterName, BrokerId } from 'redux/interfaces';
|
||||||
|
|
||||||
import { BASE_PARAMS } from 'lib/constants';
|
import { BASE_PARAMS } from 'lib/constants';
|
||||||
import * as actions from '../actions';
|
import * as actions from 'redux/actions/actions';
|
||||||
|
|
||||||
const apiClientConf = new Configuration(BASE_PARAMS);
|
const apiClientConf = new Configuration(BASE_PARAMS);
|
||||||
export const brokersApiClient = new BrokersApi(apiClientConf);
|
export const brokersApiClient = new BrokersApi(apiClientConf);
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { ClustersApi, Configuration, Cluster } from 'generated-sources';
|
import { ClustersApi, Configuration, Cluster } from 'generated-sources';
|
||||||
import { PromiseThunkResult, ClusterName } from 'redux/interfaces';
|
import { PromiseThunkResult, ClusterName } from 'redux/interfaces';
|
||||||
|
|
||||||
import { BASE_PARAMS } from 'lib/constants';
|
import { BASE_PARAMS } from 'lib/constants';
|
||||||
import * as actions from '../actions';
|
import * as actions from 'redux/actions/actions';
|
||||||
|
|
||||||
const apiClientConf = new Configuration(BASE_PARAMS);
|
const apiClientConf = new Configuration(BASE_PARAMS);
|
||||||
export const clustersApiClient = new ClustersApi(apiClientConf);
|
export const clustersApiClient = new ClustersApi(apiClientConf);
|
||||||
|
|
|
@ -4,9 +4,8 @@ import {
|
||||||
PromiseThunkResult,
|
PromiseThunkResult,
|
||||||
ClusterName,
|
ClusterName,
|
||||||
} from 'redux/interfaces';
|
} from 'redux/interfaces';
|
||||||
|
|
||||||
import { BASE_PARAMS } from 'lib/constants';
|
import { BASE_PARAMS } from 'lib/constants';
|
||||||
import * as actions from '../actions';
|
import * as actions from 'redux/actions/actions';
|
||||||
|
|
||||||
const apiClientConf = new Configuration(BASE_PARAMS);
|
const apiClientConf = new Configuration(BASE_PARAMS);
|
||||||
export const consumerGroupsApiClient = new ConsumerGroupsApi(apiClientConf);
|
export const consumerGroupsApiClient = new ConsumerGroupsApi(apiClientConf);
|
||||||
|
|
|
@ -10,7 +10,6 @@ import {
|
||||||
SchemaName,
|
SchemaName,
|
||||||
FailurePayload,
|
FailurePayload,
|
||||||
} from 'redux/interfaces';
|
} from 'redux/interfaces';
|
||||||
|
|
||||||
import { BASE_PARAMS } from 'lib/constants';
|
import { BASE_PARAMS } from 'lib/constants';
|
||||||
import * as actions from 'redux/actions';
|
import * as actions from 'redux/actions';
|
||||||
import { getResponse } from 'lib/errorHandling';
|
import { getResponse } from 'lib/errorHandling';
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { ActionType } from 'typesafe-actions';
|
import { ActionType } from 'typesafe-actions';
|
||||||
import { ThunkAction } from 'redux-thunk';
|
import { ThunkAction } from 'redux-thunk';
|
||||||
import * as actions from 'redux/actions/actions';
|
import * as actions from 'redux/actions/actions';
|
||||||
|
|
||||||
import { TopicsState } from './topic';
|
import { TopicsState } from './topic';
|
||||||
import { ClusterState } from './cluster';
|
import { ClusterState } from './cluster';
|
||||||
import { BrokersState } from './broker';
|
import { BrokersState } from './broker';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { dismissAlert, createTopicAction } from 'redux/actions';
|
import { dismissAlert, createTopicAction } from 'redux/actions';
|
||||||
import reducer from 'redux/reducers/alerts/reducer';
|
import reducer from 'redux/reducers/alerts/reducer';
|
||||||
|
|
||||||
import { failurePayload1, failurePayload2 } from './fixtures';
|
import { failurePayload1, failurePayload2 } from './fixtures';
|
||||||
|
|
||||||
jest.mock('lodash', () => ({
|
jest.mock('lodash', () => ({
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import configureStore from 'redux/store/configureStore';
|
import configureStore from 'redux/store/configureStore';
|
||||||
import { createTopicAction } from 'redux/actions';
|
import { createTopicAction } from 'redux/actions';
|
||||||
import * as selectors from '../selectors';
|
import * as selectors from 'redux/reducers/alerts/selectors';
|
||||||
|
|
||||||
import { failurePayload1, failurePayload2 } from './fixtures';
|
import { failurePayload1, failurePayload2 } from './fixtures';
|
||||||
|
|
||||||
const store = configureStore();
|
const store = configureStore();
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { getType } from 'typesafe-actions';
|
import { getType } from 'typesafe-actions';
|
||||||
import { dismissAlert } from 'redux/actions';
|
import { dismissAlert } from 'redux/actions';
|
||||||
import { Action, AlertsState } from 'redux/interfaces';
|
import { Action, AlertsState } from 'redux/interfaces';
|
||||||
|
|
||||||
import { addError, removeAlert } from './utils';
|
import { addError, removeAlert } from './utils';
|
||||||
|
|
||||||
export const initialState: AlertsState = {};
|
export const initialState: AlertsState = {};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { fetchClusterListAction } from 'redux/actions';
|
import { fetchClusterListAction } from 'redux/actions';
|
||||||
import reducer from 'redux/reducers/clusters/reducer';
|
import reducer from 'redux/reducers/clusters/reducer';
|
||||||
|
|
||||||
import { clustersPayload } from './fixtures';
|
import { clustersPayload } from './fixtures';
|
||||||
|
|
||||||
describe('Clusters reducer', () => {
|
describe('Clusters reducer', () => {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { fetchClusterListAction } from 'redux/actions';
|
import { fetchClusterListAction } from 'redux/actions';
|
||||||
import configureStore from 'redux/store/configureStore';
|
import configureStore from 'redux/store/configureStore';
|
||||||
import * as selectors from '../selectors';
|
import * as selectors from 'redux/reducers/clusters/selectors';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
clustersPayload,
|
clustersPayload,
|
||||||
offlineClusterPayload,
|
offlineClusterPayload,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { createFetchingSelector } from 'redux/reducers/loader/selectors';
|
||||||
import {
|
import {
|
||||||
ConsumerGroupID,
|
ConsumerGroupID,
|
||||||
ConsumerGroupsState,
|
ConsumerGroupsState,
|
||||||
} from '../../interfaces/consumerGroup';
|
} from 'redux/interfaces/consumerGroup';
|
||||||
|
|
||||||
const consumerGroupsState = ({
|
const consumerGroupsState = ({
|
||||||
consumerGroups,
|
consumerGroups,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { combineReducers } from 'redux';
|
import { combineReducers } from 'redux';
|
||||||
import { RootState } from 'redux/interfaces';
|
import { RootState } from 'redux/interfaces';
|
||||||
|
|
||||||
import topics from './topics/reducer';
|
import topics from './topics/reducer';
|
||||||
import clusters from './clusters/reducer';
|
import clusters from './clusters/reducer';
|
||||||
import brokers from './brokers/reducer';
|
import brokers from './brokers/reducer';
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
fetchSchemaVersionsAction,
|
fetchSchemaVersionsAction,
|
||||||
} from 'redux/actions';
|
} from 'redux/actions';
|
||||||
import reducer from 'redux/reducers/schemas/reducer';
|
import reducer from 'redux/reducers/schemas/reducer';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
clusterSchemasPayload,
|
clusterSchemasPayload,
|
||||||
initialState,
|
initialState,
|
||||||
|
|
|
@ -4,7 +4,8 @@ import {
|
||||||
fetchSchemaVersionsAction,
|
fetchSchemaVersionsAction,
|
||||||
} from 'redux/actions';
|
} from 'redux/actions';
|
||||||
import configureStore from 'redux/store/configureStore';
|
import configureStore from 'redux/store/configureStore';
|
||||||
import * as selectors from '../selectors';
|
import * as selectors from 'redux/reducers/schemas/selectors';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
clusterSchemasPayload,
|
clusterSchemasPayload,
|
||||||
clusterSchemasPayloadWithNewSchema,
|
clusterSchemasPayloadWithNewSchema,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { deleteTopicAction, clearMessagesTopicAction } from 'redux/actions';
|
import { deleteTopicAction, clearMessagesTopicAction } from 'redux/actions';
|
||||||
import reducer from '../reducer';
|
import reducer from 'redux/reducers/topics/reducer';
|
||||||
|
|
||||||
const topic = {
|
const topic = {
|
||||||
name: 'topic',
|
name: 'topic',
|
||||||
|
|
Loading…
Add table
Reference in a new issue