Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 12 additions & 10 deletions src/components/pages/deployment/DeploymentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import relativeTime from 'dayjs/plugin/relativeTime';
import utc from 'dayjs/plugin/utc';

import { getDeploymentDuration } from '../allDeployments/TableColumns';
import {capitalize} from "@/components/utils";
import {Loader2} from "lucide-react";
import {getBadgeVariant} from "../../../../utils/setBadgeStatus";
import { capitalize } from "@/components/utils";
import { Loader2 } from "lucide-react";
import { getBadgeVariant } from "../../../../utils/setBadgeStatus";
import { Link as LinkIcon } from 'lucide-react';

dayjs.extend(relativeTime);
dayjs.extend(utc);
Expand Down Expand Up @@ -51,7 +52,7 @@ export const deploymentColumns = [
{
title: 'Actions',
key: 'actions',
dataIndex: 'actons',
dataIndex: 'actions',
},
];
export default function DeploymentPage({
Expand Down Expand Up @@ -100,16 +101,17 @@ export default function DeploymentPage({

const deploymentDataRow = {
status: <Badge variant={getBadgeVariant(deployment.status, deployment.buildStep)}>{capitalize(deployment.status)} {!['complete', 'cancelled', 'failed'].includes(deployment.status) &&
<Loader2 className="h-4 w-4 animate-spin t"/>}
<Loader2 className="h-4 w-4 animate-spin t" />}
</Badge>,
name: deployment.bulkId ? (
<section className="flex items-center ">
<section className="flex items-center gap-4">
<p>{deployment.name}</p>
<div className="bulk-link bg-blue-400 hover:bg-blue-600 py-1 px-2 translate-x-4/5 mr-3 rounded-sm transition-colors">
<Link className="text-white" href={`/bulkdeployment/${deployment.bulkId}`}>
<Link className="py-1 px-2" href={`/bulkdeployment/${deployment.bulkId}`}>
<Badge variant="info" className="py-1 px-2 rounded-sm">
BULK
</Link>
</div>
<LinkIcon className="h-4 w-4" />
</Badge>
</Link>
</section>
) : (
deployment.name
Expand Down
14 changes: 8 additions & 6 deletions src/components/pages/deployments/_components/TableColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import utc from 'dayjs/plugin/utc';
import { dateRangeFilter } from 'utils/tableDateRangeFilter';
import { Check, Loader2, X } from 'lucide-react';
import { getBadgeVariant } from 'utils/setBadgeStatus';
import { Link as LinkIcon } from 'lucide-react';

dayjs.extend(isBetween);
dayjs.extend(duration);
Expand Down Expand Up @@ -57,7 +58,7 @@ const getDeploymentTableColumns = (basePath: string) =>
{(status == "failed" || status == "cancelled") && <X color="red" size="16" />}
<Badge variant={getBadgeVariant(status, buildStep)}>
{capitalize(status)}
{!['complete', 'cancelled', 'failed'].includes(status) && <Loader2 className="h-4 w-4 animate-spin t"/>}
{!['complete', 'cancelled', 'failed'].includes(status) && <Loader2 className="h-4 w-4 animate-spin t" />}
</Badge>
</div>

Expand Down Expand Up @@ -93,16 +94,17 @@ const getDeploymentTableColumns = (basePath: string) =>
cell: ({ row }) => {
const { bulkId, name } = row.original;
return (
<section className="flex justify-between">
<section className={`flex items-center gap-4`}>
<Link className="hover:text-blue-800 transition-colors" href={`${basePath}/${name}`}>
{name}
</Link>
{bulkId ? (
<div className="bulk-link bg-blue-400 hover:bg-blue-600 py-1 px-2 mr-10 rounded-sm transition-colors">
<Link className="text-white" href={`/bulkdeployment/${bulkId}`}>
<Link className="py-1 px-2" href={`/bulkdeployment/${bulkId}`}>
<Badge variant="info" className="py-1 px-2 rounded-sm">
BULK
</Link>
</div>
<LinkIcon className="h-4 w-4" />
</Badge>
</Link>
) : null}
</section>
);
Expand Down