Fix lint, tests and styling

This commit is contained in:
Chocobozzz 2024-02-12 11:12:05 +01:00 committed by Chocobozzz
parent f9c89b98f7
commit 3cac8a756f
9 changed files with 20 additions and 25 deletions

View File

@ -1,2 +0,0 @@
@use '_variables' as *;
@use '_mixins' as *;

View File

@ -5,8 +5,7 @@ import { first } from 'rxjs'
@Component({ @Component({
selector: 'my-account-import-export', selector: 'my-account-import-export',
templateUrl: './my-account-import-export.component.html', templateUrl: './my-account-import-export.component.html'
styleUrls: [ './my-account-import-export.component.scss' ]
}) })
export class MyAccountImportExportComponent implements OnInit, CanComponentDeactivate { export class MyAccountImportExportComponent implements OnInit, CanComponentDeactivate {
@ViewChild('accountImport') accountImport: MyAccountImportComponent @ViewChild('accountImport') accountImport: MyAccountImportComponent
@ -20,11 +19,11 @@ export class MyAccountImportExportComponent implements OnInit, CanComponentDeact
ngOnInit () { ngOnInit () {
this.authService.userInformationLoaded this.authService.userInformationLoaded
.pipe(first()) .pipe(first())
.subscribe(() => { .subscribe(() => {
this.userService.getMyVideoQuotaUsed() this.userService.getMyVideoQuotaUsed()
.subscribe(res => this.videoQuotaUsed = res.videoQuotaUsed) .subscribe(res => this.videoQuotaUsed = res.videoQuotaUsed)
}) })
} }
canDeactivate () { canDeactivate () {

View File

@ -7,8 +7,7 @@
<div class="col-12 col-lg-8 col-xl-9"> <div class="col-12 col-lg-8 col-xl-9">
@if (isImportEnabled()) { @if (isImportEnabled()) {
<p i18n> <p i18n>You can import an archive created by another PeerTube website.</p>
You can import an archive created by another PeerTube website.
<p i18n> <p i18n>
This is an <strong>import</strong> tool and not a migration tool. This is an <strong>import</strong> tool and not a migration tool.

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core' import { Component, OnInit } from '@angular/core'
import { AuthUser, ScreenService, ServerService } from '@app/core' import { AuthUser, ScreenService } from '@app/core'
import { TopMenuDropdownParam } from '../shared/shared-main/misc/top-menu-dropdown.component' import { TopMenuDropdownParam } from '../shared/shared-main/misc/top-menu-dropdown.component'
@Component({ @Component({
@ -11,10 +11,7 @@ export class MyAccountComponent implements OnInit {
menuEntries: TopMenuDropdownParam[] = [] menuEntries: TopMenuDropdownParam[] = []
user: AuthUser user: AuthUser
constructor ( constructor (private screenService: ScreenService) { }
private screenService: ScreenService,
private server: ServerService
) { }
get isBroadcastMessageDisplayed () { get isBroadcastMessageDisplayed () {
return this.screenService.isBroadcastMessageDisplayed return this.screenService.isBroadcastMessageDisplayed

View File

@ -213,7 +213,7 @@ export interface ServerConfig {
} }
users: { users: {
enabled:boolean enabled: boolean
} }
} }

View File

@ -4,8 +4,7 @@ import validator from 'validator'
import { getAllPrivacies, omit, pick, wait } from '@peertube/peertube-core-utils' import { getAllPrivacies, omit, pick, wait } from '@peertube/peertube-core-utils'
import { import {
HttpStatusCode, HttpStatusCode,
HttpStatusCodeType, HttpStatusCodeType, ResultList,
ResultList,
UserVideoRateType, UserVideoRateType,
Video, Video,
VideoCreate, VideoCreate,
@ -631,10 +630,12 @@ export class VideosCommand extends AbstractCommand {
return super.sendResumableChunks<{ video: VideoCreateResult }>(options) return super.sendResumableChunks<{ video: VideoCreateResult }>(options)
} }
async buildResumeVideoUpload (options: Parameters<AbstractCommand['buildResumeUpload']>[0]) { async buildResumeVideoUpload (
options: Parameters<AbstractCommand['buildResumeUpload']>[0]
): Promise<VideoCreateResult> {
const result = await super.buildResumeUpload<{ video: VideoCreateResult }>(options) const result = await super.buildResumeUpload<{ video: VideoCreateResult }>(options)
return result?.video || undefined return result?.video || result as any
} }
prepareVideoResumableUpload (options: Parameters<AbstractCommand['prepareResumableUpload']>[0]) { prepareVideoResumableUpload (options: Parameters<AbstractCommand['prepareResumableUpload']>[0]) {

View File

@ -1,12 +1,12 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import { HttpStatusCode } from '@peertube/peertube-models'
import { import {
cleanupTests, cleanupTests,
createSingleServer, PeerTubeServer, createSingleServer, PeerTubeServer,
setAccessTokensToServers, setAccessTokensToServers,
waitJobs waitJobs
} from '@peertube/peertube-server-commands' } from '@peertube/peertube-server-commands'
import { HttpStatusCode } from '../../../../models/src/http/http-status-codes.js'
import { expect } from 'chai' import { expect } from 'chai'
describe('Test user import API validators', function () { describe('Test user import API validators', function () {

View File

@ -301,8 +301,8 @@ function checkUploadVideoParam (options: {
: server.videos.buildResumeVideoUpload({ : server.videos.buildResumeVideoUpload({
token, token,
fixture: attributes.fixture, fixture: attributes.fixture,
attaches: this.buildUploadAttaches(attributes), attaches: server.videos.buildUploadAttaches(attributes, false),
fields: this.buildUploadFields(attributes), fields: server.videos.buildUploadFields(attributes),
expectedStatus, expectedStatus,
completedExpectedStatus, completedExpectedStatus,
path: '/api/v1/videos/upload-resumable' path: '/api/v1/videos/upload-resumable'

View File

@ -271,7 +271,8 @@ export class VideoPlaylistElementModel extends Model<Partial<AttributesOnly<Vide
model: VideoModel.unscoped(), model: VideoModel.unscoped(),
required: true required: true
} }
] ],
order: getSort('position')
} }
return VideoPlaylistElementModel.findAll(query) return VideoPlaylistElementModel.findAll(query)