Skip to content
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import VueRouter from 'vue-router';
import ChannelList from './views/Channel/ChannelList';
import StudioMyChannels from './views/Channel/StudioMyChannels.vue';
import ChannelSetList from './views/ChannelSet/ChannelSetList';
import ChannelSetModal from './views/ChannelSet/ChannelSetModal';
import CatalogList from './views/Channel/CatalogList';
Expand All @@ -14,7 +15,7 @@ const router = new VueRouter({
{
name: RouteNames.CHANNELS_EDITABLE,
path: '/my-channels',
component: ChannelList,
component: StudioMyChannels,
props: { listType: ChannelListTypes.EDITABLE },
Copy link
Member

Choose a reason for hiding this comment

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

Would you remove listType prop and all related conditional logic from StudioMyChannels?StudioMyChannels will always be EDITABLE - so you can just assume it in that component. I've tried to say more in the issue, not sure if it's explained well - let me now if you had any questions.

Note listType prop removal from RouteNames.CHANNELS_EDITABLE route above. In contrast to shared ChannelList that is re-used from multiple pages and requires related conditional logic, StudioMyChannels will be only used from My Channels. Therefore, do not add listType prop to StudioMyChannels. Preserve only logic that was previously related to ChannelListTypes.EDITABLE type. Cleanup copied code to not contain listType conditions and code for other types, such as ChannelListTypes.PUBLIC.

Otherwise, as we progress refactoring other tabs on the page, StudioMyChannels would end up as a monolithic component with lots of conditional logic and hard to maintain. The current ChannelList suffers from this problem and I want us to avoid it in new components. We will take a different approach to re-use logic - I will outline the strategy in the upcoming issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need some clarification

So for starred and view-only pages. Are we going to use same component StudioMyChannels or it will be an new component

Copy link
Member

Choose a reason for hiding this comment

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

We won't use StudioMyChannels for starred and view-only pages. There will be another components, something like StudioStarredChannels and StudioViewOnlyChannels.

I know there's overlap in their logic, but we will use a different strategy to organize shared parts than currently - I will specify everything in detail in the upcoming issues :)

},

Expand Down
Loading