From bfd9a6c72e0d16c45c23e4a5a3488c04a6369884 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Thu, 12 Oct 2023 09:55:20 -0700 Subject: [PATCH 1/4] Update removeDownloadRequest function to take contentnode_id as argument. --- .../learn/assets/src/composables/useDownloadRequests.js | 6 +++++- .../HybridLearningContentCard/HybridLearningFooter.vue | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kolibri/plugins/learn/assets/src/composables/useDownloadRequests.js b/kolibri/plugins/learn/assets/src/composables/useDownloadRequests.js index f286696c0c7..2dcd3ae5f74 100644 --- a/kolibri/plugins/learn/assets/src/composables/useDownloadRequests.js +++ b/kolibri/plugins/learn/assets/src/composables/useDownloadRequests.js @@ -147,7 +147,11 @@ export default function useDownloadRequests(store) { return Promise.resolve(); } - function removeDownloadRequest(contentRequest) { + function removeDownloadRequest(contentNodeId) { + const contentRequest = downloadRequestMap[contentNodeId]; + if (!contentRequest) { + return Promise.resolve(); + } ContentRequestResource.deleteModel({ id: contentRequest.id, }); diff --git a/kolibri/plugins/learn/assets/src/views/HybridLearningContentCard/HybridLearningFooter.vue b/kolibri/plugins/learn/assets/src/views/HybridLearningContentCard/HybridLearningFooter.vue index 64d60f7a788..ae6eb1d96fa 100644 --- a/kolibri/plugins/learn/assets/src/views/HybridLearningContentCard/HybridLearningFooter.vue +++ b/kolibri/plugins/learn/assets/src/views/HybridLearningContentCard/HybridLearningFooter.vue @@ -196,7 +196,7 @@ this.disableRequestButtons = false; }, confirmRemoveRequest() { - this.removeDownloadRequest(this.contentNode).then(() => { + this.removeDownloadRequest(this.contentNode.id).then(() => { this.removeConfirmationModalOpen = false; }); }, From dd3e24fcd0c7ef949d2eecc11886ce8672e67ce0 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Thu, 12 Oct 2023 11:19:20 -0700 Subject: [PATCH 2/4] Simplify responsive display. Fix selection behaviour. --- .../views/DownloadsList/index.vue | 231 ++++++------------ 1 file changed, 79 insertions(+), 152 deletions(-) diff --git a/kolibri/plugins/learn/assets/src/my_downloads/views/DownloadsList/index.vue b/kolibri/plugins/learn/assets/src/my_downloads/views/DownloadsList/index.vue index 21114bf81d9..24dfcdf5b17 100644 --- a/kolibri/plugins/learn/assets/src/my_downloads/views/DownloadsList/index.vue +++ b/kolibri/plugins/learn/assets/src/my_downloads/views/DownloadsList/index.vue @@ -8,7 +8,7 @@ :totalPageNumber="totalPageNumber" :numFilteredItems="downloadItemListLength" > - + - - - - -