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 366dd7d19..c9e4f6890 100644 --- a/client/e2e/src/suites-local/video-password.e2e-spec.ts +++ b/client/e2e/src/suites-local/video-password.e2e-spec.ts @@ -1,10 +1,10 @@ import { LoginPage } from '../po/login.po' -import { SignupPage } from '../po/signup.po' +import { MyAccountPage } from '../po/my-account.po' import { PlayerPage } from '../po/player.po' +import { SignupPage } from '../po/signup.po' import { VideoUploadPage } from '../po/video-upload.po' import { VideoWatchPage } from '../po/video-watch.po' import { getScreenshotPath, go, isMobileDevice, isSafari, waitServerUp } from '../utils' -import { MyAccountPage } from '../po/my-account.po' describe('Password protected videos', () => { let videoUploadPage: VideoUploadPage @@ -142,9 +142,10 @@ describe('Password protected videos', () => { it('Should watch the playlist', async () => { await myAccountPage.clickOnPlaylist(playlistName) await myAccountPage.playPlaylist() - playlistUrl = await browser.getUrl() await videoWatchPage.waitUntilVideoName(publicVideoName1, 40 * 1000) + playlistUrl = await browser.getUrl() + await videoWatchPage.waitUntilVideoName(passwordProtectedVideoName, 40 * 1000) await videoWatchPage.waitUntilVideoName(publicVideoName2, 40 * 1000) }) diff --git a/client/e2e/src/types/wdio.d.ts b/client/e2e/src/types/wdio.d.ts index 6dc2cbd87..f3bacfd24 100644 --- a/client/e2e/src/types/wdio.d.ts +++ b/client/e2e/src/types/wdio.d.ts @@ -1,5 +1,9 @@ -declare namespace WebdriverIO { - interface Element { - chooseFile: (path: string) => Promise +declare global { + namespace WebdriverIO { + interface Element { + chooseFile: (path: string) => Promise + } } } + +export {} diff --git a/client/e2e/src/utils/hooks.ts b/client/e2e/src/utils/hooks.ts index cdfa51a26..e2d88c703 100644 --- a/client/e2e/src/utils/hooks.ts +++ b/client/e2e/src/utils/hooks.ts @@ -65,7 +65,7 @@ function buildConfig (suiteFile: string = undefined) { defaults: { publish: { download_enabled: false, - comments_enabled: false, + comments_policy: 2, privacy: 2, licence: 4 }, diff --git a/client/e2e/tsconfig.json b/client/e2e/tsconfig.json index 1291601c9..af776ebd3 100644 --- a/client/e2e/tsconfig.json +++ b/client/e2e/tsconfig.json @@ -5,7 +5,7 @@ "noImplicitAny": false, "esModuleInterop": true, "module": "commonjs", - "target": "es5", + "target": "ES2015", "typeRoots": [ "../node_modules/@types", "../node_modules" @@ -17,6 +17,9 @@ "expect-webdriverio" ] }, + "ts-node": { + "files": true + }, "include": [ "src/**/*.ts", "./*.ts" diff --git a/client/package.json b/client/package.json index b2c81a73f..37d840f24 100644 --- a/client/package.json +++ b/client/package.json @@ -113,6 +113,7 @@ "stylelint": "^16.2.1", "stylelint-config-sass-guidelines": "^11.0.0", "tinykeys": "^2.1.0", + "ts-node": "^10.9.2", "tslib": "^2.4.0", "typescript": "~5.4.5", "video.js": "^7.19.2", diff --git a/client/src/app/+videos/video-list/videos-list-common-page.component.ts b/client/src/app/+videos/video-list/videos-list-common-page.component.ts index 278c787c4..671e87c2e 100644 --- a/client/src/app/+videos/video-list/videos-list-common-page.component.ts +++ b/client/src/app/+videos/video-list/videos-list-common-page.component.ts @@ -2,11 +2,11 @@ import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router' import { ComponentPaginationLight, DisableForReuseHook, MetaService, RedirectService, ServerService } from '@app/core' import { HooksService } from '@app/core/plugins/hooks.service' -import { VideoFilters, VideoFilterScope } from '@app/shared/shared-video-miniature/video-filters.model' +import { VideoService } from '@app/shared/shared-main/video/video.service' +import { VideoFilterScope, VideoFilters } from '@app/shared/shared-video-miniature/video-filters.model' import { ClientFilterHookName, VideoSortField } from '@peertube/peertube-models' import { Subscription } from 'rxjs' import { VideosListComponent } from '../../shared/shared-video-miniature/videos-list.component' -import { VideoService } from '@app/shared/shared-main/video/video.service' export type VideosListCommonPageRouteData = { sort: VideoSortField diff --git a/client/src/app/shared/shared-video-miniature/video-filters.model.ts b/client/src/app/shared/shared-video-miniature/video-filters.model.ts index 74660b4fa..1cd6bb375 100644 --- a/client/src/app/shared/shared-video-miniature/video-filters.model.ts +++ b/client/src/app/shared/shared-video-miniature/video-filters.model.ts @@ -132,6 +132,7 @@ export class VideoFilters { clone () { const cloned = new VideoFilters(this.defaultValues.get('sort'), this.defaultValues.get('scope'), this.hiddenFields) + cloned.setNSFWPolicy(this.defaultNSFWPolicy) cloned.load(this.toUrlObject()) diff --git a/client/src/standalone/embed-player-api/vite.config.mjs b/client/src/standalone/embed-player-api/vite.config.mjs index aad8ef4c7..c30ec3ccf 100644 --- a/client/src/standalone/embed-player-api/vite.config.mjs +++ b/client/src/standalone/embed-player-api/vite.config.mjs @@ -11,6 +11,7 @@ export default defineConfig(() => { outDir: resolve(__dirname, 'build'), emptyOutDir: true, minify: 'esbuild', + target: [ 'firefox78', 'ios12' ], lib: { name: 'PeerTubePlayer', fileName: () => `player.min.js`, diff --git a/client/src/standalone/embed-player-api/webpack.config.js b/client/src/standalone/embed-player-api/webpack.config.js deleted file mode 100644 index 48d350edf..000000000 --- a/client/src/standalone/embed-player-api/webpack.config.js +++ /dev/null @@ -1,12 +0,0 @@ -const path = require('path') - -module.exports = [ - { - mode: 'production', - entry: './dist/player.js', - output: { - filename: 'player.min.js', - path: path.resolve(__dirname, 'build') - } - } -] diff --git a/client/src/standalone/videos/vite.config.mjs b/client/src/standalone/videos/vite.config.mjs index 3e8ffa44e..41494f3f4 100644 --- a/client/src/standalone/videos/vite.config.mjs +++ b/client/src/standalone/videos/vite.config.mjs @@ -34,6 +34,8 @@ export default defineConfig(() => { outDir: resolve(root, 'dist', 'standalone', 'videos'), emptyOutDir: true, + target: [ 'firefox78', 'ios12' ], + rollupOptions: { input: { embed: resolve(root, 'src', 'standalone', 'videos', 'embed.html'), diff --git a/client/yarn.lock b/client/yarn.lock index 8d634900e..cd0d01d96 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -485,6 +485,13 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.6.0.tgz#ec6cd237440700bc23ca23087f513c75508958b0" integrity sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@csstools/css-parser-algorithms@^2.6.3": version "2.6.3" resolved "https://registry.yarnpkg.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.6.3.tgz#b5e7eb2bd2a42e968ef61484f1490a8a4148a8eb" @@ -1042,7 +1049,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.24" -"@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== @@ -1057,6 +1064,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" @@ -1686,6 +1701,26 @@ resolved "https://registry.yarnpkg.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c" integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA== +"@tsconfig/node10@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + "@tufjs/canonical-json@2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz#a52f61a3d7374833fca945b2549bc30a2dd40d0a" @@ -2332,7 +2367,14 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.9.0: +acorn-walk@^8.1.1: + version "8.3.3" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.3.tgz#9caeac29eefaa0c41e3d4c65137de4d6f34df43e" + integrity sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw== + dependencies: + acorn "^8.11.0" + +acorn@^8.11.0, acorn@^8.4.1, acorn@^8.9.0: version "8.12.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.0.tgz#1627bfa2e058148036133b8d9b51a700663c294c" integrity sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw== @@ -2514,6 +2556,11 @@ are-docs-informative@^0.0.2: resolved "https://registry.yarnpkg.com/are-docs-informative/-/are-docs-informative-0.0.2.tgz#387f0e93f5d45280373d387a59d34c96db321963" integrity sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig== +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -3382,7 +3429,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" -create-require@^1.1.1: +create-require@^1.1.0, create-require@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== @@ -3682,6 +3729,11 @@ diff@5.0.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + diff@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" @@ -6037,6 +6089,11 @@ mailparser-mit@^1.0.0: mime "^1.6.0" uue "^3.1.0" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + make-fetch-happen@^13.0.0, make-fetch-happen@^13.0.1: version "13.0.1" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-13.0.1.tgz#273ba2f78f45e1f3a6dca91cede87d9fa4821e36" @@ -8576,6 +8633,25 @@ ts-api-utils@^1.3.0: resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== +ts-node@^10.9.2: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" @@ -8840,6 +8916,11 @@ uuid@^9.0.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + validate-npm-package-license@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -9358,6 +9439,11 @@ yauzl@^3.0.0: buffer-crc32 "~0.2.3" pend "~1.2.0" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"