Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,36 @@
appearance="basic-link"
@click="setSelection(true)"
/>
<Checkbox
<KCheckbox
v-else-if="selecting"
v-model="selectAll"
Copy link
Member

@MisRob MisRob Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this place, we can keep v-model - it will be simpler to maintain.

I think that when you implemented this PR, KCheckbox didn't yet support v-model, but we recently implemented it - you can see the latest documentation. You will need to merge latest unstable to this branch and run pnpm install so that you have access to the latest KDS version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, when I was writing this I forgot for a moment that we're targeting channel-cards. So actually let's wait a bit for this update until I do this and then you can resolve it together with test conflicts.

class="mb-4 mx-2"
:checked="selectAll"
:indeterminate="isIndeterminate"
:label="$tr('selectAll')"
data-test="select-all"
:indeterminate="selected.length > 0 && selected.length < channels.length"
class="mb-4 mx-2"
@change="toggleSelectAll"
/>
</VFlex>
<VFlex xs12>
<VLayout
v-for="item in channels"
:key="item.id"
align-center
<KCardGrid
layout="1-1-1"
:skeletonsConfig="[
{
breakpoints: [0, 1, 2, 3, 4, 5, 6, 7],
orientation: 'vertical',
count: 3,
},
]"
>
<Checkbox
v-show="selecting"
v-model="selected"
class="mx-2"
:value="item.id"
data-test="checkbox"
<StudioChannelCard
v-for="channel in channels"
:key="channel.id"
:channel="channel"
:selectable="selecting"
:selected="isChannelSelected(channel.id)"
@toggle-selection="handleSelectionToggle"
/>
<ChannelItem
:channelId="item.id"
:detailsRouteName="detailsRouteName"
style="flex-grow: 1; width: 100%"
/>
</VLayout>
</KCardGrid>
</VFlex>
<VFlex
xs12
Expand Down Expand Up @@ -130,11 +132,10 @@
import union from 'lodash/union';
import { RouteNames } from '../../constants';
import CatalogFilters from './CatalogFilters';
import ChannelItem from './ChannelItem';
import StudioChannelCard from './components/StudioChannelCard';
import LoadingText from 'shared/views/LoadingText';
import Pagination from 'shared/views/Pagination';
import BottomBar from 'shared/views/BottomBar';
import Checkbox from 'shared/views/form/Checkbox';
import ToolBar from 'shared/views/ToolBar';
import OfflineText from 'shared/views/OfflineText';
import { constantsTranslationMixin } from 'shared/mixins';
Expand All @@ -143,12 +144,11 @@
export default {
name: 'CatalogList',
components: {
ChannelItem,
StudioChannelCard,
LoadingText,
CatalogFilters,
Pagination,
BottomBar,
Checkbox,
ToolBar,
OfflineText,
},
Expand Down Expand Up @@ -202,9 +202,6 @@
debouncedSearch() {
return debounce(this.loadCatalog, 1000);
},
detailsRouteName() {
return RouteNames.CATALOG_DETAILS;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for removing this part?

},
channels() {
// Sort again by the same ordering used on the backend - name.
// Have to do this because of how we are getting the object data via getChannels.
Expand All @@ -213,6 +210,9 @@
selectedCount() {
return this.page.count - this.excluded.length;
},
isIndeterminate() {
return this.selected.length > 0 && this.selected.length < this.channels.length;
},
},
watch: {
$route(to) {
Expand All @@ -236,6 +236,20 @@
},
methods: {
...mapActions('channelList', ['searchCatalog']),
isChannelSelected(channelId) {
return this.selected.includes(channelId);
},
handleSelectionToggle(channelId) {
const currentlySelected = this.selected;
if (currentlySelected.includes(channelId)) {
this.selected = currentlySelected.filter(id => id !== channelId);
} else {
this.selected = [...currentlySelected, channelId];
}
},
toggleSelectAll() {
this.selectAll = !this.selectAll;
},
loadCatalog() {
this.loading = true;
const params = {
Expand Down
Loading