Skip to content

Commit dfe0649

Browse files
committed
feat(frontend): add retry count column to campaign targets tables
Add retry count column to both deployment and update campaign target tables to provide visibility into the number of retry attempts for each device. The retry count column is only visible for devices in the IN_PROGRESS status, where retry information is most relevant for monitoring ongoing deployments and updates. Signed-off-by: Omar <omar.brbutovic@secomind.com>
1 parent 5172731 commit dfe0649

5 files changed

Lines changed: 46 additions & 1 deletion

File tree

frontend/src/components/DeploymentTargetsTable.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const CAMPAIGN_TARGETS_TABLE_FRAGMENT = graphql`
4242
id
4343
name
4444
}
45+
retryCount
4546
latestAttempt
4647
completionTimestamp
4748
deployment {
@@ -71,6 +72,7 @@ const columnIds = [
7172
"state",
7273
"readiness",
7374
"lastErrorMessage",
75+
"retryCount",
7476
"latestAttempt",
7577
"completionTimestamp",
7678
] as const;
@@ -151,6 +153,19 @@ const columns = [
151153
},
152154
},
153155
),
156+
columnHelper.accessor("retryCount", {
157+
header: () => (
158+
<FormattedMessage
159+
id="components.DeploymentTargetsTable.retryCountTitle"
160+
defaultMessage="Retry Count"
161+
description="Title for the Retry Count column of the Deployment Targets table"
162+
/>
163+
),
164+
cell: ({ getValue }) => {
165+
const retryCount = getValue();
166+
return retryCount ? retryCount : "";
167+
},
168+
}),
154169
columnHelper.accessor("latestAttempt", {
155170
header: () => (
156171
<FormattedMessage

frontend/src/components/DeploymentTargetsTabs.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ const CAMPAIGN_TARGETS_IDLE_FRAGMENT = graphql`
116116

117117
const columnMap: Record<CampaignTargetStatusType, ColumnId[]> = {
118118
IDLE: ["deviceName"],
119-
IN_PROGRESS: ["deviceName", "state", "readiness", "latestAttempt"],
119+
IN_PROGRESS: [
120+
"deviceName",
121+
"state",
122+
"readiness",
123+
"retryCount",
124+
"latestAttempt",
125+
],
120126
SUCCESSFUL: ["deviceName", "completionTimestamp"],
121127
FAILED: ["deviceName", "lastErrorMessage", "completionTimestamp"],
122128
};

frontend/src/components/UpdateTargetsTable.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const CAMPAIGN_TARGETS_TABLE_FRAGMENT = graphql`
4242
id
4343
name
4444
}
45+
retryCount
4546
latestAttempt
4647
completionTimestamp
4748
otaOperation {
@@ -164,6 +165,7 @@ const columnIds = [
164165
"otaOperationStatus",
165166
"otaOperationStatusProgress",
166167
"otaOperationStatusCode",
168+
"retryCount",
167169
"latestAttempt",
168170
"completionTimestamp",
169171
] as const;
@@ -244,6 +246,19 @@ const columns = [
244246
},
245247
},
246248
),
249+
columnHelper.accessor("retryCount", {
250+
header: () => (
251+
<FormattedMessage
252+
id="components.UpdateTargetsTable.retryCountTitle"
253+
defaultMessage="Retry Count"
254+
description="Title for the Retry Count column of the Update Targets table"
255+
/>
256+
),
257+
cell: ({ getValue }) => {
258+
const retryCount = getValue();
259+
return retryCount ? retryCount : "";
260+
},
261+
}),
247262
columnHelper.accessor("latestAttempt", {
248263
header: () => (
249264
<FormattedMessage

frontend/src/components/UpdateTargetsTabs.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ const columnMap: Record<CampaignTargetStatusType, ColumnId[]> = {
118118
"deviceName",
119119
"otaOperationStatus",
120120
"otaOperationStatusProgress",
121+
"retryCount",
121122
"latestAttempt",
122123
],
123124
SUCCESSFUL: ["deviceName", "completionTimestamp"],

frontend/src/i18n/langs/en.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,10 @@
717717
"defaultMessage": "Readiness",
718718
"description": "Title for the Readiness column of the Deployment Targets table"
719719
},
720+
"components.DeploymentTargetsTable.retryCountTitle": {
721+
"defaultMessage": "Retry Count",
722+
"description": "Title for the Retry Count column of the Deployment Targets table"
723+
},
720724
"components.DeploymentTargetsTable.stateTitle": {
721725
"defaultMessage": "State",
722726
"description": "Title for the State column of the Deployment Targets table"
@@ -1288,6 +1292,10 @@
12881292
"defaultMessage": "Operation",
12891293
"description": "Title for the Operation Status column of the Update Targets table"
12901294
},
1295+
"components.UpdateTargetsTable.retryCountTitle": {
1296+
"defaultMessage": "Retry Count",
1297+
"description": "Title for the Retry Count column of the Update Targets table"
1298+
},
12911299
"components.UpdateTargetsTabs.updateTargetsLabel": {
12921300
"defaultMessage": "Devices"
12931301
},

0 commit comments

Comments
 (0)