Skip to content

Commit

Permalink
Prevent multiple calls to concept set list when loading cohort editor (
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonysena authored Oct 24, 2023
1 parent cb1a150 commit 427a622
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions js/components/atlas.cohort-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<cohort-expression-viewer params="expression: $component.currentCohortDefinition().expression"></cohort-expression-viewer>
<!-- /ko -->
<div class="modal fade" data-bind="modal: showModal" tabindex="-1" role="dialog">
<!-- ko if:showModal-->
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" data-bind="text: ko.i18n('components.atlasCohortEditor.importConceptSet', 'Import Concept Set From Repository...')"></div>
Expand All @@ -27,6 +28,7 @@
</div>
</div>
</div>
<!-- /ko -->
</div>
</div>
</div>
5 changes: 2 additions & 3 deletions js/components/circe/components/ConceptSetBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ define([
// dispose subscriptions

// startup actions
self.loadConceptSetsFromRepository(self.selectedSource()
.url);
self.loadConceptSetsFromRepository(self.selectedSource().url);

this.options = {
Facets: [
Expand Down Expand Up @@ -175,7 +174,7 @@ define([
render: datatableUtils.getCreatedByFormatter(),
}
]);

const { pageLength, lengthMenu } = commonUtils.getTableOptions('M');
this.pageLength = params.pageLength || pageLength;
this.lengthMenu = params.lengthMenu || lengthMenu;
Expand Down
2 changes: 2 additions & 0 deletions js/components/from-reusables-modal/from-reusables-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2 class="selected-reusable-name" data-bind="text: selectedReusable().name"></h
</atlas-modal>

<div data-bind="modal: showCsBrowser" class="modal fade cs-modal" tabindex="-1" role="dialog">
<!-- ko if:showCsBrowser-->
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" data-bind="text: ko.i18n('components.conceptSetBuilder.selectConceptSet', 'Select Concept Set...')"></div>
Expand All @@ -62,4 +63,5 @@ <h2 class="selected-reusable-name" data-bind="text: selectedReusable().name"></h
</div>
</div>
</div>
<!-- /ko -->
</div>
2 changes: 1 addition & 1 deletion js/extensions/bindings/datatableBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ define([
table.clear();

// Rebuild table from data source specified in binding
if (data.length > 0)
if (data && data.length > 0)
table.rows.add(data);

// drawing may access observables, which updating we do not want to trigger a redraw to the table
Expand Down
4 changes: 3 additions & 1 deletion js/services/AuthAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,9 @@ define(function(require, exports) {

const executeWithRefresh = async function(httpPromise) {
const result = await httpPromise;
await refreshToken();
if (config.userAuthenticationEnabled) {
await refreshToken();
}
return result;
}

Expand Down

0 comments on commit 427a622

Please sign in to comment.