-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FE: Brokers: Configs: Improvements (#179)
- Loading branch information
Showing
21 changed files
with
643 additions
and
220 deletions.
There are no files selected for viewing
30 changes: 0 additions & 30 deletions
30
frontend/src/components/Brokers/Broker/Configs/Configs.styled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,6 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const ValueWrapper = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
button { | ||
margin: 0 10px; | ||
} | ||
`; | ||
|
||
export const Value = styled.span` | ||
line-height: 24px; | ||
margin-right: 10px; | ||
text-overflow: ellipsis; | ||
max-width: 400px; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
`; | ||
|
||
export const ButtonsWrapper = styled.div` | ||
display: flex; | ||
`; | ||
export const SearchWrapper = styled.div` | ||
margin: 10px; | ||
width: 21%; | ||
`; | ||
|
||
export const Source = styled.div` | ||
display: flex; | ||
align-content: center; | ||
svg { | ||
margin-left: 10px; | ||
vertical-align: middle; | ||
cursor: pointer; | ||
} | ||
`; |
103 changes: 24 additions & 79 deletions
103
frontend/src/components/Brokers/Broker/Configs/Configs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 0 additions & 91 deletions
91
frontend/src/components/Brokers/Broker/Configs/InputCell.tsx
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...ts/Brokers/Broker/Configs/TableComponents/ConfigSourceHeader/ConfigSourceHeader.styled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Source = styled.div` | ||
display: flex; | ||
align-content: center; | ||
svg { | ||
margin-left: 10px; | ||
vertical-align: middle; | ||
cursor: pointer; | ||
} | ||
`; |
27 changes: 27 additions & 0 deletions
27
...mponents/Brokers/Broker/Configs/TableComponents/ConfigSourceHeader/ConfigSourceHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import Tooltip from 'components/common/Tooltip/Tooltip'; | ||
import InfoIcon from 'components/common/Icons/InfoIcon'; | ||
import { CONFIG_SOURCE_NAME_MAP } from 'components/Brokers/Broker/Configs/lib/constants'; | ||
|
||
import * as S from './ConfigSourceHeader.styled'; | ||
|
||
const tooltipContent = `${CONFIG_SOURCE_NAME_MAP.DYNAMIC_TOPIC_CONFIG} = dynamic topic config that is configured for a specific topic | ||
${CONFIG_SOURCE_NAME_MAP.DYNAMIC_BROKER_LOGGER_CONFIG} = dynamic broker logger config that is configured for a specific broker | ||
${CONFIG_SOURCE_NAME_MAP.DYNAMIC_BROKER_CONFIG} = dynamic broker config that is configured for a specific broker | ||
${CONFIG_SOURCE_NAME_MAP.DYNAMIC_DEFAULT_BROKER_CONFIG} = dynamic broker config that is configured as default for all brokers in the cluster | ||
${CONFIG_SOURCE_NAME_MAP.STATIC_BROKER_CONFIG} = static broker config provided as broker properties at start up (e.g. server.properties file) | ||
${CONFIG_SOURCE_NAME_MAP.DEFAULT_CONFIG} = built-in default configuration for configs that have a default value | ||
${CONFIG_SOURCE_NAME_MAP.UNKNOWN} = source unknown e.g. in the ConfigEntry used for alter requests where source is not set`; | ||
|
||
const ConfigSourceHeader = () => ( | ||
<S.Source> | ||
Source | ||
<Tooltip | ||
value={<InfoIcon />} | ||
content={tooltipContent} | ||
placement="top-end" | ||
/> | ||
</S.Source> | ||
); | ||
|
||
export default ConfigSourceHeader; |
53 changes: 53 additions & 0 deletions
53
...end/src/components/Brokers/Broker/Configs/TableComponents/InputCell/InputCellEditMode.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React, { type FC, useState } from 'react'; | ||
import Input from 'components/common/Input/Input'; | ||
import { Button } from 'components/common/Button/Button'; | ||
import CheckmarkIcon from 'components/common/Icons/CheckmarkIcon'; | ||
import CancelIcon from 'components/common/Icons/CancelIcon'; | ||
|
||
import * as S from './styled'; | ||
|
||
interface EditModeProps { | ||
initialValue: string; | ||
onSave: (value: string) => void; | ||
onCancel: () => void; | ||
} | ||
|
||
const InputCellEditMode: FC<EditModeProps> = ({ | ||
initialValue, | ||
onSave, | ||
onCancel, | ||
}) => { | ||
const [value, setValue] = useState(initialValue); | ||
|
||
return ( | ||
<S.ValueWrapper> | ||
<Input | ||
type="text" | ||
inputSize="S" | ||
value={value} | ||
aria-label="inputValue" | ||
onChange={({ target }) => setValue(target.value)} | ||
/> | ||
<S.ButtonsWrapper> | ||
<Button | ||
buttonType="primary" | ||
buttonSize="S" | ||
aria-label="confirmAction" | ||
onClick={() => onSave(value)} | ||
> | ||
<CheckmarkIcon /> Save | ||
</Button> | ||
<Button | ||
buttonType="primary" | ||
buttonSize="S" | ||
aria-label="cancelAction" | ||
onClick={onCancel} | ||
> | ||
<CancelIcon /> Cancel | ||
</Button> | ||
</S.ButtonsWrapper> | ||
</S.ValueWrapper> | ||
); | ||
}; | ||
|
||
export default InputCellEditMode; |
Oops, something went wrong.