From ec14d4cbd5b4946c1d3045bee155e3a23bfc2452 Mon Sep 17 00:00:00 2001 From: Rene Pfeuffer Date: Mon, 12 Feb 2024 14:14:34 +0100 Subject: [PATCH] Keep links from plugins in sources after loading more MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the source view, links from plugins had been removed, when more files had been fetched using the 'proceed' link for more than 100 files. This caused the issue, that buttons from plugins (like "upload file" from the editor plugin) did no longer show up after loading more files. Now, we keep all links from the first page except the proceed link. Pushed-by: Rene Pfeuffer Co-authored-by: René Pfeuffer Committed-by: René Pfeuffer --- gradle/changelog/code_buttons.yaml | 2 ++ scm-ui/ui-api/src/sources.ts | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 gradle/changelog/code_buttons.yaml diff --git a/gradle/changelog/code_buttons.yaml b/gradle/changelog/code_buttons.yaml new file mode 100644 index 0000000000..1e6c881e19 --- /dev/null +++ b/gradle/changelog/code_buttons.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Buttons from plugins in the code view will not be removed after fetching more sources diff --git a/scm-ui/ui-api/src/sources.ts b/scm-ui/ui-api/src/sources.ts index 5972168944..d1484a431f 100644 --- a/scm-ui/ui-api/src/sources.ts +++ b/scm-ui/ui-api/src/sources.ts @@ -113,12 +113,17 @@ const merge = (files?: File[]): File | undefined => { children.push(...(page._embedded?.children || [])); } const lastPage = files[files.length - 1]; + const firstPage = files[0]; return { ...lastPage, _embedded: { ...lastPage._embedded, children, }, + _links: { + ...firstPage._links, + proceed: lastPage._links.proceed, + } }; };