Update deployments only if valid request Id exists

This commit is contained in:
IshaVenikar 2024-10-10 10:46:24 +05:30 committed by Nabarun
parent 9ede75a5a2
commit 0341e41c63
5 changed files with 14 additions and 9 deletions

View File

@ -473,7 +473,8 @@ export class Registry {
}
async getAuctionData(auctionId: string): Promise<any> {
const auction = this.registry.getAuctionsByIds([auctionId]);
const auction = await this.registry.getAuctionsByIds([auctionId]);
log({auction})
return auction;
}

View File

@ -23,10 +23,10 @@ enum DeploymentStatus {
}
enum AuctionStatus {
AuctionStatusCommitPhase
AuctionStatusRevealPhase
AuctionStatusExpired
AuctionStatusCompleted
completed
reveal
commit
expired
}
enum DomainStatus {

View File

@ -173,9 +173,13 @@ export class Service {
createdAt: 'DESC',
},
});
const requestRecordIds = new Set(records.map((record) => record.attributes.request).filter(Boolean));
const filteredDeployments = deployments.filter((deployment) =>
deployment.applicationDeploymentRequestId && requestRecordIds.has(deployment.applicationDeploymentRequestId)
);
// Get project IDs of deployments that are in production environment
const productionDeploymentProjectIds = deployments.reduce(
const productionDeploymentProjectIds = filteredDeployments.reduce(
(acc, deployment): Set<string> => {
if (deployment.environment === Environment.Production) {
acc.add(deployment.projectId);

View File

@ -12,7 +12,7 @@ export const AuctionData = ({
}: {
project: Project
}) => {
const [isAuctionCompleted, setIsAuctionCompleted] = useState<boolean>(true);
const [isAuctionCompleted, setIsAuctionCompleted] = useState<boolean>(false);
const client = useGQLClient();
const getIconByAuctionStatus = (isCompleted: Boolean) => {
return isCompleted ? <CheckRoundFilledIcon /> : <LoadingIcon className="animate-spin" />
@ -76,7 +76,7 @@ export const AuctionData = ({
Auction Id: {project.auctionId}
</p>
<p className="text-elements-low-em text-sm mt-2">
<p className="text-elements-low-em text-sm">
Deployer LRNs:
</p>

View File

@ -206,7 +206,7 @@ const OverviewTabPanel = () => {
No current deployment found.
</p>
)}
<AuctionData project={project}/>
{project.auctionId && <AuctionData project={project}/>}
</div>
<Activity activities={activities} isLoading={fetchingActivities} />
</div>