diff --git a/scm-ui/ui-components/src/OverviewPageActions.tsx b/scm-ui/ui-components/src/OverviewPageActions.tsx index 57672d4138..633bc07d52 100644 --- a/scm-ui/ui-components/src/OverviewPageActions.tsx +++ b/scm-ui/ui-components/src/OverviewPageActions.tsx @@ -36,7 +36,6 @@ type Props = { label?: string; testId?: string; searchPlaceholder?: string; - filterPlaceholder?: string; }; const OverviewPageActions: FC = ({ @@ -47,8 +46,7 @@ const OverviewPageActions: FC = ({ groupSelected, label, testId, - searchPlaceholder, - filterPlaceholder + searchPlaceholder }) => { const history = useHistory(); const location = useLocation(); @@ -59,7 +57,6 @@ const OverviewPageActions: FC = ({ options={groups} preselectedOption={currentGroup} optionSelected={groupSelected} - placeholder={filterPlaceholder} /> ); diff --git a/scm-ui/ui-components/src/forms/DropDown.tsx b/scm-ui/ui-components/src/forms/DropDown.tsx index 504f37de87..e801a0c2a8 100644 --- a/scm-ui/ui-components/src/forms/DropDown.tsx +++ b/scm-ui/ui-components/src/forms/DropDown.tsx @@ -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 { 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 { return (
- + {options.map((option, index) => { const value = optionValues && optionValues[index] ? optionValues[index] : option; return ( diff --git a/scm-ui/ui-components/src/forms/FilterInput.tsx b/scm-ui/ui-components/src/forms/FilterInput.tsx index b90ce3d61d..15dcabb9e1 100644 --- a/scm-ui/ui-components/src/forms/FilterInput.tsx +++ b/scm-ui/ui-components/src/forms/FilterInput.tsx @@ -65,7 +65,7 @@ const FilterInput: FC = ({ filter, value, testId, placeholder }) => { setStateValue(event.target.value)} /> diff --git a/scm-ui/ui-webapp/public/locales/de/groups.json b/scm-ui/ui-webapp/public/locales/de/groups.json index 65035781b6..a351a3eda1 100644 --- a/scm-ui/ui-webapp/public/locales/de/groups.json +++ b/scm-ui/ui-webapp/public/locales/de/groups.json @@ -25,6 +25,9 @@ "setPermissionsNavLink": "Berechtigungen" } }, + "overview": { + "searchGroup": "Gruppe suchen" + }, "add-group": { "title": "Gruppe erstellen", "subtitle": "Erstellen einer neuen Gruppe" diff --git a/scm-ui/ui-webapp/public/locales/de/repos.json b/scm-ui/ui-webapp/public/locales/de/repos.json index d9a2f94b37..151c6844b5 100644 --- a/scm-ui/ui-webapp/public/locales/de/repos.json +++ b/scm-ui/ui-webapp/public/locales/de/repos.json @@ -44,7 +44,7 @@ "noRepositories": "Keine Repositories gefunden.", "createButton": "Repository erstellen", "searchRepository": "Repository suchen", - "filterNamespace": "Namespace filtern" + "allNamespaces": "Alle Namespaces" }, "create": { "title": "Repository erstellen", diff --git a/scm-ui/ui-webapp/public/locales/de/users.json b/scm-ui/ui-webapp/public/locales/de/users.json index 80d251e6b3..271caff650 100644 --- a/scm-ui/ui-webapp/public/locales/de/users.json +++ b/scm-ui/ui-webapp/public/locales/de/users.json @@ -30,6 +30,9 @@ "noUsers": "Keine Benutzer gefunden.", "createButton": "Benutzer erstellen" }, + "overview": { + "searchUser": "Benutzer suchen" + }, "singleUser": { "errorTitle": "Fehler", "errorSubtitle": "Unbekannter Benutzer Fehler", diff --git a/scm-ui/ui-webapp/public/locales/en/groups.json b/scm-ui/ui-webapp/public/locales/en/groups.json index 069013e5d0..944d271071 100644 --- a/scm-ui/ui-webapp/public/locales/en/groups.json +++ b/scm-ui/ui-webapp/public/locales/en/groups.json @@ -25,6 +25,9 @@ "setPermissionsNavLink": "Permissions" } }, + "overview": { + "searchGroup": "Search group" + }, "add-group": { "title": "Create Group", "subtitle": "Create a new group" diff --git a/scm-ui/ui-webapp/public/locales/en/repos.json b/scm-ui/ui-webapp/public/locales/en/repos.json index 87c6301ffb..6bb4043c91 100644 --- a/scm-ui/ui-webapp/public/locales/en/repos.json +++ b/scm-ui/ui-webapp/public/locales/en/repos.json @@ -44,7 +44,7 @@ "noRepositories": "No repositories found.", "createButton": "Create Repository", "searchRepository": "Search repository", - "filterNamespace": "Filter by namespace" + "allNamespaces": "All namespaces" }, "create": { "title": "Create Repository", diff --git a/scm-ui/ui-webapp/public/locales/en/users.json b/scm-ui/ui-webapp/public/locales/en/users.json index 627e2b80aa..877675bc85 100644 --- a/scm-ui/ui-webapp/public/locales/en/users.json +++ b/scm-ui/ui-webapp/public/locales/en/users.json @@ -44,6 +44,9 @@ "setApiKeyNavLink": "API Keys" } }, + "overview": { + "searchUser": "Search user" + }, "createUser": { "title": "Create User", "subtitle": "Create a new user" diff --git a/scm-ui/ui-webapp/src/groups/containers/Groups.tsx b/scm-ui/ui-webapp/src/groups/containers/Groups.tsx index 7fe45d0163..2584239ce0 100644 --- a/scm-ui/ui-webapp/src/groups/containers/Groups.tsx +++ b/scm-ui/ui-webapp/src/groups/containers/Groups.tsx @@ -92,7 +92,12 @@ class Groups extends React.Component { {this.renderGroupTable()} {this.renderCreateButton()} - + ); diff --git a/scm-ui/ui-webapp/src/repos/containers/Overview.tsx b/scm-ui/ui-webapp/src/repos/containers/Overview.tsx index eaee435640..de5be31591 100644 --- a/scm-ui/ui-webapp/src/repos/containers/Overview.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/Overview.tsx @@ -101,8 +101,12 @@ class Overview extends React.Component { } }; + getNamespaceFilterPlaceholder = () => { + return this.props.t("overview.allNamespaces"); + }; + namespaceSelected = (newNamespace: string) => { - if (newNamespace === "") { + if (newNamespace === this.getNamespaceFilterPlaceholder()) { this.props.history.push("/repos/"); } else { this.props.history.push(`/repos/${newNamespace}/`); @@ -111,8 +115,10 @@ class Overview extends React.Component { render() { const { error, loading, showCreateButton, namespace, namespaces, t } = this.props; - - const namespacesToRender = namespaces ? ["", ...namespaces._embedded.namespaces.map(n => n.namespace).sort()] : []; + const namespaceFilterPlaceholder = this.getNamespaceFilterPlaceholder(); + const namespacesToRender = namespaces + ? [namespaceFilterPlaceholder, ...namespaces._embedded.namespaces.map(n => n.namespace).sort()] + : []; return ( @@ -127,7 +133,6 @@ class Overview extends React.Component { label={t("overview.createButton")} testId="repository-overview" searchPlaceholder={t("overview.searchRepository")} - filterPlaceholder={t("overview.filterNamespace")} /> diff --git a/scm-ui/ui-webapp/src/users/containers/Users.tsx b/scm-ui/ui-webapp/src/users/containers/Users.tsx index d0d4adc9dc..fbae53f084 100644 --- a/scm-ui/ui-webapp/src/users/containers/Users.tsx +++ b/scm-ui/ui-webapp/src/users/containers/Users.tsx @@ -93,7 +93,12 @@ class Users extends React.Component { {this.renderUserTable()} {this.renderCreateButton()} - + );