-
Notifications
You must be signed in to change notification settings - Fork 281
[Remove Vuetify from Studio] Cards in Content Library #5616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: channel-cards
Are you sure you want to change the base?
Changes from all commits
7000d7f
ded9d8a
90b6ac2
933bd8a
524b4cf
be36934
5048ea6
a52562b
99d1711
0cc3d1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,36 +43,38 @@ | |
| <KButton | ||
| v-if="page.count && !selecting" | ||
| :text="$tr('selectChannels')" | ||
| data-testid="select" | ||
| data-test="select" | ||
| appearance="basic-link" | ||
| @click="setSelection(true)" | ||
| /> | ||
| <Checkbox | ||
| <KCheckbox | ||
| v-else-if="selecting" | ||
| v-model="selectAll" | ||
| class="mb-4 mx-2" | ||
| :indeterminate="isIndeterminate" | ||
| :label="$tr('selectAll')" | ||
| :indeterminate="selected.length > 0 && selected.length < channels.length" | ||
| class="mb-4 mx-2" | ||
| /> | ||
| </VFlex> | ||
| <VFlex xs12> | ||
| <VLayout | ||
| v-for="item in channels" | ||
| :key="item.id" | ||
| align-center | ||
| <KCardGrid | ||
| layout="1-1-1" | ||
| :skeletonsConfig="[ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we're not yet passing We will probably use loading skeletons, but that'd be outside of scope of this task, so let's remove. |
||
| { | ||
| 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" | ||
| <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 | ||
|
|
@@ -135,27 +137,25 @@ | |
| import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow'; | ||
| import { RouteNames } from '../../constants'; | ||
| import CatalogFilters from './CatalogFilters'; | ||
| import CatalogFilterBar from './CatalogFilterBar'; | ||
| import ChannelItem from './ChannelItem'; | ||
| 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'; | ||
| import { channelExportMixin } from 'shared/views/channel/mixins'; | ||
| import CatalogFilterBar from './CatalogFilterBar'; | ||
| import StudioChannelCard from './components/StudioChannelCard'; | ||
|
|
||
| export default { | ||
| name: 'CatalogList', | ||
| components: { | ||
| ChannelItem, | ||
| StudioChannelCard, | ||
| LoadingText, | ||
| CatalogFilters, | ||
| CatalogFilterBar, | ||
| Pagination, | ||
| BottomBar, | ||
| Checkbox, | ||
| ToolBar, | ||
| OfflineText, | ||
| }, | ||
|
|
@@ -216,9 +216,6 @@ | |
| debouncedSearch() { | ||
| return debounce(this.loadCatalog, 1000); | ||
| }, | ||
| detailsRouteName() { | ||
| return RouteNames.CATALOG_DETAILS; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the reason for removing this part?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was unused code that wasn't passed to StudioChannelCard.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That depends if the change affects user experience - you may want to check before/after. Is the route same as the one in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any observations on the above? |
||
| }, | ||
| 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. | ||
|
|
@@ -227,6 +224,9 @@ | |
| selectedCount() { | ||
| return this.page.count - this.excluded.length; | ||
| }, | ||
| isIndeterminate() { | ||
| return this.selected.length > 0 && this.selected.length < this.channels.length; | ||
| }, | ||
| }, | ||
| watch: { | ||
| $route(to) { | ||
|
|
@@ -250,6 +250,17 @@ | |
| }, | ||
| 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]; | ||
| } | ||
| }, | ||
| loadCatalog() { | ||
| this.loading = true; | ||
| const params = { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to change
testid. Perhaps just merge conflict?