Skip to content

Commit 72db464

Browse files
UI improvements for collections pages link
1 parent a1d4c0f commit 72db464

File tree

1 file changed

+50
-48
lines changed

1 file changed

+50
-48
lines changed

contentcuration/contentcuration/frontend/channelList/views/ChannelSet/ChannelSetList.vue

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,24 @@
77
<VLayout
88
row
99
wrap
10-
align-end
11-
justify-center
10+
align-center
11+
justify-space-between
12+
class="pb-2"
1213
>
13-
<VFlex>
14+
<VFlex class="text-xs-left">
1415
<KButton
16+
v-if="!loading && channelSets && channelSets.length"
1517
:text="$tr('aboutChannelSetsLink')"
1618
class="link-btn"
1719
appearance="basic-link"
1820
@click="infoDialog = true"
1921
/>
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>
3822
</VFlex>
39-
<VSpacer />
40-
<VFlex class="text-xs-right">
23+
24+
<VFlex
25+
class="text-xs-right"
26+
shrink="0"
27+
>
4128
<KButton
4229
v-if="!loading"
4330
appearance="raised-button"
@@ -48,6 +35,7 @@
4835
/>
4936
</VFlex>
5037
</VLayout>
38+
5139
<VLayout
5240
row
5341
justify-center
@@ -57,12 +45,19 @@
5745
<template v-if="loading">
5846
<LoadingText />
5947
</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+
6661
<template v-else>
6762
<VDataTable
6863
:headers="headers"
@@ -76,6 +71,21 @@
7671
</template>
7772
</VFlex>
7873
</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>
7989
</VContainer>
8090

8191
</template>
@@ -91,15 +101,9 @@
91101
92102
export default {
93103
name: 'ChannelSetList',
94-
components: {
95-
ChannelSetItem,
96-
LoadingText,
97-
},
104+
components: { ChannelSetItem, LoadingText },
98105
data() {
99-
return {
100-
loading: true,
101-
infoDialog: false,
102-
};
106+
return { loading: true, infoDialog: false };
103107
},
104108
computed: {
105109
...mapGetters('channelSet', ['channelSets']),
@@ -112,25 +116,23 @@
112116
];
113117
},
114118
channelSetsDisclamerStyle() {
115-
return {
116-
color: this.$themePalette.red.v_500,
117-
};
119+
return { color: this.$themePalette.red.v_500 };
118120
},
119121
sortedChannelSets() {
120-
return sortBy(this.channelSets, s => s.name.toLowerCase()) || [];
122+
return sortBy(this.channelSets || [], s => (s.name || '').toLowerCase());
121123
},
122124
},
123-
mounted() {
124-
this.loadChannelSetList().then(() => {
125+
async mounted() {
126+
try {
127+
await this.loadChannelSetList();
128+
} finally {
125129
this.loading = false;
126-
});
130+
}
127131
},
128132
methods: {
129133
...mapActions('channelSet', ['loadChannelSetList']),
130134
newChannelSet() {
131-
this.$router.push({
132-
name: RouteNames.NEW_CHANNEL_SET,
133-
});
135+
this.$router.push({ name: RouteNames.NEW_CHANNEL_SET });
134136
},
135137
},
136138
$trs: {
@@ -139,7 +141,7 @@
139141
'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.',
140142
addChannelSetTitle: 'New collection',
141143
aboutChannelSets: 'About collections',
142-
aboutChannelSetsLink: 'Learn about collections',
144+
aboutChannelSetsLink: 'Learn more about collections',
143145
channelSetsDescriptionText:
144146
'A collection contains multiple Kolibri Studio channels that can be imported at one time to Kolibri with a single collection token.',
145147
channelSetsInstructionsText:

0 commit comments

Comments
 (0)