diff --git a/frontend/src/v5/store/drawings/drawings.helpers.tsx b/frontend/src/v5/store/drawings/drawings.helpers.tsx index 3e610f63610..fc80b9172a5 100644 --- a/frontend/src/v5/store/drawings/drawings.helpers.tsx +++ b/frontend/src/v5/store/drawings/drawings.helpers.tsx @@ -38,7 +38,7 @@ export const DRAWING_LIST_COLUMN_WIDTHS = { width: 155, hideWhenSmallerThan: Display.Desktop, }, - calibration: { + calibrationStatus: { width: 155, hideWhenSmallerThan: Display.Tablet, }, diff --git a/frontend/src/v5/ui/components/dashboard/dashboardList/useOrderedList/useOrderedList.helpers.ts b/frontend/src/v5/ui/components/dashboard/dashboardList/useOrderedList/useOrderedList.helpers.ts index 508c21ef395..014c1710b9d 100644 --- a/frontend/src/v5/ui/components/dashboard/dashboardList/useOrderedList/useOrderedList.helpers.ts +++ b/frontend/src/v5/ui/components/dashboard/dashboardList/useOrderedList/useOrderedList.helpers.ts @@ -18,6 +18,7 @@ // Positive infinity ensures null values are shown at the top export const dateToNum = (date) => (date ? (date).getTime() : Number.POSITIVE_INFINITY); +import { CALIBRATION_SORT_ORDER } from '@/v5/ui/routes/dashboard/projects/calibration/calibration.helpers'; import { SortingDirection } from '@components/dashboard/dashboardList/dashboardList.types'; import { get, isArray } from 'lodash'; @@ -37,6 +38,10 @@ export const getSortingFunction = (sortConfig) => { return +aValue - +bValue; } + if (aValue in CALIBRATION_SORT_ORDER && bValue in CALIBRATION_SORT_ORDER) { + return CALIBRATION_SORT_ORDER[aValue] - CALIBRATION_SORT_ORDER[bValue]; + } + if (typeof aValue === 'string') { return aValue.localeCompare(bValue); } diff --git a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibration.helpers.ts b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibration.helpers.ts index 187de3b62e6..88d1786bd59 100644 --- a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibration.helpers.ts +++ b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibration.helpers.ts @@ -18,6 +18,14 @@ import { Matrix3, Vector2 } from 'three'; import { Coord2D, Coord3D, Vector1D, Vector2D, Vector3D } from './calibration.types'; import { isNumber } from 'lodash'; +import { CalibrationStatus } from '@/v5/store/drawings/drawings.types'; + +export const CALIBRATION_SORT_ORDER = { + [CalibrationStatus.EMPTY]: 0, + [CalibrationStatus.UNCALIBRATED]: 1, + [CalibrationStatus.UNCONFIRMED]: 2, + [CalibrationStatus.CALIBRATED]: 3, +}; export const DEFAULT_SETTINGS_CALIBRATION = { units: 'm', diff --git a/frontend/src/v5/ui/routes/dashboard/projects/drawings/drawingsList/drawingsList.component.tsx b/frontend/src/v5/ui/routes/dashboard/projects/drawings/drawingsList/drawingsList.component.tsx index 82546fa2f43..ca7e97c2ef7 100644 --- a/frontend/src/v5/ui/routes/dashboard/projects/drawings/drawingsList/drawingsList.component.tsx +++ b/frontend/src/v5/ui/routes/dashboard/projects/drawings/drawingsList/drawingsList.component.tsx @@ -100,7 +100,7 @@ export const DrawingsList = ({ - +