From a976a826a57eb6f00707d79ae6746224635efe3f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 27 Nov 2020 13:20:26 +0100 Subject: [PATCH] :bug: Fix inconsistences on messages specs. --- frontend/src/app/main/data/media.cljs | 27 +++++++++++++----------- frontend/src/app/main/data/messages.cljs | 4 ++-- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/frontend/src/app/main/data/media.cljs b/frontend/src/app/main/data/media.cljs index bdab5699b4..0f32ada2b8 100644 --- a/frontend/src/app/main/data/media.cljs +++ b/frontend/src/app/main/data/media.cljs @@ -2,25 +2,28 @@ ;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; -;; Copyright (c) 2016 Andrey Antukh +;; This Source Code Form is "Incompatible With Secondary Licenses", as +;; defined by the Mozilla Public License, v. 2.0. +;; +;; Copyright (c) 2020 UXBOX Labs SL (ns app.main.data.media (:require - [cljs.spec.alpha :as s] - [cuerdas.core :as str] - [beicon.core :as rx] - [potok.core :as ptk] - [app.common.spec :as us] [app.common.data :as d] [app.common.media :as cm] - [app.main.data.messages :as dm] - [app.main.store :as st] - [app.main.repo :as rp] - [app.util.i18n :refer [tr]] - [app.util.router :as rt] + [app.common.spec :as us] [app.common.uuid :as uuid] + [app.main.data.messages :as dm] + [app.main.repo :as rp] + [app.main.store :as st] + [app.util.i18n :refer [tr]] + [app.util.router :as r] + [app.util.router :as rt] [app.util.time :as ts] - [app.util.router :as r])) + [beicon.core :as rx] + [cljs.spec.alpha :as s] + [cuerdas.core :as str] + [potok.core :as ptk])) ;; --- Specs diff --git a/frontend/src/app/main/data/messages.cljs b/frontend/src/app/main/data/messages.cljs index a688c756b8..9cce091990 100644 --- a/frontend/src/app/main/data/messages.cljs +++ b/frontend/src/app/main/data/messages.cljs @@ -28,12 +28,12 @@ (s/def ::status #{:visible :hide}) (s/def ::controls #{:none :close :inline-actions :bottom-actions}) -(s/def ::tag ::us/string) +(s/def ::tag (s/or :str ::us/string :kw ::us/keyword)) (s/def ::label ::us/string) (s/def ::callback fn?) (s/def ::action (s/keys :req-un [::label ::callback])) (s/def ::actions (s/every ::message-action :kind vector?)) -(s/def ::timeout ::us/integer) +(s/def ::timeout (s/nilable ::us/integer)) (s/def ::content ::us/string) (s/def ::message