|
1 | 1 | <template> |
2 | 2 |
|
3 | 3 | <CatalogFilters> |
4 | | - <!-- Offline banner --> |
5 | 4 | <VSlideYTransition> |
6 | 5 | <ToolBar |
7 | 6 | v-show="offline" |
|
12 | 11 | <OfflineText /> |
13 | 12 | </ToolBar> |
14 | 13 | </VSlideYTransition> |
15 | | - |
16 | 14 | <VContainer |
17 | 15 | fluid |
18 | 16 | class="pb-4 pl-4 pr-4" |
|
167 | 165 | loading: true, |
168 | 166 | loadError: false, |
169 | 167 | 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 | + */ |
170 | 174 | 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 | + */ |
171 | 181 | excluded: [], |
172 | 182 | }; |
173 | 183 | }, |
|
191 | 201 | }, |
192 | 202 | set(selected) { |
193 | 203 | 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 |
196 | 206 | ); |
197 | 207 | }, |
198 | 208 | }, |
|
203 | 213 | return RouteNames.CATALOG_DETAILS; |
204 | 214 | }, |
205 | 215 | 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. |
206 | 218 | return sortBy(this.getChannels(this.page.results), 'name'); |
207 | 219 | }, |
208 | 220 | selectedCount() { |
|
215 | 227 | this.loading = true; |
216 | 228 | this.debouncedSearch(); |
217 | 229 |
|
| 230 | + // Reset selection mode if a filter is changed (ignore page) |
218 | 231 | const ignoreDefaults = { page: 0 }; |
219 | 232 | const toQuery = { ...to.query, ...ignoreDefaults }; |
220 | 233 | const fromQuery = { ...this.previousQuery, ...ignoreDefaults }; |
|
282 | 295 | cancelButton: 'Cancel', |
283 | 296 | downloadButton: 'Download', |
284 | 297 | downloadCSV: 'Download CSV', |
285 | | - downloadPDF: 'Download PDF', |
| 298 | + downloadPDF: 'Download PDF', // Kevin demanded NO DOTS!!! |
286 | 299 | downloadingMessage: 'Download started', |
287 | 300 | channelSelectionCount: |
288 | 301 | '{count, plural,\n =1 {# channel selected}\n other {# channels selected}}', |
|
0 commit comments