Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential improvement to the Demo play ground #348

Open
samer1977 opened this issue May 24, 2024 · 3 comments
Open

Potential improvement to the Demo play ground #348

samer1977 opened this issue May 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@samer1977
Copy link

samer1977 commented May 24, 2024

Hi,

First thanks for providing a way to test jslt using the demo (https://www.garshol.priv.no/jslt-demo ), Couple of things that can be an improvement:

1- Adding line number (as in this) in the JSLT & the Input Editor. This will be helpful when debugging because of an error since most of the error would mention the line number where the error occurred.

2- Its says here that is by default the jslt engine will filter null,empty array and objects and you have to update the filter if you want to do otherwise. I notice in Nifi the jslt processor there is field to specify the default filter which you can override. Can this be an option in the demo tool as well.

3- The three area (input, jslt & result) need to be fitted by default in one page ( with option to increase size as needed), each area needs to have its own scrollbar (vertical & horizontal ) while keeping text wrapping as an option. Text wrapping by default add more confusion to complex spec and I find my self often how to increase the width to overcome this.

4- More concise error message with option to view stacktrace when needed. I noticed when something goes wrong the error message almost takes over the entire page. most of the time all I care about is just the error message and not the stack trace, so either hide it or make it optional to view. You can organize the expectation list horizontally vs vertically to conserve space as well.

5- Just thought of another one, It would be nice just like in jolt to have options to beautify\validate json input.

I hope that makes sense and Im not asking for too much.
Thanks for reading and consideration.
S

@larsga larsga added the enhancement New feature or request label May 27, 2024
@larsga
Copy link
Collaborator

larsga commented May 27, 2024

I think all of these ideas make a lot of sense, but I don't think I'm going to work on this at the moment. Pull requests are very much welcome, though.

The current UI is basically an HTML page with super simple embedded JavaScript code, so extending/modifying it is not difficult.

@catull
Copy link

catull commented May 27, 2024

@larsga I actually am looking at it.

There are a few changes one needs to make for running it locally.
Still, I have a locally modified version of jstl, which I versioned to be 0.1.15-SNAPSHOT.
I see it built in core/build/libs.
I introduce a new builtin function replace-regexp, see PR #350.

However, even if I add this new SNAPSHOT version to playground/build.gradle:

dependencies {
  implementation project(':core')
  implementation 'org.eclipse.jetty:jetty-server:9.4.45.v20220203'
  implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
  implementation 'com.schibsted.spt.data:jslt:0.1.15-SNAPSHOT'
}

group 'com.schibsted.spt.data'
version '0.1.15-SNAPSHOT'

it is still not picked up.

I do a gradle jar && gradle shadowJar.

Then I start it, as described in playground/README.md.

But when I want to use it in the playground at localhost:9999/jstl, I get the same error as when I try it at https://www.garshol.priv.no/jslt-demo.

See the image below.

So, what is the trick I am missing ?

image

@catull
Copy link

catull commented May 27, 2024

Never mind, I was in the branch master instead of feature/support-replace-with-regexp.
All is fine.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants