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

Allow hidden=true for categorized object, #999

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

btsimonh
Copy link

hiding the tab and the config pane.

Q A
Is bugfix?
New feature? ✔️
Is backward-compatible? ✔️
Tests pass? ✔️
Fixed issues comma-separated list of tickets # fixed by the PR, if any
Updated README/docs?
Added CHANGELOG entry?

Hi, my first PR for this branch.
The small mods allow 'Category' tabs to hide when the related object is hidden.

I have added my HTML I was using to test the feature, not sure if I was correct to do so...
(will shortly push this updated with a valid jsoneditor js location!)

pls. review carefully....
br, Simon

@schmunk42
Copy link
Collaborator

Do you also have a codeceptjs test, since there's a test page?

@btsimonh
Copy link
Author

hi @schmunk42,
I've not looked into the codeceptjs stuff yet - is there a guide anywhere?
I had some trouble working out how to get started and debug - I may add a Wiki page with the steps I ended up using to get something operational, as it is a complex project.
s

@schmunk42
Copy link
Collaborator

Do you have Docker on your machine?

Starting point for testing: https://github.com/json-editor/json-editor/tree/master/tests#testing

@btsimonh
Copy link
Author

hi @schmunk42,

thanks for bearing with me on this.

no docker here; I try to keep things as simple as possible, and I'm windows 10 based :(.
I was a little scared when the project installed puppeteer on my machine and downloaded chromium :).

I ran 'npm run test' and it seems to do something, but not sure what I am looking at... I guess I need to spend some time looking at the current tests and see which is closest. But 'run tests' is not the codeceptjs stuff, is it?

but... having looked a little deeper, I found that the main reason stuff was not working well for me was port 9001 was occupied...
so...
To run tests on windows (complete from scratch):
clone repo to a folder.
go to folder
npm install
check port 9001 is available, if not check here for a solution to Intel Graphics issue:
npm run build
npm run winserver - will spawn a server window serving on 9001.
npm run cp:test - runs tests

the results are NOT clean, I see a lot of these in the test output:

(node:43560) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7509)
(node:43560) UnhandledPromiseRejectionWarning: Error: Cannot dismiss dialog which is already handled!
    at assert (D:\Data\dev\yella\json-editor\node_modules\puppeteer\lib\helper.js:279:11)
    at Dialog.dismiss (D:\Data\dev\yella\json-editor\node_modules\puppeteer\lib\Dialog.js:68:5)
    at Dialog.<anonymous> (D:\Data\dev\yella\json-editor\node_modules\puppeteer\lib\helper.js:112:23)
    at Page.<anonymous> (D:\Data\dev\yella\json-editor\node_module

and it finishes with (master branch from yesterday):

  FAIL  | 97 passed, 4 failed, 3 skipped   // 5m 

is this normal?
br, Simon

p.s. I'm guessing that the 'test' I should try to create would load different schemas with different arrangements of categories and hidden, and check for text on screen? - this would be the first time I'd created a test involving this sort of thing....

@schmunk42
Copy link
Collaborator

I can't really help you with the setup.
But are @optional tests excluded?

@germanbisurgi
Copy link
Collaborator

It would be nice if the same behaviour applies when the category is a dependant editor.

{
  "options": {
    "dependencies": {
      "age": 26
    }
  }
}

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

Successfully merging this pull request may close these issues.

None yet

3 participants