mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
Use preselected value with translation key for namespace filter / improve translations
This commit is contained in:
committed by
René Pfeuffer
parent
237c48356a
commit
fd79107468
@@ -36,7 +36,6 @@ type Props = {
|
||||
label?: string;
|
||||
testId?: string;
|
||||
searchPlaceholder?: string;
|
||||
filterPlaceholder?: string;
|
||||
};
|
||||
|
||||
const OverviewPageActions: FC<Props> = ({
|
||||
@@ -47,8 +46,7 @@ const OverviewPageActions: FC<Props> = ({
|
||||
groupSelected,
|
||||
label,
|
||||
testId,
|
||||
searchPlaceholder,
|
||||
filterPlaceholder
|
||||
searchPlaceholder
|
||||
}) => {
|
||||
const history = useHistory();
|
||||
const location = useLocation();
|
||||
@@ -59,7 +57,6 @@ const OverviewPageActions: FC<Props> = ({
|
||||
options={groups}
|
||||
preselectedOption={currentGroup}
|
||||
optionSelected={groupSelected}
|
||||
placeholder={filterPlaceholder}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -32,7 +32,6 @@ type Props = {
|
||||
preselectedOption?: string;
|
||||
className?: string;
|
||||
disabled?: boolean;
|
||||
placeholder?: string;
|
||||
};
|
||||
|
||||
const FullWidthSelect = styled.select`
|
||||
@@ -41,7 +40,7 @@ const FullWidthSelect = styled.select`
|
||||
|
||||
class DropDown extends React.Component<Props> {
|
||||
render() {
|
||||
const { options, optionValues, preselectedOption, className, disabled, placeholder } = this.props;
|
||||
const { options, optionValues, preselectedOption, className, disabled } = this.props;
|
||||
|
||||
if (preselectedOption && options.filter(o => o === preselectedOption).length === 0) {
|
||||
options.push(preselectedOption);
|
||||
@@ -49,12 +48,7 @@ class DropDown extends React.Component<Props> {
|
||||
|
||||
return (
|
||||
<div className={classNames(className, "select", disabled ? "disabled" : "")}>
|
||||
<FullWidthSelect
|
||||
value={preselectedOption ? preselectedOption : ""}
|
||||
onChange={this.change}
|
||||
disabled={disabled}
|
||||
placeholder={placeholder}
|
||||
>
|
||||
<FullWidthSelect value={preselectedOption ? preselectedOption : ""} onChange={this.change} disabled={disabled}>
|
||||
{options.map((option, index) => {
|
||||
const value = optionValues && optionValues[index] ? optionValues[index] : option;
|
||||
return (
|
||||
|
||||
@@ -65,7 +65,7 @@ const FilterInput: FC<Props> = ({ filter, value, testId, placeholder }) => {
|
||||
<FixedHeightInput
|
||||
className="input"
|
||||
type="search"
|
||||
placeholder={placeholder || t("overviewAction.filterEntries")}
|
||||
placeholder={placeholder || t("filterEntries")}
|
||||
value={stateValue}
|
||||
onChange={event => setStateValue(event.target.value)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user