upgrade dependencies and migrate
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user