File tree Expand file tree Collapse file tree
src/com/yetanalytics/lrs_admin_ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ div.form-input-container {
3030 @extend .form-text-input ;
3131}
3232
33+ .json-editor {
34+ border : 1px solid black ;
35+ }
36+
3337// Toggle
3438
3539/* The switch - the box around the slider */
Original file line number Diff line number Diff line change 809809 ::db/statements-upload-analyzed? false )
810810 json-errors (assoc-in [::db/statements-upload-manual-errors :json ] json-errors)
811811 (not json-errors) (assoc-in [::db/statements-upload-manual-errors :json ] []))
812- :dispatch-later [{:ms 3000
812+ :dispatch-later [{:ms 1500
813813 :dispatch [:statements-upload/validate-manual-xapi ]
814814 :event-id :manual-xapi-validate }]})))
815815
Original file line number Diff line number Diff line change 266266 :statements-upload/manual-json-buffer
267267 :<- [:statements-upload/editor-contents ]
268268 :<- [:statements-upload/manual-errors ]
269- (fn [[json errors]]
269+ :<- [:statements-upload/analyzed? ]
270+ (fn [[json errors analyzed?]]
270271 {:json (or json " " )
271272 :errors errors
272- :status (if (seq errors) :error :valid )}))
273+ :status (cond (not analyzed?) :loading
274+ (seq errors) :error
275+ :else :valid )}))
273276
274277(reg-sub
275278 :statements-upload/analyzed?
Original file line number Diff line number Diff line change 270270 [:div
271271 [json-file-picker]
272272 [:br ]
273+ [:h5 {:class " content-title" }
274+ " Manual Statement Entry" ]
273275 [manual-json-editor {:buffer buffer
274276 :set-json #(dispatch [:statements-upload/set-editor-contents %])}]
275277 [:br ]
288290 " "
289291 (get % " event" ))}
290292 {:name @(subscribe [:lang/get :statements-upload.event-log.header.duration ])
291- :selector #(str (get % " duration" ))}
293+ :selector #(str (get % " duration" ) " ms " )}
292294 {:name @(subscribe [:lang/get :statements-upload.event-log.header.timestamp ])
293295 :selector #(time/ms->local (get % " timestamp" ))}]
294296 data events
Original file line number Diff line number Diff line change 143143 (fn []
144144 (let [{:keys [status errors]} @buffer]
145145 [:div {:class " validation-display-wrapper" }
146- (if (= :valid status)
147- [v/validation-static-display
148- status
149- " Valid" ]
150- ; ; Error or Warning
151- (let [message (format-error-message errors status)
152- dis-msg (format-error-details-message status)
153- display [v/validation-item-display
154- status
155- dis-msg
156- display-ref
157- :message
158- error-details-display
159- errors]]
160- [v/validation-display
161- status
162- message
163- display-ref
164- display]))]))))
146+ (case status
147+ :valid [v/validation-static-display
148+ status
149+ " Valid" ]
150+ :loading [v/validation-static-display
151+ status
152+ " Validating..." ]
153+ :error (let [message (format-error-message errors status)
154+ dis-msg (format-error-details-message status)
155+ display [v/validation-item-display
156+ status
157+ dis-msg
158+ display-ref
159+ :message
160+ error-details-display
161+ errors]]
162+ [v/validation-display
163+ status
164+ message
165+ display-ref
166+ display]))]))))
165167
166168(defn manual-json-editor
167169 " Create a JSON CodeMirror editor similar to buffered-json-editor
175177 [{:keys [buffer
176178 set-json]}]
177179 (let [{:keys [json]} @buffer]
178- [:div
180+ [:div.json-editor
179181 (when (not (clojure.string/blank? json))
180182 [raw-text-upload-validation-display
181183 buffer])
You can’t perform that action at this time.
0 commit comments