Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

[ETL] delete retry button #674

Merged
merged 1 commit into from
Oct 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions app/src/features/Batches/BatchListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ import React from "react";

import { Link, Paper, Typography } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
import { Replay } from "@material-ui/icons";
import { DateTime } from "luxon";
import { useSnackbar } from "notistack";
import { useTranslation } from "react-i18next";

import Button from "common/components/Button";
import { Batch } from "services/api/generated/api.generated";

import { KIBANA_URL } from "../../constants";
Expand All @@ -30,9 +27,7 @@ const useStyles = makeStyles((theme) => ({
display: "flex",
alignItems: "center",
flexWrap: "wrap",
},
margin: {
marginRight: theme.spacing(1),
gap: theme.spacing(1),
},
title: {
display: "flex",
Expand All @@ -50,7 +45,6 @@ const BatchListItem = ({ batch }: BatchListItemType): JSX.Element => {
const classes = useStyles();
const { t } = useTranslation();
const batchEnd = batch.completed_at ?? batch.canceled_at;
const { enqueueSnackbar } = useSnackbar();

const isBatchInProgress = !batch.completed_at && !batch.canceled_at;
const hasBatchCompletedWithErrors =
Expand Down Expand Up @@ -87,13 +81,6 @@ const BatchListItem = ({ batch }: BatchListItemType): JSX.Element => {
const getCreatedAtDate = (date: string) =>
new Date(date).toLocaleString().split(",").join(" -");

const handleBatchRetry = () => {
// TODO: batch retry is not implemented yet
enqueueSnackbar("Retrying a batch is not yet implemented !", {
variant: "warning",
});
};

return (
<Paper
key={batch.id}
Expand Down Expand Up @@ -135,17 +122,9 @@ const BatchListItem = ({ batch }: BatchListItemType): JSX.Element => {
)}
</div>
<div className={classes.listItemActions}>
<Typography variant="subtitle2" className={classes.margin}>
<Typography variant="subtitle2">
{getCreatedAtDate(batch.created_at)}
</Typography>
<Button
variant="outlined"
startIcon={<Replay />}
onClick={handleBatchRetry}
className={classes.margin}
>
{t("retry")}
</Button>
{isBatchRunning && <BatchCancel batch={batch} />}
</div>
</Paper>
Expand Down