- remove coding warnings

- search page styling
This commit is contained in:
Arno Kaimbacher 2021-12-10 11:57:19 +01:00
parent 8c5094f91a
commit 81153061ac
9 changed files with 349 additions and 304 deletions

View file

@ -5,5 +5,5 @@ import { Options, Vue } from "vue-class-component";
name: "HelpViewComponent",
})
export default class HelpViewComponent extends Vue {
results: Array<any> = [];
// results: Array<any> = [];
}

View file

@ -1,4 +1,4 @@
import { Observable, Subscription } from "rxjs";
import { Subscription } from "rxjs";
import { Options, Vue } from "vue-class-component";
import DatasetService from "../../services/dataset.service";
import { DbDataset } from "@/models/dataset";
@ -19,21 +19,21 @@ export default class SitelinkViewComponent extends Vue {
// // this.rdrAPI = new DatasetService();
// }
beforeMount() {
beforeMount(): void {
// this.rdrAPI = new DatasetService();
this.getYears();
}
getYears() {
getYears(): void {
const newSubs: Subscription = DatasetService.getYears().subscribe(
(res: string[]) => this.dataHandler(res),
(error: any) => this.errorHandler(error),
(error: string) => this.errorHandler(error),
() => newSubs.unsubscribe(),
);
// this.subscriptions.push(newSubs);
}
beforeUnmount() {
beforeUnmount(): void {
//unsunscribe to ensure no memory leaks
// this.subscription.unsubscribe();
for (const subs of this.subscriptions) {
@ -41,13 +41,13 @@ export default class SitelinkViewComponent extends Vue {
}
}
select(year: string) {
select(year: string): void {
this.selected = year;
const newSubs = DatasetService.getDocuments(year).subscribe(
(res: Array<DbDataset>) => {
this.datasets = res;
},
(error: any) => this.errorHandler(error),
(error: string) => this.errorHandler(error),
);
this.subscriptions.push(newSubs);
}
@ -57,7 +57,7 @@ export default class SitelinkViewComponent extends Vue {
this.years = res;
}
private errorHandler(err: any): void {
private errorHandler(err: string): void {
this.error = err;
// this.loading = false;
}