Skip to content

Commit

Permalink
fix(machine learning): fix algorithms parameters reset on algo select…
Browse files Browse the repository at this point in the history
… change
  • Loading branch information
FlorentinTh committed May 15, 2021
1 parent db2fb91 commit 3e620fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<div class="right">
<div class="actions">
<p class="action">
{{#[utils/compare] ../fileType '===' 'models'}}
<button class="btn-disabled" id="download" disabled>Download</button>
{{else}}
{{#[utils/compare] ../fileType '!==' 'models'}}
<button id="download">Download</button>
{{else}}
<button class="btn-disabled" id="download" disabled>Download</button>
{{/[utils/compare]}}
</p>
<p class="action">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class Learning extends Task {

if (!(confParamsStore === undefined)) {
Store.remove('conf-params');
this.removeAlgoParams();
}

const select = event.target;
Expand Down Expand Up @@ -262,20 +263,24 @@ class Learning extends Task {
}
}

removeAlgoData() {
const storedValue = sessionStorage.getItem('algorithm-name');
if (!(storedValue === undefined)) {
sessionStorage.removeItem('algorithm-name');
algoSelect.options[0].selected = true;
}

removeAlgoParams() {
const JSONValues = JSON.parse(JSON.stringify(sessionStorage));
// eslint-disable-next-line array-callback-return
Object.keys(JSONValues).filter(key => {
if (/^algo-param-/.test(key)) {
sessionStorage.removeItem(key);
}
});
}

removeAlgoData() {
const storedValue = sessionStorage.getItem('algorithm-name');
if (!(storedValue === undefined)) {
sessionStorage.removeItem('algorithm-name');
algoSelect.options[0].selected = true;
}

this.removeAlgoParams();

const paramsContainer = this.context.querySelector('.params-container');

Expand Down

0 comments on commit 3e620fb

Please sign in to comment.