- linting sytax corrections

This commit is contained in:
Arno Kaimbacher 2022-06-01 13:16:54 +02:00
parent 2a5c21806f
commit 304878c711
5 changed files with 23 additions and 8 deletions

View File

@ -71,7 +71,7 @@ export default class MapComponent extends Vue {
// this.onMapInitializedEvent.emit(this.mapId);
this.addBaseMap();
const newSubs = DatasetService.getOAI().subscribe(
const newSubs = DatasetService.getOaiDatasets().subscribe(
(res: Array<OaiDataset>) => {
this.tethys = res;
const bottomPane: HTMLElement = this.map.createPane("bottom");

View File

@ -9,3 +9,8 @@ export interface OaiDataset {
east: number;
west: number;
}
export interface OaiPerson {
contributorName: string;
creatorName: string;
}

9
src/models/pagination.ts Normal file
View File

@ -0,0 +1,9 @@
import { Dataset } from "./dataset";
export interface Pagination {
total: number;
per_page?: number;
current_page: number;
last_page?: number;
data: Array<Dataset>;
}

View File

@ -9,7 +9,7 @@ import { VUE_APP_PORTAL } from "@/constants";
// import { deserialize, instanceToInstance } from "class-transformer";
import { deserialize } from "class-transformer";
// import { OAI_DATASETS } from "./mock-oai-datasets";
import { OaiDataset } from "@/models/oai";
import { OaiDataset, OaiPerson } from "@/models/oai";
import xml2js from "xml2js";
class DatasetService {
@ -162,7 +162,7 @@ class DatasetService {
const path = "/api/sitelinks/" + year;
const base = host + path;
const documents = api.get<Array<DbDataset>>(base);
const documents: Observable<DbDataset[]> = api.get<Array<DbDataset>>(base);
// this.messageService.add('HeroService: fetched heroes');
return documents;
}
@ -178,7 +178,7 @@ class DatasetService {
return dataset;
}
public getOAI(): Observable<OaiDataset[]> {
public getOaiDatasets(): Observable<OaiDataset[]> {
const apiUrl = "https://data.tethys.at/oai?verb=ListRecords&metadataPrefix=oai_datacite";
const oaiDatasets = api.get<string>(apiUrl).pipe(
map(
@ -237,8 +237,8 @@ class DatasetService {
let creator = "";
if (dc.creators.creator instanceof Array) {
dc.creators.creator.forEach((person: any) => {
creator += person.creatorName._ + "; ";
dc.creators.creator.forEach((person: OaiPerson) => {
creator += person.creatorName + "; ";
});
} else {
creator += dc.creators.creator.creatorName._;
@ -247,7 +247,7 @@ class DatasetService {
let contributor = "";
if (dc.contributors) {
if (dc.contributors.contributor instanceof Array) {
dc.contributors.contributor.forEach((person: any) => {
dc.contributors.contributor.forEach((person: OaiPerson) => {
contributor += person.contributorName + "; ";
});
} else {

View File

@ -11,6 +11,7 @@ import { Suggestion, Dataset, SearchType } from "@/models/dataset";
import { SolrResponse, FacetFields, FacetItem, FacetResults, FacetInstance } from "@/models/headers";
import { ActiveFilterCategories } from "@/models/solr";
import { SOLR_HOST, SOLR_CORE } from "@/constants";
import { Pagination } from "@/models/pagination";
@Options({
name: "SearchViewComponent",
@ -35,7 +36,7 @@ export default class SearchViewComponent extends Vue {
searchTerm: string | Suggestion = "";
// activeFilterCategories: Object = {};
activeFilterCategories: ActiveFilterCategories = new ActiveFilterCategories(); // = new Array<ActiveFilterCategory>();
pagination: any = {
pagination: Pagination = {
total: 0,
per_page: 2,
current_page: 0,