
* Refactor topic creation
* Remove unused thunk
* Remove excess interface
* Add New page snapshot test
* Refactor new component tests
* Remove excess function
* Add typography variables and classes
* Add font families
* Implement custom button
* Get rid of enums
* Add theme
* Separate styles from logic
* Feature/layout redesign (#862)
* Refactor pages general layout
* Refactor breadcrumbs
* Refactor brokers metrics
* Fix toggle position
Co-authored-by: azat.belgibayev <azat.belgibayev@almatech.dev>
* add redesigned new menu item
* remove styles from theme
* update tests
* fix local and app wide styles
* add tests
* Add theme
* Add types to the styles
* update menu item prop prefixes, minor fixes
* add theme styles, move interface, update test, snapshot
* add optional styling
* add isActive props, propagate component, update tests
* remove button
* Revert "remove button"
This reverts commit 4a9c87d8d8
.
* add tests for styled button
* remove ternary operator from style
* import styled from lib/
* Custom Inputs (#890)
* Implement and test custom input
* Custom select (#896)
* Implement custom select
* Fix Metrics component (#914)
* Add styled table header cell component (#901)
* Redesign menu (#918)
* Finish styling menu
* Styled Table
* Fix styled table
* Allow custom buttons work as links
* Restyle Breadcrumb
* Topics list (#946)
* Redesign pagination
* Fix styled components usage
* Topic messages (#959)
* Topic Consumer Groups
* Message settings
* Finish styling indicators
* Style the dashboard
* Finish with the topics page
* Style consumer groups list
* Restyle the consumer group details
* Style alerts
* Style confirmation modal
* Update DangerZone.spec.tsx
* redesign schema registry
* Add Topic details snapshot
* Style Page Loader
* Style connectors list
* Style KSQL
* Remove all the classes from the styled components (#1049)
* Redesign topic form (#1051)
* Redesign connect details (#1053)
* Update types for styled-components (#1054)
* Redesign some minor forms in the app (#1062)
* Fix alert styles
* Get rid of bulma/layout styles
* Fix form styling
* Custom Switch component
* fix border-radius property of metrick widgets
* get rid of warnings in tests
* use jest-styled-components
* cleanup
* get rid of some bulma modules
* refactor metrics component
* get rid of JSON-tree. Json Editor redesign
* update proxy config
* Refactor Alerts component (#1124)
* Refactor tests (#1129)
* App layout update (#1127)
* ‘App-layout-update’
* toBeNull changed to toBeInDocument
* scss file removed
* App navbar layout update
* navbar test
* code smells local refactoring
* StyledMenuItem code smells refactoring
* StyledClusterTab code smells refactoring
* ConfirmationModalWrapper code smells refactoring
* input icon and label code smells refactoring
* navburger displaying fixed
* Get rid of classes
* fix code smells
* refactor styles
* refactor styles
Co-authored-by: Oleg Shuralev <workshur@gmail.com>
* Refactored Cluster nav (#1147)
* Update caniuse
* refactor Nav component
* Update sonars config
* refactor Nav component + specs
* Specs
* Feature/code smells removing (#1148)
* StyledSelect code smell refactoring
* SecondaryTabs code smell refactoring
* TextareaStyled code smell refactoring
* TableStyled code smell refactoring
* StyledTableHeaderCell code smell refactoring
* Add custom render with theme provider wrapper for testing lib (#1152)
* Added cleanupPolicy to topic details. Closes #999 (#1067)
* Rename "latest first" to "oldest first"
* Switch to redux-toolkit. Refactoring (#1171)
* Switch to redux-toolkit
* Fix #1207 (cherry-pick)
* refactor metrics (#1253)
Co-authored-by: Azat Belgibayev <belg.azat@gmail.com>
Co-authored-by: Alexander <mr.afigitelniychuvak@gmail.com>
Co-authored-by: azat.belgibayev <azat.belgibayev@almatech.dev>
Co-authored-by: sergei <scheremnov@provectus.com>
Co-authored-by: Alexander Krivonosov <31561808+GneyHabub@users.noreply.github.com>
Co-authored-by: Alina Miryuk <alinamiryuk@mail.ru>
Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
106 lines
3.3 KiB
TypeScript
106 lines
3.3 KiB
TypeScript
import React from 'react';
|
|
import {
|
|
CompatibilityLevelCompatibilityEnum,
|
|
SchemaSubject,
|
|
} from 'generated-sources';
|
|
import { useParams } from 'react-router-dom';
|
|
import { clusterSchemaNewPath } from 'lib/paths';
|
|
import { ClusterName } from 'redux/interfaces';
|
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
|
import ClusterContext from 'components/contexts/ClusterContext';
|
|
import { Table } from 'components/common/table/Table/Table.styled';
|
|
import TableHeaderCell from 'components/common/table/TableHeaderCell/TableHeaderCell';
|
|
import { Button } from 'components/common/Button/Button';
|
|
import PageHeading from 'components/common/PageHeading/PageHeading';
|
|
|
|
import ListItem from './ListItem';
|
|
import GlobalSchemaSelector from './GlobalSchemaSelector/GlobalSchemaSelector';
|
|
|
|
export interface ListProps {
|
|
schemas: SchemaSubject[];
|
|
isFetching: boolean;
|
|
isGlobalSchemaCompatibilityLevelFetched: boolean;
|
|
globalSchemaCompatibilityLevel?: CompatibilityLevelCompatibilityEnum;
|
|
fetchSchemasByClusterName: (clusterName: ClusterName) => void;
|
|
fetchGlobalSchemaCompatibilityLevel: (
|
|
clusterName: ClusterName
|
|
) => Promise<void>;
|
|
updateGlobalSchemaCompatibilityLevel: (
|
|
clusterName: ClusterName,
|
|
compatibilityLevel: CompatibilityLevelCompatibilityEnum
|
|
) => Promise<void>;
|
|
}
|
|
|
|
const List: React.FC<ListProps> = ({
|
|
schemas,
|
|
isFetching,
|
|
globalSchemaCompatibilityLevel,
|
|
isGlobalSchemaCompatibilityLevelFetched,
|
|
fetchSchemasByClusterName,
|
|
fetchGlobalSchemaCompatibilityLevel,
|
|
updateGlobalSchemaCompatibilityLevel,
|
|
}) => {
|
|
const { isReadOnly } = React.useContext(ClusterContext);
|
|
const { clusterName } = useParams<{ clusterName: string }>();
|
|
|
|
React.useEffect(() => {
|
|
fetchSchemasByClusterName(clusterName);
|
|
fetchGlobalSchemaCompatibilityLevel(clusterName);
|
|
}, [fetchSchemasByClusterName, clusterName]);
|
|
|
|
return (
|
|
<div>
|
|
<PageHeading text="Schema Registry">
|
|
{!isReadOnly && isGlobalSchemaCompatibilityLevelFetched && (
|
|
<>
|
|
<GlobalSchemaSelector
|
|
globalSchemaCompatibilityLevel={globalSchemaCompatibilityLevel}
|
|
updateGlobalSchemaCompatibilityLevel={
|
|
updateGlobalSchemaCompatibilityLevel
|
|
}
|
|
/>
|
|
<Button
|
|
buttonSize="M"
|
|
buttonType="primary"
|
|
isLink
|
|
to={clusterSchemaNewPath(clusterName)}
|
|
>
|
|
<i className="fas fa-plus" /> Create Schema
|
|
</Button>
|
|
</>
|
|
)}
|
|
</PageHeading>
|
|
|
|
{isFetching ? (
|
|
<PageLoader />
|
|
) : (
|
|
<div>
|
|
<Table isFullwidth>
|
|
<thead>
|
|
<tr>
|
|
<TableHeaderCell title="Schema Name" />
|
|
<TableHeaderCell title="Version" />
|
|
<TableHeaderCell title="Compatibility" />
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{schemas.length === 0 && (
|
|
<tr>
|
|
<td colSpan={10}>No schemas found</td>
|
|
</tr>
|
|
)}
|
|
{schemas.map((subject) => (
|
|
<ListItem
|
|
key={[subject.id, subject.subject].join('-')}
|
|
subject={subject}
|
|
/>
|
|
))}
|
|
</tbody>
|
|
</Table>
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default List;
|