Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions backend/api/Database/Context/InitDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private static List<TaskDefinition> GetMissionTaskDefinitions()
var task1 = new TaskDefinition
{
Index = 1,
TagId = "dummy tag id 1",
TagId = "dummy-tag-id-1",
Description = "dummy task 1",
RobotPose = new Pose(),
AnalysisTypes = [AnalysisType.Fencilla],
Expand All @@ -213,7 +213,7 @@ private static List<TaskDefinition> GetMissionTaskDefinitions()
var task2 = new TaskDefinition
{
Index = 2,
TagId = "dummy tag id 1",
TagId = "dummy-tag-id-2",
Description = "dummy task 2",
RobotPose = new Pose(),
AnalysisTypes = [AnalysisType.CLOE],
Expand All @@ -228,7 +228,7 @@ private static List<TaskDefinition> GetMissionTaskDefinitions()
var task3 = new TaskDefinition
{
Index = 3,
TagId = "dummy tag id 2",
TagId = "dummy-tag-id-3",
Description = "dummy task 3",
RobotPose = new Pose(),
AnalysisTypes = [AnalysisType.CO2],
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/models/InspectionRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ const imageFileEndings = ['jpg', 'jpeg', 'png', 'gif']
const videoFileEndings = ['mp4', 'mpg', 'mpeg', 'm4v']

const sasURLToFileType = (sasURL: string): FileType => {
const reg: RegExp = /\.([a-zA-Z0-9]+)(\?skoid=)/
const fileEnding = sasURL.match(reg)?.[1]
if (!fileEnding) return FileType.VALUE
if (imageFileEndings.includes(fileEnding?.toLowerCase())) return FileType.IMAGE
const pathname = new URL(sasURL).pathname
const filename = pathname.split('/').pop()
const fileEnding = filename!.split('.').pop()!.toLowerCase()

if (imageFileEndings.includes(fileEnding.toLowerCase())) return FileType.IMAGE
if (videoFileEndings.includes(fileEnding.toLowerCase())) return FileType.VIDEO
return FileType.VALUE
throw new Error(`Unsupported file type for SAS URL: ${sasURL}`)
}

export const inspectionRecordToInspectionData = (record: InspectionRecord): InspectionData | null => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { useInspectionId } from 'pages/InspectionReportPage/SetInspectionIdHook'
import { tokens } from '@equinor/eds-tokens'
import { InspectionData } from 'models/InspectionRecord'

const StyledButton = styled(Button)<{ hasFinding: boolean }>`
const StyledButton = styled(Button)`
&:hover {
${({ $hasFinding }) =>
$hasFinding
${({ color }) =>
color === 'danger'
? `border-color: ${tokens.colors.interactive.danger__hover.hex};`
: `border-color: ${tokens.colors.interactive.primary__hover.hex};`};
}
Expand All @@ -20,7 +20,6 @@ export const TaskAnalysisDisplay = ({ inspectionData }: { inspectionData: Inspec

return (
<StyledButton
hasFinding={inspectionData.warning ? true : false}
color={inspectionData.warning ? 'danger' : 'primary'}
variant="ghost"
onClick={() => switchSelectedAnalysisId(inspectionData.inspectionId)}
Expand Down
Loading