fix review findings

This commit is contained in:
Konstantin Schaper
2020-12-01 15:16:55 +01:00
parent e8044747e3
commit 9ec8b4efac
17 changed files with 176 additions and 242 deletions

View File

@@ -26,7 +26,7 @@ import { Trans, useTranslation, WithTranslation, withTranslation } from "react-i
import classNames from "classnames";
import styled from "styled-components";
import { ExtensionPoint } from "@scm-manager/ui-extensions";
import {Changeset, Link, ParentChangeset, Repository, Tag} from "@scm-manager/ui-types";
import { Changeset, Link, ParentChangeset, Repository, Tag } from "@scm-manager/ui-types";
import {
AvatarImage,
AvatarWrapper,

View File

@@ -33,6 +33,7 @@ type Props = {
tag: Tag;
baseUrl: string;
onDelete: (tag: Tag) => void;
// deleting: boolean;
};
const Created = styled.span`

View File

@@ -22,11 +22,11 @@
* SOFTWARE.
*/
import React, {FC, useState} from "react";
import {Link, Tag} from "@scm-manager/ui-types";
import React, { FC, useState } from "react";
import { Link, Tag } from "@scm-manager/ui-types";
import { useTranslation } from "react-i18next";
import TagRow from "./TagRow";
import {apiClient, ConfirmAlert, ErrorNotification} from "@scm-manager/ui-components";
import { apiClient, ConfirmAlert, ErrorNotification } from "@scm-manager/ui-components";
type Props = {
baseUrl: string;
@@ -88,17 +88,18 @@ const TagTable: FC<Props> = ({ baseUrl, tags, fetchTags }) => {
return (
<>
{showConfirmAlert && confirmAlert}
{error && <ErrorNotification error={error} />}
<table className="card-table table is-hoverable is-fullwidth is-word-break">
<thead>
<tr>
<th>{t("tags.table.tags")}</th>
</tr>
</thead>
<tbody>{renderRow()}</tbody>
</table>
</>);
{showConfirmAlert && confirmAlert}
{error && <ErrorNotification error={error} />}
<table className="card-table table is-hoverable is-fullwidth is-word-break">
<thead>
<tr>
<th>{t("tags.table.tags")}</th>
</tr>
</thead>
<tbody>{renderRow()}</tbody>
</table>
</>
);
};
export default TagTable;

View File

@@ -60,7 +60,7 @@ const TagsOverview: FC<Props> = ({ repository, baseUrl }) => {
const renderTagsTable = () => {
if (!loading && tags?.length > 0) {
orderTags(tags);
return <TagTable baseUrl={baseUrl} tags={tags} fetchTags={() => fetchTags()} />;
return <TagTable baseUrl={baseUrl} tags={tags} fetchTags={fetchTags} />;
}
return <Notification type="info">{t("tags.overview.noTags")}</Notification>;
};