Skip to content

Commit

Permalink
fix(frontend): fix overflow issue in fields (#3560)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc authored Jan 25, 2024
1 parent 01c2974 commit 2b7baf7
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 18 deletions.
4 changes: 2 additions & 2 deletions web/src/components/Fields/Auth/AuthApiKeyBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const AuthApiKeyBase = ({baseName}: IProps) => (
<S.FlexContainer>
<Form.Item
data-cy="apiKey-key"
style={{flexBasis: '50%'}}
style={{flexBasis: '50%', overflow: 'hidden'}}
name={[...baseName, 'apiKey', 'key']}
label="Key"
rules={[{required: true}]}
Expand All @@ -21,7 +21,7 @@ const AuthApiKeyBase = ({baseName}: IProps) => (
</Form.Item>
<Form.Item
data-cy="apiKey-value"
style={{flexBasis: '50%'}}
style={{flexBasis: '50%', overflow: 'hidden'}}
name={[...baseName, 'apiKey', 'value']}
label="Value"
rules={[{required: true}]}
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/Fields/Auth/AuthBasic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const AuthBasic = ({baseName}: IProps) => (
<S.Row>
<S.FlexContainer>
<Form.Item
style={{flexBasis: '50%'}}
style={{flexBasis: '50%', overflow: 'hidden'}}
name={[...baseName, 'basic', 'username']}
data-cy="basic-username"
label="Username"
Expand All @@ -21,7 +21,7 @@ const AuthBasic = ({baseName}: IProps) => (
<Editor type={SupportedEditors.Interpolation} />
</Form.Item>
<Form.Item
style={{flexBasis: '50%'}}
style={{flexBasis: '50%', overflow: 'hidden'}}
name={[...baseName, 'basic', 'password']}
label="Password"
data-cy="basic-password"
Expand Down
5 changes: 5 additions & 0 deletions web/src/components/Fields/KeyValueList/KeyValueList.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ export const DeleteIcon = styled(DeleteOutlined)`
color: ${({theme}) => theme.color.textSecondary};
font-size: ${({theme}) => theme.size.md};
`;

export const Item = styled.div`
flex: 1;
overflow: hidden;
`;
16 changes: 10 additions & 6 deletions web/src/components/Fields/KeyValueList/KeyValueList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ const KeyValueList = ({
<>
{fields.map((field, index) => (
<S.KeyValueContainer key={field.name}>
<Form.Item name={[field.name, 'key']} noStyle>
<Editor type={SupportedEditors.Interpolation} placeholder={`${keyPlaceholder} ${index + 1}`} />
</Form.Item>
<S.Item>
<Form.Item name={[field.name, 'key']} noStyle>
<Editor type={SupportedEditors.Interpolation} placeholder={`${keyPlaceholder} ${index + 1}`} />
</Form.Item>
</S.Item>

<Form.Item name={[field.name, 'value']} noStyle>
<Editor type={SupportedEditors.Interpolation} placeholder={`${valuePlaceholder} ${index + 1}`} />
</Form.Item>
<S.Item>
<Form.Item name={[field.name, 'value']} noStyle>
<Editor type={SupportedEditors.Interpolation} placeholder={`${valuePlaceholder} ${index + 1}`} />
</Form.Item>
</S.Item>

<Form.Item noStyle>
<Button
Expand Down
5 changes: 5 additions & 0 deletions web/src/components/Fields/Metadata/Metadata.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ export const DeleteIcon = styled(DeleteOutlined)`
color: ${({theme}) => theme.color.textSecondary};
font-size: ${({theme}) => theme.size.md};
`;

export const Item = styled.div`
flex: 1;
overflow: hidden;
`;
16 changes: 10 additions & 6 deletions web/src/components/Fields/Metadata/Metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ const Metadata = () => (
<>
{fields.map((field, index) => (
<S.HeaderContainer key={field.name}>
<Form.Item name={[field.name, 'key']} noStyle>
<Editor type={SupportedEditors.Interpolation} placeholder={`Key ${index + 1}`} />
</Form.Item>
<S.Item>
<Form.Item name={[field.name, 'key']} noStyle>
<Editor type={SupportedEditors.Interpolation} placeholder={`Key ${index + 1}`} />
</Form.Item>
</S.Item>

<Form.Item name={[field.name, 'value']} noStyle>
<Editor type={SupportedEditors.Interpolation} placeholder={`Value ${index + 1}`} />
</Form.Item>
<S.Item>
<Form.Item name={[field.name, 'value']} noStyle>
<Editor type={SupportedEditors.Interpolation} placeholder={`Value ${index + 1}`} />
</Form.Item>
</S.Item>

<Form.Item noStyle>
<Button
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/Fields/PlainAuth/Fields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Fields = ({baseName}: IProps) => (
data-cy="plain-username"
label="Username"
rules={[{required: true}]}
style={{flexBasis: '50%'}}
style={{flexBasis: '50%', overflow: 'hidden'}}
>
<Editor type={SupportedEditors.Interpolation} placeholder="Kafka Plain Username" />
</Form.Item>
Expand All @@ -25,7 +25,7 @@ const Fields = ({baseName}: IProps) => (
label="Password"
data-cy="plain-password"
rules={[{required: true}]}
style={{flexBasis: '50%'}}
style={{flexBasis: '50%', overflow: 'hidden'}}
>
<Editor type={SupportedEditors.Interpolation} placeholder="Kafka Plain Password" />
</Form.Item>
Expand Down

0 comments on commit 2b7baf7

Please sign in to comment.