|
19 | 19 | @click="clearFilters"
|
20 | 20 | />
|
21 | 21 | </div>
|
22 |
| - <div v-else> |
23 |
| - <VLayout row wrap> |
24 |
| - <VFlex |
25 |
| - v-for="collection in collections" |
26 |
| - :key="`public-collection-${collection.id}`" |
27 |
| - xs12 |
28 |
| - class="py-2" |
29 |
| - > |
30 |
| - <VCard |
31 |
| - tabindex="0" |
32 |
| - class="pt-2" |
33 |
| - data-test="collection" |
34 |
| - @click="setCollection(collection.id)" |
35 |
| - @keyup.enter="setCollection(collection.id)" |
36 |
| - > |
37 |
| - <VLayout> |
38 |
| - <div class="px-2 text-xs-center"> |
39 |
| - <Icon style="font-size: 75px;"> |
40 |
| - local_hospital |
41 |
| - </Icon> |
42 |
| - </div> |
43 |
| - <VCardTitle primary-title class="pb-2 pt-2"> |
44 |
| - |
45 |
| - <!-- TODO: add 'notranslate' class once we figure out how to handle collections |
46 |
| - that have multiple channel languages inside --> |
47 |
| - <h3 class="headline mb-0"> |
48 |
| - {{ collection.name }} |
49 |
| - </h3> |
50 |
| - <p class="body-1 grey--text"> |
51 |
| - {{ $tr('channelCount', { count: collection.count }) }} |
52 |
| - </p> |
53 |
| - <p v-if="collection.description"> |
54 |
| - {{ collection.description }} |
55 |
| - </p> |
56 |
| - </VCardTitle> |
57 |
| - </VLayout> |
58 |
| - <VCardActions> |
59 |
| - <VSpacer /> |
60 |
| - <IconButton |
61 |
| - icon="copy" |
62 |
| - :text="$tr('copyToken')" |
63 |
| - @click.stop="displayToken = collection.token" |
64 |
| - /> |
65 |
| - </VCardActions> |
66 |
| - </VCard> |
67 |
| - </VFlex> |
68 |
| - </VLayout> |
69 |
| - |
70 |
| - <KModal |
71 |
| - v-if="displayToken" |
72 |
| - :title="$tr('copyTitle')" |
73 |
| - :text="$tr('copyTokenInstructions')" |
74 |
| - :cancelText="$tr('close')" |
75 |
| - @cancel="displayToken = null" |
76 |
| - > |
77 |
| - <div class="mb-3"> |
78 |
| - {{ $tr('copyTokenInstructions') }} |
79 |
| - </div> |
80 |
| - <CopyToken :token="displayToken" /> |
81 |
| - </KModal> |
82 |
| - |
83 |
| - </div> |
84 | 22 | </VContainer>
|
85 | 23 |
|
86 | 24 | </template>
|
|
90 | 28 | import flatten from 'lodash/flatten'; // Tests fail with native Array.flat() method
|
91 | 29 | import { catalogFilterMixin } from './mixins';
|
92 | 30 | import { constantsTranslationMixin } from 'shared/mixins';
|
93 |
| - import IconButton from 'shared/views/IconButton'; |
94 |
| - import CopyToken from 'shared/views/CopyToken'; |
95 |
| -
|
96 |
| - const publicCollections = window.publicCollections || []; |
97 | 31 |
|
98 | 32 | /*
|
99 | 33 | Returns the expected format for filters
|
|
108 | 42 |
|
109 | 43 | export default {
|
110 | 44 | name: 'CatalogFilterBar',
|
111 |
| - components: { |
112 |
| - IconButton, |
113 |
| - CopyToken, |
114 |
| - }, |
115 | 45 | mixins: [constantsTranslationMixin, catalogFilterMixin],
|
116 |
| - data() { |
117 |
| - return { |
118 |
| - displayToken: null, |
119 |
| - }; |
120 |
| - }, |
121 | 46 | computed: {
|
122 | 47 | currentFilters() {
|
123 | 48 | return flatten([
|
|
150 | 75 | createFilter(this.coach, this.$tr('coachContent'), this.resetCoach),
|
151 | 76 | createFilter(this.assessments, this.$tr('assessments'), this.resetAssessments),
|
152 | 77 | createFilter(this.subtitles, this.$tr('subtitles'), this.resetSubtitles),
|
153 |
| - createFilter(this.collection, this.getCollectionName(), this.resetCollection), |
154 | 78 | ]).filter(Boolean);
|
155 | 79 | },
|
156 |
| - collections() { |
157 |
| - return publicCollections; |
158 |
| - }, |
159 | 80 | },
|
160 | 81 | methods: {
|
161 |
| - getCollectionName() { |
162 |
| - const collection = this.collections.find(c => c.id === this.collection); |
163 |
| - return collection && collection.name; |
164 |
| - }, |
165 |
| - setCollection(collectionId) { |
166 |
| - this.collection = collectionId; |
167 |
| - }, |
168 |
| - resetCollection() { |
169 |
| - this.setCollection(null); |
170 |
| - }, |
171 | 82 | resetKeywords() {
|
172 | 83 | this.keywords = '';
|
173 | 84 | },
|
|
200 | 111 | subtitles: 'Subtitles',
|
201 | 112 | starred: 'Starred',
|
202 | 113 | clearAll: 'Clear all',
|
203 |
| - channelCount: '{count, plural,\n =1 {# channel}\n other {# channels}}', |
204 |
| - copyToken: 'Copy collection token', |
205 |
| - copyTitle: 'Copy collection token', |
206 |
| - copyTokenInstructions: |
207 |
| - 'Paste this token into Kolibri to import the channels contained in this collection', |
208 |
| - close: 'Close', |
209 | 114 | },
|
210 | 115 | };
|
211 | 116 |
|
|
0 commit comments