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>
<pre>
<code>hg update {tag?.name}</code>
<code>hg update {tag.name}</code>
</pre>
</>
);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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