From 05c9f842255daa4dd2107380d915889e699ebad4 Mon Sep 17 00:00:00 2001 From: Daniel Compton Date: Fri, 26 Jan 2018 14:43:09 +1300 Subject: [PATCH] Set a print limit of 400 characters in the event header --- CHANGELOG.md | 8 ++++++++ src/day8/re_frame/trace/view/container.cljs | 2 +- src/day8/re_frame/trace/view/traces.cljs | 9 ++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8bdee4..b88958a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file. This change ### Changed * Updated bundled re-frame version to 0.10.3, and bundled reagent version to 0.7.0. This shouldn't impact your project's dependencies as they are source bundled via [mranderson](https://github.com/benedekfazekas/mranderson). +* Add hyperlinks to docs + +### Fixed + +* Set a print limit of 400 characters in the event header, to prevent very large events from DOSing the host application. +* XML encode # character in SVGs, fixing [#130](https://github.com/Day8/re-frame-trace/issues/130). +* Fix the reset tracing button in the traces panel. +* Fix a bug when there is only one traced event, re-frame-trace would allow you to go back an epoch, throwing an exception. ## [0.1.15] - 2018-01-24 diff --git a/src/day8/re_frame/trace/view/container.cljs b/src/day8/re_frame/trace/view/container.cljs index 325d268..7285c55 100644 --- a/src/day8/re_frame/trace/view/container.cljs +++ b/src/day8/re_frame/trace/view/container.cljs @@ -99,7 +99,7 @@ :overflow-x "hidden" :overflow-y "auto" :background-color "white"} - :children [[:span.event-header (prn-str current-event)]]] + :children [[:span.event-header (subs (prn-str current-event) 0 400)]]] [:span.arrow (if newer-epochs-available? {:on-click #(rf/dispatch [:epochs/next-epoch])} {:class "arrow__disabled"}) diff --git a/src/day8/re_frame/trace/view/traces.cljs b/src/day8/re_frame/trace/view/traces.cljs index 1d9cf59..854970d 100644 --- a/src/day8/re_frame/trace/view/traces.cljs +++ b/src/day8/re_frame/trace/view/traces.cljs @@ -73,11 +73,10 @@ [:td.trace--details-tags {:col-span 2 :on-click #(.log js/console tags)} [:div.trace--details-tags-text - (let [tag-str (with-out-str (pprint/pprint tags)) - string-size-limit 400] - (if (< string-size-limit (count tag-str)) - (str (subs tag-str 0 string-size-limit) " ...") - tag-str))]] + (let [tag-str (prn-str tags)] + (str (subs tag-str 0 400) + (when (< 400 (count tag-str)) + " ...")))]] [:td.trace--meta.trace--details-icon {:on-click #(.log js/console tags)}]]))))))))