Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,19 @@ jobs:
ls -al install/*
echo "${PWD}/install/bin" >> $GITHUB_PATH

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'yarn'

- name: Install packages
- name: Enable Corepack
run: |
yarn install --pure-lockfile
corepack enable
corepack prepare yarn@stable --activate
corepack yarn --version

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install dependencies
run: corepack yarn install --immutable

- name: Configure rails app
run: |
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,3 @@ app/javascript/XDSMjs
# Ignore Openmdao reports
**/reports
**/*_out

# Ignore sqlite files
Binary file added .yarn/install-state.gz
Binary file not shown.
6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
approvedGitRepositories:
- "**"

enableScripts: true

nodeLinker: node-modules
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<h1>CHANGELOG</h1>

<h3>2.0.3 (28/04/2026)</h3>
<ul>
<li>Add static html XDSM generation with variable names</li>
</ul>

<h3>2.0.2 (13/04/2026)</h3>
<ul>
<li>[Tech] Update dependencies backend/frontend</li>
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.2
2.0.3
8 changes: 6 additions & 2 deletions app/controllers/analysis_exports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class AnalysisExportsController < ApplicationController
def new
mda_id = params[:mda_id]
format = params[:format]
edge_labels = params[:edge_labels]
with_server = (params[:with_server] == "true")
with_runops = (params[:with_runops] == "true")
with_unittests = (params[:with_unittests] == "true")
Expand Down Expand Up @@ -48,9 +49,12 @@ def new
end

elsif format == "html"
htmlgen = WhatsOpt::HtmlGenerator.new(mda, url: self.request.base_url)
show_link_nb_only = (edge_labels != "names")
htmlgen = WhatsOpt::HtmlGenerator.new(mda,
url: self.request.base_url,
show_link_nb_only: show_link_nb_only)
content, filename = htmlgen.generate
send_data content, filename: filename, type: "text/html"
send_data content, filename: filename, type: "text/html", disposition: "inline"
else
redirect_to mdas_url, alert: "Export format '#{format}' not handled!"
end
Expand Down
25 changes: 24 additions & 1 deletion app/javascript/mda_viewer/components/ToolBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class ToolBar extends React.Component {
const hrefGemseo = api.url(`${exportBase}.gemseo?with_server=false`);
const hrefCmdows = api.url(`${exportBase}.cmdows`);
const hrefHtml = api.url(`${exportBase}.html`);
const hrefHtmlVariableNames = api.url(`${exportBase}.html?edge_labels=names`);
return (
<div>
<div className="btn-toolbar" role="toolbar">
Expand Down Expand Up @@ -159,7 +160,29 @@ class ToolBar extends React.Component {
</button>
</div>
<div className="btn-group me-2" role="group">
<a className="btn btn-primary" href={hrefHtml}>Export Html</a>
<button
className="btn btn-primary dropdown-toggle"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
Export Html
</button>
<ul className="dropdown-menu">
<li>
<a className="dropdown-item" href={hrefHtml}>with Variables Counts</a>
</li>
<li>
<a
className="dropdown-item"
href={hrefHtmlVariableNames}
target="_blank"
rel="noopener noreferrer"
>
with Variables Names
</a>
</li>
</ul>
</div>
</div>
<div className="collapse" id="collapseListing">
Expand Down
16 changes: 9 additions & 7 deletions app/lib/whats_opt/html_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
const mdo = <%= @xdsm_json %>;
const config = {
labelizer: {
ellipsis: 5,
subSupScript: false,
showLinkNbOnly: true,
ellipsis: <%= @label_ellipsis %>,
subSupScript: false,
showLinkNbOnly: <%= @show_link_nb_only %>,
},
layout: {
origin: { x: 50, y: 20 },
cellsize: { w: 150, h: 50 },
padding: 10,
origin: { x: 50, y: 20 },
cellsize: { w: 150, h: 50 },
padding: 10,
},
withDefaultDriver: false,
};
Expand All @@ -52,11 +52,13 @@

module WhatsOpt
class HtmlGenerator
def initialize(mda, url: nil)
def initialize(mda, url: nil, show_link_nb_only: true)
@mda = mda
@basename = "xdsm"
@content = ""
@at = url.nil? ? "" : "@#{url}"
@show_link_nb_only = show_link_nb_only
@label_ellipsis = show_link_nb_only ? 5 : 200
end

def generate
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@
"eslint-webpack-plugin": "^6.0.0",
"webpack-dev-server": "^5.0.4"
},
"packageManager": "yarn@1.22.19"
"packageManager": "yarn@4.14.1"
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
openmdao
salib
smt
openturns
openturns<1.27
egobox
openmdao_extensions
thrift
Expand Down
Loading
Loading