Skip to content

Commit

Permalink
fix reservation unit filter (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
siren authored Aug 24, 2022
1 parent 2194630 commit 6aafd77
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions admin-ui/src/component/filters/ReservationUnitFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SortedSelect from "../ReservationUnits/ReservationUnitEditor/SortedSelect

const RESERVATION_UNITS_QUERY = gql`
query reservationUnits {
units {
reservationUnits {
edges {
node {
nameFi
Expand Down Expand Up @@ -38,11 +38,11 @@ const ReservationUnitFilter = ({ onChange, value }: Props): JSX.Element => {
label={t("ReservationUnitsFilter.label")}
multiselect
placeholder={t("common.filter")}
options={(data?.units?.edges || [])
options={(data?.reservationUnits?.edges || [])
.map((e) => e?.node)
.map((unit) => ({
label: unit?.nameFi as string,
value: String(unit?.pk as number),
.map((reservationUnit) => ({
label: reservationUnit?.nameFi as string,
value: String(reservationUnit?.pk as number),
}))}
value={value}
onChange={onChange}
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/src/component/reservations/ReservationsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const ReservationsTable = ({
<>
<DataOrMessage
filteredData={reservations}
noFilteredData={t("ReservationsTable.noFilteredReservations")}
noFilteredData={t("Reservations.noFilteredReservations")}
>
<>
<CustomTable
Expand Down
2 changes: 2 additions & 0 deletions admin-ui/src/component/reservations/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ export const RESERVATIONS_QUERY = gql`
$maxPrice: Float
$begin: DateTime
$end: DateTime
$reservationUnit: [ID]
) {
reservations(
first: $first
offset: $offset
orderBy: $orderBy
after: $after
unit: $unit
reservationUnit: $reservationUnit
reservationUnitType: $reservationUnitType
state: $state
textSearch: $textSearch
Expand Down
8 changes: 3 additions & 5 deletions admin-ui/src/i18n/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1264,11 +1264,6 @@ const translations: ITranslations = {
removeSuccess: ["Resurssi poistettu."],
},
RequestedReservations: {
// todo remove this
insightCountHandledApplications: ["tarkastettava anomus"],
insightCountHandledApplications_plural: ["tarkastettavaa anomusta"],
insightCountMonthlyHandledApplications: ["käsiteltyä anomusta / kk"],
insightCountTotalApplications: ["anomusta yhteensä"],
heading: {
unit: ["Toimipiste"],
applicant: ["Tilan käyttäjä"],
Expand All @@ -1279,6 +1274,9 @@ const translations: ITranslations = {
},
Reservations: {
reservationListHeading: ["Varaustoiveet"],
noFilteredReservations: [
"Valituilla suodattimilla ei löytynyt yhtään varausta. Valitse suodattimia uudelleen tai tyhjennä kaikki suodattimet.",
],
reservationListDescription: [
"Alla näet kaikki käsiteltävät varaustoiveet.",
],
Expand Down

0 comments on commit 6aafd77

Please sign in to comment.