Skip to content

Commit 579b71c

Browse files
done
1 parent 8a8b7cc commit 579b71c

File tree

1 file changed

+18
-5
lines changed
  • contentcuration/contentcuration/frontend/channelList/views/Channel

1 file changed

+18
-5
lines changed

contentcuration/contentcuration/frontend/channelList/views/Channel/CatalogList.vue

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
22

33
<CatalogFilters>
4-
<!-- Offline banner -->
54
<VSlideYTransition>
65
<ToolBar
76
v-show="offline"
@@ -12,7 +11,6 @@
1211
<OfflineText />
1312
</ToolBar>
1413
</VSlideYTransition>
15-
1614
<VContainer
1715
fluid
1816
class="pb-4 pl-4 pr-4"
@@ -167,7 +165,19 @@
167165
loading: true,
168166
loadError: false,
169167
selecting: false,
168+
169+
/**
170+
* jayoshih: router guard makes it difficult to track
171+
* differences between previous query params and new
172+
* query params, so just track it manually
173+
*/
170174
previousQuery: this.$route.query,
175+
176+
/**
177+
* jayoshih: using excluded logic here instead of selected
178+
* to account for selections across pages (some channels
179+
* not in current page)
180+
*/
171181
excluded: [],
172182
};
173183
},
@@ -191,8 +201,8 @@
191201
},
192202
set(selected) {
193203
this.excluded = union(
194-
this.excluded.filter(id => !selected.includes(id)),
195-
difference(this.page.results, selected),
204+
this.excluded.filter(id => !selected.includes(id)), // Remove selected items
205+
difference(this.page.results, selected), // Add non-selected items
196206
);
197207
},
198208
},
@@ -203,6 +213,8 @@
203213
return RouteNames.CATALOG_DETAILS;
204214
},
205215
channels() {
216+
// Sort again by the same ordering used on the backend - name.
217+
// Have to do this because of how we are getting the object data via getChannels.
206218
return sortBy(this.getChannels(this.page.results), 'name');
207219
},
208220
selectedCount() {
@@ -215,6 +227,7 @@
215227
this.loading = true;
216228
this.debouncedSearch();
217229
230+
// Reset selection mode if a filter is changed (ignore page)
218231
const ignoreDefaults = { page: 0 };
219232
const toQuery = { ...to.query, ...ignoreDefaults };
220233
const fromQuery = { ...this.previousQuery, ...ignoreDefaults };
@@ -282,7 +295,7 @@
282295
cancelButton: 'Cancel',
283296
downloadButton: 'Download',
284297
downloadCSV: 'Download CSV',
285-
downloadPDF: 'Download PDF',
298+
downloadPDF: 'Download PDF', // Kevin demanded NO DOTS!!!
286299
downloadingMessage: 'Download started',
287300
channelSelectionCount:
288301
'{count, plural,\n =1 {# channel selected}\n other {# channels selected}}',

0 commit comments

Comments
 (0)