mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +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
@@ -92,7 +92,12 @@ class Groups extends React.Component<Props> {
|
||||
{this.renderGroupTable()}
|
||||
{this.renderCreateButton()}
|
||||
<PageActions>
|
||||
<OverviewPageActions showCreateButton={canAddGroups} link="groups" label={t("create-group-button.label")} />
|
||||
<OverviewPageActions
|
||||
showCreateButton={canAddGroups}
|
||||
link="groups"
|
||||
label={t("create-group-button.label")}
|
||||
searchPlaceholder={t("overview.searchGroup")}
|
||||
/>
|
||||
</PageActions>
|
||||
</Page>
|
||||
);
|
||||
|
||||
@@ -101,8 +101,12 @@ class Overview extends React.Component<Props> {
|
||||
}
|
||||
};
|
||||
|
||||
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<Props> {
|
||||
|
||||
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 (
|
||||
<Page title={t("overview.title")} subtitle={t("overview.subtitle")} loading={loading} error={error}>
|
||||
@@ -127,7 +133,6 @@ class Overview extends React.Component<Props> {
|
||||
label={t("overview.createButton")}
|
||||
testId="repository-overview"
|
||||
searchPlaceholder={t("overview.searchRepository")}
|
||||
filterPlaceholder={t("overview.filterNamespace")}
|
||||
/>
|
||||
</PageActions>
|
||||
</Page>
|
||||
|
||||
@@ -93,7 +93,12 @@ class Users extends React.Component<Props> {
|
||||
{this.renderUserTable()}
|
||||
{this.renderCreateButton()}
|
||||
<PageActions>
|
||||
<OverviewPageActions showCreateButton={canAddUsers} link="users" label={t("users.createButton")} />
|
||||
<OverviewPageActions
|
||||
showCreateButton={canAddUsers}
|
||||
link="users"
|
||||
label={t("users.createButton")}
|
||||
searchPlaceholder={t("overview.searchUser")}
|
||||
/>
|
||||
</PageActions>
|
||||
</Page>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user