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> { async getAuctionData(auctionId: string): Promise<any> {
const auction = this.registry.getAuctionsByIds([auctionId]); const auction = await this.registry.getAuctionsByIds([auctionId]);
log({auction})
return auction; return auction;
} }

View File

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

View File

@ -173,9 +173,13 @@ export class Service {
createdAt: 'DESC', 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 // Get project IDs of deployments that are in production environment
const productionDeploymentProjectIds = deployments.reduce( const productionDeploymentProjectIds = filteredDeployments.reduce(
(acc, deployment): Set<string> => { (acc, deployment): Set<string> => {
if (deployment.environment === Environment.Production) { if (deployment.environment === Environment.Production) {
acc.add(deployment.projectId); acc.add(deployment.projectId);

View File

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

View File

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