mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
fixes some small bugs with signature icon
This commit is contained in:
@@ -35,8 +35,7 @@ import ChangesetAuthor from "./ChangesetAuthor";
|
||||
import ChangesetTags from "./ChangesetTags";
|
||||
import ChangesetButtonGroup from "./ChangesetButtonGroup";
|
||||
import ChangesetDescription from "./ChangesetDescription";
|
||||
import SignatureIcon from "@scm-manager/ui-webapp/src/repos/components/changesets/SignatureIcon";
|
||||
import { Level } from "../..";
|
||||
import SignatureIcon from "./SignatureIcon";
|
||||
|
||||
type Props = WithTranslation & {
|
||||
repository: Repository;
|
||||
|
||||
@@ -22,15 +22,26 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
import React, { FC } from "react";
|
||||
import { Icon, Tooltip } from "@scm-manager/ui-components";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Signature } from "@scm-manager/ui-types";
|
||||
import styled from "styled-components";
|
||||
import Icon from "../../Icon";
|
||||
import Tooltip from "../../Tooltip";
|
||||
|
||||
type Props = {
|
||||
signatures: Signature[];
|
||||
className: any;
|
||||
};
|
||||
|
||||
const StyledIcon = styled(Icon)`
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: middle;
|
||||
border-radius: 0.25em;
|
||||
margin-bottom: 0.2em;
|
||||
`;
|
||||
|
||||
|
||||
const SignatureIcon: FC<Props> = ({ signatures, className }) => {
|
||||
const [t] = useTranslation("repos");
|
||||
|
||||
@@ -54,14 +65,16 @@ const SignatureIcon: FC<Props> = ({ signatures, className }) => {
|
||||
return `${t("changeset.signatureStatus")}: ${status}`;
|
||||
}
|
||||
|
||||
let message = `${t("changeset.signedBy")}: ${signature.owner ? signature.owner : t("changeset.noOwner")}\n${t("changeset.keyId")}: ${signature.keyId}\n${t(
|
||||
let message = `${t("changeset.keyOwner")}: ${signature.owner ? signature.owner : t("changeset.noOwner")}\n${t("changeset.keyId")}: ${signature.keyId}\n${t(
|
||||
"changeset.signatureStatus"
|
||||
)}: ${status}`;
|
||||
|
||||
if (signature.contacts?.length > 0) {
|
||||
message = message + `\n${t("changeset.keyContacts")}: ${signature.contacts.map((contact: string) => `\n- ${contact}`)}`;
|
||||
message += `\n${t("changeset.keyContacts")}:`;
|
||||
signature.contacts.forEach((contact) => {
|
||||
message += `\n- ${contact}`;
|
||||
});
|
||||
}
|
||||
|
||||
return message;
|
||||
};
|
||||
|
||||
@@ -78,7 +91,7 @@ const SignatureIcon: FC<Props> = ({ signatures, className }) => {
|
||||
|
||||
return (
|
||||
<Tooltip location="top" message={createTooltipMessage()}>
|
||||
<Icon name={"key"} className={className} color={getColor()} />
|
||||
<StyledIcon name="key" className={className} color={getColor()} />
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
@@ -88,7 +88,7 @@
|
||||
"shortSummary": "Committet <0/> <1/>",
|
||||
"tags": "Tags",
|
||||
"diffNotSupported": "Diff des Changesets wird von diesem Repositorytyp nicht unterstützt",
|
||||
"signedBy": "Signiert von",
|
||||
"keyOwner": "Schlüssel Besitzer",
|
||||
"signatureStatus": "Status",
|
||||
"keyId": "Schlüssel-ID",
|
||||
"keyContacts": "Kontakte",
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
"summary": "Changeset <0/> was committed <1/>",
|
||||
"shortSummary": "Committed <0/> <1/>",
|
||||
"tags": "Tags",
|
||||
"signedBy": "Signed by",
|
||||
"keyOwner": "Key Owner",
|
||||
"keyId": "Key ID",
|
||||
"keyContacts": "Contacts",
|
||||
"noOwner": "Unknown",
|
||||
|
||||
@@ -43,7 +43,7 @@ import {
|
||||
} from "@scm-manager/ui-components";
|
||||
import ContributorTable from "./ContributorTable";
|
||||
import { Link as ReactLink } from "react-router-dom";
|
||||
import SignatureIcon from "./SignatureIcon";
|
||||
import SignatureIcon from "@scm-manager/ui-components/src/repos/changesets/SignatureIcon";
|
||||
|
||||
type Props = WithTranslation & {
|
||||
changeset: Changeset;
|
||||
|
||||
Reference in New Issue
Block a user