GithubHelp home page GithubHelp logo

zalando-incubator / bro-q Goto Github PK

View Code? Open in Web Editor NEW
83.0 11.0 11.0 3.03 MB

Chrome Extension for JSON formatting and jq filtering in your browser.

License: MIT License

CSS 12.19% HTML 20.35% JavaScript 9.66% TypeScript 57.79%
utilities jq chrome json chrome-extension json-format filter

bro-q's People

Contributors

akread avatar anstit avatar baggerspion avatar bbbco avatar christianlohmann avatar dependabot-preview[bot] avatar dependabot-support avatar drummerwolli avatar harti2006 avatar kev-hoffmann avatar mrandi avatar patandrick avatar raphaeleidus avatar roskenet avatar xerebosx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bro-q's Issues

Grab bag of regression issues after Preact refactoring

The Preact implementation does not quite match up with the 1.4 version of bro/q.

Some regression items I noticed in no particular order:

  • Missing logo on right hand side
  • Missing "Copy Sharable URL" button
  • No margin around (?) button and Copy buttons below the input/output
  • The ACE editor window should not stretch below the bottom of the window to require scrolling the page to see long content (the input/output editors should be scrollable themselves)
  • As #224 indicates, the liveURLQuery option does not work
  • No button option to hide unfiltered input view
  • Needs a version bump to 1.5?

Hide #broq-filter=.

Expected Behaviour

It would be great if bro-q could hide the url fragment #broq-filter=, if only the default filter . is currently applied.

Current Behaviour

The bro-q plugin appends the currently active filter as fragment to the URL address. By default the . filter is active. E.g. when opening the document http://some.api/resource.json, bro-q will immediately change the content of the address bar to http://some.api/resource.json#broq-filter=..

Possible Solution

Show the fragment broq-filter only if

  • either the content is distinct from *
  • or the filter was manually changed

Context

Often I just want to display a JSON document and copy the URL in the browser's address bar to share with others. While the broq-filter is useful when some filter was actually applied, it just adds "noise" to the address, in cases where just the . was used. As I don't like to share unnecessary things, I usually try to cut away the filter before copying the content of the address bar.

json not render correctly

While opening the first time a web address returning a json, bro/q will render only the first 2 rows

bro-q appearing in the middle of the page although it should not

Expected Behaviour

the page https://www.postgresql.org/docs/current/static/monitoring.html opens without bro-q popping up at the bottom.

image

Current Behaviour

the page https://www.postgresql.org/docs/current/static/monitoring.html has at the bottom bro-q attached, which should not be.

image

Steps to Reproduce (for bugs)

go to the page https://www.postgresql.org/docs/current/static/monitoring.html with bro-q enabled

Context

its not affecting the use of the website much, but it disturbs. also i'm wondering if it happens on other pages as well.

Your Environment

https://www.whatismybrowser.com/w/R9JYPJN

Remove jQuery

We don't need jQuery because everything can be done with DOM API.

Expected Behaviour

No jQuery

Current Behaviour

We have jQuery as dependency just for the option page

Jq Array Deference doesnt work in this extension.

Expected Behaviour

curl https://raw.githubusercontent.com/LearnWebCode/json-example/master/pets-data.json | jq '.pets[]'

should return
{
"name": "Purrsloud",
"species": "Cat",
"favFoods": [
"wet food",
"dry food",
"any food"
],
"birthYear": 2016,
"photo": "https://learnwebcode.github.io/json-example/images/cat-2.jpg"
}
{
"name": "Barksalot",
"species": "Dog",
"birthYear": 2008,
"photo": "https://learnwebcode.github.io/json-example/images/dog-1.jpg"
}
{
"name": "Meowsalot",
"species": "Cat",
"favFoods": [
"tuna",
"catnip",
"celery"
],
"birthYear": 2012,
"photo": "https://learnwebcode.github.io/json-example/images/cat-1.jpg"
}

Current Behaviour

If I try the previous on

Possible Solution

Steps to Reproduce (for bugs)

curl https://raw.githubusercontent.com/LearnWebCode/json-example/master/pets-data.json | jq '.pets[]'

Current behavior :
[
{
"name": "Purrsloud",
"species": "Cat",
"favFoods": [
"wet food",
"dry food",
"any food"
],
"birthYear": 2016,
"photo": "https://learnwebcode.github.io/json-example/images/cat-2.jpg"
},
{
"name": "Barksalot",
"species": "Dog",
"birthYear": 2008,
"photo": "https://learnwebcode.github.io/json-example/images/dog-1.jpg"
},
{
"name": "Meowsalot",
"species": "Cat",
"favFoods": [
"tuna",
"catnip",
"celery"
],
"birthYear": 2012,
"photo": "https://learnwebcode.github.io/json-example/images/cat-1.jpg"
}
]

This doesnt deference the array, so every filter after this breaks.

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39):
  • Operating System and version (desktop or mobile):

filter bar not visible

Opening the inspect element window on the latest chrome will let the filter bar disappear

Add unit tests

We need to add unit tests to produce high quality codebase.

Expected Behaviour

We have unit tests and basic code coverage should be 20%.

Current Behaviour

We don't have tests at all.

Possible Solution

no output update

Expected Behaviour

If you remove a filter, the output should show the same JSON as the input.

Current Behaviour

If you delete the filter that you entered the output will not update.

Possible Solution

change if-statement in /src/ts/index.ts - line 65-75

Steps to Reproduce (for bugs)

For example go to: https://api.cryptonator.com/api/full/btc-usd

  1. inset any character you want in the filter
  2. output will be null
  3. remove the character
  4. output will not updated and is still null

The same issue happens, when you remove a normal filter query.
Otherwise when you remove a whole query at once (marked and then cutted out with ctrl+x)
the output still shows the filtered content.

Your Environment

Chrome 67 (67.0.3396.62) on linux

wrong link in readme to releases

wrong link in readme to releases

Expected Behaviour

link to releases in readme works

Current Behaviour

links to old private GH repo

Possible Solution

will create PR with updated link

Steps to Reproduce (for bugs)

click link in readme to releases

Context

n/a

Your Environment

n/a

Discussion: Migrate UI Code to Library/Framework

I did some poking around the codebase today to put together a pull request.
I found a couple things that I think could be improved.
jQuery is included but barely used. Markup for the UI is hand made by calling document.createElement, then setting properties and then doing appendChild on other elements
This makes it pretty difficult to reason about the markup that is generated.

I would suggest either:

  1. use jQuery much more heavily to allow you to write markup more naturally
  2. remove jQuery entirely and add something like React, Vue, or Preact
  3. use a full application framework like Knockout or Angular

Personally I lean towards option 2 and I would be happy to put together a PR to show what it would be like.
I think option 1 would be minimal effort which is appealing.
I dont think option 3 is a good choice. The application will never scale to a point where there is a return on this sort of investment.

If jQuery can be removed and Preact gets added in it's place the resulting application would be much smaller overall as well which is nice.

I would love to hear your thoughts.

Add a spinner/loader indicating the filter has finished being applied.

Sometimes when I'm doing a filter nothing seems to change (even with the new display error functionality). I would like to see a spinner/loader that indicates that the filter has finished updating. This is especially helpful when working with large data sets.

Expected Behaviour

I type in a filter and a simple loader lets me know that the filter has completed, especially when working with larger data sets and when I have a error in my filter syntax.

Current Behaviour

When I type in a filter (especially on a large data set), I don't see any obvious update to the results (especially if I have an error in my filter syntax).

Possible Solution

Steps to Reproduce (for bugs)

  1. Type in a filter that is incorrect
  2. Update the filter but keep it broken intentionally
  3. Notice there is nothing obvious indicating that the filter has been successfully applied

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39):
  • Operating System and version (desktop or mobile):

Filtered JSON is sometimes empty when bro/q opens

Expected Behaviour

When I open a plain application/json document with bro/q and no filter is applied in the url, the filtered json view should contain the full unfiltered document.

Current Behaviour

Sometimes, usually when bro/q opens a document for the first time, the filtered json view just contains {} instead of the unfiltered document, even if no filter was applied.

Steps to Reproduce (for bugs)

Open an arbitrary application/json document or page

Your Environment

  • bro/q Version 1.4.0
  • Chrome Version 71.0.3578.98
  • Operating System and version (desktop or mobile): Desktop macOS Version 1.14.2

Fails to filter after a specific URL is opened

  1. Install or re-install.
  2. Open URL1: https://api.cryptonator.com/api/full/btc-usd?fa821dba_ipp_uid2=2KAqqXDHQc7imq5N%2fSKzHvpfLYX1dL%2fy7h5ScSQ%3d%3d&fa821dba_ipp_uid1=1521453593959&fa821dba_ipp_key=1521453647804%2Fo9mf6i0lMO%2fDtYRjy%2fakzA%3d%3d#broq-filter=.
  3. It works.
  4. Open URL2: ... (a protected url, reported privately)...
  5. Get HTTP 401 or HTTP 200 โ€” it does not matter what is the response, the effect is the same.
  6. Reload URL1 โ€” it does not work anymore for any URL.
  7. Click "Reload" on the extension record in the settings.
  8. Open URL1 again and see that it works again.

All other extensions were disabled during this experiment.

Expected Behaviour

It works for all URLs.

Current Behaviour

It does not.

Possible Solution

Steps to Reproduce (for bugs)

Seems like it reaches some failure state inside its background hidden tab for the second URL, regardless of the response structure (but maybe status).

Your Environment

Mac OS X.
Chrome: Version 64.0.3282.186 (Official Build) (64-bit)
Extension version: 1.0.0
Installed from the archive, which was downloaded at https://github.com/zalando-incubator/bro-q/releases

Filter errors are not being shown

When an error to the filter occurs, it is not obvious what the issue might be. We should add a box that displays the resulting error message from JQ.

Expected Behaviour

Add a box next to the filter input to display any error messages that might occur.

Current Behaviour

No errors are being displayed

Context

I'd like to know when my filter input is wrong and any helpful info on what needs fixed.

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39):
  • Operating System and version (desktop or mobile):

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.