Skip to content

Commit 660356e

Browse files
authored
Tweak occurrence duration label (#488)
1 parent 9fa81cf commit 660356e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

ui/src/data-services/models/occurrence.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ export class Occurrence {
9393
: undefined
9494
}
9595

96-
get durationLabel(): string {
97-
return this._occurrence.duration_label
96+
get durationLabel(): string | undefined {
97+
return this._occurrence.duration_label?.length
98+
? this._occurrence.duration_label
99+
: undefined
98100
}
99101

100102
get displayName(): string {

ui/src/design-system/components/table/basic-table-cell/basic-table-cell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const BasicTableCell = ({
3030
})}
3131
style={{ textAlign, ...style }}
3232
>
33-
{label && <span className={styles.label}>{label}</span>}
33+
{label ? <span className={styles.label}>{label}</span> : null}
3434
{details &&
3535
details.map((detail, index) => (
3636
<span key={index} className={styles.details}>

ui/src/pages/occurrences/occurrence-columns.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ export const columns: (projectId: string) => TableColumn<Occurrence>[] = (
147147
name: translate(STRING.FIELD_LABEL_DURATION),
148148
sortField: 'duration',
149149
renderCell: (item: Occurrence) => (
150-
<BasicTableCell value={item.durationLabel} />
150+
<BasicTableCell
151+
value={item.durationLabel ?? translate(STRING.VALUE_NOT_AVAILABLE)}
152+
/>
151153
),
152154
},
153155
{

0 commit comments

Comments
 (0)