Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 2fbb902

Browse files
author
noah
committed
fix: replace lastStatus field
1 parent 0da2e14 commit 2fbb902

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

ui/src/apis/deployment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const mapDataToDeployment = (data: DeploymentData): Deployment => {
7474
ref: data.ref,
7575
sha: data.sha,
7676
env: data.env,
77-
lastStatus: mapDeploymentStatusEnum(data.status),
77+
status: mapDeploymentStatusEnum(data.status),
7878
uid: data.uid,
7979
isRollback: data.is_rollback,
8080
isApprovalEanbled: data.is_approval_enabled,

ui/src/components/ActivityLogs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ interface ActivityLogsProps {
1616
export default function ActivityLogs(props: ActivityLogsProps): JSX.Element {
1717
return <Timeline>
1818
{props.deployments.map((d, idx) => {
19-
const dot = (d.lastStatus === DeploymentStatusEnum.Running)?
19+
const dot = (d.status === DeploymentStatusEnum.Running)?
2020
<SyncOutlined style={{color: "purple"}} spin />:
2121
null
2222
const avatar = <UserAvatar user={d.deployer} />
2323

24-
return <Timeline.Item key={idx} color={getStatusColor(d.lastStatus)} dot={dot}>
24+
return <Timeline.Item key={idx} color={getStatusColor(d.status)} dot={dot}>
2525
<p>
2626
<Text strong>{d.env}</Text> <DeploymentRefCode deployment={d}/> <a href={`/${d.repo?.namespace}/${d.repo?.name}/deployments/${d.number}`}>• View detail #{d.number}</a>
2727
</p>

ui/src/components/DeploymentStatusBadge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface DeploymentStatusBadgeProps {
99
export default function DeploymentStatusBadge(props: DeploymentStatusBadgeProps): JSX.Element {
1010
const deployment = props.deployment
1111
return (
12-
<Badge color={getStatusColor(deployment.lastStatus)}text={deployment.lastStatus}/>
12+
<Badge color={getStatusColor(deployment.status)}text={deployment.status}/>
1313
)
1414
}
1515

ui/src/models/Deployment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default interface Deployment {
88
ref: string
99
sha: string
1010
env: string
11-
lastStatus: DeploymentStatusEnum
11+
status: DeploymentStatusEnum
1212
uid: number
1313
isRollback: boolean
1414
isApprovalEanbled: boolean

ui/src/redux/deployment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export const deploymentSlice = createSlice({
278278
state.deploying = RequestStatus.Idle
279279

280280
if (state.deployment) {
281-
state.deployment.lastStatus = DeploymentStatusEnum.Failure
281+
state.deployment.status = DeploymentStatusEnum.Failure
282282
}
283283
})
284284

ui/src/redux/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const mainSlice = createSlice({
130130
})
131131

132132
if (idx !== -1 ) {
133-
if (!runningDeploymentStatus.includes(deployment.lastStatus)) {
133+
if (!runningDeploymentStatus.includes(deployment.status)) {
134134
state.deployments.splice(idx, 1)
135135
return
136136
}

ui/src/views/Deployment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export default function DeploymentView(): JSX.Element {
177177
}
178178

179179
function isDeployable(deployment: Deployment, approvals: Approval[]): boolean {
180-
if (deployment.lastStatus !== DeploymentStatusEnum.Waiting) {
180+
if (deployment.status !== DeploymentStatusEnum.Waiting) {
181181
return false
182182
}
183183

0 commit comments

Comments
 (0)