diff --git a/gradle/changelog/repository_flags.yaml b/gradle/changelog/repository_flags.yaml new file mode 100644 index 0000000000..0005d60cda --- /dev/null +++ b/gradle/changelog/repository_flags.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Uniform rendering of tooltips for repository badges ([#1698](https://github.com/scm-manager/scm-manager/pull/1698)) diff --git a/scm-ui/ui-components/src/CardColumn.tsx b/scm-ui/ui-components/src/CardColumn.tsx index 70d3da1946..c72deec191 100644 --- a/scm-ui/ui-components/src/CardColumn.tsx +++ b/scm-ui/ui-components/src/CardColumn.tsx @@ -59,11 +59,6 @@ const FooterWrapper = styled.div` padding-bottom: 1rem; `; -const ContentLeft = styled.div` - margin-bottom: 0 !important; - overflow: hidden; -`; - const ContentRight = styled.div` margin-left: auto; `; @@ -115,15 +110,15 @@ const CardColumn: FC = ({ {renderAvatar}
- -

{title}

+
+

{title}

{renderDescription} - +
{renderContentRight}
{footerLeft} - + {footerRight} 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 6fa4ee4174..7e1a50c3ca 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -2374,10 +2374,10 @@ exports[`Storyshots CardColumn Default 1`] = ` className="is-flex" >

title @@ -2394,14 +2394,14 @@ exports[`Storyshots CardColumn Default 1`] = ` className="CardColumn__FooterWrapper-sc-1w6lsih-3 kYSWZY level is-flex" >

left footer
right footer @@ -2427,10 +2427,10 @@ exports[`Storyshots CardColumn Minimal 1`] = ` className="is-flex" >

title @@ -2442,14 +2442,14 @@ exports[`Storyshots CardColumn Minimal 1`] = ` className="CardColumn__FooterWrapper-sc-1w6lsih-3 kYSWZY level is-flex" >

left footer
right footer @@ -2475,10 +2475,10 @@ exports[`Storyshots CardColumn With hoverable date 1`] = ` className="is-flex" >

title @@ -2490,14 +2490,14 @@ exports[`Storyshots CardColumn With hoverable date 1`] = ` className="CardColumn__FooterWrapper-sc-1w6lsih-3 kYSWZY level is-flex" >

left footer

heartOfGold - - repository.archived - + + + repository.archived + + +

heartOfGold +

+

heartOfGold +

heartOfGold - - repository.exporting - + + + repository.exporting + + +

heartOfGold - - repository.healthCheckFailure - + + + repository.healthCheckFailure + + +

heartOfGold - - repository.archived - - - repository.exporting - + + + repository.archived + + + + + repository.exporting + + +

heartOfGold +

heartOfGold - - repository.healthCheckFailure - + + + repository.healthCheckFailure + + +

* { - margin-right: 0.25rem; +const RepositoryFlagContainer = styled.div` + /*pointer-events: all;*/ + + .tag { + margin-left: 0.25rem; } `; @@ -181,8 +185,11 @@ class RepositoryEntry extends React.Component { return ( <ExtensionPoint name="repository.card.beforeTitle" props={{ repository }} /> - <strong>{repository.name}</strong> {repositoryFlags} - <ExtensionPoint name="repository.flags" props={{ repository }} renderAll={true} /> + <strong>{repository.name}</strong>{" "} + <RepositoryFlagContainer> + {repositoryFlags} + <ExtensionPoint name="repository.flags" props={{ repository }} renderAll={true} /> + </RepositoryFlagContainer> ); }; diff --git a/scm-ui/ui-components/src/repos/RepositoryFlag.tsx b/scm-ui/ui-components/src/repos/RepositoryFlag.tsx index a96f939f4b..b4aafafea6 100644 --- a/scm-ui/ui-components/src/repos/RepositoryFlag.tsx +++ b/scm-ui/ui-components/src/repos/RepositoryFlag.tsx @@ -23,20 +23,23 @@ */ import React, { FC } from "react"; -import Tag from "../Tag"; import { Color, Size } from "../styleConstants"; +import Tooltip from "../Tooltip"; +import Tag from "../Tag"; type Props = { color?: Color; - title?: string; + title: string; onClick?: () => void; size?: Size; }; -const RepositoryFlag: FC = ({ children, size = "small", ...props }) => ( - - {children} - +const RepositoryFlag: FC = ({ children, title, size = "small", ...props }) => ( + + + {children} + + ); export default RepositoryFlag; diff --git a/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx b/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx index 82ddf72928..07c2d0be46 100644 --- a/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx @@ -160,28 +160,18 @@ const RepositoryRoot = () => { const repositoryFlags = []; if (repository.archived) { - repositoryFlags.push( - - {t("repository.archived")} - - ); + repositoryFlags.push({t("repository.archived")}); } if (repository.exporting) { - repositoryFlags.push( - - {t("repository.exporting")} - - ); + repositoryFlags.push({t("repository.exporting")}); } if (repository.healthCheckFailures && repository.healthCheckFailures.length > 0) { repositoryFlags.push( - - setShowHealthCheck(true)} color="danger"> - {t("repository.healthCheckFailure")} - - + setShowHealthCheck(true)}> + {t("repository.healthCheckFailure")} + ); }