fix: options to mark songs as private/public shown in Community edition (#1870)

This commit is contained in:
Phan An 2024-10-31 17:55:09 +07:00 committed by GitHub
parent 5d9d75111a
commit a86c2ab654
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -305,6 +305,12 @@ new class extends UnitTestCase {
expect(emitMock).toHaveBeenCalledWith('MODAL_SHOW_CREATE_PLAYLIST_FORM', null, playables) 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 () => { it('makes songs private', async () => {
this.enablePlusEdition() this.enablePlusEdition()

View file

@ -167,6 +167,10 @@ const visibilityActions = computed(() => {
return [] return []
} }
if (!isPlus.value) {
return []
}
const visibilities = Array.from(new Set((playables.value as Song[]).map(song => song.is_public const visibilities = Array.from(new Set((playables.value as Song[]).map(song => song.is_public
? 'public' ? 'public'
: 'private', : 'private',