Attempt to resolve #1166 with displayTree=BOD in URL#1177
Conversation
There was a problem hiding this comment.
Pull request overview
Enables both the SSVC Calculator (ssvc-calc) and Explorer (ssvc-explorer) to choose the initial/default decision tree based on a defaultTree URL parameter, with a fallback to a default selection when no match is found.
Changes:
- Added
defaultTreeURL parameter parsing in both tools to drive the initial tree selection. - Updated selection logic to match on the provided
defaultTreestring (instead of hardcoding a “Deployer” match). - Added fallback behavior and bumped tool version strings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/ssvc-explorer/simple.js | Adds URL-driven default tree selection and fallback selection logic for Explorer. |
| docs/ssvc-calc/ssvc.js | Adds URL-driven default tree selection and fallback selection logic for Calculator; bumps version. |
| $(function () { | ||
| /* document.ready() */ | ||
| reset_form(); | ||
| let defaultTree = "Deployer Patch Application Priority"; |
There was a problem hiding this comment.
My opinion only, for what it's worth:
"default" would be the thing that displays when no url parameter is set.
so the parameter will override the default, and could just be something like "tree" or "displayTree"
e.g., https://.../ssvc-calc/?tree=Foo
There was a problem hiding this comment.
or rather ?display=Foo (avoid tree since we want to be consistent calling them tables now
There was a problem hiding this comment.
okay made it possible for both display and displayTree as potential URL parameters that can be used for displaying the right tree.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
security fix for exception handling. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
exception handling for top.location - good idea. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Resolves Issue #1166 when you use the new code you can specify the defaultTree in url, a matching tree will be displayed as the default for both Explorer and Calculator tools.
This pull request updates the default decision tree selection logic in both the
ssvc-calcandssvc-explorertools. The main improvement is allowing the default decision tree to be specified via a URL parameter, with better handling when the specified tree is not found. Additionally, version numbers for both tools have been incremented.Default Decision Tree Selection Improvements:
defaultTreeURL parameter in bothssvc-calc(ssvc.js) andssvc-explorer(simple.js). If the parameter is present, it overrides the previous hardcoded default. [1] [2]defaultTreevalue, instead of always matching "Deployer". [1] [2]Version Updates:
ssvc-calc/ssvc.jsfrom 6.0.2 to 6.1.1.ssvc-explorer/simple.jsfrom 1.0.12 to 1.0.13.