Skip to content

Commit 6853201

Browse files
committed
Refactor channelMenuOptions into single list with mobile-only items prepended
1 parent 9c4872f commit 6853201

1 file changed

Lines changed: 20 additions & 45 deletions

File tree

  • contentcuration/contentcuration/frontend/channelEdit/views/TreeView

contentcuration/contentcuration/frontend/channelEdit/views/TreeView/TreeViewBase.vue

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@
495495
channelMenuOptions() {
496496
const options = [];
497497
498+
// On small screens, prepend the actions that are hidden from the toolbar
498499
if (this.windowIsSmall) {
499500
if (this.canManage) {
500501
options.push({
@@ -503,12 +504,6 @@
503504
disabled: this.disablePublish,
504505
});
505506
}
506-
if (this.currentChannel && this.currentChannel.draft_token) {
507-
options.push({
508-
label: this.getDraftTokenAction$(),
509-
value: ChannelMenuOptions.PREVIEW_DRAFT,
510-
});
511-
}
512507
options.push({
513508
label: this.$tr('channelDetails'),
514509
value: ChannelMenuOptions.VIEW_DETAILS,
@@ -523,47 +518,27 @@
523518
}
524519
options.push(editOption);
525520
}
526-
527-
if (this.canSubmitToCommunityLibrary) {
528-
options.push({
529-
label: this.$tr('submitToCommunityLibrary'),
530-
value: ShareMenuOptions.SUBMIT_TO_LIBRARY,
531-
});
532-
}
533-
if (this.canManage) {
534-
options.push({
535-
label: this.$tr('inviteCollaborators'),
536-
value: ShareMenuOptions.INVITE_COLLABORATORS,
537-
});
538-
}
539-
if (this.isPublished) {
540-
options.push({
541-
label: this.$tr('shareToken'),
542-
value: ShareMenuOptions.SHARE_TOKEN,
543-
});
544-
}
545-
} else {
546-
// Desktop view - show different options
547-
if (this.currentChannel && this.currentChannel.draft_token) {
548-
options.push({
549-
label: this.getDraftTokenAction$(),
550-
value: ChannelMenuOptions.PREVIEW_DRAFT,
551-
});
552-
}
553-
if (this.isPublished) {
554-
options.push({
555-
label: this.$tr('getToken'),
556-
value: ChannelMenuOptions.GET_TOKEN,
557-
});
558-
}
559-
if (this.canManage) {
560-
options.push({
561-
label: this.$tr('shareChannel'),
562-
value: ChannelMenuOptions.SHARE_CHANNEL,
563-
});
564-
}
565521
}
566522
523+
// Common options shown on all screen sizes
524+
if (this.currentChannel && this.currentChannel.draft_token) {
525+
options.push({
526+
label: this.getDraftTokenAction$(),
527+
value: ChannelMenuOptions.PREVIEW_DRAFT,
528+
});
529+
}
530+
if (this.isPublished) {
531+
options.push({
532+
label: this.$tr('getToken'),
533+
value: ChannelMenuOptions.GET_TOKEN,
534+
});
535+
}
536+
if (this.canManage) {
537+
options.push({
538+
label: this.$tr('shareChannel'),
539+
value: ChannelMenuOptions.SHARE_CHANNEL,
540+
});
541+
}
567542
if (this.canEdit) {
568543
options.push({
569544
label: this.$tr('syncChannel'),

0 commit comments

Comments
 (0)