Use unique keys for terminal and line components' children

--- src/cljs/asciinema_player/view.cljs
+++ src/cljs/asciinema_player/view.cljs
@@ -23,15 +23,14 @@
   [:span {:class-name (part-class-name (last p))} (first p)])

 (defn line [parts]
-  [:span.line (map (fn [p] [part p]) parts)])
-  ;[:span.line (map (fn [p] ^{:key p} [part p]) parts)])
+  [:span.line (map-indexed (fn [idx p] ^{:key idx} [part p]) parts)])

 (defn terminal-class-name [font-size]
   (str "font-" font-size))

 (defn terminal [font-size lines]
   [:pre.asciinema-terminal {:class-name (terminal-class-name font-size)}
-    (map (fn [l] [line l]) lines)])
+    (map-indexed (fn [idx l] ^{:key idx} [line l]) lines)])

 (def logo-raw-svg "<defs> <mask id=\"small-triangle-mask\"> <rect width=\"100%\" height=\"100%\" fill=\"white\"/> <polygon points=\"508.01270189221935 433.01270189221935, 208.0127018922194 259.8076211353316, 208.01270189221927 606.217782649107\" fill=\"black\"></polygon> </mask> </defs> <polygon points=\"808.0127018922194 433.01270189221935, 58.01270189221947 -1.1368683772161603e-13, 58.01270189221913 866.0254037844386\" mask=\"url(#small-triangle-mask)\" fill=\"white\"></polygon> <polyline points=\"481.2177826491071 333.0127018922194, 134.80762113533166 533.0127018922194\" stroke=\"white\" stroke-width=\"90\"></polyline>")


destructure arg

destructure arg

--- src/cljs/clj_money/api/imports.cljs
+++ src/cljs/clj_money/api/imports.cljs
@@ -8,8 +8,8 @@
             [clj-money.api :refer [handle-ex]]))

 (defn- ->multipart-params
-  [import-data]
-  (->> (:files import-data)
+  [{:keys [files] :as import-data}]
+  (->> files
        (map-indexed (fn [idx f] [idx f]))
        (reduce (fn [m [index file]]
                  (assoc m


Switch to peek for performance Peek performace.

--- src/cljs/love_letter_cljs/game.cljs
+++ src/cljs/love_letter_cljs/game.cljs
@@ -19,7 +19,7 @@
     (repeat count {:face face :value value :visible []})))

 (defn generate-deck []
-  (vec (shuffle (mapcat generate-card cards))))
+  (-> (mapcat generate-card cards) shuffle vec))

 (defn create-player [n]
   {:id n
@@ -67,7 +67,7 @@
 (defn find-card [game target]
   (-> game
       (get-in [:players target :hand])
-      first))
+      peek))

 (defn create-and-deal []
   (-> (create-game)
@@ -123,7 +123,7 @@
   (let [hand (player :hand)]
     (merge
      (select-keys player [:id])
-     (select-keys (first hand) [:face :value]))))
+     (select-keys (peek hand) [:face :value]))))

 (defn score-game [game]
   (-> game


metabadge link

metabadge link

--- src/cljs/salava/badge/ui/modal.cljs
+++ src/cljs/salava/badge/ui/modal.cljs
@@ -142,7 +142,10 @@
         (if (session/get :user)
           [badge-message-link message_count  badge_id])])
      ;endorsements
-     [:div.row (badge-endorsement-modal-link badge_id endorsement_count)]]))
+     [:div.row (badge-endorsement-modal-link badge_id endorsement_count)]
+     ;metabadges
+     [:div.row [metabadge (:assertion_url @state)]]
+     ]))

 (defn badge-content [state]
   (let [{:keys [id badge_id  owner? visibility show_evidence rating issuer_image issued_on expires_on revoked issuer_content_id issuer_content_name issuer_content_url issuer_contact issuer_description first_name last_name description criteria_url criteria_content user-logged-in? congratulated? congratulations view_count evidence_url issued_by_obf verified_by_obf obf_url recipient_count assertion creator_content_id creator_name creator_image creator_url creator_email creator_description  qr_code owner message_count issuer-endorsements content endorsement_count endorsements]} @state
@@ -165,7 +168,7 @@
           [:div.expired [:label (str (t :badge/Expiredon) ":")] (date-from-unix-time (* 1000 expires_on))])
         [:h1.uppercase-header name]
         ;[metabadge-block (:assertion_url @state)]
-        [metabadge (:assertion_url @state)]
+        ;[metabadge (:assertion_url @state)]
         (if (< 1 (count (:content @state)))
           [:div.inline [:label (t :core/Languages)": "](content-language-selector selected-language (:content @state))])
         (issuer-modal-link issuer_content_id issuer_content_name)


Fixed a type-o and it compiles and passes tests

--- src/clojure/funcatron/tron/core.clj
+++ src/clojure/funcatron/tron/core.clj
@@ -32,7 +32,7 @@
       (-> opts :options :devmode)
       (shimmy/start-dev-server)

-      (-> opts :options :)
+      ; (-> opts :options :)
       )
     ))


--- src/spec_tools/json_schema.cljc
+++ src/spec_tools/json_schema.cljc
@@ -269,7 +269,7 @@
                                (assoc acc (keyword (name k)) v)
                                acc))
                            {}
-                           spec)
+                           (into {} spec))
         extra-info (-> spec
                        (select-keys [:name :description])
                        (set/rename-keys {:name :title}))]


CMR-3461 Make tagging association errors more user friendly

--- search-app/src/cmr/search/services/tagging_service.clj
+++ search-app/src/cmr/search/services/tagging_service.clj
@@ -226,14 +226,28 @@
         {:keys [tag-key originator-id]} existing-tag
         mdb-context (assoc context :system
                            (get-in context [:system :embedded-systems :metadata-db]))
-        [t1 result] (util/time-execution (util/fast-map
-                                           (fn [association]
-                                             (update-tag-association
-                                                mdb-context (merge association {:tag-key tag-key
-                                                                                :originator-id originator-id}) operation))
-                                           tag-associations))]
-     (debug "update-tag-associations:" t1)
-     result))
+        failed-concepts (atom nil)
+        [t1 result] (util/time-execution
+                     (doall (pmap (fn [association]
+                                    (try
+                                      (update-tag-association
+                                       mdb-context (merge association {:tag-key tag-key
+                                                                       :originator-id originator-id}) operation)
+                                      (catch Exception e
+                                        (swap! failed-concepts conj {:exception e
+                                                                     :concept-id (:concept-id association)})
+                                        nil)))
+                                  tag-associations)))]
+    (debug "update-tag-associations:" t1)
+    (if @failed-concepts
+      (let [messages (map #(format "Failed to %s collection [%s] with tag [%s]"
+                                   (if (= operation :insert) "associate" "dissociate")
+                                   (:concept-id %) (:concept-id tag-concept))
+                          @failed-concepts)]
+        (if (= (count @failed-concepts) (count tag-associations)) ; total failure
+          (errors/throw-service-errors (:type (ex-data (-> @failed-concepts first :exception))) messages)
+          (remove nil? (merge result {:errors messages})))) ; partial failure - 200 status code + list of results and errors
+      result)))

 (defn- update-tag-associations-with-query
   "Based on the input operation type (:insert or :delete), insert or delete tag associations


[#3092] Adapt tests

[#3092] Adapt tests

--- backend/test/akvo/lumen/lib/transformation/derive_test.clj
+++ backend/test/akvo/lumen/lib/transformation/derive_test.clj
@@ -183,6 +183,14 @@
                    "direction" nil
                    "columnName" "c2"}])]
     (is (= nil (derive/columns-groups columns)))
-    (is (= {"Transformations" [:d1]} (derive/columns-groups (update-in columns [0] (fn [c] (assoc c :columnName "d1"))))))
-    (is (= {"Metadata" [:identifier]} (derive/columns-groups (update-in columns [0] (fn [c] (assoc c :columnName "identifier"))))))
-    (is (= {"My Group" [:c1]} (derive/columns-groups (update-in columns [0] (fn [c] (assoc c :groupName "My Group"))))))))
+    (is (= {"transformations" [:d1]
+            "Transformations" [:d1]
+            "Main" [:c2]
+            "main" [:c2]} (derive/columns-groups (update-in columns [0] (fn [c] (assoc c :columnName "d1"))))))
+    (is (= {"metadata" [:identifier]
+            "Metadata" [:identifier]
+            "Main" [:identifier :c2]
+            "main" [:identifier :c2]} (derive/columns-groups (update-in columns [0] (fn [c] (assoc c :columnName "identifier"))))))
+    (is (= {"My Group" [:c1]
+            "Main" [:c2]
+            "main" [:c2]} (derive/columns-groups (update-in columns [0] (fn [c] (assoc c :groupName "My Group"))))))))


CMR-6161 autocomplete index definition

CMR-6161 autocomplete index definition

--- indexer-app/src/cmr/indexer/data/index_set.clj
+++ indexer-app/src/cmr/indexer/data/index_set.clj
@@ -48,6 +48,10 @@
   "Number of shards to use for the services index."
   {:default 5 :type Long})

+(defconfig elastic-autocomplete-index-num-shards
+  "Number of shards to use for the autocomplete index"
+  {:default 5 :type Long})
+
 (defconfig collections-index-alias
   "The alias to use for the collections index."
   {:default "collection_search_alias" :type String})
@@ -81,10 +85,27 @@
                         :number_of_replicas 1,
                         :refresh_interval "1s"}})

+(def autocomplete-settings {:index
+                            {:number_of_shards (elastic-autocomplete-index-num-shards)
+                             :number_of_replicas 1
+                             :refresh_interval "1s"}
+                           :analysis
+                            {:filter
+                             {:autocomplete_filter
+                              {:type "edge_ngram"
+                               :min_gram 1
+                               :max_gram 8}}
+                             :analyzer
+                             {:autocomplete_analyzer
+                              {:type "custom"
+                               :tokenizer "standard"
+                               :filter ["lowercase" "autocomplete_filter"]}}}})
+
 (def service-setting {:index
                        {:number_of_shards (elastic-service-index-num-shards)
                         :number_of_replicas 1,
                         :refresh_interval "1s"}})
+

 (defnestedmapping attributes-field-mapping
   "Defines mappings for attributes."
@@ -666,6 +687,14 @@
    :tag-key.lowercase (-> m/string-field-mapping m/stored m/doc-values)
    :description (m/not-indexed (m/stored m/string-field-mapping))
    :originator-id.lowercase (m/stored m/string-field-mapping)})
+
+(defmapping autocomplete-mapping :autocomplete
+  "Defines the elasticsearch mapping for storing autocomplete suggestions.
+   These are the fields that will be stored in an Elasticsearch document."
+  {:_id  {:path "concept-id"}}
+  {:concept-id (-> m/string-field-mapping m/stored m/doc-values)
+   :type (-> m/string-field-mapping m/string-field-mapping)
+   :value {:type "string" :analyzer "autocomplete_analyzer"}})

 (defmapping variable-mapping :variable
   "Defines the elasticsearch mapping for storing variables. These are the
@@ -775,6 +804,10 @@
                            {:name "all-variable-revisions"
                             :settings variable-setting}]
                           :mapping variable-mapping}
+               :autocomplete {:indexes
+                              [{:name "autocomplete"
+                                :settings autocomplete-settings}]
+                              :mapping autocomplete-mapping}
                :service {:indexes
                          [{:name "services"
                            :settings service-setting}


added obomi namespace

added obomi namespace

--- kabob-core/src/main/clojure/edu/ucdenver/ccp/kabob/namespace.clj
+++ kabob-core/src/main/clojure/edu/ucdenver/ccp/kabob/namespace.clj
@@ -6,24 +6,24 @@
      '(;;standard namespaces
        ("rdf" "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
        ("rdfs" "http://www.w3.org/2000/01/rdf-schema#")
-       ("owl" "http://www.w3.org/2002/07/owl#")
+       ("owl" "http://www.w3.org/2002/07/owl#")
        ("xsd" "http://www.w3.org/2001/XMLSchema#")

        ;;testing
        ("ex" "http://www.example.com/")
-
+
        ;;a few bonus namespaces
        ("skos" "http://www.w3.org/2004/02/skos/core#")
-       ("vcard" "http://www.w3.org/2001/vcard-rdf/3.0#")
-       ("rss" "http://purl.org/rss/1.0/")
+       ("vcard" "http://www.w3.org/2001/vcard-rdf/3.0#")
+       ("rss" "http://purl.org/rss/1.0/")
        ("daml" "http://www.daml.org/2001/03/daml+oil#")
        ("dc" "http://purl.org/dc/elements/1.1/")
        ("dcterms" "http://purl.org/dc/terms/")
        ("oboInOwl" "http://www.geneontology.org/formats/oboInOwl#")
-
+
        ("ja" "http://jena.hpl.hp.com/2005/11/Assembler#")

-
+
        ("obo" "http://purl.obolibrary.org/obo/")

@@ -31,20 +31,20 @@
        ("kiao" "http://kabob.ucdenver.edu/iao/")
        ("kabob" "http://kabob.ucdenver.edu/")
        ("kbio" "http://kabob.ucdenver.edu/bio/")
-
+
        ;;in domain
        ("bfo" "http://www.ifomis.org/bfo/1.1#")
        ("iaobfo" "http://kabob.ucdenver.edu/iao/bfo/")
-
+
        ;;("bto" "http://purl.org/obo/owl/BTO#")
        ("iaobto" "http://kabob.ucdenver.edu/iao/bto/")
-
+
        ;;("chebi" "http://purl.org/obo/owl/CHEBI#")
        ("iaochebi" "http://kabob.ucdenver.edu/iao/chebi/")
-
+
        ;;("cl" "http://purl.org/obo/owl/CL#")
        ("iaocl" "http://kabob.ucdenver.edu/iao/cl/")
-
+
        ("dip" "http://dip.doe-mbi.ucla.edu/dip/")
        ("iaodip" "http://kabob.ucdenver.edu/iao/dip/")

@@ -53,96 +53,97 @@

        ("ecocyc" "http://ecocyc.org/")
        ("iaoecocyc" "http://kabob.ucdenver.edu/iao/ecocyc/")
-
+
        ("eg" "http://www.ncbi.nlm.nih.gov/gene/")
        ("iaoeg" "http://kabob.ucdenver.edu/iao/eg/")
-
+
        ("embl" "http://www.ebi.ac.uk/embl/")
        ("iaoembl" "http://kabob.ucdenver.edu/iao/embl/")
-
+
        ("gad" "http://geneticassociationdb.nih.gov/")
        ("iaogad" "http://kabob.ucdenver.edu/iao/gad/")
-
+
        ("gensat" "http://gensat.org/")
        ("iaogensat" "http://kabob.ucdenver.edu/iao/gensat/")
-
+
        ;;("go" "http://purl.org/obo/owl/GO#")
        ("iaogo" "http://kabob.ucdenver.edu/iao/go/")
-
+
        ("goa" "http://www.ei.ac.uk/GOA/")
        ("iaogoa" "http://kabob.ucdenver.edu/iao/goa/")
-
+
        ("hgnc" "http://www.genenames.org/hgnc/")
        ("iaohgnc" "http://kabob.ucdenver.edu/iao/hgnc/")
-
+
        ("homologene" "http://www.ncbi.nlm.nih.gov/homologene/")
        ("iaohomologene" "http://kabob.ucdenver.edu/iao/homologene/")
-
+
        ("hprd" "http://www.hprd.org/")
        ("iaohprd" "http://kabob.ucdenver.edu/iao/hprd/")
-
+
        ("interpro" "http://www.ebi.ac.uk/interpro/")
        ("iaointerpro" "http://kabob.ucdenver.edu/iao/interpro/")
-
+
        ("irefweb" "http://wodaklab.org/iRefWeb/")
        ("iaoirefweb" "http://kabob.ucdenver.edu/iao/irefweb/")
-
+
        ("kegg" "http://www.genome.jp/kegg/")
        ("iaokegg" "http://kabob.ucdenver.edu/iao/kegg/")
-
+
+       ("obomi" "http://purl.obolibrary.org/obo/mi#")
        ;;("mi" "http://purl.org/obo/owl/MI#")
        ("iaomi" "http://kabob.ucdenver.edu/iao/mi/")
-
+
        ("mgi" "http://www.informatics.jax.org/")
        ("iaomgi" "http://kabob.ucdenver.edu/iao/mgi/")
-
+
        ;;("mod" "http://purl.org/obo/owl/MOD#")
        ("iaomod" "http://kabob.ucdenver.edu/iao/mod/")
-
+
        ;;("mpheno" "http://purl.org/obo/owl/MP#")
        ("iaompheno" "http://kabob.ucdenver.edu/iao/mpheno/")
-
+
        ;;("ncbitaxon" "http://purl.org/obo/owl/NCBITaxon#")
        ("iaoncbitaxon" "http://kabob.ucdenver.edu/iao/ncbitaxon/")
-
+
        ("omim" "http://www.ncbi.nlm.nih.gov/omim/")
        ("iaoomim" "http://kabob.ucdenver.edu/iao/omim/")
-
-       ("pharmgkb" "http://www.pharmgkb.org/")
+
+       ("pharmgkb" "http://www.pharmgkb.org/")
        ("iaopharmgkb" "http://kabob.ucdenver.edu/iao/pharmgkb/")
-
+
        ("premod" "http://genomequebec.mcgill.ca/PReMod/")
        ("iaopremod" "http://kabob.ucdenver.edu/iao/premod/")
-
+
        ("iaopw" "http://kabob.ucdenver.edu/iao/pw/")
-
+
        ;;("pr" "http://purl.obolibrary.org/obo/")
        ("iaopr" "http://kabob.ucdenver.edu/iao/pr/")
-
+
        ("reactome" "http://www.reactome.org/")
        ("iaoreactome" "http://kabob.ucdenver.edu/iao/reactome/")
-
+
        ("refseq" "http://www.ncbi.nlm.nih.gov/refseq/")
        ("iaorefseq" "http://kabob.ucdenver.edu/iao/refseq/")

        ;;("rgd" "http://rgd/")
        ("iaorgd" "http://kabob.ucdenver.edu/iao/rgd/")
-
+
        ;;("ro" "http://www.obofoundry.org/ro/ro.owl#")
        ("iaoro" "http://kabob.ucdenver.edu/iao/ro/")
        ;;("kro" "http://kabob.ucdenver.edu/iao/ro/")
        ("kro" "http://kabob.ucdenver.edu/ro/")
-
+
        ;;("so" "http://purl.org/obo/owl/SO#")
        ("iaoso" "http://kabob.ucdenver.edu/iao/so/")
        ("kso" "http://kabob.ucdenver.edu/so/")
-
+
        ("transfac" "http://www.gene-regulation.com/transfac/")
        ("iaotransfac" "http://kabob.ucdenver.edu/iao/transfac/")
-
+
        ("uniprot" "http://purl.uniprot.org/uniprot/")
        ("iaouniprot" "http://kabob.ucdenver.edu/iao/uniprot/")
-
+
        ("iaouberon" "http://kabob.ucdenver.edu/iao/uberon/")

        ("iaohan" "http://kabob.ucdenver.edu/iao/hanalyzer/")


[#7369] Can send tokens in Aragon Dapp in Finance section

Signed-off-by: Igor Mandrigin <042dc4512fa3d391c5170cf3aa61e6a638f84342@mandrigin.ru>

--- src/status_im/ui/screens/wallet/send/events.cljs
+++ src/status_im/ui/screens/wallet/send/events.cljs
@@ -132,7 +132,7 @@
          {:keys [payload message-id] :as queued-transaction} (last transactions-queue)
          {:keys [method params id]} payload
          db' (update-in db [:wallet :transactions-queue] drop-last)]
-     (when (and (not (:id send-transaction)) queued-transaction)
+     (when (and (not (= :wallet-transaction-sent (:view-id db))) (not (:id send-transaction)) queued-transaction)
        (cond

          ;;SEND TRANSACTION


Add tests for byte buf conversion fns

Add tests for byte buf conversion fns

--- test/caesium/byte_bufs_test.clj
+++ test/caesium/byte_bufs_test.clj
@@ -3,6 +3,7 @@
             [clojure.test :refer [deftest is]]
             [clojure.test.check.clojure-test :refer [defspec]]
             [clojure.test.check.generators :as gen]
+            [com.gfredericks.test.chuck.clojure-test :refer [for-all]]
             [com.gfredericks.test.chuck.properties :as prop'])
   (:import (java.nio ByteBuffer)))

@@ -11,6 +12,32 @@
    (fn [n] (ByteBuffer/allocate n))
    (fn [n] (ByteBuffer/allocateDirect n))
    (fn [n] (ByteBuffer/wrap (byte-array n)))])
+
+(defspec ->indirect-byte-buf-spec
+  1000
+  (for-all
+   [n gen/pos-int
+    g (gen/elements ways-of-getting-a-buf-of-len-n)
+    :let [src (g n)
+          buf (bb/->indirect-byte-buf src)]]
+   (is (= n (bb/buflen src) (bb/buflen buf)))
+   (is (instance? ByteBuffer buf))
+   (when-not (instance? ByteBuffer src)
+     ;; when the input is a byte buffer, don't convert
+     (is (not (.isDirect buf))))))
+
+(defspec ->direct-byte-buf-spec
+  1000
+  (for-all
+   [n gen/pos-int
+    g (gen/elements ways-of-getting-a-buf-of-len-n)
+    :let [src (g n)
+          buf (bb/->direct-byte-buf src)]]
+   (is (= n (bb/buflen src) (bb/buflen buf)))
+   (is (instance? ByteBuffer buf))
+   (when-not (instance? ByteBuffer src)
+     ;; when the input is a byte buffer, don't convert
+     (is (.isDirect buf)))))

 (defspec buflen-spec
   1000


testing bridged

testing bridged

--- test/celestial/test/proxmox.clj
+++ test/celestial/test/proxmox.clj
@@ -1,5 +1,7 @@
 (ns celestial.test.proxmox
-  (:require proxmox.provider)
+  (:require
+    [celestial.fixtures :as fix :refer [redis-prox-spec with-conf with-m?]]
+    proxmox.provider)
   (:use
     midje.sweet
     [proxmox.provider :only (vzctl enable-features)]
@@ -9,7 +11,7 @@
     [celestial.model :only (vconstruct)]
     [proxmox.generators :only (ct-id)]
     [proxmox.auth :only (fetch-headers auth-headers auth-store auth-expired?)]
-    [celestial.fixtures :only (redis-prox-spec with-conf with-m?)])
+    )
   (:import clojure.lang.ExceptionInfo))

 (with-conf
@@ -18,7 +20,7 @@
       (fact "missing vmid"
             (vconstruct (assoc-in redis-prox-spec [:proxmox :vmid] nil)) =>
             (throws ExceptionInfo (with-m? {:machine {:vmid '("vmid must be present")}} ))))
-    (fact "non int vmid"
+      (fact "non int vmid"
           (vconstruct (assoc-in redis-prox-spec [:proxmox :vmid] "string")) =>
           (throws ExceptionInfo (with-m? {:machine {:vmid '("vmid must be a number")}})))
     (with-redefs [ct-id (fn [_] 101)]
@@ -26,7 +28,11 @@
         (fact "vzctl usage"
               (enable-features ct) => '()
               (provided
-                (vzctl ct "set 101 --features \"nfs:on\" --save") => nil :times 1))))))
+                (vzctl ct "set 101 --features \"nfs:on\" --save") => nil :times 1))
+        (fact "bridged constructions"
+          (vconstruct fix/redis-bridged-prox-spec) =>
+              (contains {:network {:gateway "192.168.5.255" :netmask "255.255.255.0"}}))
+        ))))

 (with-conf
   (let [headers {"Cookie" "PVEAuthCookie=" "CSRFPreventionToken" "foobar"}]


using vconstruct

using vconstruct

--- test/celestial/test/proxmox.clj
+++ test/celestial/test/proxmox.clj
@@ -3,7 +3,7 @@
     [proxmox.remote :only (prox-get)]
     [proxmox.provider :only (vzctl enable-features ->Container)]
     [celestial.common :only (config)]
-    [celestial.model :only (create-vm)]
+    [celestial.model :only (vconstruct)]
     [celestial.fixtures :only (spec local-prox)]
     expectations.scenarios)
   (:import
@@ -12,15 +12,15 @@
 (let [{:keys [machine proxmox]} spec]
   (scenario
     (expect java.lang.AssertionError
-       (create-vm (assoc-in spec [:proxmox :vmid] nil)))
+       (vconstruct (assoc-in spec [:proxmox :vmid] nil)))
     (expect java.lang.AssertionError
-       (create-vm (assoc-in spec [:proxmox :vmid] "string") ))
+       (vconstruct (assoc-in spec [:proxmox :vmid] "string") ))
     ))

 (with-redefs [config local-prox]
   (def ct
-    (create-vm (assoc-in spec [:proxmox :features] ["nfs:on"]))))
+    (vconstruct (assoc-in spec [:proxmox :features] ["nfs:on"]))))

 (scenario
   (enable-features ct)


Format code

Format code

--- test/cljc/reitit/ring_test.cljc
+++ test/cljc/reitit/ring_test.cljc
@@ -247,8 +247,8 @@
                                  :post (constantly ok)}]]]
     (testing "using :method :add"
       (let [app (ring/ring-handler
-                 (ring/router routes)
-                 (ring/redirect-trailing-slash-handler {:method :add}))]
+                  (ring/router routes)
+                  (ring/redirect-trailing-slash-handler {:method :add}))]

         (testing "exact matches work"
           (is (= ok (app {:request-method :get, :uri "/slash-less"})))


STORM-232 ship JNI dependencies with the storm jar

--- storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -438,12 +438,19 @@
       (FileUtils/moveDirectory (File. tmproot) (File. stormroot))
       ))

+(defn jlp [stormroot conf]
+  (let [resource-root (str stormroot "/" RESOURCES-SUBDIR)
+        os (clojure.string/replace (System/getProperty "os.name") #"\s+" "_")
+        arch (System/getProperty "os.arch")
+        arch-resource-root (str resource-root "/" os "-" arch)]
+    (str arch-resource-root ":" resource-root ":" (conf JAVA-LIBRARY-PATH))))

 (defmethod launch-worker
     :distributed [supervisor storm-id port worker-id]
     (let [conf (:conf supervisor)
           storm-home (System/getProperty "storm.home")
           stormroot (supervisor-stormdist-root conf storm-id)
+          jlp (jlp stormroot conf)
           stormjar (supervisor-stormjar-path stormroot)
           storm-conf (read-supervisor-storm-conf conf storm-id)
           classpath (add-to-classpath (current-classpath) [stormjar])
@@ -452,7 +459,7 @@
                                  (str port))
           logfilename (str "worker-" port ".log")
           command (str "java -server " childopts
-                       " -Djava.library.path=" (conf JAVA-LIBRARY-PATH)
+                       " -Djava.library.path=" jlp
                        " -Dlogfile.name=" logfilename
                        " -Dstorm.home=" storm-home
                        " -Dlogback.configurationFile=" storm-home "/logback/cluster.xml"
@@ -463,7 +470,7 @@
                        (java.net.URLEncoder/encode storm-id) " " (:assignment-id supervisor)
                        " " port " " worker-id)]
       (log-message "Launching worker with command: " command)
-      (launch-process command :environment {"LD_LIBRARY_PATH" (conf JAVA-LIBRARY-PATH)})
+      (launch-process command :environment {"LD_LIBRARY_PATH" jlp})
       ))

 ;; local implementation


Minor

Minor

--- storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -668,7 +668,7 @@
                                   (if (is-absolute-path? storm-log-conf-dir)
                                     storm-log-conf-dir
                                     (str storm-home file-path-separator storm-log-conf-dir))
-                                  (str storm-home file-path-separator "log4j"))
+                                  (str storm-home file-path-separator "log4j2"))
           stormroot (supervisor-stormdist-root conf storm-id)
           jlp (jlp stormroot conf)
           stormjar (supervisor-stormjar-path stormroot)


fix: connectivity banner height

fix: connectivity banner height

Fixes #9803 --the height of the banner was cutting off banner messages spanning multiple lines

Due to the animation of the view surrounding the banner text, calculate the banner height, then re-render the banner with the updated height.

Render a view that wraps not only the message banner itself, but also a hidden (0-opacity and absolutely positioned) view with the banner text that calculates the height of the banner during the `on-layout` event. The banner height calculation causes the reagent atom value change to re-render the banner view with the udpated height.

1. There is an animation on the message banner. The "out" animation (ie when the banner is in the process of disappearing) seems to work correctly. However, there did not seem to be an "in" animation. I'm fairly confident these changes did not break any existing animations, however it's worth noting this so that others who are more familiar with the existing codebase may be in a better place to say otherwise.
2. Testing during changes was done by dispatching the `network-info-changed` event like so:
```
(re-frame/dispatch [::network-info-changed {:isConnected false}])
```

Co-authored-by: Pascal Precht <de9b8d32d21ac4abee992cab0591365746b5103f@status.im>
Co-authored-by: Eric Dvorsak <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@status.im>
Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ui/components/connectivity/view.cljs
+++ src/status_im/ui/components/connectivity/view.cljs
@@ -12,9 +12,6 @@
             [taoensso.timbre :as log])
   (:require-macros
    [status-im.utils.views :as views :refer [defview letsubs]]))
-
-(def connectivity-bar-height 36)
-(def neg-connectivity-bar-height (- connectivity-bar-height))

 ;; ui-connectivity-status delays
 (def standard-delay 1000)
@@ -81,65 +78,66 @@

 (defn manage-visibility
   "status-hidden is a per-view state, while to-hide? is a global state common to
-  all connectivity views (we have at least one view in home and one in chat)"
-  [connected? animate? anim-opacity anim-y status-hidden]
-
-  (if connected?
-    (if animate?
-      (when (and @to-hide? (not @status-hidden))
-        (animation/start
-         (animation/parallel
-          [(animation/timing anim-opacity
-                             {:toValue         0
-                              :delay           800
-                              :duration        150
-                              :easing          (.-ease ^js animation/easing)
-                              :useNativeDriver true})
-           (animation/timing anim-y
-                             {:toValue         (if platform/desktop? 0 neg-connectivity-bar-height)
-                              :delay           800
-                              :duration        150
-                              :easing          (.-ease ^js animation/easing)
-                              :useNativeDriver true})])
-          ;; second param of start() - a callback that fires when animation stops
-         #(do (reset! to-hide? false) (reset! status-hidden true))))
-      (do
-        (animation/set-value anim-opacity 0)
-        (animation/set-value anim-y (if platform/desktop? 0 neg-connectivity-bar-height))
-        (reset! to-hide? false)
-        (reset! status-hidden true)))
-    ;; else
-    (if animate?
-      (when (and (not @to-hide?) @status-hidden)
-        (animation/start
-         (animation/parallel
-          [(animation/timing anim-opacity
-                             {:toValue         1
-                              :duration        150
-                              :easing          (.-ease ^js animation/easing)
-                              :useNativeDriver true})
-           (animation/timing anim-y
-                             {:toValue         (if platform/desktop? connectivity-bar-height 0)
-                              :duration        150
-                              :easing          (.-ease ^js animation/easing)
-                              :useNativeDriver true})])
-          ;; second param of start() - a callback that fires when animation stops
-         #(do (reset! to-hide? true) (reset! status-hidden false))))
-      (do
-        (animation/set-value anim-opacity 1)
-        (animation/set-value anim-y (if platform/desktop? connectivity-bar-height 0))
-        (reset! to-hide? true)
-        (reset! status-hidden false)))))
+all connectivity views (we have at least one view in home and one in chat)"
+  [connected? animate? anim-opacity anim-y status-hidden connectivity-bar-height]
+  (let [neg-connectivity-bar-height (- @connectivity-bar-height)]
+    (if connected?
+      (if animate?
+        (when (and @to-hide? (not @status-hidden))
+          (animation/start
+           (animation/parallel
+            [(animation/timing anim-opacity
+                               {:toValue         0
+                                :delay           800
+                                :duration        150
+                                :easing          (.-ease ^js animation/easing)
+                                :useNativeDriver true})
+             (animation/timing anim-y
+                               {:toValue         (if platform/desktop? 0 neg-connectivity-bar-height)
+                                :delay           800
+                                :duration        150
+                                :easing          (.-ease ^js animation/easing)
+                                :useNativeDriver true})])
+            ;; second param of start() - a callback that fires when animation stops
+           #(do (reset! to-hide? false) (reset! status-hidden true))))
+        (do
+          (animation/set-value anim-opacity 0)
+          (animation/set-value anim-y (if platform/desktop? 0 neg-connectivity-bar-height))
+          (reset! to-hide? false)
+          (reset! status-hidden true)))
+      ;; else
+      (if animate?
+        (when (and (not @to-hide?) @status-hidden)
+          (animation/start
+           (animation/parallel
+            [(animation/timing anim-opacity
+                               {:toValue         1
+                                :duration        150
+                                :easing          (.-ease ^js animation/easing)
+                                :useNativeDriver true})
+             (animation/timing anim-y
+                               {:toValue         (if platform/desktop? connectivity-bar-height 0)
+                                :duration        150
+                                :easing          (.-ease ^js animation/easing)
+                                :useNativeDriver true})])
+            ;; second param of start() - a callback that fires when animation stops
+           #(do (reset! to-hide? true) (reset! status-hidden false))))
+        (do
+          (animation/set-value anim-opacity 1)
+          (animation/set-value anim-y (if platform/desktop? connectivity-bar-height 0))
+          (reset! to-hide? true)
+          (reset! status-hidden false))))))

 (defn connectivity-status
-  [{:keys [connected?]} status-hidden]
-  (let [anim-translate-y (animation/create-value neg-connectivity-bar-height)
-        anim-opacity     (animation/create-value 0)]
+  [{:keys [connected?]} status-hidden height]
+  (let [neg-connectivity-bar-height (- @height)
+        anim-translate-y            (animation/create-value neg-connectivity-bar-height)
+        anim-opacity                (animation/create-value 0)]
     (reagent/create-class
      {:component-did-mount
       (fn []
         (manage-visibility connected? false
-                           anim-opacity anim-translate-y status-hidden))
+                           anim-opacity anim-translate-y status-hidden height))
       :should-component-update
       ;; ignore :loading-indicator?
       (fn [_ [_ old_p] [_ new_p]]
@@ -148,13 +146,13 @@
       :component-did-update
       (fn [comp]
         (manage-visibility (:connected? (reagent/props comp)) true
-                           anim-opacity anim-translate-y status-hidden))
+                           anim-opacity anim-translate-y status-hidden height))
       :reagent-render
       (fn [{:keys [message on-press-event connected? connecting?] :as opts}]
         (when-not @status-hidden
           [react/animated-view {:style               (styles/text-wrapper
                                                       (assoc opts
-                                                             :height connectivity-bar-height
+                                                             :height @height
                                                              :background-color (if connected?
                                                                                colors/green
                                                                                colors/gray)
@@ -173,6 +171,20 @@
                [react/text {:style    styles/text
                             :on-press (when on-press-event #(re-frame/dispatch [on-press-event]))}
                 (i18n/label message)]))]))})))
+
+(defn connectivity-status-comp
+  [_ _]
+  (let [height (reagent/atom 36)]
+    (fn [props status-hidden]
+      [react/view {}
+       (when-not @status-hidden
+         [react/text {:style     (merge styles/text {:position :absolute
+                                                     :opacity  0})
+                      :on-layout (fn [e]
+                                   (let [h (-> e .-nativeEvent .-layout .-height)]
+                                     (reset! height (+ h (* (:top styles/text) 2)))))}
+          (i18n/label (:message props))])
+       [connectivity-status props status-hidden height]])))

 ;; timer updating the enqueued status
 (def timer (atom nil))
@@ -243,7 +255,7 @@
         [react/view
          (when (and loading-indicator? @status-hidden)
            [loading-indicator @window-width])]]
-       [connectivity-status
+       [connectivity-status-comp
         (merge (or ui-status-properties
                    {:connected? true :message :t/connected})
                {:window-width @window-width})


WIP - Bots pour le contest CG "Mean Max" - LW2

--- clojure/codingame/competition/mean-max/src/mean_max/core.clj
+++ clojure/codingame/competition/mean-max/src/mean_max/core.clj
@@ -29,11 +29,16 @@
   "Test whether 'my-unit' is 'in' the 'other-unit'"
   (< (distance (:x my-unit) (:y my-unit) (:x other-unit) (:y other-unit)) (:radius other-unit)))

+(defn near [my-unit other-unit]
+  "Test whether 'my-unit' is 'near' an 'other-unit'"
+  (< (distance (:x my-unit) (:y my-unit) (:x other-unit) (:y other-unit)) (+ (:radius other-unit) (:radius my-unit))))
+
 (defn compute-reaper-action [my-reaper next-wreck]
   (cond
     (nil? next-wreck) "WAIT"
     (in my-reaper next-wreck) "WAIT"
-    true (str (:x next-wreck) " " (:y next-wreck) " 200")))
+    (near my-reaper next-wreck) (str (:x next-wreck) " " (:y next-wreck) " 150")
+    true (str (:x next-wreck) " " (:y next-wreck) " 300")))

 (defn compute-destroyer-action [my-destroyer next-tanker]
   (cond


Unify start and wake appliers in the controller manager

--- src/keechma/controller_manager.cljs
+++ src/keechma/controller_manager.cljs
@@ -50,10 +50,10 @@
           (recur (rest stop) new-app-db))
         app-db))))

-(defn apply-start-controllers [app-db reporter controllers commands-chan get-running start]
-  (loop [start start
+(defn apply-start-or-wake-controllers [action app-db reporter controllers commands-chan get-running start-or-wake]
+  (loop [start-or-wake start-or-wake
          app-db app-db]
-      (if-let [s (first start)]
+      (if-let [s (first start-or-wake)]
         (let [[topic params] s
               controller (assoc (get controllers topic)
                                 :in-chan (chan)
@@ -63,30 +63,14 @@
                                 :name topic
                                 :reporter reporter
                                 :running (partial get-running topic))
-              new-app-db (-> (controller/start controller params app-db)
+              new-app-db (-> (action controller params app-db)
                              (assoc-in [:internal :running-controllers topic] controller))]
-          (reporter :app :out :controller [topic :start] params :info)
-          (recur (rest start) new-app-db))
+          (reporter :app :out :controller [topic :start-or-wake] params :info)
+          (recur (rest start-or-wake) new-app-db))
         app-db)))

-(defn apply-wake-controllers [app-db reporter controllers commands-chan get-running wake]
-  (loop [wake wake
-         app-db app-db]
-      (if-let [s (first wake)]
-        (let [[topic params] s
-              controller (assoc (get controllers topic)
-                                :in-chan (chan)
-                                :out-chan commands-chan
-                                :params params
-                                :route-params (:route app-db)
-                                :name topic
-                                :reporter reporter
-                                :running (partial get-running topic))
-              new-app-db (-> (controller/wake controller params app-db)
-                             (assoc-in [:internal :running-controllers topic] controller))]
-          (reporter :app :out :controller [topic :wake] params :info)
-          (recur (rest wake) new-app-db))
-        app-db)))
+(def apply-start-controllers (partial apply-start-or-wake-controllers controller/start))
+(def apply-wake-controllers (partial apply-start-or-wake-controllers controller/wake))

 (defn call-handler-on-started-controllers [app-db-atom reporter start]
   (doseq [[topic _] start]


Fixing type-o.

Fixing type-o.

--- src/kilo/data/resource_accessor.clj
+++ src/kilo/data/resource_accessor.clj
@@ -9,7 +9,8 @@
    :user         entities/user
    :group        entities/group
    :group-member entities/group_member
-   ;;:notification entities/notification})
+   ;;:notification entities/notification
+   })

 (defn get-data
   [entity id]
@@ -22,4 +23,4 @@
         fields (assoc fields :timemodified (quot (System/currentTimeMillis) 1000))]
     (update (entity resource-entities)
               (set-fields fields)
-              (where {:id id})))))
+              (where {:id id}))))


less noisy warning when inspect resource fails

--- src/main/shadow/build/classpath.clj
+++ src/main/shadow/build/classpath.clj
@@ -416,7 +416,13 @@
                               (try
                                 (inspect-resource cp src)
                                 (catch Exception e
-                                  (log/warnf e "failed to inspect resource \"%s\", it will not be available."
+                                  ;; don't warn with stacktrace
+                                  (log/warnf "failed to inspect resource \"%s\", it will not be available."
+                                    (or (:file src)
+                                        (:url src)
+                                        (:resource-name src)))
+                                  ;; debug log should contain stacktrace
+                                  (log/debugf e "failed to inspect resource \"%s\", it will not be available."
                                     (or (:file src)
                                         (:url src)
                                         (:resource-name src)))


Allow nil for chart data values.

Allow nil for chart data values.

--- src/oc/storage/resources/common.clj
+++ src/oc/storage/resources/common.clj
@@ -70,12 +70,12 @@
 (def DataPeriod {
   :period lib-schema/NonBlankStr
   ;; Finances
-  (schema/optional-key :cash) schema/Num
-  (schema/optional-key :costs) schema/Num
-  (schema/optional-key :revenue) schema/Num
+  (schema/optional-key :cash) (schema/maybe schema/Num)
+  (schema/optional-key :costs) (schema/maybe schema/Num)
+  (schema/optional-key :revenue) (schema/maybe schema/Num)
   ;; Growth
   (schema/optional-key :slug) lib-schema/NonBlankStr
-  (schema/optional-key :value) schema/Num})
+  (schema/optional-key :value) (schema/maybe schema/Num)})

 (def Attachment {
   :file-name lib-schema/NonBlankStr


fix inferring orgs based on repos

fix inferring orgs based on repos

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -160,9 +160,12 @@
                                                       (map :login)
                                                       set)
                                        in-orgs? (comp org-names :login)]
-                                   (->> repos (map :owner)
-                                        (remove in-orgs?)
-                                        (set))))))]
+                                   (reduce (fn [accum {:keys [owner vcs_type]}]
+                                             (if (in-orgs? owner)
+                                               accum
+                                               (conj accum (assoc owner :vcs_type vcs_type))))
+                                           []
+                                           repos)))))]
            (when (get-in user [:repos-loading (keyword vcs-type)])
              [:div.orgs-loading
               [:div.loading-spinner common/spinner]])]])))))


passing in the view on the payment-plan to make it more of a reusable component

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -281,7 +281,7 @@
                                        {:org-name (:username (first org-follows)) :repos org-follows :settings settings}))
            (vals follows-by-orgs))]]))

-(defrender payment-plan [selected-org owner]
+(defrender payment-plan [{:keys [selected-org view]} owner]
   (analytics/track-payment-plan-impression {:view view})
   (html
     [:div.payment-plan
@@ -415,4 +415,5 @@
                          (first))]
             (println selected-org)
             (if (or (= selected-org (:login user)) (:show-upsell? org))
-              (om/build payment-plan selected-org)))]]]])))
+              (om/build payment-plan {:selected-org selected-org
+                                      :view view})))]]]])))


Hide OSS message for all Enterprise plans.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -864,7 +864,7 @@
               " for more parallelism and shorter queue times."))])
         (when (pm/freemium? plan)
           [:p (str (pm/freemium-containers plan) " container is free, forever.")])
-        (when-not (config/enterprise?)
+        (when-not (pm/enterprise? plan)
           [:p "Additionally, projects that are public on GitHub will build with " pm/oss-containers " extra containers -- our gift to free and open source software."])]]))))

 (def main-component


Allow non-admin users to see participants profiles in group chat settings (#3934)

Signed-off-by: Goran Jovic <fc686822162e6f379ea05b6f92d78d206147085c@gmail.com>

--- src/status_im/ui/screens/profile/group_chat/views.cljs
+++ src/status_im/ui/screens/profile/group_chat/views.cljs
@@ -79,7 +79,8 @@
      :extend-title        (:name contact)
      :extended?           admin?
      :accessibility-label :member-item
-     :inner-props         {:accessibility-label :member-name-text}}]])
+     :inner-props         {:accessibility-label :member-name-text}
+     :on-press            #(re-frame/dispatch [:show-profile (:whisper-identity contact)])}]])

 (defview chat-group-contacts-view [admin?]
   (letsubs [contacts [:get-current-chat-contacts]]


improved server interaction docs, including network queue clearing

--- src/devguide/untangled_devguide/H_Server_Interactions.cljs
+++ src/devguide/untangled_devguide/H_Server_Interactions.cljs
@@ -172,19 +172,18 @@

   ### Load vs. Load Data vs. Load Field

-  All of these function families are calls to the built-in `untangled/load` mutation behind the scenes, so requests made by these functions
-  go through the same networking layer and have the same customizations through their named parameters (see the doc strings
+  All of these functions are calls to the built-in `untangled/load` mutation behind the scenes, so requests made by these functions
+  go through the same networking layer and have similar named parameters (see the doc strings
   in the [data-fetch namespace](https://github.com/untangled-web/untangled-client/blob/master/src/untangled/client/data_fetch.cljs)).
   The only difference is in how the query is specified. `load` requires a top-level keyword and a component, `load-data`
   must be passed a complete query, and `load-field` uses the passed-in component and a field name to create its query.
+  `load` and `load-data` are subtle variants with the former being more consice, and the latter more generally flexible.

   `load-field` is really just a helper for a common use-case: loading a field of some specific thing on the screen. It
-   focuses the component's query to the specified field, associates the component's ident with the query,
+  focuses the component's query to the specified field, associates the component's ident with the query,
   and asks the UI to re-render all components with the calling component's ident after the load is complete. Since `load-field`
-  requires a component to build the query sent to the server it cannot be used with the reconciler. If you want to load data
-  from your server when the app initially loads, you must use `load-data` with the reconciler passed to the
-  `:started-callback` function when creating a new untangled client application.
-
+  requires a component to build the query sent to the server it cannot be used with the reconciler.
+
   #### Use case - Initial load

   In Untangled, initial load is an explicit step. You simply put calls to `load` or `load-data` in your app start callback.
@@ -204,13 +203,14 @@
                                    :post-mutation 'app/build-views)))
   ```

-  In the above example the client is created (which must be mounted as a separate step). Once mounted the application
-  will call the `:started-callback` which in turn will trigger a load. This helper functions are really a call to
+  In the above example the client is created (which must be mounted as a separate step). Once the application is mounted
+  it will call the `:started-callback` which in turn will trigger a load. These helper functions are really a call to
   om `transact!` that places `ready-to-load` markers in the app state, which in turn triggers the network plumbing. The
-  network plumbing pulls these and processes them via the server and all of the normalization bits of Om (and Untangled).
+  network plumbing pulls these from the app state and processes them via the server and all of the normalization bits of
+  Om (and Untangled).

   The `:without` parameter will elide portions of the query. So for example, if you'd like to lazy load some portion of the
-  collection (e.g. comments on each item) at a later time, you can prevent the server from being asked.
+  collection (e.g. comments on each item) at a later time you can prevent the server from being asked to send them.

   The `:post-mutation` parameter is the name of the mutation you'd like to run on a successful result of the query. If there
   is a failure, then a failure marker will be placed in the app state, which you can have programmed your UI to react to
@@ -227,10 +227,11 @@
   which will load the specific entity (assuming your server responsds with it) into you client database. This could be
   used, for example, to refresh a particular entity in your client database.

-  Giving a post mutation would allow you to further integrate that entity into you views.
-
-  NOTE: the `untangled.core/integrate-ident!` function is particularly handy for peppering the resulting ident
-  around the views in a post mutation.
+  Giving a post mutation as a parameter would allow you to further integrate that entity into you views. Post mutations are
+  run after the query, and allow you to modify the application state as you see fit.
+
+  NOTE: the `untangled.core/integrate-ident!` function is particularly handy for peppering the ident of the resulting item
+  around the views via a post mutation.

   #### Use case - Loading a collection into an entity

@@ -244,12 +245,14 @@
   { :friends { :tab { :people [] }}}
   ```

-  The following load would send the desired query, and rewrite the result into the desired location (while also
+  The following load would send the desired query and rewrite the result into the desired location (while also
   normalizing the incoming People):

   ```
   (df/load app :all-people Person {:target [:friends :tab :people]})
   ```
+
+  resulting in:

   ```
   { :friends { :tab { :people [[:people/by-id 1] [:people/by-id 2]] }}
@@ -266,7 +269,7 @@
   (df/load app :all-people Person {:params {:limit 10} :target [:friends :tab :people]})
   ```

-  would result in `{:limit 10}` being visible in the server query parameters:
+  would result in `{:limit 10}` being visible in the parameters when parsing the server query:

   ```
   ;; assuming your server-side read is a multimethod:
@@ -278,10 +281,12 @@

   One common operation is to load data in response to a user interaction. Interestingly, the query that you might
   have used in the initial load use case might have included UI queries for data you didn't want to fetch yet. So, we want
-  to note that the initial load use-case supports eliding part of the query. For example, you can load an item without,
-  say, comments. Later, when the user wants to see comments you can supply a button that can load the comments on demand.
-
-  This is directly supported by `load-field`, which derives the query to send to the server from the component itself!
+  to note that the initial load use-case supports eliding part of the query. For example, you can for example load an item without
+  comments. Later, when the user wants to see comments you can supply a button that can load the comments on demand. The earlier
+  use case on startup demonstrated this technique.
+
+  The `load-field` function, which derives the query to send to the server from the component itself, can be used to trigger the
+  load of the subsequent data:

   ```
   (load-field this :comments)
@@ -293,6 +298,10 @@
   For example, say you had:

   ```
+  (defui Comment
+     static om/IQuery
+     (query [this] [:author :text]))
+
   (defui Item
      static om/IQuery
      (query [this] [:id :value {:comments (om/get-query Comment)}])
@@ -303,21 +312,16 @@
         ...
         (dom/button #js { :onClick #(df/load-field this :comments) } \"Load comments\")
         ...)
-
-  ;; Note that the call to load field above is the same as:
-      (df/load-data this (om/full-query this [:comments])
-        :ident (om/get-ident this)
-        :refresh [(om/get-ident this)])
   ```

   then clicking the button will result in the following query to the server:

   ```
-  [{[:item/by-id 32] [{:comments [:other :props]]}]
+  [{[:item/by-id 32] [{:comments [:author :text]]}]
   ```

   and the code to write for the server is now trivial. The dispatch key is :item/by-id, the 32 is accessible on the AST,
-  and the query is a pull fragment that will work relative to an item in your (assuming Datomic) database!
+  and the query is a pull fragment that indicates the exact data to pull from your server database.

   Furthermore, the underlying code can easily put a marker in place of that data in the app state so you can show the
   'load in progress' marker of your choice.
@@ -326,9 +330,10 @@

   ### Load vs. Load-Action

-  Both `load-field` and `load-data` will call `om/transact!` under the hood, targeting untangled's built-in `untangled/load`
-  mutation, which is responsible for sending your request to the server. By contrast, `load-field-action` and `load-data-action`,
-  **do not** call `om/transact!`, and are used to initialize a load inside of one of your custom client-side mutations.
+  `load`, `load-field`, and `load-data` will call `om/transact!` under the hood, targeting untangled's built-in `untangled/load`
+  mutation, which is responsible for sending your request to the server. By contrast, `load-action`, `load-field-action`,
+  and `load-data-action` **do not** call `om/transact!`, but can be used to initialize a load inside of one of your own
+  client-side mutations.

   Let's look at an example of a standard load. Say you want to load a list of people from the server:

@@ -362,38 +367,44 @@
   for a running example.

   The action-suffixed load functions are useful when performing an action in the user interface that must *both* modify
-  the client-side database *and* load data from the server. They must be used with `untangled.client.data-fetch/remote-load`,
-  which converts the remote mutation key for your mutation to the `untangled/load` key:
+  the client-side database *and* load data from the server. **NOTE**: You must use the result of the
+  `untangled.client.data-fetch/remote-load` funtion as the value of the `:remote` key in the mutation return value.

   ```
   (require [untangled.client.data-fetch :as df]
            [untangled.client.mutations :refer [mutate]]
-           [app.ui :as ui] ;; namespace with defuis
-           )
-
-  (defmethod mutate 'app/change-view [{:keys [state] as env} _ {:keys [new-view]}]
-    {:remote (df/remote-load env)
+           [app.ui :as ui]) ;; namespace with defuis
+
+  (defmethod mutate 'app/change-view [{:keys [state] :as env} _ {:keys [new-view]}]
+    {:remote (df/remote-load env) ;; (2)
      :action (fn []
                 (let [new-view-query (cond
                                        (= new-view :main) (om/get-query ui/Main)
                                        (= new-view :settings) (om/get-query ui/Settings)]
-                (df/load-data-action state new-view-query)
+                (df/load-data-action state new-view-query) ;; (1)
                 (swap! state update :app/current-view new-view))})
   ```
-  This snippet defines a mutation that (1) modifies the app state to display the view passed in via the mutation parameters,
-  and (2) loads the data for that view. A few important points:
-
-  1. If an action thunk calls an action-suffixed load, then it MUST call `remote-load` for the remote keyword.
-  2. The `remote-load` function *changes* the mutation's dispatch key to `untangled/load` when sending it to the remote.
-  So, a mutation that uses an action-suffixed load cannot have a server-side implementation.
-  3. If you find yourself wanting to put a call to `load-data` or `load-field` in a React Lifecycle method, try reworking
-  the code to use the action-suffixed load instead. To learn more about the dangers of loads and lifecycle methods, see
-  the [reference on loading data]().
+
+  This snippet defines a mutation that modifies the app state to display the view passed in via the mutation parameters
+  and loads the data for that view. A few important points:
+
+  1. If an action thunk calls one or more `action`-suffixed load functions (which do nothing but queue the load
+     request) then it MUST also use a call to `remote-load` for the remote keyword.
+  2. The `remote-load` function *changes* the mutation's dispatch key to `untangled/load` which in turn triggers
+     the networking layer that one or more loads are ready.
+  3. If you find yourself wanting to put a call to any `load-*` in a React Lifecycle method try reworking
+     the code to use your own mutations (which can check if a load is really needed) and the use the action-suffixed
+     loads instead. Lifecycle methods are often misunderstood, leading to incorrect behaviors like triggering loads
+     over and over again. To learn more about the dangers of loads and lifecycle methods, see the [reference
+     on loading data]().

   ### Using the `untangled/load` Mutation Directly

-  The helper functions described above simply trigger a built-in Untangled mutation called `untangled/load`, which you are
-  allowed (and sometimes encouraged) to use directly. The arguments to this mutation include:
+  The helper functions described above simply trigger a built-in Untangled mutation called `untangled/load`
+  (the `*-action` variants do so by modifying the remote mutation AST via the `remote-load` helper function).
+
+  You are allowed (and sometimes encouraged) to use this mutation directly in a call to `transact!`.
+  The arguments to this mutation include:

   - `query`: The specific query you'd like to send to the server
   - `post-mutation`: A symbol indicating a mutation to run after the load completes
@@ -401,18 +412,26 @@
   - `without`: A set of keywords that should be (recursively) removed from `query`
   - `refresh`: A vector of keywords that should cause re-rendering after the load.
   - `parallel`: True or false. If true, bypasses the sequential network queue
-  - `ident`: An ident. Used if you want the query to be morphed into an ident join. Used by
-  `load-field`.
-  - `field`: A keyword. Used if you want to focus the query to a specific single item. Used by
-  `load-field`.
+  - `target`: A key path where the result should be move to when the load is complete.
   - `marker`: True or false. If true, places a loading marker in place of the first top-level key in the query,
     of in place of the given database object if `ident` and `field` are set (e.g. by `load-field`)

   For most direct use-cases you'll probably skip using the `load-field` specific parameters. You can read
   the source of `load-field` if you'd like to simulate it by hand.

-  The most common use for a direct call to the `untangled/load` mutation is obtaining a value from the server
-  after running some mutation that had a (potential) remote effect.
+  For example:
+
+  ```
+  (load-data reconciler [:prop])
+  ```
+
+  is a simple helper that is ultimately identical to:
+
+  ```
+  (om/transact! reconciler '[(untangled/load {:query [:prop]}) :ui/loading-data])
+  ```
+
+  (the follow-on read is to ensure load markers update).

   #### Getting a Remote Value after a Mutation

@@ -439,11 +458,12 @@
       - Non-opaque reasoning
       - No need to write parser logic to figure out if you want to do remote reads
   - The costs are:
-      - The UI is aware of what is remote, and what is local (in stock Om, the UI is completely unconcerned
-        about remoting.)
-
-  In practice, we've found that the idea that something involves a server is pretty clear-cut, so the ability
-  to completely abstract it away really isn't that necessary pragmatically, and the cost of writing
+      - The UI is aware of what is remote, and what is local (in stock Om, the UI *can be* completely unconcerned
+        about remoting, though in practice you want to trigger this kind of thing from the UI an expose it as
+        some kind of mutation.)
+
+  In practice, we've found that the idea that something involves a server is pretty clear-cut even at the UI layer,
+  so the ability to completely abstract it away really isn't that necessary pragmatically, and the cost of writing
   the behind-the-scenes logic related making a parser trigger remote reads is somewhat high.

   #### A bit More About How it Works
@@ -467,7 +487,7 @@

   - Pulls an item from the queue (or \"blocks\" when empty)
   - Sends it over the network
-  - Updates the marker in the app state to `loading` (which causes a re-render, so you can render loading UI)
+  - Updates the marker in the app state to `loading` (which causes a re-render, so you can show loading indicators)
   - \"waits\" for the response
       - On success: merges the data
       - On error: updates the state marker to an error state (which re-renders allowing the UI to show error UI)
@@ -493,15 +513,14 @@

   ### Data merge

-  Untangled will automatically merge the result of loads into the application client database.
-  It overrides the built-in Om
-  shallow merge. Untangled's data merge has a number of extension that are useful for
+  Untangled will automatically merge (and normalize) the result of loads into the application client database.
+  Untangled overrides the built-in Om shallow merge to a merge that has a number of extension that are useful for
   simple application reasoning:

   #### Deep Merge

   Untangled merges the response via a deep merge, meaning that existing data is not wiped out by default. Unfortunately,
-  this causes a different problem. Let's say you have two UI components that ask for similar information:
+  this causes a different problem. Let's say you have two UI components (with the same Ident) that ask for similar information:

   Component A asks for [:a]
   Component A2 asks for [:a :b]
@@ -525,11 +544,11 @@
   #### Normalization

   Normalization is always *on* in Untangled because your application will not work correctly if you don't normalize the
-  data in your database. Loads must use real composed queries from the UI for normalization to work (the om `get-query` function adds info to assit
-  with normalization).
-
-  Therefore, you almost *never* want to use a hand-written query that has not been placed on a `defui`. It is perfectly
-  acceptable to define queries via `defui` to ensure normalization will work, and this will commonly be the case if your
+  data in your database. Loads must use real composed queries from the UI for normalization to work (the om `get-query`
+  function adds info to assit with normalization).
+
+  Therefore, you almost *never* want to use a hand-written query that has not been placed on a `defui`. **It is perfectly
+  acceptable to define queries via `defui` to ensure normalization will work**, and this will commonly be the case if your
   UI needs to ask for data in a structure different from what you want to run against the server.

   For example, say we have some items in our database, and we're planning on showing them grouped by category. We *could*
@@ -587,7 +606,7 @@

   #### Post Mutations

-  We've seen the power of using component to generate queries that are simple for the server (even though the UI might
+  We've seen the power of using a component to generate queries that are simple for the server (even though the UI might
   want to display the result in a more complex way). Now, we'll finish the example by showing you how post mutations
   can complete the story (and for Om users, complete your understanding of why a custom parser isn't necessary in Untangled).

@@ -612,11 +631,11 @@
   We all understand doing these kinds of transforms, so this technique gives some real concrete advantages overall:

   - Simple query to the server (only have to write one query handler)
-      - Independent of the server's database structure (do items belong to categories, or just have them, etc).
+      - Independent of the server's database structure (do items belong to categories, or just have them? etc).
   - Simple layout in resulting UI database (normalized into tables and a graph)
   - Straightforward data transform into what we want to show

-  So, let's add in the idea that the UI really wants to show a Toolbar that contains the items
+  So, let's assume that the UI really wants to show a Toolbar that contains the items
   grouped by category, but our sample load is as before.

   The Untangled post-mutation can defined as:
@@ -764,10 +783,22 @@

   You can have any number of fallbacks in a tx, and they will run in order if the transaction fails.

-  TODO: Clearing the remaining send queue, etc. The API does not support (but needs to) optional clearing of
-  the remainder of the send queue on the client as part of fallback handling. This might be necessary, say, in the case
-  where the tx that failed indicates the app state is invalid...additional network interactions are probably all going to
-  fail. What you want to do is trigger some kind of state reload to restore sanity.
+  #### Clearing Network Queue
+
+  If the server sends back a failure it may be desirable to clear any pending network requests from the client
+  network queue. For example, if you're adding an item to a list and get a server error you might have a mutation waiting
+  in your network queue that was some kind of modification to that (now failed) item. Continuing the network processing
+  might just cause more errors.
+
+  The UntangledApplication protocol (implemented by your client app) includes the protocol method
+  `clear-pending-remote-requests!` which will drain all pending network requests.
+
+  ```
+  (untangled.client.core/clear-pending-remote-requests! my-app)
+  ```
+
+  A common recovery strategy from errors could be to clean the network queue and run a mutation that resets your application
+  to a known state, possibly loading sane state from the server.

   #### Remote reads after a mutation


updated spec to run each card separately so it can use regular browsers like chrome

--- src/test/visual_regression_spec.clj
+++ src/test/visual_regression_spec.clj
@@ -7,7 +7,8 @@
   (:import [ru.yandex.qatools.ashot Screenshot]
            [javax.imageio ImageIO]
            [ru.yandex.qatools.ashot.comparison ImageDiffer ImageDiff]
-           (java.io File)))
+           (java.io File)
+           (clj_webdriver.element Element)))

 (defn start-browser []
   (taxi/set-driver! {:browser :phantomjs} "http://localhost:8001/visuals.html"))
@@ -25,31 +26,41 @@
   "Take screen shots of every devcard and write them to the output-dir
   dir. Returns a vector of the file names of all the images captured."
   [output-dir]
-  (let [driver             (start-browser)
-        _                  (touch-dir output-dir)
-        title-selector     "a.com-rigsomelight-devcards_set-current-path"
+  (try (let [driver             (start-browser)
+             _                  (touch-dir output-dir)
+             title-selector     "a.com-rigsomelight-devcards_set-current-path"

-        _                  (taxi/wait-until #(-> (taxi/element title-selector)))
-        _                  (taxi/window-maximize)
+             _                  (taxi/wait-until #(-> (taxi/element title-selector)))
+             _                  (taxi/window-maximize)

-        card-link-selector "a.com-rigsomelight-devcards-list-group-item"
-        card-count         (count (taxi/elements card-link-selector))
-        file-names         (atom [])]
-    (timbre/info "Capturing cards into" output-dir)
-    (doseq [idx (range card-count)]
-      (let [selector   (str "div.com-rigsomelight-devcards-list-group a:nth-child("
-                         (inc idx) ")")
-            card-title (taxi/text (str selector " span:nth-child(2)"))
-            img-path   (str output-dir card-title ".png")]
-        (timbre/info "Capturing card:" card-title)
-        (taxi/click selector)
-        ;; Allow any animations to happen e.g. d3 or React lifecycle methods.
-        (Thread/sleep 500)
-        (taxi/take-screenshot :file img-path)
-        (swap! file-names conj (str card-title ".png"))
-        (taxi/back)))
-    (taxi/quit)
-    @file-names))
+             card-link-selector "a.com-rigsomelight-devcards-list-group-item"
+             card-count         (count (taxi/elements card-link-selector))
+             file-names         (atom [])]
+         (timbre/info "Capturing cards into" output-dir)
+         (doseq [idx (range card-count)]
+           (let [selector   (str "div.com-rigsomelight-devcards-list-group a:nth-child("
+                              (inc idx) ")")
+                 card-title (taxi/text (str selector " span:nth-child(2)"))]
+             (taxi/click selector)
+             (timbre/info "navigated to " selector)
+             (Thread/sleep 300)
+             (let [cards     (taxi/elements "div.com-rigsomelight-devcards-panel-heading > a")
+                   subtitles (mapv (fn [e] (-> e :webelement .getText)) cards)]
+               (timbre/info "found " (count cards) " titled " subtitles)
+               (doseq [subtitle subtitles]
+                 (let [ img-path (str output-dir card-title "-" subtitle ".png")]
+                   (timbre/info "navigating to " subtitle)
+                   (taxi/get-url (str "http://localhost:8001/visuals.html#!/" card-title "/" subtitle))
+                   (Thread/sleep 1000)
+                   (timbre/info "Writing " img-path)
+                   (taxi/take-screenshot :file img-path)
+                   (swap! file-names conj (str card-title ".png"))
+                   (taxi/back))))
+             (taxi/back)))
+         (taxi/quit)
+         @file-names)
+       (catch Exception e (taxi/quit)
+                          [{:FAILED e}])))

 (defn compare-cards
   "Compares screenshots in the expected and actual directories (generates the actual).


Test for function load-configuration-file, updated other tests as well

--- test/cloverage_jenkins_reporter/config_loader_test.clj
+++ test/cloverage_jenkins_reporter/config_loader_test.clj
@@ -63,19 +63,25 @@
     (let [property (doto (new java.util.Properties)
                          (.setProperty "a" "A")
                          (.setProperty "b" "B"))]
-        (is (= {:a 'A :b 'B} (properties->map property)))))
+        (is (= {:a "A" :b "B"} (properties->map property)))))

 (deftest test-properties->map-2
     "Check the behaviour of function emender-jenkins/properties->map."
     (let [property (doto (new java.util.Properties)
                          (.setProperty "propertyA" "property_a")
                          (.setProperty "propertyB" "property_b"))]
-        (is (= {:propertyA 'property_a :propertyB 'property_b} (properties->map property)))))
+        (is (= {:propertyA "property_a" :propertyB "property_b"} (properties->map property)))))

 (deftest test-properties->map-3
     "Check the behaviour of function emender-jenkins/properties->map."
     (let [property (doto (new java.util.Properties)
                          (.setProperty "value1" "1")
                          (.setProperty "value2" "2"))]
-        (is (= {:value1 1 :value2 2} (properties->map property)))))
+        (is (= {:value1 "1" :value2 "2"} (properties->map property)))))

+(deftest test-load-configuration-file
+    "Check the behaviour of function emender-jenkins/load-configuration-file."
+    (println (properties->map (load-configuration-file "test/test1.properties")))
+    (let [property (load-configuration-file "test/test1.properties")]
+        (is (= {:value1 "value1" :value2 "42" :value3 "3"} (properties->map property)))))
+


CMR-285: Renamed test.

CMR-285: Renamed test.

--- test/cmr/system_int_test/search/paging_search_test.clj
+++ test/cmr/system_int_test/search/paging_search_test.clj
@@ -31,7 +31,7 @@

 (use-fixtures :once wrap-setup)

-(deftest search_with_page_size
+(deftest search-with-page-size
   (testing "Search with page size."
     (let [references (search/find-collection-refs {:provider "PROV1"
                                                    :page_size 5})]


Use explicit event type

Use explicit event type

--- closure-dom-events/src/cljs/closure_dom_events/core.cljs
+++ closure-dom-events/src/cljs/closure_dom_events/core.cljs
@@ -1,17 +1,16 @@
 (ns closure-dom-events.core
   (:require [goog.events :as events]
+            [goog.events.EventType :as EventType]
             [goog.dom :as dom]))

-(defn main
-  []
+(defn main []
   (let [counter (atom 0)
         button (dom/getElement "button")
         display (dom/getElement "numclicks")]
     (set! (.-innerHTML display) @counter)
-    (events/listen button "click"
+    (events/listen button EventType/CLICK
                    (fn [event]
                      (swap! counter inc)
                      (set! (.-innerHTML display) @counter)))))

-
 (main)


Test for existence of utils/fourth

Test for existence of utils/fourth

--- test/emender_jenkins/utils_test.clj
+++ test/emender_jenkins/utils_test.clj
@@ -31,6 +31,12 @@
     "Check that the emender-jenkins.utils/third definition exists."
     (testing "if the emender-jenkins.utils/third definition exists."
         (is (callable? 'emender-jenkins.utils/third))))
+
+
+(deftest test-fourth-existence
+    "Check that the emender-jenkins.utils/fourth definition exists."
+    (testing "if the emender-jenkins.utils/fourth definition exists."
+        (is (callable? 'emender-jenkins.utils/fourth))))

 (deftest test-substring-existence


fix: spacing

fix: spacing

--- src/main/clojure/pdok/featured/persistence.clj
+++ src/main/clojure/pdok/featured/persistence.clj
@@ -146,7 +146,7 @@
 			     fs.collection = f.collection AND
 			     fs.feature_id = f.feature_id
   WHERE fs.dataset = ?"
-  (when (seq collections) (str "AND f.collection in ("
+  (when (seq collections) (str " AND f.collection in ("
                                (clojure.string/join "," (repeat (count collections) "?"))
                                ")"))
 "  ORDER BY fs.id DESC"


Story ID: RPC-178 Corrected invalid reference to old macro name

--- test/smooth_test/provided_spec.cljc
+++ test/smooth_test/provided_spec.cljc
@@ -1,6 +1,6 @@
 (ns smooth-test.provided-spec
   #?(:clj
-     (:require [smooth-test.core :as c :refer [specification behavior provided with-timeline event tick assertions]]
+     (:require [smooth-test.core :as c :refer [specification behavior provided with-timeline async tick assertions]]
                [clojure.test :as t :refer (are is deftest with-test run-tests testing do-report)]
                [smooth-test.provided :as p]
                ))


hiccup version

hiccup version

--- re_view/project.clj
+++ re_view/project.clj
@@ -6,7 +6,7 @@
   :dependencies [[org.clojure/clojure "1.9.0-alpha17"]
                  [org.clojure/clojurescript "1.9.854"]
                  [re-db "0.1.12"]
-                 [re-view-hiccup "0.1.11"]
+                 [re-view-hiccup "0.1.12-SNAPSHOT"]

                  [cljsjs/react "16.0.0-0"]
                  [cljsjs/react-dom "16.0.0-0"]]


Bugfix: declare precedence order of dom and sub.

--- EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
+++ EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
@@ -686,7 +686,7 @@
     (declareprecedence ?decprec)
     (aspect ?dominator)
     (aspect ?subordinate)
-    (equals -1 (.compare ?decprec ?dominator ?subordinate))))
+    (equals 1 (.compare ?decprec ?dominator ?subordinate))))


Add header grid

Add header grid

--- src/reddio_frontend/screens/shared/header.cljs
+++ src/reddio_frontend/screens/shared/header.cljs
@@ -1,6 +1,15 @@
 (ns reddio-frontend.screens.shared.header
   (:require))

-  [:div.header
 (defn main []
-   [:h1 "Header"]])
+  [:div.header.container-fluid
+   [:div.row
+    [:div.col-sm-3
+     [:div.header-brand
+      [:h1 "Reddio"]]]
+    [:div.col-sm-6
+     [:div.header-search
+      [:h1 "Search"]]]
+    [:div.col-sm-3
+     [:div.header-nav
+      [:h1 "Navigation"]]]]])


Fix docs to clarify :cookie-attrs in WF [IMMUTANT-527]

--- web/src/immutant/web/middleware.clj
+++ web/src/immutant/web/middleware.clj
@@ -47,19 +47,28 @@

      * :timeout The number of seconds of inactivity before session expires [1800]
      * :cookie-name The name of the cookie that holds the session key [\"JSESSIONID\"]
-     * :cookie-attrs A map of attributes to associate with the session cookie [nil]

   A :timeout value less than or equal to zero indicates the session
   should never expire.

-  The following :cookie-attrs keys are supported:
+  When running embedded, i.e. not deployed to a WildFly/EAP container,
+  another option is available:
+
+     * :cookie-attrs A map of attributes to associate with the session cookie [nil]
+
+  And the following :cookie-attrs keys are supported:

      * :path      - the subpath the cookie is valid for
      * :domain    - the domain the cookie is valid for
      * :max-age   - the maximum age in seconds of the cookie
      * :secure    - set to true if the cookie requires HTTPS, prevent HTTP access
      * :http-only - set to true if the cookie is valid for HTTP and HTTPS only
-                    (ie. prevent JavaScript access)"
+                    (ie. prevent JavaScript access)
+
+  Within WildFly/EAP, :cookie-attrs is ignored because a servlet
+  context may only be configured at deployment. This means
+  non-standard cookie configuration must be done in
+  `WEB-INF/web.xml`."
   ([handler]
      (wrap-session handler {}))
   ([handler options]


Correct y-axis mirroring problem in tsplot.

--- metlog-vault/src-client/metlog_client/tsplot.cljs
+++ metlog-vault/src-client/metlog_client/tsplot.cljs
@@ -38,15 +38,19 @@

 (defn translate-fn [ range size ]
   (let [min (:min range)
-        max (:max range)]
-    (fn [ val ]
-      (* size
-         (/ (- val min)
-            (- max min))))))
+        max (:max range)
+        delta (- max min)]
+    #(* size (/ (- % min) delta))))
+
+(defn translate-fn-invert [ range size ]
+  (let [min (:min range)
+        max (:max range)
+        delta (- max min)]
+    #(- size (* size (/ (- % min) delta)))))

 (defn draw-series-line [ ctx data x-range y-range w h ]
   (let [tx (translate-fn x-range w)
-        ty (translate-fn y-range h)]
+        ty (translate-fn-invert y-range h)]
     (.beginPath ctx)
     (let [ pt (first data) ]
       (.moveTo ctx (tx (:t pt)) (ty (:val pt))))


env(clojure): add proto-repl dependency to make atom ink work

--- clojure/adventofcode/project.clj
+++ clojure/adventofcode/project.clj
@@ -3,7 +3,8 @@
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :dependencies [[org.clojure/clojure "1.8.0"]]
+  :dependencies [[org.clojure/clojure "1.8.0"]
+                 [proto-repl "0.3.1"]]
   :main ^:skip-aot adventofcode.core
   :target-path "target/%s"
   :profiles {:uberjar {:aot :all}})


Fixed an error.

Fixed an error.

--- umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
@@ -143,7 +143,7 @@
       (is (empty? (generate-and-validate-xml :collection :umm-json umm-c-record))))))

 (deftest roundtrip-generated-collection-records
-  (checking "collection round tripping" 1000
+  (checking "collection round tripping" 100
     [umm-record (gen/no-shrink umm-gen/umm-c-generator)
      metadata-format (gen/elements tested-collection-formats)]
     (is (= (expected-conversion/convert umm-record metadata-format)


add a wide pivot to test a problem with pivots over about 8 pivot-keys wide

--- dada-demo/src/main/clojure/org/dada/demo/whales.clj
+++ dada-demo/src/main/clojure/org/dada/demo/whales.clj
@@ -256,5 +256,6 @@
 (? [(split :ocean nil [(ccount)])] all-whales)
 (? [(pivot :ocean oceans (keyword (count-value-key nil)))(ccount)(split :ocean)] all-whales)
 (? [(union "count/type/ocean")(split :type nil [(pivot :ocean oceans (keyword (count-value-key nil)))(ccount)(split :ocean )])] all-whales)
-
-;;--------------------------------------------------------------------------------
+(? [(union "count/ocean/type")(split :ocean nil [(pivot :type types (keyword (count-value-key nil)))(ccount)(split :type )])] all-whales)
+
+;;--------------------------------------------------------------------------------


adding test for message-router

adding test for message-router

--- test/cljc/ow/starbuck/message_router_test.cljc
+++ test/cljc/ow/starbuck/message_router_test.cljc
@@ -1,4 +1,135 @@
 (ns ow.starbuck.message-router-test
-  (:require [ow.starbuck.message-router :as sut]
+  (:require [ow.starbuck.message-router :as mr]
             #?(:clj [clojure.test :as t]
                :cljs [cljs.test :as t :include-macros true])))
+
+;;;
+;;; EXAMPLE RULESET:
+;;;
+
+(def example-ruleset
+  {:routes {:switch-booking
+
+            {:transitions {;;; you can define the next component statically:
+                           nil :database-reader
+
+                           ;;; you can provide a map instead of a keyword.
+                           ;;; :next defines the next component. it can be a keyword but also a function that
+                           ;;;       returns a keyword.
+                           ;;; :postprocess is an optional function that can alter the msg after routing.
+                           :database-reader {:next (fn [msg] :converter)
+                                             :postprocess (fn [msg] (assoc msg :postprocessed true))}
+
+                           ;;; :preprocess is an optional function that can alter the msg before routing.
+                           ;;; :next can also be a sequence of next components. that will multiply resulting
+                           ;;;       messages. in this case, it will generate messages to the components
+                           ;;;       :logger and :http-server.
+                           :converter {:preprocess (fn [msg] (assoc msg :preprocessed true))
+                                       :next [:logger (fn [msg] :http-server)]}
+
+                           ;;; if :next is set to nil, the message will not be routed:
+                           :logger (fn [msg] nil)
+                           :http-server nil}
+
+             ;;; event-handlers generate additional messages, depending on whether or not a msg
+             ;;; contains a specified keyword (:error in the example below).
+             ;;; you can define event-handlers that are local to the route. local event-handlers
+             ;;; override global event-handlers for the same keyword.
+             ;;; you can provide a map.
+             ;;; :next within that map defines the component the generated msg will be routed to.
+             ;;; :abort? (if set to true) will throw away the original message. only the
+             ;;;         event-handler message will be routed.
+             :event-handlers {:error {:next :http-server
+                                      :abort? true}}}}
+
+   :event-handlers {:error :foobar
+                    :notify (fn [msg] :notifier)
+                    :pending-mails [:logger (fn [msg] :mailer)]}})
+
+(t/deftest route1
+  (let [msg {:route :switch-booking}]
+    (t/is (= (mr/advance msg example-ruleset)
+             [{:route :switch-booking
+               :comp :database-reader
+               :starbuck/route-count 1}]))))
+
+(t/deftest route2
+  (let [msg {:route :switch-booking
+             :comp :database-reader
+             :starbuck/route-count 1}]
+    (t/is (= (mr/advance msg example-ruleset)
+             [{:route :switch-booking
+               :comp :converter
+               :starbuck/route-count 2
+               :postprocessed true}]))))
+
+(t/deftest route3
+  (let [msg {:route :switch-booking
+             :comp :converter
+             :starbuck/route-count 2}]
+    (t/is (= (mr/advance msg example-ruleset)
+             [{:route :switch-booking
+               :comp :logger
+               :starbuck/route-count 3
+               :preprocessed true}
+              {:route :switch-booking
+               :comp :http-server
+               :starbuck/route-count 3
+               :preprocessed true}]))))
+
+(t/deftest route4
+  (let [msg {:route :switch-booking
+             :comp :logger}]
+    (t/is (= (mr/advance msg example-ruleset)
+             []))))
+
+(t/deftest route5
+  (let [msg {:route :switch-booking
+             :comp :http-server}]
+    (t/is (= (mr/advance msg example-ruleset)
+             []))))
+
+(t/deftest event1
+  (let [msg {:route :switch-booking
+             :notify true}]
+    (t/is (= (mr/advance msg example-ruleset)
+             [{:route :switch-booking
+               :comp :database-reader
+               :starbuck/route-count 1
+               :notify true}
+              {:route :switch-booking
+               :comp :notifier
+               :starbuck/route-count 1
+               :notify true}]))))
+
+(t/deftest event2
+  (let [msg {:route :switch-booking
+             :comp :database-reader
+             :pending-mails true}]
+    (t/is (= (mr/advance msg example-ruleset)
+             [{:route :switch-booking
+               :comp :converter
+               :starbuck/route-count 1
+               :postprocessed true
+               :pending-mails true}
+              {:route :switch-booking
+               :comp :logger
+               :starbuck/route-count 1
+               :postprocessed true
+               :pending-mails true}
+              {:route :switch-booking
+               :comp :mailer
+               :starbuck/route-count 1
+               :postprocessed true
+               :pending-mails true}]))))
+
+(t/deftest event3
+  (let [msg {:route :switch-booking
+             :comp :database-reader
+             :error true}]
+    (t/is (= (mr/advance msg example-ruleset)
+             [{:route :switch-booking
+               :comp :http-server
+               :starbuck/route-count 1
+               :postprocessed true
+               :error true}]))))


prefer the new nrepl to the old one

prefer the new nrepl to the old one

--- sidecar/src/figwheel_sidecar/components/nrepl_server.clj
+++ sidecar/src/figwheel_sidecar/components/nrepl_server.clj
@@ -3,11 +3,11 @@
    [figwheel-sidecar.utils :as utils]
    [com.stuartsierra.component :as component]))

-(if (utils/require? 'clojure.tools.nrepl.server)
+(if (utils/require? 'nrepl.server)
   (require
-   '[clojure.tools.nrepl.server :as nrepl-serv])
+   '[nrepl.server :as nrepl-serv])
   (require
-   '[nrepl.server :as nrepl-serv]))
+   '[clojure.tools.nrepl.server :as nrepl-serv]))

 (defn start-nrepl-server
   [figwheel-options autobuild-options]


Fixing failing umm spec tests.

Fixing failing umm spec tests.

--- umm-spec-lib/src/cmr/umm_spec/xml_mappings.clj
+++ umm-spec-lib/src/cmr/umm_spec/xml_mappings.clj
@@ -7,7 +7,13 @@
             [cmr.umm-spec.json-schema :as js]
             [cmr.umm-spec.record-generator :as record-gen]
             [cmr.common.util :as util]
-            [cmr.umm-spec.util :as spec-util]))
+            [cmr.umm-spec.util :as spec-util]
+
+            ;; Models must be required to be available
+            [cmr.umm-spec.models.common]
+            [cmr.umm-spec.models.collection]
+
+            ))

 ;; TODO define json schema for mappings and use to validate them


Removes :type keys from state maps (#1349)

--- scheduler/src/cook/kubernetes/compute_cluster.clj
+++ scheduler/src/cook/kubernetes/compute_cluster.clj
@@ -319,10 +319,8 @@
         compute-cluster (->KubernetesComputeCluster api-client compute-cluster-name cluster-entity-id
                                                     (:match-trigger-chan trigger-chans)
                                                     exit-code-syncer-state (atom {}) (atom {})
-                                                    ; These :type keys are here to make it easier to trace provenance
-                                                    ; when debugging and exist for no other reason.
-                                                    (atom {:type :expected-state-map})
-                                                    (atom {:type :existing-state-map})
+                                                    (atom {})
+                                                    (atom {})
                                                     (atom nil)
                                                     namespace
                                                     scan-frequency-seconds)]


Refactored star textures

Refactored star textures

--- desktop/src-common/ds3/space.clj
+++ desktop/src-common/ds3/space.clj
@@ -21,8 +21,8 @@
       (pixmap! :fill-rectangle 0 0 1 1))
     (texture pix-map)))

-(defn create-star [x y]
-  (assoc (create-star-texture (first (shuffle star-colors)))
+(defn create-star [x y star]
+  (assoc (texture star)
     :width (c/screen-to-world 1) :height (c/screen-to-world 1)
     :x x :y y
     :star? true :id :star
@@ -30,9 +30,10 @@
     :speed (first (shuffle star-speeds))))

 (defn create-space []
-  (for [count (range star-count)]
-    (create-star (c/screen-to-world (rand-int c/game-width)) (c/screen-to-world (rand-int c/game-height)))
-    ))
+  (let [star-textures (map (fn [c] (create-star-texture c)) star-colors)]
+    (for [count (range star-count)]
+      (create-star (c/screen-to-world (rand-int c/game-width)) (c/screen-to-world (rand-int c/game-height)) (first (shuffle star-textures)) )
+      )))

 (defn move-star [screen {:keys [:y :speed] :as entity}]
   (let [new-y (if (< (+ y speed) 0)


Added missing require.

Added missing require.

--- dev-resources/src/dragon/dev.clj
+++ dev-resources/src/dragon/dev.clj
@@ -6,6 +6,7 @@
   (:require [dragon.cli :as cli]
             [dragon.generator :as generator]
             [dragon.main :as main]
+            [dragon.post.rfc5322 :as rfc5322]
             [dragon.util :as util]
             [dragon.web :as web]
             [dragon.web.content :as content]


CMR-1793: minor change.

CMR-1793: minor change.

--- ingest-app/src/cmr/ingest/services/provider_service.clj
+++ ingest-app/src/cmr/ingest/services/provider_service.clj
@@ -8,7 +8,7 @@
 (defn- successful?
   "Returns true if the mdb response was successful."
   [response]
-  (< 199 (:status response) 300))
+  (<= 200 (:status response) 299))

 (defn create-provider
   "Create a provider."


Deleted too many functions

Deleted too many functions

--- src/adventofcode1/nineteen_b.clj
+++ src/adventofcode1/nineteen_b.clj
@@ -37,6 +37,11 @@
   [arr]
   (fv/subvec arr 1))

+(defn calculate-opposite
+  "n is the number of elfs incl me. Im a at pos 0.
+   Return the opposite position."
+  [n]
+  (int (/ n 2)))

 (defn move
   [elfs]


Finished resource creation. Code requires cleaning and models

--- src/ardoq/swagger/swagger_v2.clj
+++ src/ardoq/swagger/swagger_v2.clj
@@ -36,7 +36,7 @@

 (defn contact-str [{:keys [:contact]}]
   ;;Converts the contact part of the info to a markdown table. Needs fixing
-  (let [{:keys [:name :url :email]} contact]
+  (let [{:keys [name url email] :or {name "N/A" url "N/A" email "N/A" }} contact]
     (->> ""
          (str "| \n")
          (str (str " | " email))
@@ -48,7 +48,7 @@

 (defn license-str [{:keys [:license]}]
   ;;Converts the license part of the info to a markdown table. Needs fixing
-  (let [{:keys [:name :url]} license]
+  (let [{:keys [name url] :or {url "N/A"}} license]
     (->> ""
          (str "| \n")
          (str (str " | " url))
@@ -68,44 +68,45 @@
     (.replaceAll "[ {]*:license [{](.*?)[}][,}]" (license-str info))
     ))

-(defn create-models2 [client base-url {wid :_id model-id :componentModel :as w} model {:keys [resource component]}]
-  (let [url (str base-url (:path resource))
-        api-declaration (""; get-resource-listing url
-                         )]
-    (reduce
-     (fn [acc [type schema]]
-       (assoc acc (keyword type)
-              (assoc
-               (api/->Component type "";(model-template schema)
- (str wid) model-id (api/type-id-by-name model "Model")  nil
-                                )
-               :schema schema)))
-     {}
-     (:models api-declaration))))
+(defn update-comp [component {:keys [produces consumes]}]
+  (clojure.pprint/pprint component)
+  (api/update
+   (cond-> (api/map->Component component)
+     produces (assoc :produces produces)
+     consumes (assoc :consumes consumes)) client))

-(defn create-models [{:keys [:paths]} resource]
+(defn create-methods [parent model description wid _id path [methods]]
+  (-> (api/->Component methods description (str wid) _id (api/type-id-by-name model "Operation") (str (:_id parent)))
+      (api/create client))
+  )
+
+(defn create-resource [{:keys [paths]} workspace]
+  ;;Create a resource. Does so by setting first path resource then adding the operations to it. Requires a full swagger file as input and the workspace it is being created in
   (let [model (find-or-create-model client)
-        {:keys [_id description]} model])
-)
-
-(defn create-resource [{:keys [:paths]}]
-  (let [model (find-or-create-model client)
-        {:keys [_id description]} model]
-    ;; (first (first paths)) is a very bad hack, need to fix it
-    (-> (api/->Component (first (first paths)) description (str _id) _id (api/type-id-by-name model "Resource") nil)
-        (api/create client))))
+        {:keys [_id description]} model
+        wid (:_id workspace)]
+    (map
+     (fn [[path methods]]
+       (let [parent (-> (api/->Component path description (str wid) _id (api/type-id-by-name model "Resource") nil)
+                        (api/create client))]
+         ;; (map
+         ;;  (fn [[m]]
+         ;;    (-> (api/->Component m description (str wid) _id (api/type-id-by-name model "Operation") (str (:_id parent)))
+         ;;        (api/create client)))
+         ;;  methods)
+         (map (partial create-methods parent model description wid _id path) methods)
+         ))
+     paths)))

 (defn get-info [spec]
-  ;Converts the info from a Swagger 2 map to a string
-  (let [{:keys [:info]} spec]
-    (->> ""
-         (str info)
-         (json-to-markdown info)
-         (create-workspace "tester" client)
-                                        ;(println)
-         ))
-  (create-resource spec)
-  )
+  ;Converts the info from a Swagger 2 map to a string - This method needs to be redone
+  (let [{:keys [:info]} spec
+        workspace (->> ""
+             (str info)
+             (json-to-markdown info)
+             (create-workspace "tester" client)
+             )]
+    (create-resource spec workspace)))

 (defn get-data [spec]


prevent repeated items in sequence for reading stave exercises.fix typo on treble.

--- src/cljs/daveconservatoire/site/ui/exercises.cljs
+++ src/cljs/daveconservatoire/site/ui/exercises.cljs
@@ -300,7 +300,7 @@
     (exercise (om/props this)
       (dom/p #js {:key "p"} "You will hear two notes. Are they an octave apart?"))))

-(def notes-tremble
+(def notes-treble
   {::read-note-order  ["E" "F" "G" "A" "B" "C" "D" "E" "F"]
    ::read-note-prefix "trebleclefimages"})

@@ -309,8 +309,17 @@
    ::read-note-prefix "bassclefimages"})

 (def notes-grand-staff
-  {::read-note-order  ["G" "A" "B" "C" "D" "E" "F" "G" "A" "B" #_"TREMBLE" "D" "E" "F" "G" "A" "B" "C" "D" "E" "F" "C"]
+  {::read-note-order  ["G" "A" "B" "C" "D" "E" "F" "G" "A" "B" #_"TREBLE" "D" "E" "F" "G" "A" "B" "C" "D" "E" "F" "C"]
    ::read-note-prefix "grandstaffimages"})
+
+(defn rand-int-new [n old]
+  "Generate a new random number like rand-int, if number is equals to `old` a new
+  number will be generated until it's different."
+  (loop []
+    (let [x (rand-int n)]
+      (if (= x old)
+        (recur)
+        x))))

 (om/defui ^:once ReadingMusic
   static uc/InitialAppState
@@ -330,23 +339,23 @@

   static IExercise
   (new-round [_ props]
-    (let [{:keys [::read-note-order]} props
-          pos (rand-int (count read-note-order))
+    (let [{::keys [read-note-order read-note]} props
+          pos (rand-int-new (count read-note-order) read-note)
           note (get read-note-order pos)
-          notes [(str note (cond-> 3
-                             (> pos 4) inc))]]
+          octave (if (> pos 4) 4 3)
+          notes [(str note octave)]]
       (assoc props
-        ::read-note (inc pos)
+        ::read-note pos
         ::notes notes
         ::correct-answer (.toLowerCase note))))

   Object
   (render [this]
-    (let [{:keys [::read-note ::read-note-prefix] :as props} (om/props this)]
+    (let [{::keys [read-note read-note-prefix] :as props} (om/props this)]
       (exercise props
         (dom/p #js {:key "p"} "Enter the letter name of the note displayed below. Please use a lower case letter (e.g. e, f or c).")
         (dom/div #js {:key "img"}
-          (dom/img #js {:src (str "/img/" read-note-prefix "/" read-note ".jpg")}))))))
+          (dom/img #js {:src (str "/img/" read-note-prefix "/" (inc read-note) ".jpg")}))))))

 (def available-rhytm-notes
   {1 "quarter"
@@ -536,7 +545,7 @@
 (defmethod slug->exercise "treble-clef-reading" [name]
   {::name  name
    ::class ReadingMusic
-   ::props notes-tremble})
+   ::props notes-treble})

 (defmethod slug->exercise "bass-clef-reading" [name]
   {::name  name


Asserts at a possible a.toLowerCase source [GAWB-2872] (#1060)

--- src/cljs/main/broadfcui/page/workspaces_list.cljs
+++ src/cljs/main/broadfcui/page/workspaces_list.cljs
@@ -179,6 +179,10 @@
         no-access? (= accessLevel "NO ACCESS")
         auth-domain (:authorizationDomain workspace)
         domain-groups (map :membersGroupName auth-domain)]
+    ;; GAWB-2872
+    (let [{:keys [namespace name]} workspace-id]
+      (assert namespace (str "Cannot list workspace because it has no namespace." (when name (str " Name is \"" name "\"."))))
+      (assert name (str "Cannot list workspace because it has no name." (when namespace (str " Namespace is \"" namespace "\".")))))
     (assoc ws
       :workspace-id workspace-id
       :workspace-column-sort-value (mapv string/lower-case (replace workspace-id [:namespace :name]))