diff --git a/client/e2e/src/po/my-account.po.ts b/client/e2e/src/po/my-account.po.ts index 743e3094f..cc1555e9b 100644 --- a/client/e2e/src/po/my-account.po.ts +++ b/client/e2e/src/po/my-account.po.ts @@ -56,7 +56,7 @@ export class MyAccountPage { async removeVideo (name: string) { const container = await this.getVideoElement(name) - await container.$('.dropdown-toggle').click() + await container.$('my-action-dropdown .dropdown-toggle').click() const deleteItem = () => { return $$('.dropdown-menu .dropdown-item').find(async v => { @@ -120,9 +120,7 @@ export class MyAccountPage { async updatePlaylistPrivacy (playlistUUID: string, privacy: 'Public' | 'Private' | 'Unlisted') { go('/my-library/video-playlists/update/' + playlistUUID) - await browser.waitUntil(async () => { - return (await $('form .video-playlist-title').getText() === 'PLAYLIST') - }) + await $('a[href*="/my-library/video-playlists/update/"]').waitForDisplayed() await selectCustomSelect('videoChannelId', 'Main root channel') await selectCustomSelect('privacy', privacy) diff --git a/client/e2e/src/po/video-list.po.ts b/client/e2e/src/po/video-list.po.ts index f62c79adc..81afbd992 100644 --- a/client/e2e/src/po/video-list.po.ts +++ b/client/e2e/src/po/video-list.po.ts @@ -67,7 +67,7 @@ export class VideoListPage { async getVideosListName () { const elems = await $$('.videos .video-miniature .video-miniature-name') - const texts = await Promise.all(elems.map(e => e.getText())) + const texts = await elems.map(e => e.getText()) return texts.map(t => t.trim()) } diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts index 67081fe4a..544930c6c 100644 --- a/client/e2e/src/po/video-watch.po.ts +++ b/client/e2e/src/po/video-watch.po.ts @@ -13,8 +13,11 @@ export class VideoWatchPage { const index = this.isMobileDevice ? 0 : 1 return browser.waitUntil(async () => { - return await $('.video-info .video-info-name').isExisting() && - (await $$('.video-info .video-info-name')[index].getText()).includes(videoName) + if (!await $('.video-info .video-info-name').isExisting()) return false + + const elem = await $$('.video-info .video-info-name')[index] + + return (await elem.getText()).includes(videoName) && elem.isDisplayed() }) } @@ -31,9 +34,13 @@ export class VideoWatchPage { } async isDownloadEnabled () { - await this.clickOnMoreDropdownIcon() + try { + await this.clickOnMoreDropdownIcon() - return $('.dropdown-item .icon-download').isExisting() + return await $('.dropdown-item .icon-download').isExisting() + } catch { + return $('.action-button-download').isDisplayed() + } } areCommentsEnabled () { diff --git a/client/e2e/src/suites-all/videos.e2e-spec.ts b/client/e2e/src/suites-all/videos.e2e-spec.ts index 5d0f8c152..dcc8eefbf 100644 --- a/client/e2e/src/suites-all/videos.e2e-spec.ts +++ b/client/e2e/src/suites-all/videos.e2e-spec.ts @@ -176,7 +176,7 @@ describe('Videos all workflow', () => { await videoWatchPage.waitUntilVideoName(video2Name, 40 * 1000) }) - it('Should watch the WEB VIDEO playlist in the embed', async () => { + it('Should watch the Web Video playlist in the embed', async () => { if (isUploadUnsupported()) return const accessToken = await browser.execute(`return window.localStorage.getItem('access_token');`) diff --git a/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts b/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts index 4d5f44001..e839d132e 100644 --- a/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts +++ b/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts @@ -30,14 +30,21 @@ describe('Custom server defaults', () => { await videoWatchPage.waitWatchVideoName('video') - expect(await videoWatchPage.getPrivacy()).toBe('Internal') - expect(await videoWatchPage.getLicence()).toBe('Attribution - Non Commercial') - expect(await videoWatchPage.isDownloadEnabled()).toBeFalsy() - expect(await videoWatchPage.areCommentsEnabled()).toBeFalsy() - }) + const videoUrl = await browser.getUrl() - after(async function () { + expect(await videoWatchPage.getPrivacy()).toBe('Unlisted') + expect(await videoWatchPage.getLicence()).toBe('Attribution - Non Commercial') + expect(await videoWatchPage.areCommentsEnabled()).toBeFalsy() + + // Owners can download their videos + expect(await videoWatchPage.isDownloadEnabled()).toBeTruthy() + + // Logout to see if the download enabled is correct for anonymous users await loginPage.logout() + await browser.url(videoUrl) + await videoWatchPage.waitWatchVideoName('video') + + expect(await videoWatchPage.isDownloadEnabled()).toBeFalsy() }) }) diff --git a/client/e2e/src/suites-local/video-password.e2e-spec.ts b/client/e2e/src/suites-local/video-password.e2e-spec.ts index 3683b387a..366dd7d19 100644 --- a/client/e2e/src/suites-local/video-password.e2e-spec.ts +++ b/client/e2e/src/suites-local/video-password.e2e-spec.ts @@ -130,10 +130,12 @@ describe('Password protected videos', () => { it('Should update the playlist to public', async () => { const url = await browser.getUrl() - const regex = /\/([a-f0-9-]+)$/i + const regex = /\/my-library\/video-playlists\/([^/]+)/i const match = url.match(regex) const uuid = match ? match[1] : null + expect(uuid).not.toBeNull() + await myAccountPage.updatePlaylistPrivacy(uuid, 'Public') }) diff --git a/client/e2e/src/utils/hooks.ts b/client/e2e/src/utils/hooks.ts index 05a32916c..cdfa51a26 100644 --- a/client/e2e/src/utils/hooks.ts +++ b/client/e2e/src/utils/hooks.ts @@ -66,7 +66,7 @@ function buildConfig (suiteFile: string = undefined) { publish: { download_enabled: false, comments_enabled: false, - privacy: 4, + privacy: 2, licence: 4 }, p2p: { diff --git a/client/src/app/+accounts/routes.ts b/client/src/app/+accounts/routes.ts index f9b3266e8..0528c108b 100644 --- a/client/src/app/+accounts/routes.ts +++ b/client/src/app/+accounts/routes.ts @@ -1,12 +1,14 @@ import { Routes } from '@angular/router' +import { AbuseService } from '@app/shared/shared-moderation/abuse.service' +import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service' +import { BulkService } from '@app/shared/shared-moderation/bulk.service' +import { VideoBlockService } from '@app/shared/shared-moderation/video-block.service' +import { UserSubscriptionService } from '@app/shared/shared-user-subscription/user-subscription.service' +import { UserAdminService } from '@app/shared/shared-users/user-admin.service' +import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service' import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' import { AccountVideosComponent } from './account-videos/account-videos.component' import { AccountsComponent } from './accounts.component' -import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service' -import { VideoBlockService } from '@app/shared/shared-moderation/video-block.service' -import { UserSubscriptionService } from '@app/shared/shared-user-subscription/user-subscription.service' -import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service' -import { AbuseService } from '@app/shared/shared-moderation/abuse.service' export default [ { @@ -21,7 +23,9 @@ export default [ BlocklistService, VideoPlaylistService, VideoBlockService, - AbuseService + AbuseService, + UserAdminService, + BulkService ], children: [ { diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.html b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.html index 0918a3342..5ee74e6b1 100644 --- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.html +++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.html @@ -1,85 +1,84 @@
{{ error }}
-
-
- - - @if (isCreation()) { -

NEW PLAYLIST

- } @else { -

UPDATE PLAYLIST

- } -
- -
-
- -
- - - -
- -
- - - -
- -
- - -
- -
- -
- -
- - -
- -
- - - - - -
- - -
-
+ @if (isCreation()) { +

NEW PLAYLIST

+ } @else { +

UPDATE PLAYLIST

+ }
+
+
+ +
+ + + +
+ +
+ + + +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ + + + + +
+ + +
+
+ diff --git a/client/src/app/+videos/+video-watch/routes.ts b/client/src/app/+videos/+video-watch/routes.ts index 2a5dd763f..b700986fc 100644 --- a/client/src/app/+videos/+video-watch/routes.ts +++ b/client/src/app/+videos/+video-watch/routes.ts @@ -1,15 +1,17 @@ import { Routes } from '@angular/router' -import { VideoWatchComponent } from './video-watch.component' -import { OverviewService } from '../video-list' -import { RecentVideosRecommendationService, RecommendedVideosStore } from './shared' +import { AbuseService } from '@app/shared/shared-moderation/abuse.service' import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service' import { VideoBlockService } from '@app/shared/shared-moderation/video-block.service' import { SearchService } from '@app/shared/shared-search/search.service' import { UserSubscriptionService } from '@app/shared/shared-user-subscription/user-subscription.service' +import { UserAdminService } from '@app/shared/shared-users/user-admin.service' import { VideoCommentService } from '@app/shared/shared-video-comment/video-comment.service' import { LiveVideoService } from '@app/shared/shared-video-live/live-video.service' import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service' -import { AbuseService } from '@app/shared/shared-moderation/abuse.service' +import { OverviewService } from '../video-list' +import { RecentVideosRecommendationService, RecommendedVideosStore } from './shared' +import { VideoWatchComponent } from './video-watch.component' +import { BulkService } from '@app/shared/shared-moderation/bulk.service' export default [ { @@ -25,7 +27,9 @@ export default [ RecentVideosRecommendationService, RecommendedVideosStore, SearchService, - AbuseService + AbuseService, + UserAdminService, + BulkService ], children: [ { diff --git a/client/src/assets/player/shared/peertube/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts index d9aeadb67..4ee02429f 100644 --- a/client/src/assets/player/shared/peertube/peertube-plugin.ts +++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts @@ -398,6 +398,8 @@ class PeerTubePlugin extends Plugin { private updatePlayerSizeClasses () { requestAnimationFrame(() => { + if (!this.player) return + debugLogger('Updating player size classes') const width = this.player.currentWidth()