Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

#159 Adds Console Component for rendering of output #277

Merged
merged 10 commits into from
Dec 12, 2019

Conversation

dafrie
Copy link
Contributor

@dafrie dafrie commented Dec 10, 2019

Uses console-feed for rendering of output and allows searching, filtering and ordering of output. Resolves #159

TODO:

  • Linting/formatting
  • Reset output on integration change and add clear button
  • Resolve ordering issue
  • Resolve resubmission of warning messages upon ordering change

@corradio
Copy link
Member

Looks cool! Ping me when you want me to review.

@dafrie
Copy link
Contributor Author

dafrie commented Dec 11, 2019

@corradio should now be ready for review. Could do further improvements, e.g. storing selected filter categories in LocalStorage? Or maybe later once requirements of #160 is more clear?

@corradio corradio self-requested a review December 11, 2019 11:41
@corradio corradio marked this pull request as ready for review December 11, 2019 11:41
@corradio
Copy link
Member

I'll review asap

@dafrie dafrie changed the title WIP: #159 Adds Console Component for rendering of output #159 Adds Console Component for rendering of output Dec 11, 2019

useEffect(() => {
// eslint-disable-next-line arrow-parens
Hook(window.console, log => {
Copy link
Member

@corradio corradio Dec 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dafrie,

Here's a first suggestion:

Instead of using a hook on console.log, I suggest using a prop or expose a logger class that is hooked to
https://github.com/tmrowco/tmrowapp-contrib/blob/master/playground/server/index.js#L77-L81
That will make the interface cleaner and more robust.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep makes sense! I will go the props way. Expanding the main app state was actually my first shot at it, but then decided to have only within the console component - Did not look careful enough at the runLogs listener!

@dafrie dafrie requested a review from corradio December 11, 2019 19:10
@corradio
Copy link
Member

is it possible to sort ASC by default and show all output by default (i.e. warn and debug by default?)

@dafrie
Copy link
Contributor Author

dafrie commented Dec 12, 2019

is it possible to sort ASC by default and show all output by default (i.e. warn and debug by default?)

Like so? In the ASC case however, then probably it should always scroll to bottom, so the whole console output should be wrapped in a scrollable container?

@corradio
Copy link
Member

corradio commented Dec 12, 2019

This looks good for now! I suggest we merge and then we can make additional UX changes later on.
Thank you so much!

@corradio corradio merged commit 4546c8b into electricitymaps:master Dec 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create error logs and warnings component in dev playground
2 participants