1
0
Fork 0

Remove useless option

See https://blog.angular.dev/using-isolatedmodules-in-angular-18-2-68a7d3a6c03d
This commit is contained in:
Chocobozzz 2024-08-21 10:56:35 +02:00
parent a86252b399
commit 5291ac2478
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 31 additions and 36 deletions

View file

@ -1,6 +1,7 @@
import { Subscription } from 'rxjs'
import { NgClass, NgIf } from '@angular/common'
import { HttpErrorResponse } from '@angular/common/http'
import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { ActivatedRoute } from '@angular/router'
import { AuthService, HooksService, Notifier, RedirectService } from '@app/core'
import { genericUploadErrorHandler } from '@app/helpers'
@ -10,18 +11,16 @@ import {
VIDEO_CHANNEL_SUPPORT_VALIDATOR
} from '@app/shared/form-validators/video-channel-validators'
import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service'
import { VideoChannelUpdate } from '@peertube/peertube-models'
import { VideoChannelEdit } from './video-channel-edit'
import { VideoChannelService } from '@app/shared/shared-main/video-channel/video-channel.service'
import { shallowCopy } from '@peertube/peertube-core-utils'
import { PeertubeCheckboxComponent } from '../../shared/shared-forms/peertube-checkbox.component'
import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
import { HelpComponent } from '../../shared/shared-main/misc/help.component'
import { VideoChannelUpdate } from '@peertube/peertube-models'
import { Subscription } from 'rxjs'
import { ActorAvatarEditComponent } from '../../shared/shared-actor-image-edit/actor-avatar-edit.component'
import { ActorBannerEditComponent } from '../../shared/shared-actor-image-edit/actor-banner-edit.component'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgIf, NgClass } from '@angular/common'
import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model'
import { VideoChannelService } from '@app/shared/shared-main/video-channel/video-channel.service'
import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
import { PeertubeCheckboxComponent } from '../../shared/shared-forms/peertube-checkbox.component'
import { HelpComponent } from '../../shared/shared-main/misc/help.component'
import { VideoChannelEdit } from './video-channel-edit'
@Component({
selector: 'my-video-channel-update',
@ -42,7 +41,6 @@ import { VideoChannelService } from '@app/shared/shared-main/video-channel/video
})
export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnInit, AfterViewInit, OnDestroy {
error: string
videoChannel: VideoChannel
private paramsSub: Subscription
private oldSupportField: string

View file

@ -1,6 +1,7 @@
import { VideoConstant, VideoPlaylist, VideoPlaylistPrivacyType } from '@peertube/peertube-models'
import { SelectChannelItem } from '../../../types/select-options-item.model'
import { FormReactive } from '@app/shared/shared-forms/form-reactive'
import { VideoPlaylist } from '@app/shared/shared-video-playlist/video-playlist.model'
import { VideoConstant, VideoPlaylistPrivacyType } from '@peertube/peertube-models'
import { SelectChannelItem } from '../../../types/select-options-item.model'
export abstract class MyVideoPlaylistEdit extends FormReactive {
// Declare it here to avoid errors in create template

View file

@ -1,6 +1,6 @@
import { forkJoin, Subscription } from 'rxjs'
import { map, switchMap } from 'rxjs/operators'
import { NgClass, NgIf } from '@angular/common'
import { Component, OnDestroy, OnInit } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { ActivatedRoute, Router, RouterLink } from '@angular/router'
import { AuthService, Notifier, ServerService } from '@app/core'
import { listUserChannelsForSelect } from '@app/helpers'
@ -12,17 +12,16 @@ import {
VIDEO_PLAYLIST_PRIVACY_VALIDATOR
} from '@app/shared/form-validators/video-playlist-validators'
import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service'
import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
import { VideoPlaylistUpdate } from '@peertube/peertube-models'
import { MyVideoPlaylistEdit } from './my-video-playlist-edit'
import { forkJoin, Subscription } from 'rxjs'
import { map, switchMap } from 'rxjs/operators'
import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
import { PreviewUploadComponent } from '../../shared/shared-forms/preview-upload.component'
import { SelectChannelComponent } from '../../shared/shared-forms/select/select-channel.component'
import { SelectOptionsComponent } from '../../shared/shared-forms/select/select-options.component'
import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
import { HelpComponent } from '../../shared/shared-main/misc/help.component'
import { PreviewUploadComponent } from '../../shared/shared-forms/preview-upload.component'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgIf, NgClass } from '@angular/common'
import { VideoPlaylist } from '@app/shared/shared-video-playlist/video-playlist.model'
import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
import { MyVideoPlaylistEdit } from './my-video-playlist-edit'
@Component({
templateUrl: './my-video-playlist-edit.component.html',
@ -43,7 +42,6 @@ import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-pl
})
export class MyVideoPlaylistUpdateComponent extends MyVideoPlaylistEdit implements OnInit, OnDestroy {
error: string
videoPlaylistToUpdate: VideoPlaylist
private paramsSub: Subscription

View file

@ -1,15 +1,13 @@
import { getAbsoluteAPIUrl } from '@app/helpers'
import { Account as ServerAccount, ActorImage, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@peertube/peertube-models'
import { Actor } from '../account/actor.model'
import { maxBy } from '@peertube/peertube-core-utils'
import { ActorImage, Account as ServerAccount, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@peertube/peertube-models'
import { Actor } from '../account/actor.model'
export class VideoChannel extends Actor implements ServerVideoChannel {
displayName: string
description: string
support: string
isLocal: boolean
nameWithHost: string
nameWithHostForced: string

View file

@ -12,16 +12,14 @@ import {
import { Video } from './video.model'
export class VideoDetails extends Video implements VideoDetailsServerModel {
declare channel: VideoChannel
declare account: Account
descriptionPath: string
support: string
channel: VideoChannel
tags: string[]
account: Account
downloadEnabled: boolean
waitTranscoding: boolean
state: VideoConstant<VideoStateType>
commentsEnabled: never
commentsPolicy: VideoConstant<VideoCommentPolicyType>
@ -32,8 +30,11 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
inputFileUpdatedAt: Date | string
files: VideoFile[]
streamingPlaylists: VideoStreamingPlaylist[]
// These fields are not optional
declare files: VideoFile[]
declare streamingPlaylists: VideoStreamingPlaylist[]
declare waitTranscoding: boolean
declare state: VideoConstant<VideoStateType>
constructor (hash: VideoDetailsServerModel, translations = {}) {
super(hash, translations)

View file

@ -44,8 +44,7 @@
"crypto": [
"src/shims/noop.ts"
]
},
"useDefineForClassFields": false
}
},
"references": [
{ "path": "../packages/core-utils" },