mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
move Person type to ui-types
This commit is contained in:
@@ -22,9 +22,10 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
export type Person = {
|
||||
name: string;
|
||||
mail?: string;
|
||||
};
|
||||
import { Person } from "@scm-manager/ui-types";
|
||||
|
||||
// re export type to avoid breaking changes,
|
||||
// after the type was moved to ui-types
|
||||
export { Person };
|
||||
|
||||
export const EXTENSION_POINT = "avatar.factory";
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
import React, { FC } from "react";
|
||||
import { Changeset } from "@scm-manager/ui-types";
|
||||
import { Changeset, Person } from "@scm-manager/ui-types";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useBinder } from "@scm-manager/ui-extensions";
|
||||
import { EXTENSION_POINT, Person } from "../../avatar/Avatar";
|
||||
import { EXTENSION_POINT } from "../../avatar/Avatar";
|
||||
import styled from "styled-components";
|
||||
import CommaSeparatedList from "../../CommaSeparatedList";
|
||||
import ContributorAvatar from "./ContributorAvatar";
|
||||
@@ -167,7 +167,7 @@ const ChangesetAuthor: FC<Props> = ({ changeset }) => {
|
||||
coAuthors.push(...extensions);
|
||||
}
|
||||
|
||||
return <CommaSeparatedList>{authorLine}</CommaSeparatedList>
|
||||
return <CommaSeparatedList>{authorLine}</CommaSeparatedList>;
|
||||
};
|
||||
|
||||
export default ChangesetAuthor;
|
||||
|
||||
@@ -25,15 +25,16 @@
|
||||
import { Collection, Links } from "./hal";
|
||||
import { Tag } from "./Tags";
|
||||
import { Branch } from "./Branches";
|
||||
import { Person } from "@scm-manager/ui-components/src/avatar/Avatar";
|
||||
|
||||
export type Person = {
|
||||
name: string;
|
||||
mail?: string;
|
||||
};
|
||||
|
||||
export type Changeset = Collection & {
|
||||
id: string;
|
||||
date: Date;
|
||||
author: {
|
||||
name: string;
|
||||
mail?: string;
|
||||
};
|
||||
author: Person;
|
||||
description: string;
|
||||
trailers: Trailer[];
|
||||
_links: Links;
|
||||
|
||||
@@ -29,16 +29,12 @@ export { Me } from "./Me";
|
||||
export { DisplayedUser, User } from "./User";
|
||||
export { Group, Member } from "./Group";
|
||||
|
||||
export {
|
||||
Repository,
|
||||
RepositoryCollection,
|
||||
RepositoryGroup
|
||||
} from "./Repositories";
|
||||
export { Repository, RepositoryCollection, RepositoryGroup } from "./Repositories";
|
||||
export { RepositoryType, RepositoryTypeCollection } from "./RepositoryTypes";
|
||||
|
||||
export { Branch, BranchRequest } from "./Branches";
|
||||
|
||||
export { Changeset } from "./Changesets";
|
||||
export { Changeset, Person, Trailer, ParentChangeset } from "./Changesets";
|
||||
|
||||
export { Tag } from "./Tags";
|
||||
|
||||
@@ -46,22 +42,13 @@ export { Config } from "./Config";
|
||||
|
||||
export { IndexResources } from "./IndexResources";
|
||||
|
||||
export {
|
||||
Permission,
|
||||
PermissionCreateEntry,
|
||||
PermissionCollection
|
||||
} from "./RepositoryPermissions";
|
||||
export { Permission, PermissionCreateEntry, PermissionCollection } from "./RepositoryPermissions";
|
||||
|
||||
export { SubRepository, File } from "./Sources";
|
||||
|
||||
export { SelectValue, AutocompleteObject } from "./Autocomplete";
|
||||
|
||||
export {
|
||||
Plugin,
|
||||
PluginCollection,
|
||||
PluginGroup,
|
||||
PendingPlugins
|
||||
} from "./Plugin";
|
||||
export { Plugin, PluginCollection, PluginGroup, PendingPlugins } from "./Plugin";
|
||||
|
||||
export { RepositoryRole } from "./RepositoryRole";
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
import React, { FC } from "react";
|
||||
import { Changeset } from "@scm-manager/ui-types";
|
||||
import { Changeset, Person } from "@scm-manager/ui-types";
|
||||
import styled from "styled-components";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useBinder } from "@scm-manager/ui-extensions";
|
||||
@@ -36,12 +36,6 @@ const SizedTd = styled.td`
|
||||
width: 10rem;
|
||||
`;
|
||||
|
||||
// TODO get from ui-types?
|
||||
type Person = {
|
||||
name: string;
|
||||
mail?: string;
|
||||
};
|
||||
|
||||
const Contributor: FC<{ person: Person }> = ({ person }) => {
|
||||
const [t] = useTranslation("repos");
|
||||
const binder = useBinder();
|
||||
@@ -101,7 +95,7 @@ const ContributorTable: FC<Props> = ({ changeset }) => {
|
||||
{getTrailersByType().map(trailer => (
|
||||
<tr key={trailer.type}>
|
||||
<SizedTd>{t("changeset.trailer.type." + trailer.type) + ":"}</SizedTd>
|
||||
<td className="shorten-text is-marginless">
|
||||
<td className="is-ellipsis-overflow is-marginless">
|
||||
<CommaSeparatedList>
|
||||
{trailer.persons.map(person => (
|
||||
<Contributor key={person.name} person={person} />
|
||||
|
||||
Reference in New Issue
Block a user