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

View File

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

View File

@ -1,15 +1,13 @@
import { getAbsoluteAPIUrl } from '@app/helpers' 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 { 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 { export class VideoChannel extends Actor implements ServerVideoChannel {
displayName: string displayName: string
description: string description: string
support: string support: string
isLocal: boolean
nameWithHost: string nameWithHost: string
nameWithHostForced: string nameWithHostForced: string

View File

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

View File

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