From 58f792a2857d0953e8920df25467778e44ee3ecd Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Tue, 31 Aug 2021 07:39:02 +0200 Subject: [PATCH] Fetch clone modal data on first opening (#1784) Get the data of the clone modal the first time it is opened. This way, we display a loading spinner for a fraction of a second when the modal is first opened. But we also prevent fetching a lot of data that is probably not needed. --- gradle/changelog/clone_modal_fetch.yaml | 2 ++ .../src/repos/RepositoryEntry.tsx | 32 ++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 gradle/changelog/clone_modal_fetch.yaml diff --git a/gradle/changelog/clone_modal_fetch.yaml b/gradle/changelog/clone_modal_fetch.yaml new file mode 100644 index 0000000000..c2465dcfdf --- /dev/null +++ b/gradle/changelog/clone_modal_fetch.yaml @@ -0,0 +1,2 @@ +- type: Fixed + description: Fetch clone modal data on first opening ([#1784](https://github.com/scm-manager/scm-manager/pull/1784)) diff --git a/scm-ui/ui-components/src/repos/RepositoryEntry.tsx b/scm-ui/ui-components/src/repos/RepositoryEntry.tsx index ec81e03c77..47ca59f52a 100644 --- a/scm-ui/ui-components/src/repos/RepositoryEntry.tsx +++ b/scm-ui/ui-components/src/repos/RepositoryEntry.tsx @@ -81,21 +81,23 @@ const RepositoryEntry: FC = ({ repository, baseDate }) => { const createContentRight = () => ( - - } - closeFunction={() => setOpenCloneModal(false)} - /> + {openCloneModal && ( + + } + closeFunction={() => setOpenCloneModal(false)} + /> + )}