This commit is contained in:
Eduard Heimbuch
2020-09-16 15:09:30 +02:00
parent 29134ae261
commit 89b6829108
7 changed files with 15 additions and 12 deletions

View File

@@ -41,7 +41,7 @@ const HgTagInformation: FC<Props> = ({ tag }) => {
<> <>
<h4>{t("scm-hg-plugin.information.checkoutTag")}</h4> <h4>{t("scm-hg-plugin.information.checkoutTag")}</h4>
<pre> <pre>
<code>hg update {tag?.name}</code> <code>hg update {tag.name}</code>
</pre> </pre>
</> </>
); );

View File

@@ -49,10 +49,12 @@ const BranchRow: FC<Props> = ({ baseUrl, branch }) => {
<Link to={to} title={branch.name}> <Link to={to} title={branch.name}>
{branch.name} {branch.name}
<DefaultBranchTag defaultBranch={branch.defaultBranch} /> <DefaultBranchTag defaultBranch={branch.defaultBranch} />
{branch?.lastModified && branch.lastModifier && (
<Modified className="has-text-grey is-ellipsis-overflow"> <Modified className="has-text-grey is-ellipsis-overflow">
{t("branches.overview.lastModified")} <DateFromNow date={branch.lastModified} />{" "} {t("branches.overview.lastModified")} <DateFromNow date={branch.lastModified} />{" "}
{t("branches.overview.lastModifier")} {branch.lastModifier?.name} {t("branches.overview.lastModifier")} {branch.lastModifier?.name}
</Modified> </Modified>
)}
</Link> </Link>
</td> </td>
</tr> </tr>

View File

@@ -129,8 +129,8 @@ export function createBranch(
// Selectors // Selectors
function collectBranches(repoState: any) { function collectBranches(repoState) {
return repoState.list._embedded.branches.map((name: string) => repoState.byName[name]); return repoState.list._embedded.branches.map(name => repoState.byName[name]);
} }
const memoizedBranchCollector = memoizeOne(collectBranches); const memoizedBranchCollector = memoizeOne(collectBranches);

View File

@@ -34,7 +34,7 @@ type Props = {
const TagView: FC<Props> = ({ repository, tag }) => { const TagView: FC<Props> = ({ repository, tag }) => {
return ( return (
<div> <>
<TagDetail tag={tag} repository={repository} /> <TagDetail tag={tag} repository={repository} />
<hr /> <hr />
<div className="content"> <div className="content">
@@ -47,7 +47,7 @@ const TagView: FC<Props> = ({ repository, tag }) => {
}} }}
/> />
</div> </div>
</div> </>
); );
}; };

View File

@@ -54,8 +54,8 @@ const TagRoot: FC<Props> = ({ repository, baseUrl }) => {
}, [repository]); }, [repository]);
useEffect(() => { useEffect(() => {
const tagName = match?.params?.tag; const tagName = decodeURIComponent(match?.params?.tag);
const link = tags && tags.length > 0 && (tags.find(tag => tag.name === tagName)?._links.self as Link).href; const link = tags?.length > 0 && (tags.find(tag => tag.name === tagName)?._links.self as Link).href;
if (link) { if (link) {
apiClient apiClient
.get(link) .get(link)

View File

@@ -54,7 +54,7 @@ const TagsOverview: FC<Props> = ({ repository, baseUrl }) => {
}, [repository]); }, [repository]);
const renderTagsTable = () => { const renderTagsTable = () => {
if (!loading && tags && tags.length > 0) { if (!loading && tags?.length > 0) {
orderTags(tags); orderTags(tags);
return <TagTable baseUrl={baseUrl} tags={tags} />; return <TagTable baseUrl={baseUrl} tags={tags} />;
} }

View File

@@ -54,6 +54,7 @@ public class BranchDto extends HalRepresentation {
private boolean defaultBranch; private boolean defaultBranch;
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
private Instant lastModified; private Instant lastModified;
@JsonInclude(JsonInclude.Include.NON_NULL)
private PersonDto lastModifier; private PersonDto lastModifier;
BranchDto(Links links, Embedded embedded) { BranchDto(Links links, Embedded embedded) {