-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If worklist is restarting, don't set new sort comparator #1259
Conversation
@@ -55,7 +55,7 @@ export default App.extend({ | |||
this.setState(filterState.getFiltersState()); | |||
}, | |||
onChangeStateSort() { | |||
if (!this.isRunning()) return; | |||
if (!this.isRunning() || this.isRestarting()) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't reproduce this bug in my dev environment, so can't tell if this actually fixes the issue.
Also still contemplating how to test this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the test, but isRestarting
doesn't fix the issue:
cy
.intercept('GET', '/api/flows*', { 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();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about checking that the list
view has a collection before setting the comparator?
Like:
onChangeStateSort() {
if (!this.isRunning()) return;
const listView = this.getChildView('list');
if (listView.collection) {
listView.setComparator(this.getComparator());
}
},
That seems to work...
Passing run #6366 ↗︎
Details:
Review all test suite changes for PR #1259 ↗︎ |
Pull Request Test Coverage Report for Build cdb37ccb-08f4-4b90-973a-bd4d4ba2477fDetails
💛 - Coveralls |
@@ -55,7 +55,7 @@ export default App.extend({ | |||
this.setState(filterState.getFiltersState()); | |||
}, | |||
onChangeStateSort() { | |||
if (!this.isRunning()) return; | |||
if (!this.isRunning() || this.isRestarting()) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the test, but isRestarting
doesn't fix the issue:
cy
.intercept('GET', '/api/flows*', { 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();
0658902
to
e42c6cb
Compare
OK so.. this fixed seemed oddly unnecessary.. how was it that the app was running.. wasn't restarting and still had the preloader running. It turns out the issue was deeper and it might subsequently also solve the issue we're seeing in the program action bug. This'll actually be an odd place to test this.. Really at some point we need to add component tests for the base classes. But I think we can keep this test and just add a comment that links to this PR and a message about moving it to a component test. So in Currently: onSyncData(fetchId, options, args = []) {
this._isLoading = false;
if (!this.isRunning() || this._fetchId !== fetchId) return;
this.finallyStart.call(this, options, ...args);
},
triggerSyncFail(fetchId, options, ...args) {
this._isLoading = false;
if (!this.isRunning() || this._fetchId !== fetchId) return;
this.triggerMethod('fail', options, ...args);
}, Change to: (notice the switch from onSyncData(fetchId, options, args = []) {
if (!this._isRunning || this._fetchId !== fetchId) return;
this._isLoading = false;
this.finallyStart.call(this, options, ...args);
},
triggerSyncFail(fetchId, options, ...args) {
if (!this._isRunning || this._fetchId !== fetchId) return;
this._isLoading = false;
this.triggerMethod('fail', options, ...args);
}, |
@paulfalgout that explanation makes a ton of sense. My spidey senses were tingling when I saw this story because it seemed like something we would have noticed before, as the particular trigger is relatively common. |
e42c6cb
to
d20ce66
Compare
@paulfalgout interesting... I updated the PR to your solution and it seems to fix this worklist bug (via the test passing). But it doesn't fix the program action sidebar bug in #1260. |
Shortcut Story ID: [sc-50540]