Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
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
8 changes: 4 additions & 4 deletions src/Interfaces/IProjectInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export interface IJenkinsProject {
inQueue: boolean;
keepDependencies: boolean;
lastBuild: IJenkinsProjectBuild;
lastCompletedBuild: IJenkinsProjectBuild;
lastCompletedBuild: IJenkinsProjectBuild | null;
lastFailedBuild: IJenkinsProjectBuild | null;
lastStableBuild: IJenkinsProjectBuild;
lastSuccessfulBuild: IJenkinsProjectBuild;
lastStableBuild: IJenkinsProjectBuild | null;
lastSuccessfulBuild: IJenkinsProjectBuild | null;
lastUnstableBuild: IJenkinsProjectBuild | null;
lastUnsuccessfulBuild: IJenkinsProjectBuild;
lastUnsuccessfulBuild: IJenkinsProjectBuild | null;
nextBuildNumber: number;
property: IJenkinsProjectProperty[];
queueItem: unknown | null;
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Jarvis/JarvisMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function JarvisMain(): React.ReactElement {
{activeFeature === "parameters" && <ParametersView buildData={selectedBuildData} />}
{activeFeature === "settings" && <SettingsView />}
{activeFeature === "changes" && <ChangesView buildData={selectedBuildData} />}
{activeFeature === "status_for_project" && <ProjectStatusView buildData={projectData} />}
{activeFeature === "status_for_project" && <ProjectStatusView projectData={projectData} />}
{activeFeature === "testReport" && <TestReport buildData={selectedBuildData} />}
{activeFeature === "build" && <BuildView buildData={selectedBuildData} parameterDefinition={parameterDefinition} />}
</CustomAnimatePresence>
Expand Down
1 change: 1 addition & 0 deletions src/screens/Jarvis/Utils/JarivsUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ export class JarvisUtils {
const collectedBuildData: IJenkinsBuild[] = [];
if (!newData) throw new Error("No project data found, please check your internet connection and try again.");
const newBuilds = newData.builds;
this.setProjectData(newData);

/**
* This Section is for adding new builds to the jobCardProps array.
Expand Down
48 changes: 27 additions & 21 deletions src/screens/Jarvis/Views/ProjectStatusView/ProjectStatusView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import { IcoCube } from "@/Icons/pack_1";
import circleColor from "@/config/getCircleColor";

interface Props {
buildData: IJenkinsProject | null;
projectData: IJenkinsProject | null;
}

const ProjectStatusView: React.FC<Props> = ({ buildData }) => {
const ProjectStatusView: React.FC<Props> = ({ projectData }) => {
const [lastSuccessfulBuild, setLastSuccessfulBuild] = React.useState<IJenkinsBuild | null>(null);
const [projectDataR, setprojectDataR] = React.useState<IJenkinsProject | null>(null);

const openArtifact = async (artifact: string = "") => {
const baseURL: string = StorageManager.get("baseurl") || "";
Expand All @@ -23,50 +24,55 @@ const ProjectStatusView: React.FC<Props> = ({ buildData }) => {

await openLink(artifactURL, true);
};

const getLastSuccessfulBuild = async () => {
const lastSuccessfulBuild: number | undefined = projectDataR?.lastSuccessfulBuild?.number;
if (!lastSuccessfulBuild) return null;
const response = await fetchUtils.fetchBuildData(lastSuccessfulBuild, StorageManager.get("projectName"), 5);

return response;
};

useEffect(() => {
const getLastSuccessfulBuild = async () => {
const lastSuccessfulBuild: number | undefined = buildData?.lastSuccessfulBuild.number;
if (!lastSuccessfulBuild) return null;
const response = await fetchUtils.fetchBuildData(lastSuccessfulBuild, StorageManager.get("projectName"), 5);
return response;
};
if (buildData) {
getLastSuccessfulBuild().then((data) => {
setLastSuccessfulBuild(data);
});
if (projectData) {
if (lastSuccessfulBuild === null || lastSuccessfulBuild.number !== projectData.lastSuccessfulBuild?.number) {
getLastSuccessfulBuild().then((response) => {
if (response) setLastSuccessfulBuild(response);
});
}
}

}, [buildData]);
setprojectDataR(projectData);
}, [projectData]);

return (
<div className="mx-10 my-10">
{buildData ? (
{projectDataR ? (
<div className="flex flex-col rounded-lg p-5 mb-10 transition select-none overflow-hidden space-y-4">
{/* Title & Description */}
<div className="flex flex-row">
<div className="flex-shrink-0 mr-3 ">
<span className="relative flex h-[37px] w-[37px]">
{buildData.color.includes("_anime") ? (
<span className={`animate-ping absolute inline-flex h-full w-full rounded-full ${circleColor(buildData.color)} opacity-75`} />
{projectDataR.color.includes("_anime") ? (
<span className={`animate-ping absolute inline-flex h-full w-full rounded-full ${circleColor(projectDataR.color.includes("blue") ? projectDataR.color.replace("blue", "green") : projectDataR.color)} opacity-75`} />
) : null}
<span className={`relative inline-flex rounded-full h-full w-full ${circleColor(buildData.color)}`} />
<span className={`relative inline-flex rounded-full h-full w-full ${circleColor(projectDataR.color.includes("blue") ? projectDataR.color.replace("blue", "green") : projectDataR.color)}`} />
</span>
</div>
<div className="flex flex-col justify-center">
{/* Two rows for Title and Comment */}
<div className="text-3xl text-text-color font-bold overflow-hidden">
<p className="break-all">{buildData.displayName}</p>
<p className="break-all">{projectDataR.displayName}</p>
</div>
<div className="text-md text-comment-color overflow-hidden" dangerouslySetInnerHTML={renderHTML(buildData.description || "")} />
<div className="text-md text-comment-color overflow-hidden" dangerouslySetInnerHTML={renderHTML(projectDataR.description || "")} />
</div>
</div>


{/* Health Report */}
<div className="flex flex-row space-x-4 overflow-x-auto error-custom-scroll pb-4">
{buildData.healthReport.length !== 0 ? (
buildData.healthReport.map((healthReport, key) => (
{projectDataR.healthReport.length !== 0 ? (
projectDataR.healthReport.map((healthReport, key) => (
<ProjectHealthDisplay healthReport={healthReport} key={key} _key={key} />
))
) : null}
Expand Down