diff --git a/frontend/src/components/layout/Header.tsx b/frontend/src/components/layout/Header.tsx index 9d3378677..d6d731e78 100644 --- a/frontend/src/components/layout/Header.tsx +++ b/frontend/src/components/layout/Header.tsx @@ -14,62 +14,75 @@ import { observer } from 'mobx-react'; import { Link, useRouteMatch } from 'react-router-dom'; import { isEmbedded } from '../../config'; import { uiState } from '../../state/uiState'; -import { MotionDiv } from '../../utils/animationProps'; -import { ZeroSizeWrapper } from '../../utils/tsxUtils'; import { UserPreferencesButton } from '../misc/UserPreferences'; import DataRefreshButton from '../misc/buttons/data-refresh/Component'; import { IsDev } from '../../utils/env'; -import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbLinkProps, ColorModeSwitch, Flex } from '@redpanda-data/ui'; +import { Box, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbLinkProps, CopyButton, ColorModeSwitch, Flex } from '@redpanda-data/ui'; const AppPageHeader = observer(() => { const showRefresh = useShouldShowRefresh(); - return - }> - {!isEmbedded() && uiState.selectedClusterName && - - - Cluster - - - } - {uiState.pageBreadcrumbs.filter((_,i,arr) => { - const isCurrentPage = arr.length - 1 === i - return !isEmbedded() || isCurrentPage - }).map((entry, i, arr) => { - const isCurrentPage = arr.length - 1 === i; - const currentBreadcrumbProps: BreadcrumbLinkProps = isCurrentPage ? { - as: 'span', - fontWeight: 700, - fontSize: 'xl', - } : {}; - - return ( - - - {entry.title} - - - {isCurrentPage && showRefresh && ( - - - - )} - - ); + return {/* we need to refactor out #mainLayout > div rule, for now I've added this box as a workaround */} + + }> + {!isEmbedded() && uiState.selectedClusterName && + + + Cluster + + } - )} - + {uiState.pageBreadcrumbs.filter((_, i, arr) => { + const isCurrentPage = arr.length - 1 === i; + return !isEmbedded() || isCurrentPage; + }).map((entry, i, arr) => { + const isCurrentPage = arr.length - 1 === i; + const currentBreadcrumbProps: BreadcrumbLinkProps = isCurrentPage ? { + as: 'span', + fontWeight: 700, + fontSize: 'xl', + } : { + }; + + return ( + + + {entry.title} + + + + {isCurrentPage && entry.options?.canBeCopied && } + + {isCurrentPage && showRefresh && ( + + + + )} + + + + ); + } + )} + - - - {(IsDev && !isEmbedded()) && } + + + {(IsDev && !isEmbedded()) && } + - ; + ; }); export default AppPageHeader; diff --git a/frontend/src/components/misc/buttons/buttons.module.scss b/frontend/src/components/misc/buttons/buttons.module.scss index c6abe659e..648392504 100644 --- a/frontend/src/components/misc/buttons/buttons.module.scss +++ b/frontend/src/components/misc/buttons/buttons.module.scss @@ -13,7 +13,6 @@ .dataRefreshButton { height: 32px; display: inline-flex; - margin-left: 10px; background: $color-reload-spinner-bg; color: $color-reload-spinner; diff --git a/frontend/src/components/pages/Page.ts b/frontend/src/components/pages/Page.ts index a0490c50a..013f12102 100644 --- a/frontend/src/components/pages/Page.ts +++ b/frontend/src/components/pages/Page.ts @@ -11,7 +11,7 @@ import { makeAutoObservable } from 'mobx'; import React from 'react'; -import { uiState } from '../../state/uiState'; +import { BreadcrumbOptions, uiState } from '../../state/uiState'; // @@ -24,7 +24,7 @@ export class PageInitHelper { makeAutoObservable(this); } set title(title: string) { uiState.pageTitle = title; } - addBreadcrumb(title: string, to: string) { uiState.pageBreadcrumbs.push({ title: title, linkTo: to }) } + addBreadcrumb(title: string, to: string, options?: BreadcrumbOptions) { uiState.pageBreadcrumbs.push({ title: title, linkTo: to, options }) } } export abstract class PageComponent> extends React.Component> { diff --git a/frontend/src/components/pages/acls/Acl.List.tsx b/frontend/src/components/pages/acls/Acl.List.tsx index 2d60a94d9..05802eb1c 100644 --- a/frontend/src/components/pages/acls/Acl.List.tsx +++ b/frontend/src/components/pages/acls/Acl.List.tsx @@ -25,7 +25,7 @@ import { AclPrincipalGroupEditor } from './PrincipalGroupEditor'; import Section from '../../misc/Section'; import PageContent from '../../misc/PageContent'; import { Features } from '../../../state/supportedFeatures'; -import { Alert, AlertDialog, AlertDialogBody, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertIcon, Badge, Button, createStandaloneToast, Icon, redpandaToastOptions, SearchField, Tooltip, Text, redpandaTheme, Menu, MenuButton, MenuItem, MenuList, Result, DataTable } from '@redpanda-data/ui'; +import { Alert, AlertDialog, AlertDialogBody, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertIcon, Badge, Button, createStandaloneToast, DataTable, Flex, Icon, Menu, MenuButton, MenuItem, MenuList, redpandaTheme, redpandaToastOptions, Result, SearchField, Text, Tooltip } from '@redpanda-data/ui'; import React, { FC, useRef } from 'react'; import { openCreateUserModal } from './CreateServiceAccountModal'; @@ -142,15 +142,17 @@ class AclList extends PageComponent { this.editorType = 'edit'; this.edittingPrincipalGroup = clone(record); }}> - {principalType} - {record.principalName} - {showWarning && ( - + + {principalType} + {record.principalName} + {showWarning && ( + - - )} + + )} + ); }, diff --git a/frontend/src/components/pages/acls/CreateServiceAccountModal.tsx b/frontend/src/components/pages/acls/CreateServiceAccountModal.tsx index 58c0ca1b5..43f7c173d 100644 --- a/frontend/src/components/pages/acls/CreateServiceAccountModal.tsx +++ b/frontend/src/components/pages/acls/CreateServiceAccountModal.tsx @@ -208,7 +208,7 @@ const CreateUserConfirmationModal = observer((p: { state: CreateUserModalState; - + {p.state.username} diff --git a/frontend/src/components/pages/connect/Cluster.Details.tsx b/frontend/src/components/pages/connect/Cluster.Details.tsx index 248f94e57..780307ef9 100644 --- a/frontend/src/components/pages/connect/Cluster.Details.tsx +++ b/frontend/src/components/pages/connect/Cluster.Details.tsx @@ -20,7 +20,7 @@ import { PageComponent, PageInitHelper } from '../Page'; import { ClusterStatisticsCard, ConnectorClass, NotConfigured, TasksColumn, TaskState } from './helper'; import { isEmbedded } from '../../../config'; import { Link } from 'react-router-dom'; -import { Box, Button, DataTable } from '@redpanda-data/ui'; +import { Box, Button, DataTable, Text } from '@redpanda-data/ui'; import { ClusterAdditionalInfo, ClusterConnectorInfo } from '../../../state/restInterfaces'; import SearchBar from '../../misc/SearchBar'; import { uiSettings } from '../../../state/ui'; @@ -116,7 +116,7 @@ class KafkaClusterDetails extends PageComponent<{ clusterName: string }> { accessorKey: 'name', cell: ({row: {original}}) => ( - {original.name} + {original.name} ), size: Infinity diff --git a/frontend/src/components/pages/connect/Connector.Details.tsx b/frontend/src/components/pages/connect/Connector.Details.tsx index 72f9d19d1..ba0e40d25 100644 --- a/frontend/src/components/pages/connect/Connector.Details.tsx +++ b/frontend/src/components/pages/connect/Connector.Details.tsx @@ -348,7 +348,7 @@ const ConnectorErrorModal = observer((p: { error: ConnectorError }) => { return <> - {p.error.title} + {p.error.title} @@ -380,7 +380,10 @@ class KafkaConnectorDetails extends PageComponent<{ clusterName: string; connect p.title = connector; p.addBreadcrumb('Connectors', '/connect-clusters'); p.addBreadcrumb(clusterName, `/connect-clusters/${encodeURIComponent(clusterName)}`); - p.addBreadcrumb(connector, `/connect-clusters/${encodeURIComponent(clusterName)}/${encodeURIComponent(connector)}`); + p.addBreadcrumb(connector, `/connect-clusters/${encodeURIComponent(clusterName)}/${encodeURIComponent(connector)}`, { + canBeTruncated: true, + canBeCopied: true + }); this.refreshData(true); appGlobal.onRefresh = () => this.refreshData(true); } diff --git a/frontend/src/components/pages/connect/Overview.tsx b/frontend/src/components/pages/connect/Overview.tsx index 16c135e30..4614fe74b 100644 --- a/frontend/src/components/pages/connect/Overview.tsx +++ b/frontend/src/components/pages/connect/Overview.tsx @@ -21,7 +21,7 @@ import { PageComponent, PageInitHelper } from '../Page'; import { ConnectorClass, ConnectorsColumn, errIcon, mr05, NotConfigured, OverviewStatisticsCard, TasksColumn, TaskState } from './helper'; import Section from '../../misc/Section'; import PageContent from '../../misc/PageContent'; -import { DataTable, Tooltip } from '@redpanda-data/ui'; +import { DataTable, Tooltip, Text } from '@redpanda-data/ui'; @observer class KafkaConnectOverview extends PageComponent { @@ -212,9 +212,9 @@ class TabTasks extends Component { header: 'Connector', accessorKey: 'name', // Assuming 'name' is correct based on your initial dataIndex cell: ({ row: { original } }) => ( - appGlobal.history.push(`/connect-clusters/${encodeURIComponent(original.cluster.clusterName)}/${encodeURIComponent(original.connectorName)}`)}> + appGlobal.history.push(`/connect-clusters/${encodeURIComponent(original.cluster.clusterName)}/${encodeURIComponent(original.connectorName)}`)}> {original.connectorName} - + ), size: 300 }, diff --git a/frontend/src/components/pages/consumers/Group.Details.tsx b/frontend/src/components/pages/consumers/Group.Details.tsx index bac203e87..e497044e3 100644 --- a/frontend/src/components/pages/consumers/Group.Details.tsx +++ b/frontend/src/components/pages/consumers/Group.Details.tsx @@ -50,7 +50,10 @@ class GroupDetails extends PageComponent<{ groupId: string }> { p.title = this.props.groupId; p.addBreadcrumb('Consumer Groups', '/groups'); - if (group) p.addBreadcrumb(group, '/' + group); + if (group) p.addBreadcrumb(group, '/' + group, { + canBeCopied: true, + canBeTruncated: true, + }); this.refreshData(true); appGlobal.onRefresh = () => this.refreshData(true); diff --git a/frontend/src/components/pages/consumers/Group.List.tsx b/frontend/src/components/pages/consumers/Group.List.tsx index 86cae17ee..7ef7a61b3 100644 --- a/frontend/src/components/pages/consumers/Group.List.tsx +++ b/frontend/src/components/pages/consumers/Group.List.tsx @@ -25,7 +25,7 @@ import { BrokerList } from '../../misc/BrokerList'; import { ShortNum } from '../../misc/ShortNum'; import Section from '../../misc/Section'; import PageContent from '../../misc/PageContent'; -import { DataTable, Flex, SearchField, Tag } from '@redpanda-data/ui'; +import { DataTable, Flex, SearchField, Tag, Text } from '@redpanda-data/ui'; import { Statistic } from '../../misc/Statistic'; import { Link } from 'react-router-dom'; @@ -189,11 +189,15 @@ class GroupList extends PageComponent { GroupId = (p: { group: GroupDescription }) => { const protocol = p.group.protocolType; - if (protocol == 'consumer') return <>{p.group.groupId}; + const groupIdEl = {p.group.groupId} + + if (protocol == 'consumer') { + return groupIdEl; + } return Protocol: {protocol} - {p.group.groupId} + {groupIdEl} ; } } diff --git a/frontend/src/components/pages/reassign-partitions/Step1.Partitions.tsx b/frontend/src/components/pages/reassign-partitions/Step1.Partitions.tsx index be236cc8a..91b5b5f13 100644 --- a/frontend/src/components/pages/reassign-partitions/Step1.Partitions.tsx +++ b/frontend/src/components/pages/reassign-partitions/Step1.Partitions.tsx @@ -24,7 +24,7 @@ import Highlighter from 'react-highlight-words'; import { uiSettings } from '../../../state/ui'; import { WarningTwoTone } from '@ant-design/icons'; import { SearchTitle } from '../../misc/KowlTable'; -import { Checkbox, DataTable, Popover } from '@redpanda-data/ui' +import { Box, Checkbox, DataTable, Popover } from '@redpanda-data/ui' import { Row } from '@tanstack/react-table'; export type TopicWithPartitions = Topic & { partitions: Partition[], activeReassignments: PartitionReassignmentsPartition[] }; @@ -108,13 +108,13 @@ export class StepSelectPartitions extends Component<{ partitionSelection: Partit : record.topicName; if (this.props.throttledTopics.includes(record.topicName)) { - return
+ return {content} -
+
} - return content; + return {content}; }, size: Infinity, }, diff --git a/frontend/src/components/pages/schemas/EditCompatibility.tsx b/frontend/src/components/pages/schemas/EditCompatibility.tsx index 4738d0e22..c9edb11eb 100644 --- a/frontend/src/components/pages/schemas/EditCompatibility.tsx +++ b/frontend/src/components/pages/schemas/EditCompatibility.tsx @@ -226,7 +226,7 @@ function EditSchemaCompatibility(p: { {(subjectName && schema) && <> - {subjectName} + {subjectName} Schema diff --git a/frontend/src/components/pages/schemas/Schema.Details.tsx b/frontend/src/components/pages/schemas/Schema.Details.tsx index ded1f9bc4..f057f6d80 100644 --- a/frontend/src/components/pages/schemas/Schema.Details.tsx +++ b/frontend/src/components/pages/schemas/Schema.Details.tsx @@ -89,7 +89,10 @@ class SchemaDetailsView extends PageComponent<{ subjectName: string }> { uiState.pageTitle = subjectNameRaw; uiState.pageBreadcrumbs = []; uiState.pageBreadcrumbs.push({ title: 'Schema Registry', linkTo: '/schema-registry' }); - uiState.pageBreadcrumbs.push({ title: subjectNameRaw, linkTo: `/schema-registry/${encodeURIComponent(subjectNameRaw)}?version=${version}` }); + uiState.pageBreadcrumbs.push({ title: subjectNameRaw, linkTo: `/schema-registry/${encodeURIComponent(subjectNameRaw)}?version=${version}`, options: { + canBeTruncated: true, + canBeCopied: true, + }}); } refreshData(force?: boolean) { diff --git a/frontend/src/components/pages/schemas/Schema.List.tsx b/frontend/src/components/pages/schemas/Schema.List.tsx index 00069f93f..6b2e46cd6 100644 --- a/frontend/src/components/pages/schemas/Schema.List.tsx +++ b/frontend/src/components/pages/schemas/Schema.List.tsx @@ -27,7 +27,7 @@ import { SmallStat } from '../../misc/SmallStat'; import { TrashIcon } from '@heroicons/react/outline'; import { openDeleteModal, openPermanentDeleteModal } from './modals'; -import { createStandaloneToast } from '@chakra-ui/react'; +import { Box, createStandaloneToast } from '@chakra-ui/react'; import { SchemaRegistrySubject } from '../../../state/restInterfaces'; import { Link } from 'react-router-dom'; import { encodeURIComponentPercents } from './Schema.Details'; @@ -167,8 +167,10 @@ class SchemaList extends PageComponent<{}> { sorting columns={[ { - header: 'Name', accessorKey: 'name', size: 400, cell: ({ row: { original: { name } } }) => - {name} + header: 'Name', accessorKey: 'name', size: Infinity, cell: ({ row: { original: { name } } }) => + + {name} + }, { header: 'Type', cell: ({row: {original: r}}) => , size: 100 }, { header: 'Compatibility', cell: ({row: {original: r}}) => , size: 100 }, @@ -178,7 +180,7 @@ class SchemaList extends PageComponent<{}> { id: 'actions', cell: ({row: {original: r}}) =>