Skip to content

Commit 5e2f4f1

Browse files
authored
Merge pull request #5758 from Swoyamjeetcodes/feat/5746-remove-vuetify-filter-bar
[Remove Vuetify from Studio] Content library filter bar
2 parents fab1b12 + 51b825d commit 5e2f4f1

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

contentcuration/contentcuration/frontend/channelList/views/Channel/CatalogFilterBar.vue

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
<template>
22

3-
<VContainer class="pa-4">
4-
<div v-if="currentFilters.length">
5-
<VChip
3+
<div class="catalog-filter-bar">
4+
<div
5+
v-if="currentFilters.length"
6+
class="catalog-filter-bar-content"
7+
>
8+
<StudioChip
69
v-for="(filter, index) in currentFilters"
710
:key="`catalog-filter-${index}`"
811
close
9-
class="ma-1"
12+
class="catalog-filter-chip"
1013
:data-test="`filter-chip-${index}`"
11-
@input="filter.onclose"
14+
@close="filter.onclose"
1215
>
1316
{{ filter.text }}
14-
</VChip>
17+
</StudioChip>
1518
<KButton
1619
v-if="currentFilters.length"
1720
class="clear-link"
@@ -21,7 +24,7 @@
2124
@click="clearFilters"
2225
/>
2326
</div>
24-
</VContainer>
27+
</div>
2528

2629
</template>
2730

@@ -30,6 +33,7 @@
3033
3134
import flatten from 'lodash/flatten'; // Tests fail with native Array.flat() method
3235
import { catalogFilterMixin } from './mixins';
36+
import StudioChip from 'shared/views/StudioChip';
3337
import { constantsTranslationMixin } from 'shared/mixins';
3438
3539
/**
@@ -45,6 +49,9 @@
4549
4650
export default {
4751
name: 'CatalogFilterBar',
52+
components: {
53+
StudioChip,
54+
},
4855
mixins: [constantsTranslationMixin, catalogFilterMixin],
4956
computed: {
5057
currentFilters() {
@@ -129,17 +136,20 @@
129136
width: 100%;
130137
}
131138
132-
.container {
139+
.catalog-filter-bar {
133140
max-width: 1128px;
141+
padding: 16px;
134142
margin: 0 auto;
135143
}
136144
137-
.v-card {
138-
cursor: pointer;
145+
.catalog-filter-bar-content {
146+
display: flex;
147+
flex-wrap: wrap;
148+
align-items: center;
149+
}
139150
140-
&:hover {
141-
background-color: var(--v-grey-lighten4);
142-
}
151+
.catalog-filter-chip {
152+
margin: 4px;
143153
}
144154
145155
.clear-link {

contentcuration/contentcuration/frontend/channelList/views/Channel/__tests__/catalogFilterBar.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ const query = {
1616
async function closeChipByText(user, text) {
1717
const chip = await screen.findByText(text);
1818

19-
const closeButton = chip.closest('[data-test^="filter-chip"]').querySelector('.v-chip__close');
19+
const closeButton = chip
20+
.closest('[data-test^="filter-chip"]')
21+
.querySelector('[data-test="remove-chip"]');
2022

2123
expect(closeButton).toBeTruthy();
2224
await user.click(closeButton);

0 commit comments

Comments
 (0)