Remove specs + eslind on front

This commit is contained in:
2023-01-06 11:55:01 +01:00
parent 0daf0c582a
commit 42006caaf2
28 changed files with 2953 additions and 185 deletions

View File

@@ -18,6 +18,7 @@ export class Base implements Deserializable, Serializable {
Object.assign(this, data);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
deserialize(input: any): this {
if (input.createdAt) { input.createdAt = moment(input.createdAt).utc(true); }
if (input.modifiedAt) { input.modifiedAt = moment(input.modifiedAt).utc(true); }
@@ -27,6 +28,7 @@ export class Base implements Deserializable, Serializable {
return this;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
serialize() : any {
return Object.assign({}, this);
}

View File

@@ -1,3 +1,4 @@
export interface Deserializable {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
deserialize(input: any): this;
}

View File

@@ -6,6 +6,7 @@ import { map } from 'rxjs';
import { Record } from 'src/app/models/record.model';
export class Layer extends Base {
// eslint-disable-next-line @typescript-eslint/ban-types
number?: Number;
source?: string;
name?: string;
@@ -16,6 +17,7 @@ export class Layer extends Base {
super();
Object.assign(this, data);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
override deserialize(input: any): this {
Object.assign(this, Object.assign(this, super.deserialize(input)));
if (this.records) { this.records = this.records.map(x => new Record().deserialize(x)); }
@@ -47,7 +49,7 @@ export class Layer extends Base {
});
}
loadForm(form: UntypedFormGroup) {
for (let field of Object.keys(form.controls)) {
for (const field of Object.keys(form.controls)) {
this[field as keyof Layer] = form.controls[field].value;
}
this.createdBy = undefined;
@@ -63,6 +65,7 @@ export class Layer extends Base {
);
});
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
static getList(_http: HttpClient): any {
return new Promise((resolve, reject) => {
_http.get<Layer[]>(`${environment.api.url}/layers`)
@@ -81,7 +84,7 @@ export class Layer extends Base {
})
});
}
static parseFile(file: any, _http: HttpClient): Promise<Layer[]> {
static parseFile(file: File, _http: HttpClient): Promise<Layer[]> {
const formData = new FormData();
formData.append(file.name, file);
return new Promise((resolve, reject) => {

View File

@@ -1,9 +1,4 @@
import { Base } from './base.model';
import { UntypedFormBuilder, Validators, UntypedFormGroup, FormControl } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { environment } from 'src/environments/environment';
import { DataService } from '../services/data.service';
import { map } from 'rxjs';
export class Record extends Base {
code?: string;
@@ -19,6 +14,7 @@ export class Record extends Base {
Object.assign(this, data);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
override deserialize(input: any): this {
Object.assign(this, Object.assign(this, super.deserialize(input)));
return this;

View File

@@ -1,3 +1,4 @@
export interface Serializable {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
serialize(input: this): any;
}

View File

@@ -4,6 +4,7 @@ export class User {
userName!: string;
googleCredentials!: string;
avatar?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(input: any) {
Object.assign(this, input)
}