Skip to content

Commit

Permalink
updated solution to align with the existing structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Amelie1253 committed Feb 25, 2025
1 parent 702183d commit 6ba59ce
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions web-client/public/js/grnstate.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,7 @@ export const grnState = {

// Viewport Size Parameter
viewportSize: VIEWPORT_INIT,

// Demo Dropdown Selection
demoDropdownValue: null,
};
3 changes: 3 additions & 0 deletions web-client/public/js/setup-load-and-import-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export const setupLoadAndImportHandlers = (grnState) => {
if (selected === demoClass) {
loadDemo(demoPath, demoClass, demoName);
}
grnState.demoDropdownValue = selected;
});
};

Expand Down Expand Up @@ -227,12 +228,14 @@ export const responseCustomWorkbookData = (grnState, queryURL, name) => {
}
grnState.name = name;
grnState.workbook = workbook;
grnState.demoDropdownValue = null;
// Reset the node coloring dataset selection
grnState.nodeColoring.topDataset = grnState.defaultDataset;
grnState.nodeColoring.bottomDataset = grnState.defaultDataset;
grnState.annotateLinks();
disableUpload(false);
updateApp(grnState);
reloader = () => responseCustomWorkbookData(grnState, queryURL, name);

Check failure on line 239 in web-client/public/js/setup-load-and-import-handlers.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Trailing spaces not allowed
});
};
9 changes: 9 additions & 0 deletions web-client/public/js/update-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@ const updateModeViews = () =>{
}
};

const resetDemoDropdown = () =>{
$("#demoSourceDropdown option").removeAttr("selected");
$("#demoSourceDropdown").val("none");
};

const checkWorkbookModeSettings = () => {
const hasExpression = hasExpressionData(grnState.workbook.expression);

Expand Down Expand Up @@ -822,6 +827,10 @@ export const updateApp = grnState => {
grnState.nodeColoringEnabled = false;
}
}
if (!(grnState.demoDropdownValue)){

Check failure on line 830 in web-client/public/js/update-app.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing space before opening brace
resetDemoDropdown();
}

refreshApp();

// Rare exception to the MVC cycle: right now we have no way of knowing whether the workbook has changed
Expand Down

0 comments on commit 6ba59ce

Please sign in to comment.