-
Notifications
You must be signed in to change notification settings - Fork 729
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
Fixes loading states in general #10455
Changes from all commits
224e863
919f277
90ae11d
7d80f00
bde78d3
8eea333
97f6a99
d500a97
c47fbac
dd4c4dd
773edc4
db9602b
d942bda
6d0e51c
fb76682
b4a797a
aaa1c84
ed70564
f5153e9
30dd238
678da96
70179a8
ce235f3
caa6449
97e3d28
818d765
c15cbe6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ const logging = logger.getLogger(__filename); | |
export default { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. non-blocking but potentially important to address in a further loading state or coach-specific PR if not here: i just wanted to re-raise the issue here as it is not caused or worsened by your work but is slightly affected by it: the oddness in loading in coach-multi-facility-classes-page.movthe scenario definitely was not caused by your PR, but is affected by the addition of the loading spinner. just FYI the same doesn't occur in the somewhat parallel scenario in facility-multi-facility-as-expected.movThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... I'll see if maybe we can clear the contents of the page in coach whenever we make a new requests to a different facility or something. |
||
state() { | ||
return { | ||
busy: false, | ||
dataLoading: false, | ||
classList: [], | ||
pageName: '', | ||
toolbarRoute: {}, | ||
|
@@ -38,6 +38,9 @@ export default { | |
SET_TOOLBAR_TITLE(state, title) { | ||
state.toolbarTitle = title; | ||
}, | ||
SET_DATA_LOADING(state, dataLoading) { | ||
state.dataLoading = dataLoading; | ||
}, | ||
SET_TOOLBAR_ROUTE(state, toolbarRoute) { | ||
state.toolbarRoute = toolbarRoute; | ||
}, | ||
|
@@ -60,13 +63,19 @@ export default { | |
}, | ||
actions: { | ||
setClassList(store, facilityId) { | ||
store.commit('SET_DATA_LOADING', true); | ||
store.commit('SET_CLASS_LIST', []); // Reset the list if we're loading a new one | ||
return ClassroomResource.fetchCollection({ | ||
getParams: { parent: facilityId || store.getters.currentFacilityId, role: 'coach' }, | ||
}) | ||
.then(classrooms => { | ||
store.commit('SET_CLASS_LIST', classrooms); | ||
store.commit('SET_DATA_LOADING', false); | ||
}) | ||
.catch(error => store.dispatch('handleApiError', error)); | ||
.catch(error => { | ||
store.dispatch('handleApiError', error); | ||
store.commit('SET_DATA_LOADING', false); | ||
}); | ||
}, | ||
/** | ||
* Handle coach page errors. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,20 +45,23 @@ | |
@clearall="handleClickClearAll" | ||
/> | ||
|
||
<p v-if="!channelsAreInstalled"> | ||
<p v-if="!channelsAreInstalled && !channelListLoading"> | ||
{{ $tr('emptyChannelListMessage') }} | ||
</p> | ||
|
||
<div class="channels-list"> | ||
<ChannelPanel | ||
v-for="channel in sortedChannels" | ||
:key="channel.id" | ||
:channel="channel" | ||
:disabled="channelIsBeingDeleted(channel.id)" | ||
:showNewLabel="showNewLabel(channel.id)" | ||
@select_delete="deleteChannelId = channel.id" | ||
@select_manage="handleSelectManage(channel.id)" | ||
/> | ||
<KCircularLoader v-if="channelListLoading" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. non-blocking, hoping for additions in a follow-up PR: having the loading spinner here & in loading-in-content-and-permissions.mov |
||
<div v-else> | ||
<ChannelPanel | ||
v-for="channel in sortedChannels" | ||
:key="channel.id" | ||
:channel="channel" | ||
:disabled="channelIsBeingDeleted(channel.id)" | ||
:showNewLabel="showNewLabel(channel.id)" | ||
@select_delete="deleteChannelId = channel.id" | ||
@select_manage="handleSelectManage(channel.id)" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<SelectTransferSourceModal :pageName="pageName" /> | ||
|
@@ -134,6 +137,7 @@ | |
'managedTasks', | ||
]), | ||
...mapState('manageContent/wizard', ['pageName']), | ||
...mapState('manageContent', ['channelListLoading']), | ||
pageTitle() { | ||
return deviceString('deviceManagementTitle'); | ||
}, | ||
|
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.
non-blocking, just curious!
is there a reason this is a
var
vs. aconst
? it appears like its value doesn't get reassigned (just conditionally assigned) and it doesn't need to be accessed beyond this scope, but i think i'm missing something & i'd love to learn what it is! 🙂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 needed it to be a
var
in an earlier failed attempt to write this bit and I forgot to change it to const after getting it settledThere 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 just assumed it was for some technical reason that went over my head! 😅