File tree Expand file tree Collapse file tree
projects/behave/src/cljs/behave Expand file tree Collapse file tree Original file line number Diff line number Diff line change 850850 (fn [[_ ws-uuid]] (subscribe [:wizard/multi-value-input-count ws-uuid]))
851851 (fn [count _]
852852 (pos? count)))
853+
854+ (reg-sub
855+ :wizard/enable-graph-settings?
856+ (fn [[_ ws-uuid]]
857+ [(subscribe [:worksheet/get-graph-settings-attr
858+ ws-uuid
859+ :graph-settings/enabled? ])
860+ (subscribe [:worksheet/multi-value-input-uuids ws-uuid])])
861+ (fn [[saved-enabled?-setting multi-valued-inputs] _]
862+ (if (not (nil? (first saved-enabled?-setting)))
863+ (first saved-enabled?-setting)
864+ (pos? (count multi-valued-inputs)))))
Original file line number Diff line number Diff line change 439439 (let [*multi-value-input-uuids (subscribe [:worksheet/multi-value-input-uuids ws-uuid])
440440 group-variables (->> @*multi-value-input-uuids
441441 (map #(deref (subscribe [:wizard/group-variable %]))))
442- enabled? (first @(subscribe [:worksheet/get-graph-settings-attr
443- ws-uuid
444- :graph-settings/enabled? ]))
445442 multi-valued-input-uuids @(subscribe [:worksheet/multi-value-input-uuids ws-uuid])
446443 multi-valued-input-count (count multi-valued-input-uuids)
447444 x-axis-limits (first @(subscribe [:worksheet/graph-settings-x-axis-limits ws-uuid]))
448- units-lookup @(subscribe [:worksheet/result-table-units ws-uuid])]
445+ units-lookup @(subscribe [:worksheet/result-table-units ws-uuid])
446+ enabled? @(subscribe [:wizard/enable-graph-settings? ws-uuid])]
449447 (letfn [(radio-group [{:keys [label attr variables on-change]}]
450448 (let [*values (subscribe [:worksheet/get-graph-settings-attr ws-uuid attr])
451449 selected? (first @*values)]
Original file line number Diff line number Diff line change 427427 (let [graph-setting-id (get-in worksheet [:worksheet/graph-settings :db/id ])
428428 enabled? (get-in worksheet [:worksheet/graph-settings :graph-settings/enabled? ])]
429429 {:transact [{:db/id graph-setting-id
430- :graph-settings/enabled? (not enabled?)}]
430+ :graph-settings/enabled? (if (nil? enabled?)
431+ false
432+ (not enabled?))}]
431433 :fx [[:dispatch [:worksheet/set-default-graph-settings ws-uuid]]]})))
432434
433435(rp/reg-event-fx
You can’t perform that action at this time.
0 commit comments