From 4ed6a40cde1d9f35d4cbbafe787c17af0a0c0ebb Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Thu, 11 Nov 2021 14:50:11 +0100 Subject: [PATCH] Add contact icon to repository overview (#1855) Show repository contact on repository overview with "mail to" action if contact is set. Click on this icon to send a mail to the contact. --- gradle/changelog/repo_overview_contact.yaml | 2 + .../src/__snapshots__/storyshots.test.ts.snap | 171 +++++++++++++++--- .../src/repos/RepositoryEntry.tsx | 38 +++- scm-ui/ui-webapp/public/locales/de/repos.json | 3 +- scm-ui/ui-webapp/public/locales/en/repos.json | 3 +- 5 files changed, 185 insertions(+), 32 deletions(-) create mode 100644 gradle/changelog/repo_overview_contact.yaml diff --git a/gradle/changelog/repo_overview_contact.yaml b/gradle/changelog/repo_overview_contact.yaml new file mode 100644 index 0000000000..e7da31e004 --- /dev/null +++ b/gradle/changelog/repo_overview_contact.yaml @@ -0,0 +1,2 @@ +- type: added + description: Add contact icon to repository overview ([#1855](https://github.com/scm-manager/scm-manager/pull/1855)) diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index 9a7baae1ad..d940101f3e 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -73639,7 +73639,7 @@ exports[`Storyshots Repositories/RepositoryEntry Archived 1`] = ` className="is-flex" > heartOfGold @@ -73678,11 +73678,24 @@ exports[`Storyshots Repositories/RepositoryEntry Archived 1`] = ` className="RepositoryEntry__ContentRightContainer-sc-6jys82-0 wkQgn is-flex is-flex-direction-column is-justify-content-space-between is-relative mr-4" > + + + heartOfGold @@ -73774,11 +73787,24 @@ exports[`Storyshots Repositories/RepositoryEntry Avatar EP 1`] = ` className="RepositoryEntry__ContentRightContainer-sc-6jys82-0 wkQgn is-flex is-flex-direction-column is-justify-content-space-between is-relative mr-4" > + + + heartOfGold @@ -73873,11 +73899,24 @@ exports[`Storyshots Repositories/RepositoryEntry Before Title EP 1`] = ` className="RepositoryEntry__ContentRightContainer-sc-6jys82-0 wkQgn is-flex is-flex-direction-column is-justify-content-space-between is-relative mr-4" > + + + heartOfGold @@ -73969,11 +74008,24 @@ exports[`Storyshots Repositories/RepositoryEntry Default 1`] = ` className="RepositoryEntry__ContentRightContainer-sc-6jys82-0 wkQgn is-flex is-flex-direction-column is-justify-content-space-between is-relative mr-4" > + + + heartOfGold @@ -74076,11 +74128,24 @@ exports[`Storyshots Repositories/RepositoryEntry Exporting 1`] = ` className="RepositoryEntry__ContentRightContainer-sc-6jys82-0 wkQgn is-flex is-flex-direction-column is-justify-content-space-between is-relative mr-4" > + + + heartOfGold @@ -74184,11 +74249,24 @@ exports[`Storyshots Repositories/RepositoryEntry HealthCheck Failure 1`] = ` className="RepositoryEntry__ContentRightContainer-sc-6jys82-0 wkQgn is-flex is-flex-direction-column is-justify-content-space-between is-relative mr-4" > + + + heartOfGold @@ -74301,11 +74379,24 @@ exports[`Storyshots Repositories/RepositoryEntry MultiRepositoryTags 1`] = ` className="RepositoryEntry__ContentRightContainer-sc-6jys82-0 wkQgn is-flex is-flex-direction-column is-justify-content-space-between is-relative mr-4" > + + + heartOfGold @@ -74409,11 +74500,24 @@ exports[`Storyshots Repositories/RepositoryEntry RepositoryFlag EP 1`] = ` className="RepositoryEntry__ContentRightContainer-sc-6jys82-0 wkQgn is-flex is-flex-direction-column is-justify-content-space-between is-relative mr-4" > + + + veeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeery-loooooooooooooooooooooooooooooooooooooooooooooooooooong-repooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo-naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaame @@ -74505,11 +74609,24 @@ exports[`Storyshots Repositories/RepositoryEntry With long texts 1`] = ` className="RepositoryEntry__ContentRightContainer-sc-6jys82-0 wkQgn is-flex is-flex-direction-column is-justify-content-space-between is-relative mr-4" > + + + = ({ repository, baseDate }) => { const [t] = useTranslation("repos"); const [openCloneModal, setOpenCloneModal] = useState(false); + const avatarFactory = binder.getExtension(EXTENSION_POINT); + + const renderContactIcon = () => { + if (avatarFactory) { + return ; + } + return ; + }; + const createContentRight = () => ( = ({ repository, baseDate }) => { name="repos.repository-details.information" renderAll={true} props={{ - repository, + repository }} /> } closeFunction={() => setOpenCloneModal(false)} /> )} - + + {repository.contact ? ( + + {renderContactIcon()} + + ) : null}