From d34e09a74039688d1aa6c8af67e26864fc057175 Mon Sep 17 00:00:00 2001 From: ozer550 Date: Tue, 22 Apr 2025 12:05:56 +0530 Subject: [PATCH 01/13] refactor guest user channelItem card icons --- .../channelList/views/Channel/ChannelItem.vue | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelItem.vue b/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelItem.vue index c4fb7abf95..2f8450e3cc 100644 --- a/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelItem.vue +++ b/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelItem.vue @@ -110,6 +110,7 @@ :to="channelDetailsLink" > + Date: Tue, 29 Apr 2025 11:36:54 +0530 Subject: [PATCH 02/13] add SidePanel for basic channel Details display --- .../channelList/views/Channel/CatalogList.vue | 25 +++- .../views/Channel/ChannelDetailsSidePanel.vue | 135 ++++++++++++++++++ .../channelList/views/Channel/ChannelItem.vue | 20 ++- .../shared/views/details/DetailsPanel.vue | 50 ++++--- 4 files changed, 200 insertions(+), 30 deletions(-) create mode 100644 contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelDetailsSidePanel.vue diff --git a/contentcuration/contentcuration/frontend/channelList/views/Channel/CatalogList.vue b/contentcuration/contentcuration/frontend/channelList/views/Channel/CatalogList.vue index 2014b8ad85..e3561f9526 100644 --- a/contentcuration/contentcuration/frontend/channelList/views/Channel/CatalogList.vue +++ b/contentcuration/contentcuration/frontend/channelList/views/Channel/CatalogList.vue @@ -64,6 +64,7 @@ :channelId="item.id" :detailsRouteName="detailsRouteName" style="flex-grow: 1; width: 100%" + @show-channel-details="handleShowChannelDetails" /> @@ -142,6 +143,12 @@ + @@ -156,6 +163,7 @@ import sortBy from 'lodash/sortBy'; import union from 'lodash/union'; import { RouteNames } from '../../constants'; + import ChannelDetailsSidePanel from './ChannelDetailsSidePanel'; import CatalogFilters from './CatalogFilters'; import ChannelItem from './ChannelItem'; import LoadingText from 'shared/views/LoadingText'; @@ -178,6 +186,7 @@ Checkbox, ToolBar, OfflineText, + ChannelDetailsSidePanel, }, mixins: [channelExportMixin, constantsTranslationMixin], data() { @@ -185,12 +194,8 @@ loading: true, loadError: false, selecting: false, - - /** - * jayoshih: router guard makes it difficult to track - * differences between previous query params and new - * query params, so just track it manually - */ + showSidePanel: false, + selectedChannelId: null, previousQuery: this.$route.query, /** @@ -301,6 +306,14 @@ this.setSelection(false); return this.downloadChannelsPDF(params); }, + handleShowChannelDetails(channelId) { + this.showSidePanel = true; + this.selectedChannelId = channelId; + }, + handleCloseSidePanel() { + this.showSidePanel = false; + this.selectedChannelId = null; + }, }, $trs: { resultsText: '{count, plural,\n =1 {# result found}\n other {# results found}}', diff --git a/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelDetailsSidePanel.vue b/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelDetailsSidePanel.vue new file mode 100644 index 0000000000..fa2b46e3d6 --- /dev/null +++ b/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelDetailsSidePanel.vue @@ -0,0 +1,135 @@ + + + + + + + diff --git a/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelItem.vue b/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelItem.vue index 2f8450e3cc..a9359d08d8 100644 --- a/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelItem.vue +++ b/contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelItem.vue @@ -8,8 +8,8 @@ data-test="channel-card" tabindex="0" :href="linkToChannelTree ? channelHref : null" - :to="linkToChannelTree ? null : channelDetailsLink" - @click="goToChannelRoute" + :to="linkToChannelTree ? null : null" + @click="handleChannelClick" > {}); + handleChannelClick() { + if (this.linkToChannelTree) { + window.location.href = this.channelHref; + return; + } + + if (!this.loggedIn) { + this.$emit('show-channel-details', this.channelId); + return; + } + + this.$router.push(this.channelDetailsLink).catch(() => {}); }, trackTokenCopy() { this.$analytics.trackAction('channel_list', 'Copy token', { diff --git a/contentcuration/contentcuration/frontend/shared/views/details/DetailsPanel.vue b/contentcuration/contentcuration/frontend/shared/views/details/DetailsPanel.vue index 9db35d0376..53cb29ecbb 100644 --- a/contentcuration/contentcuration/frontend/shared/views/details/DetailsPanel.vue +++ b/contentcuration/contentcuration/frontend/shared/views/details/DetailsPanel.vue @@ -1,25 +1,31 @@