Skip to content

Commit 63ce1bb

Browse files
Allow inspection data without blob
1 parent e6b2f9e commit 63ce1bb

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

frontend/src/models/InspectionRecord.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface InspectionData {
5454
analysisId: string
5555
visualisedSAS?: string
5656
fileType: FileType
57-
anonymizedSAS: string
57+
anonymizedSAS?: string
5858
analysisType?: string
5959
tag: string
6060
createdAt: Date
@@ -88,15 +88,13 @@ export const inspectionRecordToInspectionData = (record: InspectionRecord): Insp
8888
if (!analysis) return null
8989

9090
const sas = analysis.visualizedSAS ?? analysis.anonymizedSAS
91+
const fileType = sas ? sasURLToFileType(sas) : FileType.VALUE
9192

92-
if (!sas) return null
93-
94-
const fileType = sasURLToFileType(sas)
9593
return {
9694
inspectionId: record.inspectionId,
9795
analysisId: analysis.id,
9896
visualisedSAS: analysis.visualizedSAS,
99-
anonymizedSAS: analysis.anonymizedSAS!,
97+
anonymizedSAS: analysis.anonymizedSAS,
10098
analysisType: record.inspectionType,
10199
tag: record.tag,
102100
createdAt: record.createdAt,

frontend/src/pages/InspectionReportPage/InspectionReportImage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ const InspectionVideoWithPlaceholder = ({
122122
isLargeImage: boolean
123123
}) => (isLargeImage ? <LargeVideoWithPlaceholder inspection={inspection} /> : <VideoPlaceholder />)
124124

125-
const LargeVideoWithPlaceholder = ({ inspection }: { inspection: InspectionData }) => (
126-
<VideoPlayer src={inspection.anonymizedSAS} />
127-
)
125+
const LargeVideoWithPlaceholder = ({ inspection }: { inspection: InspectionData }) =>
126+
inspection.anonymizedSAS ? <VideoPlayer src={inspection.anonymizedSAS} /> : <VideoPlaceholder />
128127

129128
const InspectionResultWithPlaceholder = ({
130129
inspection,

0 commit comments

Comments
 (0)