Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 81698b9a

Přidáno uživatelem Václav Honzík před téměř 3 roky(ů)

merge fixes

Zobrazit rozdíly:

frontend/src/features/Catalog/CatalogItemDetail.tsx
100 100
        },
101 101
        {
102 102
            rowName: 'Coordinates',
103
            items: item?.longitude && item?.latitude ? `${item?.latitude}°, ${item?.longitude}°` : '-, -',
103
            // Must be in array otherwise the string gets iterated
104
            items: [item?.longitude && item?.latitude ? `${item?.latitude}°, ${item?.longitude}°` : '-'],
104 105
        },
105 106
        {
106 107
            rowName: 'Certainty',
frontend/src/features/Catalog/CatalogTable.tsx
113 113
                    {item.name}
114 114
                </Link>
115 115
            </TableCell>
116
            {mapValueOrDefault(item.alternativeNames?.join(', '), {
116
            {mapValueOrDefault(item.allNames?.join(', '), {
117 117
                display: '-webkit-box',
118 118
                overflow: 'hidden',
119 119
                WebkitBoxOrient: 'vertical',
frontend/src/features/Navigation/navigationSlice.tsx
12 12
    storage
13 13
}
14 14

  
15
const initialState = {
15
const initialState: NavigationState = {
16 16
    selectedMenuItem: '',
17 17
    open: false
18 18
}
......
21 21
    name: 'navigation',
22 22
    initialState,
23 23
    reducers: {
24
        setSelectedMenuItem: (state, action) => ({...state, selectedMenuItem: action.payload}),
25
        setOpen: (state, action) => ({...state, open: action.payload}),
24
        setSelectedMenuItem: (state: NavigationState, action: any) => ({...state, selectedMenuItem: action.payload}),
25
        setOpen: (state: NavigationState, action: any) => ({...state, open: action.payload}),
26 26
    }
27 27
})
28 28

  
frontend/src/features/TrackingTool/trackingToolSlice.ts
17 17
    activePaths: Set<number> // indices of the active paths
18 18
    // trigger to close the dialog when API call is finished
19 19
    dialogApiCallSuccess: boolean
20
    pathsPerPage: number // max number of paths to show on the map at once
21
    currentPage: number // current page of paths - starts from 0
20 22
}
21 23

  
24
const defaultPathsPerPage = 5
25

  
22 26
const initialState: TrackingToolState = {
23 27
    isLoading: false,
24 28
    mapCenter: [
......
28 32
    primaryPathIdx: 0,
29 33
    activePaths: new Set(),
30 34
    dialogApiCallSuccess: true,
35
    pathsPerPage: defaultPathsPerPage,
36
    currentPage: 0,
31 37
}
32 38

  
33 39
// Returns tuple of average latitude and longitude
......
56 62
            ...state,
57 63
            dialogApiCallSuccess: false,
58 64
        }),
59
        clear: (state: TrackingToolState) => ({...initialState})
65
        setPage: (state: TrackingToolState, action: any) => ({
66
            ...state,
67
            currentPage: action.payload,
68
        }),
69
        clear: () => ({...initialState})
60 70
    },
61 71
    extraReducers: (builder) => {
62 72
        builder.addCase(sendTextForProcessing.fulfilled, (state, action) => {
......
75 85
                        : (state.mapCenter as LatLngTuple),
76 86
                isLoading: false,
77 87
                dialogApiCallSuccess: true,
88
                currentPage: 0,
78 89
            }
79 90
        })
80 91
        builder.addCase(sendTextForProcessing.rejected, (state, action) => ({
......
82 93
            lastError: action.error.message,
83 94
            isLoading: false,
84 95
            dialogApiCallSuccess: false,
96
            currentPage: 0,
85 97
        }))
86 98
        builder.addCase(sendTextForProcessing.pending, (state) => {
87 99
            return {

Také k dispozici: Unified diff