diff --git a/resources/assets/js/components/song/PlayableContextMenu.spec.ts b/resources/assets/js/components/song/PlayableContextMenu.spec.ts index 9977f9dd..da27aacc 100644 --- a/resources/assets/js/components/song/PlayableContextMenu.spec.ts +++ b/resources/assets/js/components/song/PlayableContextMenu.spec.ts @@ -305,6 +305,12 @@ new class extends UnitTestCase { expect(emitMock).toHaveBeenCalledWith('MODAL_SHOW_CREATE_PLAYLIST_FORM', null, playables) }) + it('does not have the options to mark song as private or public in Community edition', async () => { + await this.renderComponent(factory('song')) + expect(screen.queryByText('Mark as Private')).toBeNull() + expect(screen.queryByText('Unmark as Private')).toBeNull() + }) + it('makes songs private', async () => { this.enablePlusEdition() diff --git a/resources/assets/js/components/song/PlayableContextMenu.vue b/resources/assets/js/components/song/PlayableContextMenu.vue index ded0650e..b6b44615 100644 --- a/resources/assets/js/components/song/PlayableContextMenu.vue +++ b/resources/assets/js/components/song/PlayableContextMenu.vue @@ -167,6 +167,10 @@ const visibilityActions = computed(() => { return [] } + if (!isPlus.value) { + return [] + } + const visibilities = Array.from(new Set((playables.value as Song[]).map(song => song.is_public ? 'public' : 'private',