Skip to content

Commit de1f243

Browse files
authored
Merge pull request #6471 from espoon-voltti/display-city-in-unit-listing
Lisätään yksikköhakuun kunta-sarake
2 parents c81ed5a + 27e4eba commit de1f243

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

frontend/src/employee-frontend/components/Units.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2017-2022 City of Espoo
1+
// SPDX-FileCopyrightText: 2017-2025 City of Espoo
22
//
33
// SPDX-License-Identifier: LGPL-2.1-or-later
44

@@ -117,6 +117,7 @@ export default React.memo(function Units() {
117117
].join(', ')
118118
: unit.visitingAddress.streetAddress}
119119
</Td>
120+
<Td>{unit.visitingAddress.postOffice}</Td>
120121
<Td>
121122
{unit.type.map((type) => i18n.common.types[type]).join(', ')}
122123
</Td>
@@ -215,10 +216,16 @@ export default React.memo(function Units() {
215216
</SortableTh>
216217
<SortableTh
217218
sorted={sortColumn === 'address' ? sortDirection : undefined}
218-
onClick={() => sortBy('address')}
219+
onClick={() => sortBy('visitingAddress.streetAddress')}
219220
>
220221
{i18n.units.address}
221222
</SortableTh>
223+
<SortableTh
224+
sorted={sortColumn === 'city' ? sortDirection : undefined}
225+
onClick={() => sortBy('visitingAddress.postOffice')}
226+
>
227+
{i18n.units.city}
228+
</SortableTh>
222229
<SortableTh
223230
sorted={sortColumn === 'type' ? sortDirection : undefined}
224231
onClick={() => sortBy('type')}

frontend/src/employee-frontend/state/units.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ const defaultState: UnitsState = {
4444

4545
export const UnitsContext = createContext<UnitsState>(defaultState)
4646

47-
export type SearchColumn = 'name' | 'area.name' | 'address' | 'type'
47+
export type SearchColumn =
48+
| 'name'
49+
| 'area.name'
50+
| 'visitingAddress.streetAddress'
51+
| 'visitingAddress.postOffice'
52+
| 'type'
4853

4954
export const UnitsContextProvider = React.memo(function UnitsContextProvider({
5055
children

frontend/src/lib-customizations/defaults/employee/i18n/fi.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -2169,6 +2169,7 @@ export const fi = {
21692169
name: 'Nimi',
21702170
area: 'Alue',
21712171
address: 'Osoite',
2172+
city: 'Kunta',
21722173
type: 'Tyyppi',
21732174
findByName: 'Etsi yksikön nimellä',
21742175
selectProviderTypes: 'Valitse järjestämismuoto',

0 commit comments

Comments
 (0)