Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
Adds a reminder of STRONG authentication for BEHALF reservations
Browse files Browse the repository at this point in the history
  • Loading branch information
vincit-matu committed Feb 22, 2024
1 parent f933b11 commit 14236b1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
19 changes: 17 additions & 2 deletions apps/admin-ui/src/component/my-units/ReservationTypeForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React from "react";
import { Controller, useFormContext } from "react-hook-form";
import { RadioButton, SelectionGroup, TextArea } from "hds-react";
import type { ReservationUnitType } from "common/types/gql-types";
import { Notification, RadioButton, SelectionGroup, TextArea } from "hds-react";
import {
ReservationUnitsReservationUnitAuthenticationChoices,
ReservationUnitType,
} from "common/types/gql-types";
import { useTranslation } from "react-i18next";
import styled from "styled-components";
import { type ReservationFormType, ReservationTypes } from "app/schemas";
Expand Down Expand Up @@ -105,6 +108,18 @@ const ReservationTypeForm = ({
)}
{type !== undefined && type !== "BLOCKED" && (
<>
{type === "BEHALF" &&
reservationUnit.authentication ===
ReservationUnitsReservationUnitAuthenticationChoices.Strong && (
<Element $wide>
<Notification
label={t("reservationApplication:strongAuthentication.label")}
type="info"
>
{t("reservationApplication:strongAuthentication.info")}
</Notification>
</Element>
)}
{!disableBufferToggle && (
<BufferToggles
before={reservationUnit.bufferTimeBefore ?? 0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import { fromUIDate } from "common/src/common/util";
import { setTimeOnDate } from "app/component/reservations/utils";
import { useCheckCollisions } from "app/component/reservations/requested/hooks";
import { dateTime } from "app/helpers";
import { useModal } from "../../../context/ModalContext";
import { useModal } from "@/context/ModalContext";
import { CREATE_STAFF_RESERVATION } from "./queries";
import Loader from "../../Loader";
import { useNotification } from "../../../context/NotificationContext";
import { useNotification } from "@/context/NotificationContext";
import { flattenMetadata } from "./utils";
import { useReservationUnitQuery } from "../hooks";
import ReservationTypeForm from "../ReservationTypeForm";
Expand Down
1 change: 1 addition & 0 deletions apps/admin-ui/src/component/my-units/hooks/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const RESERVATION_UNITS_BY_UNIT = gql`
bufferTimeBefore
bufferTimeAfter
isDraft
authentication
...ReservationUnitReservations
}
}
Expand Down
1 change: 1 addition & 0 deletions apps/admin-ui/src/component/reservations/fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const RESERVATION_UNIT_FRAGMENT = gql`
bufferTimeBefore
bufferTimeAfter
reservationStartInterval
authentication
unit {
pk
nameFi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"typeSelection": {
"tooltip": "Sisäisissä varauksissa vastuu tilaisuudesta on aina kaupungilla. Ulkoisissa varauksissa vastuu tilaisuudesta on asiakkaalla. Vastuuhenkilö on nimettävä varauksella."
},

"strongAuthentication": {
"label": "Vahva tunnistautuminen",
"info": "Kohteen varaaminen edellyttää asiakkaan vahvaa tunnistautumista."
},
"buffers": {
"label": "Varauksen tauko",
"tooltip": "Asiakaspuolella varauksiin lisätään aina automaattinen tauko. Voit lisätä varauksesi alkuun tai loppuun tauon tässä.",
Expand Down

0 comments on commit 14236b1

Please sign in to comment.