Skip to content

Commit

Permalink
Merge pull request #1259 from RoundingWell/bugfix/worklist-filter
Browse files Browse the repository at this point in the history
If worklist is restarting, don't set new sort comparator
  • Loading branch information
paulfalgout committed May 9, 2024
2 parents f75c42b + d20ce66 commit 501085e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/base/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ export default App.extend({
},
beforeStart: noop,
onSyncData(fetchId, options, args = []) {
if (!this._isRunning || this._fetchId !== fetchId) return;

this._isLoading = false;
if (!this.isRunning() || this._fetchId !== fetchId) return;

this.finallyStart.call(this, options, ...args);
},
triggerSyncFail(fetchId, options, ...args) {
if (!this._isRunning || this._fetchId !== fetchId) return;

this._isLoading = false;
if (!this.isRunning() || this._fetchId !== fetchId) return;

this.triggerMethod('fail', options, ...args);
},
Expand Down
34 changes: 34 additions & 0 deletions test/integration/patients/worklist/worklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -4132,4 +4132,38 @@ context('worklist page', function() {
.find('button')
.should('not.exist');
});

// NOTE: needs to be moved to base class component tests
specify('change sort before list is done loading', function() {
cy
.routesForPatientAction()
.routeFlows()
.routeActions()
.routeFlow()
.routeFlowActions()
.routePatientByFlow()
.routePatientField();

cy
.intercept('GET', '/api/actions*', { delay: 1000, body: { data: [] } })
.visit('/worklist/owned-by');

cy
.get('[data-date-filter-region]')
.should('contain', 'Added:')
.should('contain', 'This Month')
.click();

cy
.get('.app-frame__pop-region')
.contains('Last Week')
.click();

cy
.get('.worklist-list__filter-sort')
.click()
.get('.picklist')
.contains('Patient Last: A')
.click();
});
});

0 comments on commit 501085e

Please sign in to comment.