Skip to content

Commit

Permalink
OK-345 Use constants for auth-type
Browse files Browse the repository at this point in the history
  • Loading branch information
msiukola committed Nov 9, 2023
1 parent 2056d32 commit ae1af88
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/clj/ataru/email/email_util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
(:require [ataru.translations.texts :refer [email-default-texts email-link-section-texts]]
[clojure.string :as string]
[ataru.config.core :refer [config]]
[taoensso.timbre :as log]))
[taoensso.timbre :as log]
[ataru.constants :as constants]))

(def from-address "no-reply@opintopolku.fi")

Expand Down Expand Up @@ -58,7 +59,7 @@

(defn get-application-url-and-text [form application lang]
(let [form-allows-ht? (boolean (get-in form [:properties :allow-hakeminen-tunnistautuneena]))
strong-auth? (= (:tunnistautuminen application) "strong")]
strong-auth? (= (:tunnistautuminen application) constants/auth-type-strong)]
(log/info "get application url and text " (:properties form) ", " form-allows-ht? " - " strong-auth?)
(if form-allows-ht?
(if strong-auth?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
[clojure.string :as string]
[goog.string :as gstring]
[reagent.core :as r]
[re-frame.core :refer [subscribe dispatch]]))
[re-frame.core :refer [subscribe dispatch]]
[ataru.constants :as constants]))

(defn- application-list-basic-column-header [_ _]
(let [application-sort (subscribe [:state-query [:application :sort]])]
Expand Down Expand Up @@ -249,7 +250,7 @@
@(subscribe [:editor/virkailija-translation :unknown])])]
[:span.application-handling__list-row--applicant-details (or (-> application :person :ssn) (-> application :person :dob))]
(cond
(= (:tunnistautuminen application) "strong")
(= (:tunnistautuminen application) constants/auth-type-strong)
[:span.application-handling__list-row--tunnistautunut-icon
[:img.logo-suomi-fi
{:title @(subscribe [:editor/virkailija-translation :ht-hakenut-vahvasti-tunnistautuneena])
Expand Down
7 changes: 4 additions & 3 deletions src/cljs/ataru/virkailija/views/virkailija_readonly.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
[goog.string :as s]
[ataru.application-common.hakukohde-specific-questions :as hsq]
[ataru.virkailija.application.view.virkailija-application-icons :as icons]
[ataru.virkailija.application.pohjakoulutus-toinen-aste.pohjakoulutus-toinen-aste-view :as pohjakoulutus-toinen-aste-view]))
[ataru.virkailija.application.pohjakoulutus-toinen-aste.pohjakoulutus-toinen-aste-view :as pohjakoulutus-toinen-aste-view]
[ataru.constants :as constants]))

(declare field)

Expand Down Expand Up @@ -331,15 +332,15 @@
[scroll-to-anchor content]]
(into [:div.application__wrapper-contents
(cond
(= (:tunnistautuminen application) "strong")
(= (:tunnistautuminen application) constants/auth-type-strong)
[:div.application-handling__hakenut-tunnistautuneena-infobox
[:span.application-handling__list-row--tunnistautunut-icon
[:img.logo-suomi-fi
{:title @(subscribe [:editor/virkailija-translation :ht-hakenut-vahvasti-tunnistautuneena])
:src "/lomake-editori/images/suomifi_16x16.svg"}]]
[:div.application-handling__hakenut-tunnistautuneena-infobox-text
@(subscribe [:editor/virkailija-translation :ht-hakenut-vahvasti-tunnistautuneena])]]
(= (:tunnistautuminen application) "eidas")
(= (:tunnistautuminen application) constants/auth-type-eidas)
[:div.application-handling__hakenut-tunnistautuneena-infobox
[:div.application-handling__hakenut-tunnistautuneena-infobox-text
@(subscribe [:editor/virkailija-translation :ht-eidas-tunnistautunut])]])]
Expand Down

0 comments on commit ae1af88

Please sign in to comment.