From e4936260a1ab6a0df860a95d6e342c6be848804b Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Fri, 3 Dec 2021 13:56:31 +0100 Subject: [PATCH] Fix overview document title (#1885) --- gradle/changelog/overview_document_title.yaml | 2 ++ .../ui-webapp/src/repos/containers/Overview.tsx | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 gradle/changelog/overview_document_title.yaml diff --git a/gradle/changelog/overview_document_title.yaml b/gradle/changelog/overview_document_title.yaml new file mode 100644 index 0000000000..facab4a5d0 --- /dev/null +++ b/gradle/changelog/overview_document_title.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Overview document title ([#1885](https://github.com/scm-manager/scm-manager/pull/1885)) diff --git a/scm-ui/ui-webapp/src/repos/containers/Overview.tsx b/scm-ui/ui-webapp/src/repos/containers/Overview.tsx index 5a6fc1d3ec..6acdb04d35 100644 --- a/scm-ui/ui-webapp/src/repos/containers/Overview.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/Overview.tsx @@ -32,7 +32,7 @@ import { OverviewPageActions, Page, PageActions, - urls, + urls } from "@scm-manager/ui-components"; import RepositoryList from "../components/list"; import { useNamespaces, useRepositories } from "@scm-manager/ui-api"; @@ -65,7 +65,7 @@ const useOverviewData = () => { const search = urls.getQueryStringFromLocation(location); const request = { - namespace: namespaces?._embedded.namespaces.find((n) => n.namespace === namespace), + namespace: namespaces?._embedded.namespaces.find(n => n.namespace === namespace), // ui starts counting by 1, // but backend starts counting by 0 page: page - 1, @@ -75,7 +75,7 @@ const useOverviewData = () => { // also do not fetch repositories if an invalid namespace is selected disabled: (!!namespace && !namespaces) || - (!!namespace && !namespaces?._embedded.namespaces.some((n) => n.namespace === namespace)), + (!!namespace && !namespaces?._embedded.namespaces.some(n => n.namespace === namespace)) }; const { isLoading: isLoadingRepositories, error: errorRepositories, data: repositories } = useRepositories(request); @@ -86,7 +86,7 @@ const useOverviewData = () => { namespace, repositories, search, - page, + page }; }; @@ -152,7 +152,7 @@ const Overview: FC = () => { const allNamespacesPlaceholder = t("overview.allNamespaces"); let namespacesToRender: string[] = []; if (namespaces) { - namespacesToRender = [allNamespacesPlaceholder, ...namespaces._embedded.namespaces.map((n) => n.namespace).sort()]; + namespacesToRender = [allNamespacesPlaceholder, ...namespaces._embedded.namespaces.map(n => n.namespace).sort()]; } const namespaceSelected = (newNamespace: string) => { if (newNamespace === allNamespacesPlaceholder) { @@ -166,6 +166,7 @@ const Overview: FC = () => { return ( {t("overview.title")}} subtitle={{t("overview.subtitle")}} loading={isLoading} @@ -174,7 +175,7 @@ const Overview: FC = () => {
{hasExtensions ? ( - {extensions.map((extension) => React.createElement(extension))} + {extensions.map(extension => React.createElement(extension))} ) : null}
@@ -193,7 +194,7 @@ const Overview: FC = () => { n.namespace === namespace) ? namespace : "" + namespace && namespaces?._embedded.namespaces.some(n => n.namespace === namespace) ? namespace : "" } groups={namespacesToRender} groupSelected={namespaceSelected}