From d8092bec715de7cf3b838d3cea4e3533ae398f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Wed, 17 Mar 2021 09:36:25 +0100 Subject: [PATCH] Add "links" collection to index resources, again (#1594) With the introduction of react-query, it looks like the indexResources attribute of the repository initialization extension properties lost its collection links, which was replaces by _links. In this fix we copy this collection, so that the template plugin still can use links. Fixes #1593 --- gradle/changelog/fix_index_links_in_repo_init_extension.yaml | 2 ++ scm-ui/ui-webapp/src/repos/components/form/RepositoryForm.tsx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 gradle/changelog/fix_index_links_in_repo_init_extension.yaml diff --git a/gradle/changelog/fix_index_links_in_repo_init_extension.yaml b/gradle/changelog/fix_index_links_in_repo_init_extension.yaml new file mode 100644 index 0000000000..eeb701777b --- /dev/null +++ b/gradle/changelog/fix_index_links_in_repo_init_extension.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Index link collection in repository initialize extensions ([#1594](https://github.com/scm-manager/scm-manager/issues/1588) and [#1587](https://github.com/scm-manager/scm-manager/issues/1594)) diff --git a/scm-ui/ui-webapp/src/repos/components/form/RepositoryForm.tsx b/scm-ui/ui-webapp/src/repos/components/form/RepositoryForm.tsx index 60cb7b5d05..7a96e2e194 100644 --- a/scm-ui/ui-webapp/src/repos/components/form/RepositoryForm.tsx +++ b/scm-ui/ui-webapp/src/repos/components/form/RepositoryForm.tsx @@ -124,10 +124,11 @@ const RepositoryForm: FC = ({ if (isEditMode()) { return null; } + const indexResourcesWithLinks = { ...indexResources, links: indexResources?._links }; const extensionProps = { repository: repo, setCreationContextEntry: setCreationContextEntry, - indexResources + indexResources: indexResourcesWithLinks }; return ( <>