Skip to content

Commit

Permalink
fix alignment of text for connection type form elements
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvogt committed Sep 6, 2024
1 parent 85f2b31 commit e043623
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/TruncatedText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const TruncatedText: React.FC<TruncatedTextProps> = ({ maxLines, content, ...res
overflow: 'hidden',
WebkitBoxOrient: 'vertical',
WebkitLineClamp: maxLines,
overflowWrap: 'anywhere',
}}
{...rest}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ConnectionTypePreview: React.FC<Props> = ({ obj }) => {
/>
<HelperText>
{connectionTypeDescription ? (
<HelperTextItem style={{ overflowWrap: 'anywhere' }}>
<HelperTextItem>

Check warning on line 49 in frontend/src/concepts/connectionTypes/ConnectionTypePreview.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/concepts/connectionTypes/ConnectionTypePreview.tsx#L49

Added line #L49 was not covered by tests
<TruncatedText maxLines={2} content={connectionTypeDescription} />
</HelperTextItem>
) : undefined}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, TextInput, ToolbarItem } from '@patternfly/react-core';
import { Button, SearchInput, ToolbarItem } from '@patternfly/react-core';
import React from 'react';
import { Link } from 'react-router-dom';
import FilterToolbar from '~/components/FilterToolbar';
Expand Down Expand Up @@ -27,23 +27,23 @@ const ConnectionTypesTableToolbar: React.FC<Props> = ({
filterOptions={options}
filterOptionRenders={{
[ConnectionTypesOptions.keyword]: ({ onChange, ...props }) => (
<TextInput
<SearchInput
{...props}
aria-label="Filter by keyword"
placeholder="Filter by keyword"
onChange={(_event, value) => onChange(value)}
/>
),
[ConnectionTypesOptions.category]: ({ onChange, ...props }) => (
<TextInput
<SearchInput
{...props}
aria-label="Filter by category"
placeholder="Filter by category"
onChange={(_event, value) => onChange(value)}
/>
),
[ConnectionTypesOptions.createdBy]: ({ onChange, ...props }) => (
<TextInput
<SearchInput
{...props}
aria-label="Created by"
placeholder="Created by"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const EmptyConnectionTypes: React.FC = () => (
<PageSection isFilled>
<EmptyState variant={EmptyStateVariant.full} data-testid="connection-types-empty-state">
<EmptyStateHeader
titleText="No connection types found."
titleText="No connection types"
icon={<EmptyStateIcon icon={PlusCircleIcon} />}
headingLevel="h1"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const ManageConnectionTypeFieldsTableRow: React.FC<Props> = ({
id: `draggable-row-${props.id}`,
}}
/>
<Td colSpan={4} dataLabel={columns[0].label} data-testid="field-name">
<Td dataLabel={columns[0].label} data-testid="field-name">
<div>
{row.name}{' '}
<Label color="blue" data-testid="section-heading">
Expand All @@ -77,7 +77,7 @@ const ManageConnectionTypeFieldsTableRow: React.FC<Props> = ({
</div>
</div>
</Td>
<Td />
<Td colSpan={4} />
<Td isActionCell modifier="nowrap">
<Button variant="secondary" onClick={() => onAddField(row)}>
Add field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,17 @@ const ManageConnectionTypePage: React.FC<Props> = ({ prefill, isEdit, onSave })
}}
/>
</FormGroup>
<FormGroup label="Enable" fieldId="connection-type-enable">
<Checkbox
label="Enable users in your organization to use this connection type when adding connections."
id="connection-type-enable"
name="connection-type-enable"
data-testid="connection-type-enable"
isChecked={connectionEnabled}
onChange={(_e, value) => setConnectionEnabled(value)}
/>
</FormGroup>
</FormSection>
<FormGroup label="Enable" fieldId="connection-type-enable">
<Checkbox
label="Enable users in your organization to use this connection type when adding connections."
id="connection-type-enable"
name="connection-type-enable"
data-testid="connection-type-enable"
isChecked={connectionEnabled}
onChange={(_e, value) => setConnectionEnabled(value)}
/>
</FormGroup>
<FormSection title="Fields" className="pf-v5-u-mt-0">
<FormGroup>
{isEnvVarConflict ? (
Expand Down

0 comments on commit e043623

Please sign in to comment.