Allow send multiple team invitations at once

This commit is contained in:
Pablo Alba 2022-02-23 21:09:10 +01:00 committed by Andrey Antukh
parent 087d896569
commit 1cf9ad55c6
13 changed files with 287 additions and 54 deletions

View file

@ -108,6 +108,15 @@
(when (some? node)
(.-value node)))
(defn get-input-value
"Extract the value from dom input node taking into account the type."
[^js node]
(when (some? node)
(if (or (= (.-type node) "checkbox")
(= (.-type node) "radio"))
(.-checked node)
(.-value node))))
(defn get-attribute
"Extract the value of one attribute of a dom node."
[^js node ^string attr-name]

View file

@ -8,7 +8,6 @@
(:refer-clojure :exclude [uuid])
(:require
[app.common.spec :as us]
[app.util.dom :as dom]
[app.util.i18n :refer [tr]]
[cljs.spec.alpha :as s]
[cuerdas.core :as str]
@ -114,19 +113,13 @@
(render inc)))))
(defn on-input-change
([form field]
(on-input-change form field false))
([form field trim?]
(fn [event]
(let [target (dom/get-target event)
value (if (or (= (.-type target) "checkbox")
(= (.-type target) "radio"))
(.-checked target)
(dom/get-value target))]
(swap! form (fn [state]
(-> state
(assoc-in [:data field] (if trim? (str/trim value) value))
(update :errors dissoc field))))))))
([form field value]
(on-input-change form field value false))
([form field value trim?]
(swap! form (fn [state]
(-> state
(assoc-in [:data field] (if trim? (str/trim value) value))
(update :errors dissoc field))))))
(defn on-input-blur
[form field]

View file

@ -35,6 +35,7 @@
(def altKey? (is-key? "Alt"))
(def ctrlKey? (or (is-key? "Control")
(is-key? "Meta")))
(def comma? (is-key? ","))
(defn editing? [e]
(.-editing ^js e))