Update auction card UI

This commit is contained in:
IshaVenikar
2024-10-16 15:37:09 +05:30
committed by nabarun
parent b3ac6e1367
commit b63837d432
17 changed files with 380 additions and 39 deletions
@@ -130,9 +130,6 @@ export class Deployment {
@Column('varchar')
deployerLrn!: string;
@Column('varchar', { nullable: true })
auctionId!: string | null;
@Column({
enum: Environment
})
+1 -3
View File
@@ -473,9 +473,7 @@ export class Registry {
}
async getAuctionData(auctionId: string): Promise<any> {
const auction = await this.registry.getAuctionsByIds([auctionId]);
log({auction})
return auction;
return this.registry.getAuctionsByIds([auctionId]);;
}
getLrn(appName: string): string {
+1
View File
@@ -103,6 +103,7 @@ type Deployment {
commitMessage: String!
url: String
environment: Environment!
deployerLrn: String
isCurrent: Boolean!
status: DeploymentStatus!
createdAt: String!
-1
View File
@@ -752,7 +752,6 @@ export class Service {
id: project.ownerId!,
}),
deployerLrn: deployer,
auctionId: project.auctionId
});
log(
@@ -18,12 +18,13 @@ import { Button, Tag } from 'components/shared';
const CHECK_AUCTION_STATUS_INTERVAL = 2000;
export const AuctionData = ({
export const AuctionCard = ({
project,
}: {
project: Project;
}) => {
const [auctionStatus, setAuctionStatus] = useState<string>('');
const [deployerLrns, setDeployerLrns] = useState<string[]>([]);
const [auctionDetails, setAuctionDetails] = useState<Auction | null>(null);
const [openDialog, setOpenDialog] = useState<boolean>(false);
const client = useGQLClient();
@@ -48,6 +49,8 @@ export const AuctionData = ({
if (auctionStatus !== 'completed') {
checkAuctionStatus();
intervalId = setInterval(checkAuctionStatus, CHECK_AUCTION_STATUS_INTERVAL);
} else {
setDeployerLrns(project.deployerLrn)
}
return () => {
@@ -59,7 +62,11 @@ export const AuctionData = ({
const renderAuctionStatus = useCallback(
() => (
<Tag leftIcon={getIconByAuctionStatus(auctionStatus)} size="xs">
<Tag
leftIcon={getIconByAuctionStatus(auctionStatus)}
size="xs"
type={auctionStatus === 'completed' ? "positive" : "neutral"}
>
{auctionStatus.toUpperCase()}
</Tag>
),
@@ -103,15 +110,13 @@ export const AuctionData = ({
<Typography variant="subtitle1" className="mt-3">
Deployer LRNs
</Typography>
{project.deployerLrn && (
<div>
{project.deployerLrn.map((lrn, index) => (
<Typography key={index} variant="body2" className="text-elements">
{'\u2022'} {lrn}
</Typography>
))}
</div>
)}
<div>
{deployerLrns.map((lrn, index) => (
<Typography key={index} variant="body2" className="text-elements">
{'\u2022'} {lrn}
</Typography>
))}
</div>
</CardContent>
</Card>
@@ -36,7 +36,6 @@ const deployment: Deployment = {
url: 'https://deploy1.example.com',
environment: Environment.Production,
isCurrent: true,
auctionId: '7553538436710373822151221341b43f577e07b0525d083cc9b2de98890138a1',
deployerLrn: 'lrn://deepstack-test4/deployers/webapp-deployer-api.test4.wireitin.com',
status: DeploymentStatus.Ready,
createdBy: {
@@ -21,7 +21,7 @@ import { Activity } from 'components/projects/project/overview/Activity';
import { OverviewInfo } from 'components/projects/project/overview/OverviewInfo';
import { relativeTimeMs } from 'utils/time';
import { Domain, DomainStatus } from 'gql-client';
import { AuctionData } from 'components/projects/project/overview/Activity/AuctionData';
import { AuctionCard } from 'components/projects/project/overview/Activity/AuctionCard';
const COMMITS_PER_PAGE = 4;
@@ -206,7 +206,7 @@ const OverviewTabPanel = () => {
No current deployment found.
</p>
)}
{project.auctionId && <AuctionData project={project}/>}
{project.auctionId && <AuctionCard project={project}/>}
</div>
<Activity activities={activities} isLoading={fetchingActivities} />
</div>
@@ -102,7 +102,6 @@ export const deployment0: Deployment = {
domain: domain0,
commitMessage: 'Commit Message',
createdBy: user,
auctionId: '7553538436710373822151221341b43f577e07b0525d083cc9b2de98890138a1',
deployerLrn: 'lrn://deepstack-test4/deployers/webapp-deployer-api.test4.wireitin.com',
};
-1
View File
@@ -84,7 +84,6 @@ type Deployment = {
commitMessage: string;
url?: string;
deployerLrn: string;
auctionId?: string;
environment: Environment;
isCurrent: boolean;
status: DeploymentStatus;
-1
View File
@@ -84,7 +84,6 @@ type Deployment = {
commitMessage: string;
url?: string;
deployerLrn: string;
auctionId?: string;
environment: Environment;
isCurrent: boolean;
status: DeploymentStatus;
-1
View File
@@ -183,7 +183,6 @@ query ($projectId: String!) {
commitHash
commitMessage
url
auctionId
deployerLrn
environment
isCurrent
File diff suppressed because one or more lines are too long
-1
View File
@@ -155,7 +155,6 @@ query ($projectId: String!) {
commitHash
commitMessage
url
auctionId
deployerLrn
environment
isCurrent
File diff suppressed because one or more lines are too long
-1
View File
@@ -132,7 +132,6 @@ query ($projectId: String!) {
commitHash
commitMessage
url
auctionId
deployerLrn
environment
isCurrent
-4
View File
@@ -45,9 +45,6 @@ export type Auction = {
createTime?: Date;
commitsEndTime?: Date;
revealsEndTime?: Date;
// commitFee?: Fee;
// revealFee?: Fee;
// minimumBid?: Fee;
commitFee?: string;
revealFee?: string;
minimumBid?: string;
@@ -101,7 +98,6 @@ export type Deployment = {
commitMessage: string;
url?: string;
deployerLrn: string;
auctionId?: string;
environment: Environment;
isCurrent: boolean;
status: DeploymentStatus;