upgrade dependencies and migrate
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { I18nService } from './services/i18n.service';
|
||||
import { DateAdapter } from '@angular/material/core';
|
||||
import { I18nService } from './services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Directive, ElementRef, OnInit } from '@angular/core';
|
||||
import { MatInput } from '@angular/material/input';
|
||||
|
||||
@Directive({
|
||||
standalone: false,
|
||||
selector: '[matAutofocus]',
|
||||
})
|
||||
export class AutofocusDirective implements OnInit {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
|
||||
import { AuthService } from './../../services/auth.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { MatTabNavPanel } from '@angular/material/tabs';
|
||||
import { Router } from '@angular/router';
|
||||
import { AuthService } from './../../services/auth.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-account',
|
||||
templateUrl: './account.component.html',
|
||||
styleUrls: ['./account.component.scss']
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { QuotaService } from '../../../services/quota.service';
|
||||
import { I18nService } from '../../../services/i18n.service';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { UserAliasService } from '../../../services/useralias.service';
|
||||
import { FormBuilder, FormGroup, Validators, NgForm } from '@angular/forms';
|
||||
import { FormBuilder, FormGroup, NgForm, Validators } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { I18nService } from '../../../services/i18n.service';
|
||||
import { QuotaService } from '../../../services/quota.service';
|
||||
import { UserAliasService } from '../../../services/useralias.service';
|
||||
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-account-aliases',
|
||||
templateUrl: './aliases.component.html',
|
||||
styleUrls: [ './aliases.component.scss' ]
|
||||
styleUrls: ['./aliases.component.scss']
|
||||
})
|
||||
export class AliasesComponent implements OnInit {
|
||||
|
||||
@@ -24,8 +25,8 @@ export class AliasesComponent implements OnInit {
|
||||
success: boolean;
|
||||
working: boolean;
|
||||
|
||||
aliasesColumns = [ "alias", "visibility", "delete" ];
|
||||
visibilities = [ "PRIVATE", "PROTECTED", "PUBLIC" ];
|
||||
aliasesColumns = ["alias", "visibility", "delete"];
|
||||
visibilities = ["PRIVATE", "PROTECTED", "PUBLIC"];
|
||||
|
||||
constructor(
|
||||
private quotaService: QuotaService,
|
||||
@@ -37,8 +38,8 @@ export class AliasesComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
|
||||
this.form = this.formBuilder.group({
|
||||
alias: [ '', Validators.required ],
|
||||
visibility: [ '', Validators.required ],
|
||||
alias: ['', Validators.required],
|
||||
visibility: ['', Validators.required],
|
||||
});
|
||||
|
||||
this.update();
|
||||
@@ -61,12 +62,12 @@ export class AliasesComponent implements OnInit {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +105,7 @@ export class AliasesComponent implements OnInit {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'user.aliases.confirmDelete',
|
||||
'args': [ alias.alias ]
|
||||
'args': [alias.alias]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { I18nService } from '../../../services/i18n.service';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { UserDomainService } from '../../../services/userdomain.service';
|
||||
import { FormBuilder, FormGroup, Validators, NgForm } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, NgForm, Validators } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { I18nService } from '../../../services/i18n.service';
|
||||
import { UserDomainService } from '../../../services/userdomain.service';
|
||||
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-account-domains',
|
||||
templateUrl: './domains.component.html',
|
||||
styleUrls: [ './domains.component.scss' ]
|
||||
styleUrls: ['./domains.component.scss']
|
||||
})
|
||||
export class DomainsComponent implements OnInit {
|
||||
|
||||
@@ -24,8 +25,8 @@ export class DomainsComponent implements OnInit {
|
||||
success: boolean;
|
||||
working: boolean;
|
||||
|
||||
domainsColumns = [ "domain", "secret", "validated", "delete" ];
|
||||
visibilities = [ "PRIVATE", "PROTECTED", "PUBLIC" ];
|
||||
domainsColumns = ["domain", "secret", "validated", "delete"];
|
||||
visibilities = ["PRIVATE", "PROTECTED", "PUBLIC"];
|
||||
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
@@ -37,7 +38,7 @@ export class DomainsComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.form = this.formBuilder.group({
|
||||
domain: [ '', Validators.required ],
|
||||
domain: ['', Validators.required],
|
||||
// visibility: ['', Validators.required],
|
||||
});
|
||||
|
||||
@@ -60,12 +61,12 @@ export class DomainsComponent implements OnInit {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,7 +93,7 @@ export class DomainsComponent implements OnInit {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'user.domains.confirmDelete',
|
||||
'args': [ domain.domain ]
|
||||
'args': [domain.domain]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { I18nService } from '../../../services/i18n.service';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { UserDomainService } from '../../../services/userdomain.service';
|
||||
import { FormBuilder, FormGroup, Validators, NgForm } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { DyndnsTokenService } from 'src/app/services/dyndnstoken.service';
|
||||
import { I18nService } from '../../../services/i18n.service';
|
||||
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-account-dyndns',
|
||||
templateUrl: './dyndns.component.html',
|
||||
styleUrls: ['./dyndns.component.scss']
|
||||
|
||||
@@ -3,9 +3,10 @@ import { PermissionService } from './../../../services/permission.service';
|
||||
import { QuotaService } from './../../../services/quota.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-account-info',
|
||||
templateUrl: './info.component.html',
|
||||
styleUrls: [ './info.component.scss' ]
|
||||
styleUrls: ['./info.component.scss']
|
||||
})
|
||||
export class InfoComponent implements OnInit {
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-account-profile',
|
||||
templateUrl: './profile.component.html',
|
||||
styleUrls: ['./profile.component.scss']
|
||||
@@ -8,7 +9,7 @@ import {Component, OnInit} from '@angular/core';
|
||||
export class ProfileComponent implements OnInit {
|
||||
|
||||
|
||||
constructor() {}
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, FormControl, Validators, NgForm } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
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 { Auth2FAService } from './../../../services/auth.2fa.service';
|
||||
import { UserService } from './../../../services/user.service';
|
||||
import { MatchingValidator } from './../../../utils/matching.validator';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-account-security',
|
||||
templateUrl: './security.component.html',
|
||||
styleUrls: [ './security.component.scss' ]
|
||||
styleUrls: ['./security.component.scss']
|
||||
})
|
||||
export class SecurityComponent implements OnInit {
|
||||
|
||||
@@ -20,7 +21,7 @@ export class SecurityComponent implements OnInit {
|
||||
public successStatus: boolean;
|
||||
public totp: boolean = false;
|
||||
|
||||
statuses = [ "NORMAL", "SLEEP", "PURGE" ];
|
||||
statuses = ["NORMAL", "SLEEP", "PURGE"];
|
||||
|
||||
passwordForm: FormGroup;
|
||||
statusForm: FormGroup;
|
||||
@@ -34,16 +35,16 @@ export class SecurityComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.passwordForm = this.formBuilder.group({
|
||||
oldPassword: [ '', Validators.required ],
|
||||
password: [ '', Validators.required ],
|
||||
password2: [ '', Validators.required ]
|
||||
oldPassword: ['', Validators.required],
|
||||
password: ['', Validators.required],
|
||||
password2: ['', Validators.required]
|
||||
}, {
|
||||
validator: MatchingValidator('password', 'password2')
|
||||
});
|
||||
|
||||
|
||||
this.statusForm = this.formBuilder.group({
|
||||
status: [ '', Validators.required ]
|
||||
status: ['', Validators.required]
|
||||
});
|
||||
|
||||
this.userService.get().subscribe({
|
||||
@@ -77,12 +78,12 @@ export class SecurityComponent implements OnInit {
|
||||
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.passwordForm.get(code).setErrors(errors[ code ]);
|
||||
this.passwordForm.get(code).setErrors(errors[code]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,9 +159,10 @@ export class SecurityComponent implements OnInit {
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-security-totp-dialog',
|
||||
templateUrl: 'security-totp.dialog.html',
|
||||
styleUrls: [ './security.component.scss' ]
|
||||
styleUrls: ['./security.component.scss']
|
||||
})
|
||||
export class SecurityTotpDialog {
|
||||
|
||||
@@ -172,6 +174,6 @@ export class SecurityTotpDialog {
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.code = new FormControl('', [ Validators.required, Validators.pattern("[0-9]{6}") ]);
|
||||
this.code = new FormControl('', [Validators.required, Validators.pattern("[0-9]{6}")]);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
|
||||
import { VoucherService } from './../../../services/voucher.service';
|
||||
import { QuotaService } from './../../../services/quota.service';
|
||||
import { VoucherService } from './../../../services/voucher.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-account-voucher',
|
||||
templateUrl: './voucher.component.html',
|
||||
styleUrls: [ './voucher.component.scss' ]
|
||||
styleUrls: ['./voucher.component.scss']
|
||||
})
|
||||
export class VoucherComponent implements OnInit {
|
||||
|
||||
@@ -17,7 +18,7 @@ export class VoucherComponent implements OnInit {
|
||||
available = [];
|
||||
vouchers = [];
|
||||
voucherSource = new MatTableDataSource<any>();
|
||||
voucherColumns = [ 'type', 'code' ];
|
||||
voucherColumns = ['type', 'code'];
|
||||
|
||||
constructor(private voucherService: VoucherService, private quotaService: QuotaService, public dialog: MatDialog) { }
|
||||
|
||||
@@ -50,9 +51,10 @@ export class VoucherComponent implements OnInit {
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-voucher-dialog',
|
||||
templateUrl: 'voucher.dialog.html',
|
||||
styleUrls: [ './voucher.dialog.scss' ]
|
||||
styleUrls: ['./voucher.dialog.scss']
|
||||
})
|
||||
export class VoucherDialog {
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-borrow',
|
||||
templateUrl: './borrow.component.html',
|
||||
styleUrls: [ './borrow.component.scss' ]
|
||||
styleUrls: ['./borrow.component.scss']
|
||||
})
|
||||
export class BorrowComponent {
|
||||
|
||||
|
||||
@@ -1,31 +1,32 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { PageEvent } from '@angular/material/paginator';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import * as moment from 'moment';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
|
||||
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
|
||||
import { BorrowItemsService } from './../../../services/borrow.service';
|
||||
import { AuthService } from './../../../services/auth.service';
|
||||
import { BorrowRequestEditComponent } from '../requests/requests.component';
|
||||
import { AuthService } from './../../../services/auth.service';
|
||||
import { BorrowItemsService } from './../../../services/borrow.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-borrow-items',
|
||||
templateUrl: './items.component.html',
|
||||
styleUrls: [ './items.component.scss' ]
|
||||
styleUrls: ['./items.component.scss']
|
||||
})
|
||||
export class BorrowItemsComponent implements OnInit {
|
||||
|
||||
borrowItems: any[];
|
||||
page: any = { page: 0, size: 10, sort: "id", desc: false };
|
||||
pageSizeOptions: number[] = [ 5, 10, 25, 50 ];
|
||||
pageSizeOptions: number[] = [5, 10, 25, 50];
|
||||
searchFormControl = new FormControl();
|
||||
ownerFormControl = new FormControl();
|
||||
userId: any;
|
||||
|
||||
borrowItemColumns = [ "name", "description", "availability", "url", "actions" ];
|
||||
borrowItemColumns = ["name", "description", "availability", "url", "actions"];
|
||||
|
||||
constructor(private borrowItemsService: BorrowItemsService,
|
||||
private authService: AuthService,
|
||||
@@ -152,7 +153,7 @@ export class BorrowItemsComponent implements OnInit {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'borrow.items.confirmDelete',
|
||||
'args': [ borrowItem.name ]
|
||||
'args': [borrowItem.name]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -172,16 +173,17 @@ export class BorrowItemsComponent implements OnInit {
|
||||
}
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-borrow-item-edit',
|
||||
templateUrl: './item.edit.html',
|
||||
styleUrls: [ './item.edit.scss' ]
|
||||
styleUrls: ['./item.edit.scss']
|
||||
})
|
||||
export class BorrowItemEditComponent {
|
||||
|
||||
borrowItemId: number;
|
||||
create: boolean = false;
|
||||
form: FormGroup;
|
||||
weekdays: string[] = [ 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY' ];
|
||||
weekdays: string[] = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY'];
|
||||
|
||||
constructor(private borrowItemsService: BorrowItemsService,
|
||||
private formBuilder: FormBuilder,
|
||||
@@ -190,17 +192,17 @@ export class BorrowItemEditComponent {
|
||||
public dialog: MatDialog) {
|
||||
|
||||
this.form = this.formBuilder.group({
|
||||
name: [ '', Validators.required ],
|
||||
description: [ '', Validators.nullValidator ],
|
||||
url: [ '', Validators.nullValidator ],
|
||||
minDuration: [ '', Validators.nullValidator ],
|
||||
maxDuration: [ '', Validators.nullValidator ],
|
||||
availability: [ '', Validators.required ],
|
||||
autoAccept: [ '', Validators.nullValidator ],
|
||||
emailNotification: [ '', Validators.nullValidator ],
|
||||
email: [ '', Validators.nullValidator ],
|
||||
name: ['', Validators.required],
|
||||
description: ['', Validators.nullValidator],
|
||||
url: ['', Validators.nullValidator],
|
||||
minDuration: ['', Validators.nullValidator],
|
||||
maxDuration: ['', Validators.nullValidator],
|
||||
availability: ['', Validators.required],
|
||||
autoAccept: ['', Validators.nullValidator],
|
||||
emailNotification: ['', Validators.nullValidator],
|
||||
email: ['', Validators.nullValidator],
|
||||
slots: this.formBuilder.array([])
|
||||
}, { validators: [ durationValidator ] })
|
||||
}, { validators: [durationValidator] })
|
||||
|
||||
this.form.get('availability').valueChanges.subscribe({
|
||||
next: (value) => {
|
||||
@@ -278,7 +280,7 @@ export class BorrowItemEditComponent {
|
||||
}
|
||||
|
||||
get slots() {
|
||||
return this.form.controls[ "slots" ] as FormArray;
|
||||
return this.form.controls["slots"] as FormArray;
|
||||
}
|
||||
|
||||
deleteSlot(index: number) {
|
||||
@@ -291,10 +293,10 @@ export class BorrowItemEditComponent {
|
||||
|
||||
addManualSlot(id, start, end) {
|
||||
const manualSlotForm = this.formBuilder.group({
|
||||
id: [ id, Validators.required ],
|
||||
start: [ start, Validators.required ],
|
||||
end: [ end, Validators.required ]
|
||||
}, { validators: [ manualSlotValidator ] });
|
||||
id: [id, Validators.required],
|
||||
start: [start, Validators.required],
|
||||
end: [end, Validators.required]
|
||||
}, { validators: [manualSlotValidator] });
|
||||
this.slots.push(manualSlotForm);
|
||||
}
|
||||
|
||||
@@ -306,12 +308,12 @@ export class BorrowItemEditComponent {
|
||||
endTime = endTime.substr(0, 5);
|
||||
}
|
||||
const perdiodSlotForm = this.formBuilder.group({
|
||||
id: [ id, Validators.required ],
|
||||
startDay: [ startDay, Validators.required ],
|
||||
startTime: [ startTime, Validators.required ],
|
||||
endDay: [ endDay, Validators.required ],
|
||||
endTime: [ endTime, Validators.required ]
|
||||
}, { validators: [ periodSlotValidator ] });
|
||||
id: [id, Validators.required],
|
||||
startDay: [startDay, Validators.required],
|
||||
startTime: [startTime, Validators.required],
|
||||
endDay: [endDay, Validators.required],
|
||||
endTime: [endTime, Validators.required]
|
||||
}, { validators: [periodSlotValidator] });
|
||||
this.slots.push(perdiodSlotForm);
|
||||
}
|
||||
|
||||
@@ -325,12 +327,12 @@ export class BorrowItemEditComponent {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -343,7 +345,7 @@ export class BorrowItemEditComponent {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'borrow.items.confirmDelete',
|
||||
'args': [ borrowItem.name ]
|
||||
'args': [borrowItem.name]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -368,8 +370,8 @@ const durationValidator: ValidatorFn = (fg: FormGroup) => {
|
||||
fg.get('maxDuration').setErrors(null);
|
||||
|
||||
if (minDuration && maxDuration && (moment.duration(minDuration).asMinutes() >= moment.duration(maxDuration).asMinutes())) {
|
||||
fg.get('minDuration').setErrors([ 'INVALID' ]);
|
||||
fg.get('maxDuration').setErrors([ 'INVALID' ]);
|
||||
fg.get('minDuration').setErrors(['INVALID']);
|
||||
fg.get('maxDuration').setErrors(['INVALID']);
|
||||
return { 'INVALID': true };
|
||||
}
|
||||
|
||||
@@ -386,17 +388,17 @@ const manualSlotValidator: ValidatorFn = (fg: FormGroup) => {
|
||||
fg.get('end').setErrors(null);
|
||||
|
||||
if (!start) {
|
||||
fg.get('start').setErrors([ 'MISSING_DATES' ]);
|
||||
fg.get('start').setErrors(['MISSING_DATES']);
|
||||
return { 'MISSING_DATES': true };
|
||||
}
|
||||
if (!end) {
|
||||
fg.get('end').setErrors([ 'MISSING_DATES' ]);
|
||||
fg.get('end').setErrors(['MISSING_DATES']);
|
||||
return { 'MISSING_DATES': true };
|
||||
}
|
||||
|
||||
if (start >= end) {
|
||||
fg.get('start').setErrors([ 'INVALID_DATES' ]);
|
||||
fg.get('end').setErrors([ 'INVALID_DATES' ]);
|
||||
fg.get('start').setErrors(['INVALID_DATES']);
|
||||
fg.get('end').setErrors(['INVALID_DATES']);
|
||||
return { 'INVALID_DATES': true };
|
||||
}
|
||||
|
||||
@@ -404,7 +406,7 @@ const manualSlotValidator: ValidatorFn = (fg: FormGroup) => {
|
||||
};
|
||||
|
||||
const periodSlotValidator: ValidatorFn = (fg: FormGroup) => {
|
||||
const weekdays: string[] = [ 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY' ];
|
||||
const weekdays: string[] = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY'];
|
||||
const startDay = fg.get('startDay').value;
|
||||
const startTime = fg.get('startTime').value;
|
||||
const endDay = fg.get('endDay').value;
|
||||
@@ -417,31 +419,31 @@ const periodSlotValidator: ValidatorFn = (fg: FormGroup) => {
|
||||
fg.get('endTime').setErrors(null);
|
||||
|
||||
if (!startDay) {
|
||||
fg.get('startDay').setErrors([ 'MISSING_DATES' ]);
|
||||
fg.get('startDay').setErrors(['MISSING_DATES']);
|
||||
return { 'MISSING_DATES': true };
|
||||
}
|
||||
if (!startTime) {
|
||||
fg.get('startTime').setErrors([ 'MISSING_DATES' ]);
|
||||
fg.get('startTime').setErrors(['MISSING_DATES']);
|
||||
return { 'MISSING_DATES': true };
|
||||
}
|
||||
if (!endDay) {
|
||||
fg.get('endDay').setErrors([ 'MISSING_DATES' ]);
|
||||
fg.get('endDay').setErrors(['MISSING_DATES']);
|
||||
return { 'MISSING_DATES': true };
|
||||
}
|
||||
if (!endTime) {
|
||||
fg.get('endTime').setErrors([ 'MISSING_DATES' ]);
|
||||
fg.get('endTime').setErrors(['MISSING_DATES']);
|
||||
return { 'MISSING_DATES': true };
|
||||
}
|
||||
|
||||
if (weekdays.indexOf(startDay) > weekdays.indexOf(endDay)) {
|
||||
fg.get('startDay').setErrors([ 'INVALID_DAY' ]);
|
||||
fg.get('endDay').setErrors([ 'INVALID_DAY' ]);
|
||||
fg.get('startDay').setErrors(['INVALID_DAY']);
|
||||
fg.get('endDay').setErrors(['INVALID_DAY']);
|
||||
return { 'INVALID_DAY': true };
|
||||
}
|
||||
|
||||
if (weekdays.indexOf(startDay) == weekdays.indexOf(endDay) && startTime >= endTime) {
|
||||
fg.get('startTime').setErrors([ 'INVALID_TIME' ]);
|
||||
fg.get('endTime').setErrors([ 'INVALID_TIME' ]);
|
||||
fg.get('startTime').setErrors(['INVALID_TIME']);
|
||||
fg.get('endTime').setErrors(['INVALID_TIME']);
|
||||
return { 'INVALID_TIME': true };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { AfterViewInit, Component, ElementRef, ViewChild, Inject } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { AfterViewInit, Component, ElementRef, Inject, ViewChild } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
|
||||
|
||||
import { BorrowRequestsService } from 'src/app/services/borrow.service';
|
||||
|
||||
import QrScanner from 'qr-scanner';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import QrScanner from 'qr-scanner';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-borrow-proving',
|
||||
templateUrl: './proving.component.html',
|
||||
styleUrls: [ './proving.component.scss' ]
|
||||
styleUrls: ['./proving.component.scss']
|
||||
})
|
||||
export class BorrowProvingComponent implements AfterViewInit {
|
||||
|
||||
@@ -37,7 +37,7 @@ export class BorrowProvingComponent implements AfterViewInit {
|
||||
this.cameras = cameras;
|
||||
if (this.cameras.length) {
|
||||
this.noCamera = false;
|
||||
this.camera.setValue(this.cameras[ 0 ].id, { emitEvent: false });
|
||||
this.camera.setValue(this.cameras[0].id, { emitEvent: false });
|
||||
this.camera.valueChanges.subscribe({
|
||||
next: (value) => {
|
||||
this.qrScanner.setCamera(value);
|
||||
@@ -97,9 +97,10 @@ export class BorrowProvingComponent implements AfterViewInit {
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-borrow-prooving-result',
|
||||
templateUrl: 'proving.dialog.html',
|
||||
styleUrls: [ './proving.dialog.scss' ]
|
||||
styleUrls: ['./proving.dialog.scss']
|
||||
})
|
||||
export class BorrowProvingResultDialog {
|
||||
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { PageEvent } from '@angular/material/paginator';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import * as moment from 'moment';
|
||||
|
||||
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
|
||||
import { AuthService } from './../../../services/auth.service';
|
||||
import { BorrowRequestsService } from './../../../services/borrow.service';
|
||||
import { I18nService } from './../../../services/i18n.service';
|
||||
import { AuthService } from './../../../services/auth.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-borrow-requests',
|
||||
templateUrl: './requests.component.html',
|
||||
styleUrls: [ './requests.component.scss' ]
|
||||
styleUrls: ['./requests.component.scss']
|
||||
})
|
||||
export class BorrowRequestsComponent implements OnInit {
|
||||
|
||||
borrowRequests: any[];
|
||||
page: any = { page: 0, size: 10, sort: "id", desc: false };
|
||||
pageSizeOptions: number[] = [ 5, 10, 25, 50 ];
|
||||
pageSizeOptions: number[] = [5, 10, 25, 50];
|
||||
ownerFormControl = new FormControl();
|
||||
userId: any;
|
||||
|
||||
borrowRequestColumns = [ "name", "status", "starts", "ends", "actions" ];
|
||||
borrowRequestColumns = ["name", "status", "starts", "ends", "actions"];
|
||||
|
||||
constructor(private borrowRequestsService: BorrowRequestsService,
|
||||
private i18n: I18nService,
|
||||
@@ -109,7 +108,7 @@ export class BorrowRequestsComponent implements OnInit {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'borrow.items.confirmDelete',
|
||||
'args': [ borrowRequest.name ]
|
||||
'args': [borrowRequest.name]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -129,9 +128,10 @@ export class BorrowRequestsComponent implements OnInit {
|
||||
}
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-borrow-request-edit',
|
||||
templateUrl: './request.edit.html',
|
||||
styleUrls: [ './request.edit.scss' ]
|
||||
styleUrls: ['./request.edit.scss']
|
||||
})
|
||||
export class BorrowRequestEditComponent {
|
||||
|
||||
@@ -172,12 +172,12 @@ export class BorrowRequestEditComponent {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ export class BorrowRequestEditComponent {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'borrow.requests.confirmDelete',
|
||||
'args': [ borrowRequest.name ]
|
||||
'args': [borrowRequest.name]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-dividertest',
|
||||
templateUrl: './dividertest.component.html',
|
||||
styleUrls: [ './dividertest.component.scss' ]
|
||||
styleUrls: ['./dividertest.component.scss']
|
||||
})
|
||||
export class DividertestComponent implements OnInit {
|
||||
|
||||
dividerModel = {
|
||||
free: 0,
|
||||
items: [ { name: "mail", value: 5 }, { name: "nextcloud", value: 15 } ],
|
||||
items: [{ name: "mail", value: 5 }, { name: "nextcloud", value: 15 }],
|
||||
unit: 'M',
|
||||
units: [
|
||||
{ name: "G", value: 1, steps: 0.5 },
|
||||
|
||||
@@ -6,9 +6,10 @@ import { environment } from '../../../environments/environment';
|
||||
import { Auth2FAService } from '../../services/auth.2fa.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-form-login-2fa',
|
||||
templateUrl: './form-login-2fa.component.html',
|
||||
styleUrls: [ './form-login-2fa.component.scss' ]
|
||||
styleUrls: ['./form-login-2fa.component.scss']
|
||||
})
|
||||
export class FormLogin2FAComponent implements OnInit {
|
||||
|
||||
@@ -26,11 +27,11 @@ export class FormLogin2FAComponent implements OnInit {
|
||||
async ngOnInit() {
|
||||
this.route.queryParams.subscribe({
|
||||
next: (params) => {
|
||||
if (params[ 'error' ] || params[ 'error' ] == '') {
|
||||
if (params['error'] || params['error'] == '') {
|
||||
this.loginInvalid = true;
|
||||
this.router.navigate([], { queryParams: { error: null }, queryParamsHandling: 'merge' });
|
||||
}
|
||||
if (params[ 'keep' ] || params[ 'keep' ] == '') {
|
||||
if (params['keep'] || params['keep'] == '') {
|
||||
this.keep = true;
|
||||
this.router.navigate([], { queryParams: { keep: null }, queryParamsHandling: 'merge' });
|
||||
}
|
||||
@@ -40,8 +41,8 @@ export class FormLogin2FAComponent implements OnInit {
|
||||
this.auth2FAService.getEnabled().subscribe({
|
||||
next: (providers: any) => {
|
||||
this.providers = providers;
|
||||
if (this.providers[ 0 ]) {
|
||||
this.selectedProvider = this.providers[ 0 ];
|
||||
if (this.providers[0]) {
|
||||
this.selectedProvider = this.providers[0];
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { Auth2FAService } from '../../services/auth.2fa.service';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { Location } from '@angular/common';
|
||||
import { UserAliasService } from 'src/app/services/useralias.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { UserAliasService } from 'src/app/services/useralias.service';
|
||||
import { environment } from '../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-login-oidc',
|
||||
templateUrl: './form-login-oidc.component.html',
|
||||
styleUrls: ['./form-login-oidc.component.scss']
|
||||
|
||||
@@ -4,9 +4,10 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { environment } from '../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-form-login',
|
||||
templateUrl: './form-login.component.html',
|
||||
styleUrls: [ './form-login.component.scss' ]
|
||||
styleUrls: ['./form-login.component.scss']
|
||||
})
|
||||
export class FormLoginComponent implements OnInit {
|
||||
|
||||
@@ -22,11 +23,11 @@ export class FormLoginComponent implements OnInit {
|
||||
async ngOnInit() {
|
||||
this.route.queryParams.subscribe({
|
||||
next: (params) => {
|
||||
if (params[ 'target' ]) {
|
||||
this.targetRoute = params[ 'target' ];
|
||||
if (params['target']) {
|
||||
this.targetRoute = params['target'];
|
||||
this.router.navigate([], { queryParams: { target: null }, queryParamsHandling: 'merge', replaceUrl: true });
|
||||
}
|
||||
if (params[ 'error' ] || params[ 'error' ] == '') {
|
||||
if (params['error'] || params['error'] == '') {
|
||||
this.loginInvalid = true;
|
||||
this.router.navigate([], { queryParams: { error: null }, queryParamsHandling: 'merge', replaceUrl: true });
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { MatchingValidator } from './../../../utils/matching.validator';
|
||||
import { InviteService } from './../../../services/invites.service';
|
||||
import { uniqueNamesGenerator, Config, adjectives, colors, animals } from 'unique-names-generator';
|
||||
import { I18nService } from 'src/app/services/i18n.service';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { InviteEditComponent } from '../edit/invite.edit';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { I18nService } from 'src/app/services/i18n.service';
|
||||
import { Config, adjectives, animals, colors, uniqueNamesGenerator } from 'unique-names-generator';
|
||||
import { InviteService } from './../../../services/invites.service';
|
||||
import { MatchingValidator } from './../../../utils/matching.validator';
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-invite-code',
|
||||
templateUrl: './code.component.html',
|
||||
styleUrls: [ './code.component.scss' ]
|
||||
styleUrls: ['./code.component.scss']
|
||||
})
|
||||
export class InviteCodeComponent implements OnInit {
|
||||
|
||||
@@ -47,9 +47,9 @@ export class InviteCodeComponent implements OnInit {
|
||||
this.datetimeformat = this.i18n.get('format.datetime', []);
|
||||
|
||||
this.form = this.formBuilder.group({
|
||||
username: [ '', Validators.required ],
|
||||
password: [ '', Validators.nullValidator ],
|
||||
password2: [ '', Validators.required ]
|
||||
username: ['', Validators.required],
|
||||
password: ['', Validators.nullValidator],
|
||||
password2: ['', Validators.required]
|
||||
}, {
|
||||
validators: MatchingValidator('password', 'password2')
|
||||
});
|
||||
@@ -65,8 +65,8 @@ export class InviteCodeComponent implements OnInit {
|
||||
|
||||
if (this.invite.owner == this.auth.principal.userId) {
|
||||
this.form = this.formBuilder.group({
|
||||
message: [ '', Validators.nullValidator ],
|
||||
note: [ '', Validators.nullValidator ],
|
||||
message: ['', Validators.nullValidator],
|
||||
note: ['', Validators.nullValidator],
|
||||
});
|
||||
|
||||
this.form.get("message").setValue(this.invite.message);
|
||||
@@ -98,7 +98,7 @@ export class InviteCodeComponent implements OnInit {
|
||||
|
||||
genUsername() {
|
||||
const config: Config = {
|
||||
dictionaries: [ adjectives, colors, animals ],
|
||||
dictionaries: [adjectives, colors, animals],
|
||||
separator: "",
|
||||
style: "capital",
|
||||
length: 3
|
||||
@@ -133,12 +133,12 @@ export class InviteCodeComponent implements OnInit {
|
||||
} else 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,12 +166,12 @@ export class InviteCodeComponent implements OnInit {
|
||||
} else 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { MatchingValidator } from '../../../utils/matching.validator';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { InviteService } from '../../../services/invites.service';
|
||||
import { uniqueNamesGenerator, Config, adjectives, colors, animals } from 'unique-names-generator';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-invite-edit',
|
||||
templateUrl: './invite.edit.html',
|
||||
styleUrls: [ './invite.edit.scss' ]
|
||||
styleUrls: ['./invite.edit.scss']
|
||||
})
|
||||
export class InviteEditComponent {
|
||||
|
||||
@@ -28,8 +26,8 @@ export class InviteEditComponent {
|
||||
public dialogRef: MatDialogRef<InviteEditComponent>,
|
||||
public dialog: MatDialog) {
|
||||
this.form = this.formBuilder.group({
|
||||
message: [ '', Validators.nullValidator ],
|
||||
note: [ '', Validators.nullValidator ],
|
||||
message: ['', Validators.nullValidator],
|
||||
note: ['', Validators.nullValidator],
|
||||
});
|
||||
|
||||
this.invite = data;
|
||||
@@ -58,12 +56,12 @@ export class InviteEditComponent {
|
||||
} else 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { PageEvent } from '@angular/material/paginator';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { AuthService } from '../../services/auth.service';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { QuotaService } from '../../services/quota.service';
|
||||
import { InviteService } from '../../services/invites.service';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { InviteEditComponent } from './edit/invite.edit';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { InviteService } from '../../services/invites.service';
|
||||
import { QuotaService } from '../../services/quota.service';
|
||||
import { InviteEditComponent } from './edit/invite.edit';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-invites',
|
||||
templateUrl: './invites.component.html',
|
||||
styleUrls: [ './invites.component.scss' ]
|
||||
styleUrls: ['./invites.component.scss']
|
||||
})
|
||||
export class InvitesComponent implements OnInit {
|
||||
|
||||
@@ -26,14 +26,14 @@ export class InvitesComponent implements OnInit {
|
||||
success: boolean;
|
||||
working: boolean;
|
||||
datetimeformat: string;
|
||||
pageSizeOptions: number[] = [ 5, 10, 25, 50 ];
|
||||
pageSizeOptions: number[] = [5, 10, 25, 50];
|
||||
searchFormControl = new FormControl();
|
||||
redeemedFormControl = new FormControl();
|
||||
searchOthersFormControl = new FormControl();
|
||||
redeemedOthersFormControl = new FormControl();
|
||||
|
||||
inviteColumns = [ "starts", "expires", "link", "note", "message", "redeemed", "actions" ];
|
||||
otherColumns = [ "note", "redeemed" ];
|
||||
inviteColumns = ["starts", "expires", "link", "note", "message", "redeemed", "actions"];
|
||||
otherColumns = ["note", "redeemed"];
|
||||
|
||||
constructor(
|
||||
private inviteService: InviteService,
|
||||
@@ -149,8 +149,8 @@ export class InvitesComponent implements OnInit {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, Inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, 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 { FormBuilder, FormGroup, Validators, NgForm } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { PageEvent } from '@angular/material/paginator';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
|
||||
import { QuotaService } from '../../services/quota.service';
|
||||
import { JitsiService } from '../../services/jitsi.service';
|
||||
import { QuotaService } from '../../services/quota.service';
|
||||
import { ConfirmDialog } from '../../ui/confirm/confirm.component';
|
||||
import { I18nService } from './../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-account-jitsi',
|
||||
templateUrl: './jitsi.component.html',
|
||||
styleUrls: [ './jitsi.component.scss' ]
|
||||
styleUrls: ['./jitsi.component.scss']
|
||||
})
|
||||
export class JitsiComponent implements OnInit {
|
||||
|
||||
@@ -29,9 +30,9 @@ export class JitsiComponent implements OnInit {
|
||||
shortenedUrlQuota: number = 0;
|
||||
datetimeformat: String;
|
||||
page: any = { page: 0, size: 10, sort: "id", desc: false };
|
||||
pageSizeOptions: number[] = [ 5, 10, 25, 50 ];
|
||||
pageSizeOptions: number[] = [5, 10, 25, 50];
|
||||
|
||||
jitsiRoomsColumns = [ "share", "room", "starts", "moderationStarts", "expires", "moderationUrl", "edit", "delete" ];
|
||||
jitsiRoomsColumns = ["share", "room", "starts", "moderationStarts", "expires", "moderationUrl", "edit", "delete"];
|
||||
|
||||
constructor(
|
||||
private quotaService: QuotaService,
|
||||
@@ -46,10 +47,10 @@ export class JitsiComponent 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.refresh();
|
||||
@@ -73,12 +74,12 @@ export class JitsiComponent implements OnInit {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,7 +139,7 @@ export class JitsiComponent implements OnInit {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'jitsi.rooms.confirmDelete',
|
||||
'args': [ jitsiRoom.room ]
|
||||
'args': [jitsiRoom.room]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -208,9 +209,10 @@ export class JitsiComponent implements OnInit {
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-jitsi-edit-dialog',
|
||||
templateUrl: 'jitsi.edit.html',
|
||||
styleUrls: [ './jitsi.edit.scss' ]
|
||||
styleUrls: ['./jitsi.edit.scss']
|
||||
})
|
||||
export class JitsiEditDialog {
|
||||
|
||||
@@ -230,10 +232,10 @@ export class JitsiEditDialog {
|
||||
ngOnInit(): void {
|
||||
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],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -252,12 +254,12 @@ export class JitsiEditDialog {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -267,9 +269,10 @@ export class JitsiEditDialog {
|
||||
}
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-jitsi-share-dialog',
|
||||
templateUrl: 'jitsi.share.html',
|
||||
styleUrls: [ './jitsi.share.scss' ]
|
||||
styleUrls: ['./jitsi.share.scss']
|
||||
})
|
||||
export class JitsiShareDialog {
|
||||
|
||||
@@ -290,13 +293,13 @@ export class JitsiShareDialog {
|
||||
this.datetimeformat = this.i18n.get('format.datetime', []);
|
||||
this.jitsiRoom.shareText = this.i18n.get('jitsi.share.text.intro', []);
|
||||
if (this.jitsiRoom.starts && !this.jitsiRoom.expires) {
|
||||
this.jitsiRoom.shareText += "\n\n" + this.i18n.get('jitsi.share.text.starts', [ this.datePipe.transform(new Date(this.jitsiRoom.starts), this.datetimeformat) ]);
|
||||
this.jitsiRoom.shareText += "\n\n" + this.i18n.get('jitsi.share.text.starts', [this.datePipe.transform(new Date(this.jitsiRoom.starts), this.datetimeformat)]);
|
||||
} else if (!this.jitsiRoom.starts && this.jitsiRoom.expires) {
|
||||
this.jitsiRoom.shareText += "\n\n" + this.i18n.get('jitsi.share.text.expires', [ this.datePipe.transform(new Date(this.jitsiRoom.expires), this.datetimeformat) ]);
|
||||
this.jitsiRoom.shareText += "\n\n" + this.i18n.get('jitsi.share.text.expires', [this.datePipe.transform(new Date(this.jitsiRoom.expires), this.datetimeformat)]);
|
||||
} else if (this.jitsiRoom.starts && this.jitsiRoom.expires) {
|
||||
this.jitsiRoom.shareText += "\n\n" + this.i18n.get('jitsi.share.text.both', [ this.datePipe.transform(new Date(this.jitsiRoom.starts), this.datetimeformat), this.datePipe.transform(new Date(this.jitsiRoom.expires), this.datetimeformat) ]);
|
||||
this.jitsiRoom.shareText += "\n\n" + this.i18n.get('jitsi.share.text.both', [this.datePipe.transform(new Date(this.jitsiRoom.starts), this.datetimeformat), this.datePipe.transform(new Date(this.jitsiRoom.expires), this.datetimeformat)]);
|
||||
}
|
||||
this.jitsiRoom.shareText += "\n\n" + this.i18n.get('jitsi.share.text.outro', [ this.jitsiRoom.url ]);
|
||||
this.jitsiRoom.shareText += "\n\n" + this.i18n.get('jitsi.share.text.outro', [this.jitsiRoom.url]);
|
||||
}
|
||||
|
||||
copyToClipboard(text) {
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
|
||||
import { FormControl } from '@angular/forms';
|
||||
|
||||
import { ConfirmDialog } from '../../ui/confirm/confirm.component';
|
||||
import { JukeboxService } from 'src/app/services/jukebox.service';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { Data } from '@angular/router';
|
||||
import { ConfirmDialog } from '../../ui/confirm/confirm.component';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-jukebox',
|
||||
templateUrl: './jukebox.component.html',
|
||||
styleUrls: [ './jukebox.component.scss' ]
|
||||
styleUrls: ['./jukebox.component.scss']
|
||||
})
|
||||
export class JukeboxComponent implements OnInit, OnDestroy {
|
||||
|
||||
@@ -138,7 +137,7 @@ export class JukeboxComponent implements OnInit, OnDestroy {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'jukebox.addToQueue.confirm',
|
||||
'args': [ track.artists[ 0 ].name, track.name ]
|
||||
'args': [track.artists[0].name, track.name]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Auth2FAService } from '../../services/auth.2fa.service';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { environment } from '../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-login-totp',
|
||||
templateUrl: './login-totp.component.html',
|
||||
styleUrls: [ './login-totp.component.scss' ]
|
||||
styleUrls: ['./login-totp.component.scss']
|
||||
})
|
||||
export class LoginTotpComponent implements OnInit {
|
||||
|
||||
@@ -22,14 +23,14 @@ export class LoginTotpComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.form = this.formBuilder.group({
|
||||
code: [ '', Validators.required ],
|
||||
keep: [ '' ]
|
||||
code: ['', Validators.required],
|
||||
keep: ['']
|
||||
});
|
||||
|
||||
this.route.queryParams.subscribe({
|
||||
next: (params) => {
|
||||
if (params[ 'target' ]) {
|
||||
this.targetRoute = params[ 'target' ];
|
||||
if (params['target']) {
|
||||
this.targetRoute = params['target'];
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -40,7 +41,7 @@ export class LoginTotpComponent implements OnInit {
|
||||
if (this.form.valid) {
|
||||
this.auth2FAService.login('totp', this.form.get('code').value, this.form.get('keep').value).subscribe({
|
||||
next: (response: any) => {
|
||||
this.router.navigate([ this.targetRoute ]);
|
||||
this.router.navigate([this.targetRoute]);
|
||||
},
|
||||
error: (error) => {
|
||||
this.loginInvalid = true;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AuthService } from './../../services/auth.service';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { environment } from './../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-login',
|
||||
templateUrl: './login.component.html',
|
||||
styleUrls: [ './login.component.scss' ]
|
||||
styleUrls: ['./login.component.scss']
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
|
||||
@@ -26,15 +27,15 @@ export class LoginComponent implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
this.form = this.formBuilder.group({
|
||||
username: [ '', Validators.required ],
|
||||
password: [ '', Validators.required ],
|
||||
keep: [ '' ]
|
||||
username: ['', Validators.required],
|
||||
password: ['', Validators.required],
|
||||
keep: ['']
|
||||
});
|
||||
|
||||
this.route.queryParams.subscribe({
|
||||
next: (params) => {
|
||||
if (params[ 'target' ]) {
|
||||
this.targetRoute = params[ 'target' ];
|
||||
if (params['target']) {
|
||||
this.targetRoute = params['target'];
|
||||
this.router.navigate([], { queryParams: { target: null }, queryParamsHandling: 'merge' });
|
||||
}
|
||||
}
|
||||
@@ -53,11 +54,11 @@ export class LoginComponent implements OnInit {
|
||||
|
||||
this.authService.login(loginModel).subscribe({
|
||||
next: (response: any) => {
|
||||
this.router.navigate([ this.targetRoute ]);
|
||||
this.router.navigate([this.targetRoute]);
|
||||
},
|
||||
error: (error) => {
|
||||
if (error.status == 428) {
|
||||
this.router.navigate([ "/login/totp" ], { queryParams: { target: this.targetRoute } });
|
||||
this.router.navigate(["/login/totp"], { queryParams: { target: this.targetRoute } });
|
||||
} else {
|
||||
this.loginInvalid = true;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, NgForm } from '@angular/forms';
|
||||
import { FormBuilder, FormGroup, NgForm, Validators } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
||||
import { QuotaService } from '../../../services/quota.service';
|
||||
import { MinetestAccountsService } from '../../../services/minetest.accounts.service';
|
||||
import { QuotaService } from '../../../services/quota.service';
|
||||
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-minetest-accounts',
|
||||
templateUrl: './accounts.component.html',
|
||||
styleUrls: [ './accounts.component.scss' ]
|
||||
styleUrls: ['./accounts.component.scss']
|
||||
})
|
||||
export class MinetestAccountsComponent implements OnInit {
|
||||
|
||||
@@ -21,7 +22,7 @@ export class MinetestAccountsComponent implements OnInit {
|
||||
success: boolean;
|
||||
working: boolean;
|
||||
|
||||
minetestAccountsColumns = [ "name", "delete" ];
|
||||
minetestAccountsColumns = ["name", "delete"];
|
||||
|
||||
constructor(
|
||||
private quotaService: QuotaService,
|
||||
@@ -32,7 +33,7 @@ export class MinetestAccountsComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
|
||||
this.form = this.formBuilder.group({
|
||||
name: [ '', Validators.required ],
|
||||
name: ['', Validators.required],
|
||||
});
|
||||
|
||||
this.refresh();
|
||||
@@ -53,12 +54,12 @@ export class MinetestAccountsComponent implements OnInit {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,7 +90,7 @@ export class MinetestAccountsComponent implements OnInit {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'minetest.accounts.confirmDelete',
|
||||
'args': [ name ]
|
||||
'args': [name]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-notfound',
|
||||
templateUrl: './notfound.component.html'
|
||||
})
|
||||
|
||||
@@ -3,9 +3,10 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ParteyTagsService } from '../../services/partey.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-partey',
|
||||
templateUrl: './partey.component.html',
|
||||
styleUrls: [ './partey.component.scss' ]
|
||||
styleUrls: ['./partey.component.scss']
|
||||
})
|
||||
export class ParteyComponent implements OnInit {
|
||||
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AuthService } from '../../services/auth.service';
|
||||
import { MatchingValidator } from '../../utils/matching.validator';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-password-reset',
|
||||
templateUrl: './password-reset.component.html',
|
||||
styleUrls: [ './password-reset.component.scss' ]
|
||||
styleUrls: ['./password-reset.component.scss']
|
||||
})
|
||||
export class PasswordResetComponent implements OnInit {
|
||||
|
||||
@@ -26,8 +27,8 @@ export class PasswordResetComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.form = this.formBuilder.group({
|
||||
password: [ '', Validators.required ],
|
||||
password2: [ '', Validators.required ]
|
||||
password: ['', Validators.required],
|
||||
password2: ['', Validators.required]
|
||||
}, {
|
||||
validator: MatchingValidator('password', 'password2')
|
||||
});
|
||||
@@ -53,12 +54,12 @@ export class PasswordResetComponent implements OnInit {
|
||||
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]);
|
||||
}
|
||||
} else {
|
||||
this.tokenInvalid = true;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { AuthService } from './../../services/auth.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { AuthService } from './../../services/auth.service';
|
||||
|
||||
var openpgp = require('openpgp');
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-password',
|
||||
templateUrl: './password.component.html',
|
||||
styleUrls: [ './password.component.scss' ]
|
||||
styleUrls: ['./password.component.scss']
|
||||
})
|
||||
export class PasswordComponent implements OnInit {
|
||||
|
||||
@@ -20,14 +21,14 @@ export class PasswordComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.form = this.formBuilder.group({
|
||||
username: [ '', Validators.required ],
|
||||
privateKey: [ '' ]
|
||||
username: ['', Validators.required],
|
||||
privateKey: ['']
|
||||
});
|
||||
}
|
||||
|
||||
async passwordRequest() {
|
||||
this.working = true;
|
||||
const { keys: [ privateKey ] } = await openpgp.key.readArmored(this.model.privateKey);
|
||||
const { keys: [privateKey] } = await openpgp.key.readArmored(this.model.privateKey);
|
||||
|
||||
const model = {
|
||||
username: this.model.username
|
||||
@@ -41,10 +42,10 @@ export class PasswordComponent implements OnInit {
|
||||
|
||||
const decrypted = await openpgp.decrypt({
|
||||
message: message,
|
||||
privateKeys: [ privateKey ]
|
||||
privateKeys: [privateKey]
|
||||
});
|
||||
this.working = false;
|
||||
this.router.navigate([ '/password-reset' ], { queryParams: { token: decrypted.data.trim() } });
|
||||
this.router.navigate(['/password-reset'], { queryParams: { token: decrypted.data.trim() } });
|
||||
} else {
|
||||
this.working = false;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
import { Component, OnInit, Inject, ViewChild, ElementRef } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { Router } from '@angular/router';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
import { Component, ElementRef, Inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { UserService } from './../../services/user.service';
|
||||
import { ItemService } from './../../services/item.service';
|
||||
import { I18nService } from './../../services/i18n.service';
|
||||
import { MatchingValidator } from './../../utils/matching.validator';
|
||||
import { ItemService } from './../../services/item.service';
|
||||
import { PermissionService } from './../../services/permission.service';
|
||||
import { QuotaService } from './../../services/quota.service';
|
||||
import { UserService } from './../../services/user.service';
|
||||
import { MatchingValidator } from './../../utils/matching.validator';
|
||||
|
||||
import { uniqueNamesGenerator, Config, adjectives, colors, animals } from 'unique-names-generator';
|
||||
import { Config, adjectives, animals, colors, uniqueNamesGenerator } from 'unique-names-generator';
|
||||
|
||||
var openpgp = require('openpgp');
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-register',
|
||||
templateUrl: './register.component.html',
|
||||
styleUrls: ['./register.component.scss']
|
||||
@@ -173,6 +174,7 @@ export class RegisterComponent implements OnInit {
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-register-dialog',
|
||||
templateUrl: 'register.dialog.html',
|
||||
styleUrls: ['./register.dialog.scss']
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
|
||||
|
||||
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||
import { Component } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||
|
||||
|
||||
|
||||
import { uniqueNamesGenerator, Config, adjectives, colors, animals } from 'unique-names-generator';
|
||||
import { Config, adjectives, animals, colors, uniqueNamesGenerator } from 'unique-names-generator';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-username-dialog',
|
||||
templateUrl: './username.dialog.html',
|
||||
styleUrls: ['./username.dialog.scss']
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { ServiceService } from '../../services/service.service';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { ServiceService } from '../../services/service.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-services',
|
||||
templateUrl: './services.component.html',
|
||||
styleUrls: [ './services.component.scss' ]
|
||||
styleUrls: ['./services.component.scss']
|
||||
})
|
||||
export class ServicesComponent implements OnInit {
|
||||
|
||||
@@ -31,10 +31,10 @@ export class ServicesComponent implements OnInit {
|
||||
if (!service.category || service.category == "") {
|
||||
that.baseServices.push(service);
|
||||
} else {
|
||||
if (!that.serviceCategory[ service.category ]) {
|
||||
that.serviceCategory[ service.category ] = [];
|
||||
if (!that.serviceCategory[service.category]) {
|
||||
that.serviceCategory[service.category] = [];
|
||||
}
|
||||
that.serviceCategory[ service.category ].push(service);
|
||||
that.serviceCategory[service.category].push(service);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,15 +4,16 @@ import { FormBuilder, FormGroup, NgForm, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { AuthService } from './../../services/auth.service';
|
||||
import { ItemService } from './../../services/item.service';
|
||||
import { I18nService } from './../../services/i18n.service';
|
||||
import { ItemService } from './../../services/item.service';
|
||||
import { PermissionService } from './../../services/permission.service';
|
||||
import { QuotaService } from './../../services/quota.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-tokens',
|
||||
templateUrl: './tokens.component.html',
|
||||
styleUrls: [ './tokens.component.scss' ]
|
||||
styleUrls: ['./tokens.component.scss']
|
||||
})
|
||||
export class TokensComponent implements OnInit {
|
||||
|
||||
@@ -48,7 +49,7 @@ export class TokensComponent implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
this.form = this.formBuilder.group({
|
||||
token: [ '', Validators.required ]
|
||||
token: ['', Validators.required]
|
||||
});
|
||||
|
||||
this.route.queryParams.subscribe({
|
||||
@@ -107,7 +108,7 @@ export class TokensComponent implements OnInit {
|
||||
if (this.auth.authenticated) {
|
||||
this.itemService.redeem().subscribe({
|
||||
next: (data: any) => {
|
||||
this.router.navigate([ "/account/info" ]);
|
||||
this.router.navigate(["/account/info"]);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Location } from '@angular/common'
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-unavailable',
|
||||
templateUrl: './unavailable.component.html'
|
||||
})
|
||||
@@ -18,8 +19,8 @@ export class UnavailableComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
this.route.queryParams.subscribe({
|
||||
next: (params) => {
|
||||
if (params[ 'target' ]) {
|
||||
this.targetRoute = params[ 'target' ];
|
||||
if (params['target']) {
|
||||
this.targetRoute = params['target'];
|
||||
this.router.navigate([], { queryParams: { target: null }, queryParamsHandling: 'merge', skipLocationChange: true });
|
||||
}
|
||||
}
|
||||
@@ -31,7 +32,7 @@ export class UnavailableComponent implements OnInit {
|
||||
if (!this.targetRoute || this.targetRoute === "unavailable" || this.targetRoute === "/unavailable") {
|
||||
this.location.back;
|
||||
} else {
|
||||
this.router.navigate([ this.targetRoute ]);
|
||||
this.router.navigate([this.targetRoute]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
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 { FormBuilder, FormGroup, Validators, NgForm, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { PageEvent } from '@angular/material/paginator';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
|
||||
import { MatchingValidator } from './../../utils/matching.validator';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { QuotaService } from '../../services/quota.service';
|
||||
import { UrlShortenerService } from '../../services/urlshortener.service';
|
||||
import { ConfirmDialog } from '../../ui/confirm/confirm.component';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { MatchingValidator } from './../../utils/matching.validator';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-urlshortener',
|
||||
templateUrl: './urlshortener.component.html',
|
||||
styleUrls: [ './urlshortener.component.scss' ]
|
||||
styleUrls: ['./urlshortener.component.scss']
|
||||
})
|
||||
export class UrlShortenerComponent implements OnInit {
|
||||
|
||||
@@ -32,9 +33,9 @@ export class UrlShortenerComponent implements OnInit {
|
||||
working: boolean;
|
||||
datetimeformat: String;
|
||||
page: any = { page: 0, size: 10, sort: "code", desc: false, search: "" };
|
||||
pageSizeOptions: number[] = [ 5, 10, 25, 50 ];
|
||||
pageSizeOptions: number[] = [5, 10, 25, 50];
|
||||
|
||||
shortenedUrlColumns = [ "share", "link", "note", "url", "expires", "edit", "delete" ];
|
||||
shortenedUrlColumns = ["share", "link", "note", "url", "expires", "edit", "delete"];
|
||||
|
||||
constructor(
|
||||
private quotaService: QuotaService,
|
||||
@@ -48,13 +49,13 @@ export class UrlShortenerComponent implements OnInit {
|
||||
this.datetimeformat = this.i18n.get('format.datetime', []);
|
||||
|
||||
this.form = this.formBuilder.group({
|
||||
url: [ '', Validators.required ],
|
||||
note: [ '', Validators.nullValidator ],
|
||||
code: [ '', Validators.nullValidator ],
|
||||
password: [ '', Validators.nullValidator ],
|
||||
password2: [ '', Validators.nullValidator ],
|
||||
expires: [ '', Validators.nullValidator ],
|
||||
queryParameters: [ '', Validators.nullValidator ],
|
||||
url: ['', Validators.required],
|
||||
note: ['', Validators.nullValidator],
|
||||
code: ['', Validators.nullValidator],
|
||||
password: ['', Validators.nullValidator],
|
||||
password2: ['', Validators.nullValidator],
|
||||
expires: ['', Validators.nullValidator],
|
||||
queryParameters: ['', Validators.nullValidator],
|
||||
}, {
|
||||
validator: MatchingValidator('password', 'password2')
|
||||
});
|
||||
@@ -97,12 +98,12 @@ export class UrlShortenerComponent implements OnInit {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +174,7 @@ export class UrlShortenerComponent implements OnInit {
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'urlshortener.confirmDelete',
|
||||
'args': [ shortenedUrl.url ]
|
||||
'args': [shortenedUrl.url]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -214,9 +215,10 @@ export class UrlShortenerComponent implements OnInit {
|
||||
}
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-urlshortener-edit-dialog',
|
||||
templateUrl: 'urlshortener.edit.html',
|
||||
styleUrls: [ './urlshortener.edit.scss' ]
|
||||
styleUrls: ['./urlshortener.edit.scss']
|
||||
})
|
||||
export class UrlShortenerEditDialog {
|
||||
|
||||
@@ -242,14 +244,14 @@ export class UrlShortenerEditDialog {
|
||||
ngOnInit(): void {
|
||||
this.datetimeformat = this.i18n.get('format.datetime', []);
|
||||
this.form = this.formBuilder.group({
|
||||
url: [ '', Validators.required ],
|
||||
note: [ '', Validators.nullValidator ],
|
||||
code: [ '', Validators.nullValidator ],
|
||||
newPassword: [ '', Validators.nullValidator ],
|
||||
password: [ '', Validators.nullValidator ],
|
||||
password2: [ '', Validators.nullValidator ],
|
||||
expires: [ '', Validators.nullValidator ],
|
||||
queryParameters: [ '', Validators.nullValidator ],
|
||||
url: ['', Validators.required],
|
||||
note: ['', Validators.nullValidator],
|
||||
code: ['', Validators.nullValidator],
|
||||
newPassword: ['', Validators.nullValidator],
|
||||
password: ['', Validators.nullValidator],
|
||||
password2: ['', Validators.nullValidator],
|
||||
expires: ['', Validators.nullValidator],
|
||||
queryParameters: ['', Validators.nullValidator],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -272,12 +274,12 @@ export class UrlShortenerEditDialog {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,9 +290,10 @@ export class UrlShortenerEditDialog {
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-urlshortener-share-dialog',
|
||||
templateUrl: 'urlshortener.share.html',
|
||||
styleUrls: [ './urlshortener.share.scss' ]
|
||||
styleUrls: ['./urlshortener.share.scss']
|
||||
})
|
||||
export class UrlShortenerShareDialog {
|
||||
|
||||
@@ -308,7 +311,7 @@ export class UrlShortenerShareDialog {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.datetimeformat = this.i18n.get('format.datetime', []);
|
||||
this.shortenedUrl.shareText = this.i18n.get('urlshortener.share.text', [ this.shortenedUrl.link ]);
|
||||
this.shortenedUrl.shareText = this.i18n.get('urlshortener.share.text', [this.shortenedUrl.link]);
|
||||
}
|
||||
|
||||
copyToClipboard(text) {
|
||||
@@ -323,9 +326,10 @@ export class UrlShortenerShareDialog {
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-urlshortener-password',
|
||||
templateUrl: './urlshortener.password.html',
|
||||
styleUrls: [ './urlshortener.password.scss' ]
|
||||
styleUrls: ['./urlshortener.password.scss']
|
||||
})
|
||||
export class UrlShortenerPasswordComponent implements OnInit {
|
||||
|
||||
@@ -341,7 +345,7 @@ export class UrlShortenerPasswordComponent implements OnInit {
|
||||
|
||||
this.route.queryParams.subscribe({
|
||||
next: (params) => {
|
||||
if (params[ 'error' ] || params[ 'error' ] == '') {
|
||||
if (params['error'] || params['error'] == '') {
|
||||
this.invalidPassword = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { AuthService } from '../../services/auth.service';
|
||||
import { ProfileService } from '../../services/profile.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-user',
|
||||
templateUrl: './user.component.html'
|
||||
})
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import {Component, Inject} from '@angular/core';
|
||||
import {MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
|
||||
import {I18nService} from '../../services/i18n.service';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
templateUrl: 'confirm.component.html',
|
||||
styleUrls: ['./confirm.component.scss']
|
||||
})
|
||||
|
||||
@@ -3,9 +3,10 @@ import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/f
|
||||
import * as moment from 'moment';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-datetimepicker',
|
||||
templateUrl: './datetimepicker.component.html',
|
||||
styleUrls: [ './datetimepicker.component.scss' ],
|
||||
styleUrls: ['./datetimepicker.component.scss'],
|
||||
providers: [
|
||||
{
|
||||
provide: NG_VALUE_ACCESSOR,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-divider',
|
||||
templateUrl: './divider.component.html',
|
||||
styleUrls: [ './divider.component.scss' ]
|
||||
styleUrls: ['./divider.component.scss']
|
||||
})
|
||||
export class DividerComponent implements OnInit {
|
||||
|
||||
|
||||
@@ -3,9 +3,10 @@ import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/f
|
||||
import * as moment from 'moment';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-durationpicker',
|
||||
templateUrl: './durationpicker.component.html',
|
||||
styleUrls: [ './durationpicker.component.scss' ],
|
||||
styleUrls: ['./durationpicker.component.scss'],
|
||||
providers: [
|
||||
{
|
||||
provide: NG_VALUE_ACCESSOR,
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
import { Component, HostListener, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { MatIconRegistry } from '@angular/material/icon';
|
||||
import { Component, HostListener } from '@angular/core';
|
||||
import { DateAdapter } from '@angular/material/core';
|
||||
import { MatIconRegistry } from '@angular/material/icon';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { Router } from '@angular/router';
|
||||
import { fromEvent } from 'rxjs';
|
||||
|
||||
import { Location } from '@angular/common';
|
||||
import { AuthService } from '../../services/auth.service';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { ProfileService } from '../../services/profile.service';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-main',
|
||||
templateUrl: './main.component.html',
|
||||
styleUrls: [ './main.component.scss' ]
|
||||
styleUrls: ['./main.component.scss']
|
||||
})
|
||||
export class MainComponent {
|
||||
|
||||
@@ -141,7 +142,7 @@ export class MainComponent {
|
||||
logout() {
|
||||
this.authService.logout().subscribe({
|
||||
next: (data) => {
|
||||
this.router.navigate([ "" ]).then(() => {
|
||||
this.router.navigate([""]).then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
@@ -161,7 +162,7 @@ export class MainComponent {
|
||||
window.open(url, target);
|
||||
}
|
||||
|
||||
@HostListener('window:resize', [ '$event' ])
|
||||
@HostListener('window:resize', ['$event'])
|
||||
onResize(event) {
|
||||
if (event.target.innerWidth < 768) {
|
||||
this.opened = false;
|
||||
@@ -173,8 +174,8 @@ export class MainComponent {
|
||||
touchEvents(): void {
|
||||
fromEvent(document, 'touchstart').subscribe({
|
||||
next: (event: TouchEvent) => {
|
||||
if (event.touches[ 0 ]) {
|
||||
this.touchStartX = event.touches[ 0 ].screenX;
|
||||
if (event.touches[0]) {
|
||||
this.touchStartX = event.touches[0].screenX;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -182,8 +183,8 @@ export class MainComponent {
|
||||
|
||||
fromEvent(document, 'touchmove').subscribe({
|
||||
next: (event: TouchEvent) => {
|
||||
if (event.touches[ 0 ]) {
|
||||
this.touchX = event.touches[ 0 ].screenX;
|
||||
if (event.touches[0]) {
|
||||
this.touchX = event.touches[0].screenX;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import {Component, OnInit, Input, SimpleChanges, OnChanges} from '@angular/core';
|
||||
import {Sort} from '@angular/material/sort';
|
||||
import {I18nService} from './../../services/i18n.service';
|
||||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { I18nService } from './../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-permissions',
|
||||
templateUrl: './permissions.component.html',
|
||||
styleUrls: ['./permissions.component.scss']
|
||||
@@ -15,7 +16,7 @@ export class PermissionsComponent implements OnInit, OnChanges {
|
||||
@Input() expiresVisible: boolean = true;
|
||||
permissionColumns = ["name", "starts", "expires"];
|
||||
|
||||
constructor(private i18n: I18nService) {}
|
||||
constructor(private i18n: I18nService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.sortData({ "active": "name", "direction": "asc" });
|
||||
@@ -28,14 +29,14 @@ export class PermissionsComponent implements OnInit, OnChanges {
|
||||
|
||||
sortData(sort: Sort) {
|
||||
const data = this.permissions.slice();
|
||||
if(!sort.active || sort.direction === '') {
|
||||
if (!sort.active || sort.direction === '') {
|
||||
this.permissions = data;
|
||||
return;
|
||||
}
|
||||
|
||||
this.permissions = data.sort((a, b) => {
|
||||
const isAsc = sort.direction === 'asc';
|
||||
switch(sort.active) {
|
||||
switch (sort.active) {
|
||||
case 'name': return this.compare(this.i18n.get('services.' + a.name + '.title', []), this.i18n.get('services.' + b.name + '.title', []), isAsc);
|
||||
case 'starts': return this.compare(a.starts, b.starts, isAsc);
|
||||
case 'expires': return this.compare(a.expires, b.expires, isAsc);
|
||||
@@ -44,9 +45,9 @@ export class PermissionsComponent implements OnInit, OnChanges {
|
||||
});
|
||||
}
|
||||
|
||||
compare(a: number | string , b: number | string , isAsc: boolean) {
|
||||
compare(a: number | string, b: number | string, isAsc: boolean) {
|
||||
if (typeof a === 'string' && typeof b === 'string') {
|
||||
return a.localeCompare(b,undefined, { sensitivity: 'accent' } ) * (isAsc ? 1 : -1);
|
||||
return a.localeCompare(b, undefined, { sensitivity: 'accent' }) * (isAsc ? 1 : -1);
|
||||
}
|
||||
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
|
||||
import { AuthService } from '../../../../services/auth.service';
|
||||
import { I18nService } from '../../../../services/i18n.service';
|
||||
@@ -9,8 +9,9 @@ import { I18nService } from '../../../../services/i18n.service';
|
||||
var openpgp = require('openpgp');
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
templateUrl: './profilefield.pgp-blob.html',
|
||||
styleUrls: [ './profilefield.pgp-blob.scss' ]
|
||||
styleUrls: ['./profilefield.pgp-blob.scss']
|
||||
})
|
||||
export class ProfileFieldPgpBlob implements OnInit {
|
||||
|
||||
@@ -36,7 +37,7 @@ export class ProfileFieldPgpBlob implements OnInit {
|
||||
}
|
||||
|
||||
let pgpOption = {
|
||||
userIDs: [ { name: auth.principal.username, email: auth.principal.username + "@we.bstly.de" } ],
|
||||
userIDs: [{ name: auth.principal.username, email: auth.principal.username + "@we.bstly.de" }],
|
||||
curve: "ed25519",
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
import { Component, OnInit, Inject, Input } from '@angular/core';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { Component, Inject, Input, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { ConfirmDialog } from '../confirm/confirm.component';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { ProfileService } from '../../services/profile.service';
|
||||
import { ConfirmDialog } from '../confirm/confirm.component';
|
||||
import { ProfileFieldPgpBlob } from './binary/pgp/profilefield.pgp-blob';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-profilefields',
|
||||
templateUrl: './profilefields.component.html',
|
||||
styleUrls: [ './profilefields.component.scss' ]
|
||||
styleUrls: ['./profilefields.component.scss']
|
||||
})
|
||||
export class ProfileFieldsComponent implements OnInit {
|
||||
|
||||
@Input() username;
|
||||
@Input() edit;
|
||||
profileFieldColumns = [ "name", "value" ];
|
||||
profileFieldColumns = ["name", "value"];
|
||||
profileFields: Array<any> = [];
|
||||
datetimeformat: String;
|
||||
dateformat: String;
|
||||
@@ -112,7 +113,7 @@ export class ProfileFieldsComponent implements OnInit {
|
||||
data: {
|
||||
'label': 'profileField.confirmDelete',
|
||||
'empty': true,
|
||||
'args': [ 'profileField.name.' + profileField.name ]
|
||||
'args': ['profileField.name.' + profileField.name]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -155,17 +156,18 @@ export class ProfileFieldsComponent implements OnInit {
|
||||
}
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-profilefield-dialog',
|
||||
templateUrl: 'profilefield.dialog.html',
|
||||
styleUrls: [ './profilefield.dialog.scss' ]
|
||||
styleUrls: ['./profilefield.dialog.scss']
|
||||
})
|
||||
export class ProfileFieldDialog {
|
||||
|
||||
form: FormGroup;
|
||||
profileField;
|
||||
|
||||
types = [ "TEXT", "NUMBER", "DATE", "DATETIME", "URL", "EMAIL", "BOOL", "BLOB" ];
|
||||
visibilities = [ "PRIVATE", "PROTECTED", "PUBLIC" ];
|
||||
types = ["TEXT", "NUMBER", "DATE", "DATETIME", "URL", "EMAIL", "BOOL", "BLOB"];
|
||||
visibilities = ["PRIVATE", "PROTECTED", "PUBLIC"];
|
||||
|
||||
constructor(
|
||||
private profileService: ProfileService,
|
||||
@@ -178,12 +180,12 @@ export class ProfileFieldDialog {
|
||||
|
||||
ngOnInit() {
|
||||
this.form = this.formBuilder.group({
|
||||
name: [ '', Validators.required ],
|
||||
type: [ '', Validators.required ],
|
||||
value: [ '' ],
|
||||
blob: [ '' ],
|
||||
visibility: [ '', Validators.required ],
|
||||
index: [ '' ]
|
||||
name: ['', Validators.required],
|
||||
type: ['', Validators.required],
|
||||
value: [''],
|
||||
blob: [''],
|
||||
visibility: ['', Validators.required],
|
||||
index: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -205,12 +207,12 @@ export class ProfileFieldDialog {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,9 +238,10 @@ export class ProfileFieldDialog {
|
||||
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-profilefield-blob',
|
||||
templateUrl: 'profilefield.blob.html',
|
||||
styleUrls: [ './profilefield.blob.scss' ]
|
||||
styleUrls: ['./profilefield.blob.scss']
|
||||
})
|
||||
export class ProfileFieldBlob {
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
import { Component, OnInit, Input, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { I18nService } from './../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-quotas',
|
||||
templateUrl: './quotas.component.html',
|
||||
styleUrls: [ './quotas.component.scss' ]
|
||||
styleUrls: ['./quotas.component.scss']
|
||||
})
|
||||
export class QuotasComponent implements OnInit, OnChanges {
|
||||
|
||||
|
||||
@Input() quotas;
|
||||
quotaColumns = [ "name", "value", "fixed_value", "quotaUnit" ];
|
||||
quotaColumns = ["name", "value", "fixed_value", "quotaUnit"];
|
||||
|
||||
constructor(private i18n: I18nService) { }
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-services-grid',
|
||||
templateUrl: './servicesgrid.component.html',
|
||||
styleUrls: [ './servicesgrid.component.scss' ]
|
||||
styleUrls: ['./servicesgrid.component.scss']
|
||||
})
|
||||
export class ServicesGridComponent implements OnInit {
|
||||
|
||||
@@ -32,10 +33,10 @@ export class ServicesGridComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
compare(a: number | string , b: number | string , isAsc: boolean) {
|
||||
|
||||
compare(a: number | string, b: number | string, isAsc: boolean) {
|
||||
if (typeof a === 'string' && typeof b === 'string') {
|
||||
return a.localeCompare(b,undefined, { sensitivity: 'accent' } ) * (isAsc ? 1 : -1);
|
||||
return a.localeCompare(b, undefined, { sensitivity: 'accent' }) * (isAsc ? 1 : -1);
|
||||
}
|
||||
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Sort } from '@angular/material/sort';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-services-table',
|
||||
templateUrl: './servicestable.component.html',
|
||||
styleUrls: [ './servicestable.component.scss' ]
|
||||
styleUrls: ['./servicestable.component.scss']
|
||||
})
|
||||
export class ServicesTableComponent implements OnInit {
|
||||
|
||||
@Input() services;
|
||||
serviceColumns = [ "icon", "name", "text" ];
|
||||
serviceColumns = ["icon", "name", "text"];
|
||||
|
||||
constructor(private i18n: I18nService) { }
|
||||
|
||||
@@ -34,9 +35,9 @@ export class ServicesTableComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
compare(a: number | string , b: number | string , isAsc: boolean) {
|
||||
compare(a: number | string, b: number | string, isAsc: boolean) {
|
||||
if (typeof a === 'string' && typeof b === 'string') {
|
||||
return a.localeCompare(b,undefined, { sensitivity: 'accent' } ) * (isAsc ? 1 : -1);
|
||||
return a.localeCompare(b, undefined, { sensitivity: 'accent' }) * (isAsc ? 1 : -1);
|
||||
}
|
||||
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { I18nService } from './../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-html',
|
||||
templateUrl: './html.component.html',
|
||||
styleUrls: [ './html.component.scss' ]
|
||||
styleUrls: ['./html.component.scss']
|
||||
})
|
||||
export class HtmlComponent implements OnInit {
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { I18nService } from './../services/i18n.service';
|
||||
|
||||
@Pipe({
|
||||
standalone: false,
|
||||
name: 'i18n'
|
||||
})
|
||||
export class I18nPipe implements PipeTransform {
|
||||
@@ -18,6 +19,7 @@ export class I18nPipe implements PipeTransform {
|
||||
}
|
||||
|
||||
@Pipe({
|
||||
standalone: false,
|
||||
name: 'i18nEmpty'
|
||||
})
|
||||
export class I18nEmptyPipe implements PipeTransform {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@Pipe({ name: 'datef' })
|
||||
@Pipe({
|
||||
standalone: false, name: 'datef'
|
||||
})
|
||||
export class MomentPipe implements PipeTransform {
|
||||
transform(value: Date | moment.Moment, dateFormat: string): any {
|
||||
if (!value) {
|
||||
|
||||
Reference in New Issue
Block a user