diff --git a/frontend/src/features/Catalog/CatalogItemDetail.tsx b/frontend/src/features/Catalog/CatalogItemDetail.tsx index 763d72161265c71ae410212c68d59bb226f9a07a..b987827040fd414509d39023b85c7cb29b98cd54 100644 --- a/frontend/src/features/Catalog/CatalogItemDetail.tsx +++ b/frontend/src/features/Catalog/CatalogItemDetail.tsx @@ -100,7 +100,8 @@ const CatalogItemDetail: FunctionComponent<CatalogItemDetailProps> = ({ }, { rowName: 'Coordinates', - items: item?.longitude && item?.latitude ? `${item?.latitude}°, ${item?.longitude}°` : '-, -', + // Must be in array otherwise the string gets iterated + items: [item?.longitude && item?.latitude ? `${item?.latitude}°, ${item?.longitude}°` : '-'], }, { rowName: 'Certainty', diff --git a/frontend/src/features/Catalog/CatalogTable.tsx b/frontend/src/features/Catalog/CatalogTable.tsx index 898bfbead04a9b4003b2545e518faf1bbb79441b..e34d730125b835f1f7b829741ca18aee039324e7 100644 --- a/frontend/src/features/Catalog/CatalogTable.tsx +++ b/frontend/src/features/Catalog/CatalogTable.tsx @@ -113,7 +113,7 @@ const CatalogTable = () => { {item.name} </Link> </TableCell> - {mapValueOrDefault(item.alternativeNames?.join(', '), { + {mapValueOrDefault(item.allNames?.join(', '), { display: '-webkit-box', overflow: 'hidden', WebkitBoxOrient: 'vertical', diff --git a/frontend/src/features/Navigation/navigationSlice.tsx b/frontend/src/features/Navigation/navigationSlice.tsx index 33a46b0ea5f2139509fd337ddb5eff3536597b54..6096557003f0e50ba4165d85c52380af20f948a2 100644 --- a/frontend/src/features/Navigation/navigationSlice.tsx +++ b/frontend/src/features/Navigation/navigationSlice.tsx @@ -12,7 +12,7 @@ const persistConfig = { storage } -const initialState = { +const initialState: NavigationState = { selectedMenuItem: '', open: false } @@ -21,8 +21,8 @@ export const navigationSlice = createSlice({ name: 'navigation', initialState, reducers: { - setSelectedMenuItem: (state, action) => ({...state, selectedMenuItem: action.payload}), - setOpen: (state, action) => ({...state, open: action.payload}), + setSelectedMenuItem: (state: NavigationState, action: any) => ({...state, selectedMenuItem: action.payload}), + setOpen: (state: NavigationState, action: any) => ({...state, open: action.payload}), } }) diff --git a/frontend/src/features/TrackingTool/trackingToolSlice.ts b/frontend/src/features/TrackingTool/trackingToolSlice.ts index 58ab388ce841f4e6b96eb59ae546d93bde3494cc..856bb436f8bfd217083fbb9c8c3f060e0f3de7a5 100644 --- a/frontend/src/features/TrackingTool/trackingToolSlice.ts +++ b/frontend/src/features/TrackingTool/trackingToolSlice.ts @@ -17,8 +17,12 @@ export interface TrackingToolState { activePaths: Set<number> // indices of the active paths // trigger to close the dialog when API call is finished dialogApiCallSuccess: boolean + pathsPerPage: number // max number of paths to show on the map at once + currentPage: number // current page of paths - starts from 0 } +const defaultPathsPerPage = 5 + const initialState: TrackingToolState = { isLoading: false, mapCenter: [ @@ -28,6 +32,8 @@ const initialState: TrackingToolState = { primaryPathIdx: 0, activePaths: new Set(), dialogApiCallSuccess: true, + pathsPerPage: defaultPathsPerPage, + currentPage: 0, } // Returns tuple of average latitude and longitude @@ -56,7 +62,11 @@ export const trackingToolSlice = createSlice({ ...state, dialogApiCallSuccess: false, }), - clear: (state: TrackingToolState) => ({...initialState}) + setPage: (state: TrackingToolState, action: any) => ({ + ...state, + currentPage: action.payload, + }), + clear: () => ({...initialState}) }, extraReducers: (builder) => { builder.addCase(sendTextForProcessing.fulfilled, (state, action) => { @@ -75,6 +85,7 @@ export const trackingToolSlice = createSlice({ : (state.mapCenter as LatLngTuple), isLoading: false, dialogApiCallSuccess: true, + currentPage: 0, } }) builder.addCase(sendTextForProcessing.rejected, (state, action) => ({ @@ -82,6 +93,7 @@ export const trackingToolSlice = createSlice({ lastError: action.error.message, isLoading: false, dialogApiCallSuccess: false, + currentPage: 0, })) builder.addCase(sendTextForProcessing.pending, (state) => { return {