|
7 | 7 | <VLayout |
8 | 8 | row |
9 | 9 | wrap |
10 | | - align-end |
11 | | - justify-center |
| 10 | + align-center |
| 11 | + justify-space-between |
| 12 | + class="pb-2" |
12 | 13 | > |
13 | | - <VFlex> |
| 14 | + <VFlex class="text-xs-left"> |
14 | 15 | <KButton |
| 16 | + v-if="!loading && channelSets && channelSets.length" |
15 | 17 | :text="$tr('aboutChannelSetsLink')" |
16 | 18 | class="link-btn" |
17 | 19 | appearance="basic-link" |
18 | 20 | @click="infoDialog = true" |
19 | 21 | /> |
20 | | - <KModal |
21 | | - v-if="infoDialog" |
22 | | - :cancelText="$tr('cancelButtonLabel')" |
23 | | - :title="$tr('aboutChannelSets')" |
24 | | - @cancel="infoDialog = false" |
25 | | - > |
26 | | - <div> |
27 | | - <p> |
28 | | - {{ $tr('channelSetsDescriptionText') }} |
29 | | - </p> |
30 | | - <p> |
31 | | - {{ $tr('channelSetsInstructionsText') }} |
32 | | - </p> |
33 | | - <p :class="$computedClass(channelSetsDisclamerStyle)"> |
34 | | - {{ $tr('channelSetsDisclaimer') }} |
35 | | - </p> |
36 | | - </div> |
37 | | - </KModal> |
38 | 22 | </VFlex> |
39 | | - <VSpacer /> |
40 | | - <VFlex class="text-xs-right"> |
| 23 | + |
| 24 | + <VFlex |
| 25 | + class="text-xs-right" |
| 26 | + shrink="0" |
| 27 | + > |
41 | 28 | <KButton |
42 | 29 | v-if="!loading" |
43 | 30 | appearance="raised-button" |
|
48 | 35 | /> |
49 | 36 | </VFlex> |
50 | 37 | </VLayout> |
| 38 | + |
51 | 39 | <VLayout |
52 | 40 | row |
53 | 41 | justify-center |
|
57 | 45 | <template v-if="loading"> |
58 | 46 | <LoadingText /> |
59 | 47 | </template> |
60 | | - <p |
61 | | - v-else-if="channelSets && !channelSets.length" |
62 | | - class="mb-0 text-xs-center" |
63 | | - > |
64 | | - {{ $tr('noChannelSetsFound') }} |
65 | | - </p> |
| 48 | + |
| 49 | + <template v-else-if="channelSets && !channelSets.length"> |
| 50 | + <div class="mt-4 p-2 text-xs-center"> |
| 51 | + <p class="mb-0">{{ $tr('noChannelSetsFound') }}</p> |
| 52 | + <KButton |
| 53 | + :text="$tr('aboutChannelSetsLink')" |
| 54 | + class="link-btn" |
| 55 | + appearance="basic-link" |
| 56 | + @click="infoDialog = true" |
| 57 | + /> |
| 58 | + </div> |
| 59 | + </template> |
| 60 | + |
66 | 61 | <template v-else> |
67 | 62 | <VDataTable |
68 | 63 | :headers="headers" |
|
76 | 71 | </template> |
77 | 72 | </VFlex> |
78 | 73 | </VLayout> |
| 74 | + |
| 75 | + <KModal |
| 76 | + v-if="infoDialog" |
| 77 | + :cancelText="$tr('cancelButtonLabel')" |
| 78 | + :title="$tr('aboutChannelSets')" |
| 79 | + @cancel="infoDialog = false" |
| 80 | + > |
| 81 | + <div> |
| 82 | + <p>{{ $tr('channelSetsDescriptionText') }}</p> |
| 83 | + <p>{{ $tr('channelSetsInstructionsText') }}</p> |
| 84 | + <p :class="$computedClass(channelSetsDisclamerStyle)"> |
| 85 | + {{ $tr('channelSetsDisclaimer') }} |
| 86 | + </p> |
| 87 | + </div> |
| 88 | + </KModal> |
79 | 89 | </VContainer> |
80 | 90 |
|
81 | 91 | </template> |
|
91 | 101 |
|
92 | 102 | export default { |
93 | 103 | name: 'ChannelSetList', |
94 | | - components: { |
95 | | - ChannelSetItem, |
96 | | - LoadingText, |
97 | | - }, |
| 104 | + components: { ChannelSetItem, LoadingText }, |
98 | 105 | data() { |
99 | | - return { |
100 | | - loading: true, |
101 | | - infoDialog: false, |
102 | | - }; |
| 106 | + return { loading: true, infoDialog: false }; |
103 | 107 | }, |
104 | 108 | computed: { |
105 | 109 | ...mapGetters('channelSet', ['channelSets']), |
|
112 | 116 | ]; |
113 | 117 | }, |
114 | 118 | channelSetsDisclamerStyle() { |
115 | | - return { |
116 | | - color: this.$themePalette.red.v_500, |
117 | | - }; |
| 119 | + return { color: this.$themePalette.red.v_500 }; |
118 | 120 | }, |
119 | 121 | sortedChannelSets() { |
120 | | - return sortBy(this.channelSets, s => s.name.toLowerCase()) || []; |
| 122 | + return sortBy(this.channelSets || [], s => (s.name || '').toLowerCase()); |
121 | 123 | }, |
122 | 124 | }, |
123 | | - mounted() { |
124 | | - this.loadChannelSetList().then(() => { |
| 125 | + async mounted() { |
| 126 | + try { |
| 127 | + await this.loadChannelSetList(); |
| 128 | + } finally { |
125 | 129 | this.loading = false; |
126 | | - }); |
| 130 | + } |
127 | 131 | }, |
128 | 132 | methods: { |
129 | 133 | ...mapActions('channelSet', ['loadChannelSetList']), |
130 | 134 | newChannelSet() { |
131 | | - this.$router.push({ |
132 | | - name: RouteNames.NEW_CHANNEL_SET, |
133 | | - }); |
| 135 | + this.$router.push({ name: RouteNames.NEW_CHANNEL_SET }); |
134 | 136 | }, |
135 | 137 | }, |
136 | 138 | $trs: { |
|
139 | 141 | 'You can package together multiple channels to create a collection. The entire collection can then be imported to Kolibri at once by using a collection token.', |
140 | 142 | addChannelSetTitle: 'New collection', |
141 | 143 | aboutChannelSets: 'About collections', |
142 | | - aboutChannelSetsLink: 'Learn about collections', |
| 144 | + aboutChannelSetsLink: 'Learn more about collections', |
143 | 145 | channelSetsDescriptionText: |
144 | 146 | 'A collection contains multiple Kolibri Studio channels that can be imported at one time to Kolibri with a single collection token.', |
145 | 147 | channelSetsInstructionsText: |
|
0 commit comments