Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lisätään yksikköhakuun kunta-sarake #6471

Merged
merged 1 commit into from
Mar 6, 2025
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
11 changes: 9 additions & 2 deletions frontend/src/employee-frontend/components/Units.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2017-2022 City of Espoo
// SPDX-FileCopyrightText: 2017-2025 City of Espoo
//
// SPDX-License-Identifier: LGPL-2.1-or-later

Expand Down Expand Up @@ -117,6 +117,7 @@ export default React.memo(function Units() {
].join(', ')
: unit.visitingAddress.streetAddress}
</Td>
<Td>{unit.visitingAddress.postOffice}</Td>
<Td>
{unit.type.map((type) => i18n.common.types[type]).join(', ')}
</Td>
Expand Down Expand Up @@ -215,10 +216,16 @@ export default React.memo(function Units() {
</SortableTh>
<SortableTh
sorted={sortColumn === 'address' ? sortDirection : undefined}
onClick={() => sortBy('address')}
onClick={() => sortBy('visitingAddress.streetAddress')}
>
{i18n.units.address}
</SortableTh>
<SortableTh
sorted={sortColumn === 'city' ? sortDirection : undefined}
onClick={() => sortBy('visitingAddress.postOffice')}
>
{i18n.units.city}
</SortableTh>
<SortableTh
sorted={sortColumn === 'type' ? sortDirection : undefined}
onClick={() => sortBy('type')}
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/employee-frontend/state/units.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ const defaultState: UnitsState = {

export const UnitsContext = createContext<UnitsState>(defaultState)

export type SearchColumn = 'name' | 'area.name' | 'address' | 'type'
export type SearchColumn =
| 'name'
| 'area.name'
| 'visitingAddress.streetAddress'
| 'visitingAddress.postOffice'
| 'type'

export const UnitsContextProvider = React.memo(function UnitsContextProvider({
children
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,7 @@ export const fi = {
name: 'Nimi',
area: 'Alue',
address: 'Osoite',
city: 'Kunta',
type: 'Tyyppi',
findByName: 'Etsi yksikön nimellä',
selectProviderTypes: 'Valitse järjestämismuoto',
Expand Down