-
Notifications
You must be signed in to change notification settings - Fork 13
Fix buttons in JsTree output #201
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
base: main
Are you sure you want to change the base?
Conversation
Previously, there was no test coverage for the output of multiple json-tree modules. To address this, this commit adds a new test that parses two modules and compares their combined output against the old expected output. This provides more comprehensive testing and ensures that the json-tree modules are correctly processing multiple inputs. JIRA:LIGHTY-229 Signed-off-by: tobias.pobocik <[email protected]>
Added test case for generating HTML file from multiple modules to identify the issue with multiple <body> tags. The test asserts that the file contains the expected modules, verifies that there is only one <body> tag, and checks if the output matches the expected HTML file. JIRA: LIGHTY-128 Signed-off-by: tobias.pobocik <[email protected]>
Ensure JsTree output contains a single body element, resolving the issue of multiple bodies in the generated HTML file. JIRA: LIGHTY-128 Signed-off-by: tobias.pobocik <[email protected]>
Since we have changed the logic of JsTree, the expected output for deviations needs to be changed. JIRA: LIGHTY-128 Signed-off-by: tobias.pobocik <[email protected]>
Expanders and collapsers were not funcional in the generated html file when using multiple modules. This patch resolves that issue JIRA: LIGHTY-229 Signed-off-by: tobias.pobocik <[email protected]>
Since we have changed the logic of JsTree, the expected output needs to be changed. JIRA: LIGHTY-229 Signed-off-by: tobias.pobocik <[email protected]>
Buttons expand all and colapse all did nothing when using multiple modules. JIRA:LIGHTY-230 Signed-off-by: tobias.pobocik <[email protected]>
Since we have changed the logic of JsTree, the expected output for deviations needs to be changed. JIRA:LIGHTY-230 Signed-off-by: tobias.pobocik <[email protected]>
| @@ -33,5 +34,5 @@ public interface Emitter { | |||
| /** | |||
| * Close after printing out the module. | |||
| */ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @param in javadoc.
| @Override | ||
| public void close() { | ||
| this.usedFormat.close(); | ||
| public void close(Collection<Module> modules) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final
| @@ -48,7 +49,7 @@ void init(final EffectiveModelContext context, final SchemaTree tree, final Conf | |||
| /** | |||
| * Close after printing out the module. | |||
| */ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @param in javadoc.
| try { | ||
| text = Resources.toString(url, StandardCharsets.UTF_8); | ||
|
|
||
| final StringBuilder moduleCode = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this new code should not be in try-catch block.
|
|
||
| // Define the multi-line string to add | ||
| final String multiLineStringToAdd = | ||
| " $('#basic-" + module.getName() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a text block here instead. It will improve the formatting of the resulting injected query.
| } | ||
|
|
||
| // Encapsulate module code within $(document).ready(function () {...}); | ||
| final String encapsulatedCode = "\n$(document).ready(function () {\n" + moduleCode + "});\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating this query should be moved to a separate method and called only if commentIndex != -1. If this condition is not met, the query will not be used.
| format.emit(module); | ||
| } | ||
| format.close(); | ||
| format.close((Collection<Module>) effectiveModelContext.getModules()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contextFactory.getModulesForTesting()
Fix buttons in JsTree output
Buttons expand all and colapse all did nothing when
using multiple modules.
JIRA:LIGHTY-230