upgrade dependencies and migrate
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { FormBuilder, FormGroup, Validators, NgForm } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { PageEvent } from '@angular/material/paginator';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, Inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, NgForm, Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { PageEvent } from '@angular/material/paginator';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
|
||||
import * as moment from 'moment';
|
||||
import { ParteyTimeslotsService } from '../../../services/partey.service';
|
||||
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
|
||||
import { I18nService } from './../../../services/i18n.service';
|
||||
import { AuthService } from './../../../services/auth.service';
|
||||
import * as moment from 'moment';
|
||||
import { I18nService } from './../../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-partey-timeslots',
|
||||
templateUrl: './timeslots.component.html',
|
||||
styleUrls: [ './timeslots.component.scss' ]
|
||||
styleUrls: ['./timeslots.component.scss']
|
||||
})
|
||||
export class ParteyTimeslotsComponent implements OnInit {
|
||||
|
||||
@@ -32,12 +32,12 @@ export class ParteyTimeslotsComponent implements OnInit {
|
||||
datetimeformat: string;
|
||||
page: any = { page: 0, size: 10, sort: "id", desc: false };
|
||||
filter: any = {};
|
||||
pageSizeOptions: number[] = [ 5, 10, 25, 50 ];
|
||||
visibilities = [ "PRIVATE", "PROTECTED", "PUBLIC" ];
|
||||
types = [ "VIDEO", "AUDIO", "AUDIO_STREAM", "VIDEO_STREAM" ];
|
||||
pageSizeOptions: number[] = [5, 10, 25, 50];
|
||||
visibilities = ["PRIVATE", "PROTECTED", "PUBLIC"];
|
||||
types = ["VIDEO", "AUDIO", "AUDIO_STREAM", "VIDEO_STREAM"];
|
||||
userId: any;
|
||||
|
||||
timeslotsColumns = [ "type", "starts", "ends", "title", "description", "share", "stream", "edit", "delete" ];
|
||||
timeslotsColumns = ["type", "starts", "ends", "title", "description", "share", "stream", "edit", "delete"];
|
||||
|
||||
searchFormControl = new FormControl();
|
||||
ownerFormControl = new FormControl();
|
||||
@@ -67,10 +67,10 @@ export class ParteyTimeslotsComponent implements OnInit {
|
||||
this.datetimeformat = this.i18n.get('format.datetime', []);
|
||||
|
||||
this.form = this.formBuilder.group({
|
||||
room: [ '', Validators.required ],
|
||||
starts: [ '', Validators.nullValidator ],
|
||||
moderationStarts: [ '', Validators.nullValidator ],
|
||||
expires: [ '', Validators.nullValidator ],
|
||||
room: ['', Validators.required],
|
||||
starts: ['', Validators.nullValidator],
|
||||
moderationStarts: ['', Validators.nullValidator],
|
||||
expires: ['', Validators.nullValidator],
|
||||
});
|
||||
|
||||
this.filter.owner = "";
|
||||
@@ -177,7 +177,7 @@ export class ParteyTimeslotsComponent implements OnInit {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'partey.timeslots.confirmDelete',
|
||||
'args': [ timeslot.title, this.datePipe.transform(new Date(timeslot.starts), this.datetimeformat) ]
|
||||
'args': [timeslot.title, this.datePipe.transform(new Date(timeslot.starts), this.datetimeformat)]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -238,17 +238,18 @@ export class ParteyTimeslotsComponent implements OnInit {
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-timeslot-dialog',
|
||||
templateUrl: 'timeslot.dialog.html',
|
||||
styleUrls: [ './timeslot.dialog.scss' ]
|
||||
styleUrls: ['./timeslot.dialog.scss']
|
||||
})
|
||||
export class ParteyTimeslotDialog {
|
||||
|
||||
form: FormGroup;
|
||||
timeslot;
|
||||
|
||||
visibilities = [ "PRIVATE", "PROTECTED", "PUBLIC" ];
|
||||
types = [ "VIDEO", "AUDIO", "AUDIO_STREAM", "VIDEO_STREAM" ];
|
||||
visibilities = ["PRIVATE", "PROTECTED", "PUBLIC"];
|
||||
types = ["VIDEO", "AUDIO", "AUDIO_STREAM", "VIDEO_STREAM"];
|
||||
|
||||
constructor(
|
||||
private parteyTimeslotsService: ParteyTimeslotsService,
|
||||
@@ -261,12 +262,12 @@ export class ParteyTimeslotDialog {
|
||||
|
||||
ngOnInit() {
|
||||
this.form = this.formBuilder.group({
|
||||
starts: [ '', Validators.required ],
|
||||
ends: [ '', Validators.required ],
|
||||
title: [ '', Validators.nullValidator ],
|
||||
description: [ '', Validators.nullValidator ],
|
||||
stream: [ '', this.timeslot.type == 'VIDEO_STREAM' ? Validators.required : Validators.nullValidator ],
|
||||
share: [ '', (this.timeslot.type == 'VIDEO' || this.timeslot.type == 'AUDIO') ? Validators.required : Validators.nullValidator ],
|
||||
starts: ['', Validators.required],
|
||||
ends: ['', Validators.required],
|
||||
title: ['', Validators.nullValidator],
|
||||
description: ['', Validators.nullValidator],
|
||||
stream: ['', this.timeslot.type == 'VIDEO_STREAM' ? Validators.required : Validators.nullValidator],
|
||||
share: ['', (this.timeslot.type == 'VIDEO' || this.timeslot.type == 'AUDIO') ? Validators.required : Validators.nullValidator],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -279,12 +280,12 @@ export class ParteyTimeslotDialog {
|
||||
if (error.status == 409) {
|
||||
let errors = {};
|
||||
for (let code of error.error) {
|
||||
errors[ code.field ] = errors[ code.field ] || {};
|
||||
errors[ code.field ][ code.code ] = true;
|
||||
errors[code.field] = errors[code.field] || {};
|
||||
errors[code.field][code.code] = true;
|
||||
}
|
||||
|
||||
for (let code in errors) {
|
||||
this.form.get(code).setErrors(errors[ code ]);
|
||||
this.form.get(code).setErrors(errors[code]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -300,12 +301,12 @@ export class ParteyTimeslotDialog {
|
||||
if (error.status == 409) {
|
||||
let errors = {};
|
||||
for (let code of error.error) {
|
||||
errors[ code.field ] = errors[ code.field ] || {};
|
||||
errors[ code.field ][ code.code ] = true;
|
||||
errors[code.field] = errors[code.field] || {};
|
||||
errors[code.field][code.code] = true;
|
||||
}
|
||||
|
||||
for (let code in errors) {
|
||||
this.form.get(code).setErrors(errors[ code ]);
|
||||
this.form.get(code).setErrors(errors[code]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user