mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-13 15:35:17 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -1,4 +1,12 @@
|
|||||||
import { ChevronDown, ChevronUp, Clock, Loader2, RefreshCcw, RocketIcon, Settings } from "lucide-react";
|
import {
|
||||||
|
ChevronDown,
|
||||||
|
ChevronUp,
|
||||||
|
Clock,
|
||||||
|
Loader2,
|
||||||
|
RefreshCcw,
|
||||||
|
RocketIcon,
|
||||||
|
Settings,
|
||||||
|
} from "lucide-react";
|
||||||
import React, { useEffect, useMemo, useState } from "react";
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { AlertBlock } from "@/components/shared/alert-block";
|
import { AlertBlock } from "@/components/shared/alert-block";
|
||||||
@@ -88,7 +96,10 @@ export const ShowDeployments = ({
|
|||||||
const MAX_DESCRIPTION_LENGTH = 150;
|
const MAX_DESCRIPTION_LENGTH = 150;
|
||||||
|
|
||||||
// Helper function to truncate description intelligently
|
// Helper function to truncate description intelligently
|
||||||
const truncateDescription = (description: string, maxLength: number): string => {
|
const truncateDescription = (
|
||||||
|
description: string,
|
||||||
|
maxLength: number,
|
||||||
|
): string => {
|
||||||
if (maxLength <= 0) {
|
if (maxLength <= 0) {
|
||||||
return description; // Don't truncate if maxLength is 0 or negative
|
return description; // Don't truncate if maxLength is 0 or negative
|
||||||
}
|
}
|
||||||
@@ -280,7 +291,9 @@ export const ShowDeployments = ({
|
|||||||
// The commit message is in the title field, so we truncate that
|
// The commit message is in the title field, so we truncate that
|
||||||
const titleText = deployment.title.trim();
|
const titleText = deployment.title.trim();
|
||||||
const needsTruncation = shouldTruncate(titleText);
|
const needsTruncation = shouldTruncate(titleText);
|
||||||
const isExpanded = expandedDescriptions.has(deployment.deploymentId);
|
const isExpanded = expandedDescriptions.has(
|
||||||
|
deployment.deploymentId,
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
@@ -296,7 +309,9 @@ export const ShowDeployments = ({
|
|||||||
{needsTruncation && (
|
{needsTruncation && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => toggleDescription(deployment.deploymentId)}
|
onClick={() =>
|
||||||
|
toggleDescription(deployment.deploymentId)
|
||||||
|
}
|
||||||
className="flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors w-fit mt-1 cursor-pointer"
|
className="flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors w-fit mt-1 cursor-pointer"
|
||||||
aria-label={
|
aria-label={
|
||||||
isExpanded
|
isExpanded
|
||||||
@@ -318,11 +333,12 @@ export const ShowDeployments = ({
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
{/* Hash (from description) - shown in compact form */}
|
{/* Hash (from description) - shown in compact form */}
|
||||||
{deployment.description && deployment.description.trim() && (
|
{deployment.description &&
|
||||||
<span className="text-xs text-muted-foreground font-mono">
|
deployment.description.trim() && (
|
||||||
{deployment.description}
|
<span className="text-xs text-muted-foreground font-mono">
|
||||||
</span>
|
{deployment.description}
|
||||||
)}
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})()}
|
})()}
|
||||||
|
|||||||
Reference in New Issue
Block a user