forked from geolba/tethys.frontend
- linting sytax corrections
This commit is contained in:
parent
2a5c21806f
commit
304878c711
|
@ -71,7 +71,7 @@ export default class MapComponent extends Vue {
|
||||||
// this.onMapInitializedEvent.emit(this.mapId);
|
// this.onMapInitializedEvent.emit(this.mapId);
|
||||||
this.addBaseMap();
|
this.addBaseMap();
|
||||||
|
|
||||||
const newSubs = DatasetService.getOAI().subscribe(
|
const newSubs = DatasetService.getOaiDatasets().subscribe(
|
||||||
(res: Array<OaiDataset>) => {
|
(res: Array<OaiDataset>) => {
|
||||||
this.tethys = res;
|
this.tethys = res;
|
||||||
const bottomPane: HTMLElement = this.map.createPane("bottom");
|
const bottomPane: HTMLElement = this.map.createPane("bottom");
|
||||||
|
|
|
@ -9,3 +9,8 @@ export interface OaiDataset {
|
||||||
east: number;
|
east: number;
|
||||||
west: number;
|
west: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface OaiPerson {
|
||||||
|
contributorName: string;
|
||||||
|
creatorName: string;
|
||||||
|
}
|
||||||
|
|
9
src/models/pagination.ts
Normal file
9
src/models/pagination.ts
Normal 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>;
|
||||||
|
}
|
|
@ -9,7 +9,7 @@ import { VUE_APP_PORTAL } from "@/constants";
|
||||||
// import { deserialize, instanceToInstance } from "class-transformer";
|
// import { deserialize, instanceToInstance } from "class-transformer";
|
||||||
import { deserialize } from "class-transformer";
|
import { deserialize } from "class-transformer";
|
||||||
// import { OAI_DATASETS } from "./mock-oai-datasets";
|
// import { OAI_DATASETS } from "./mock-oai-datasets";
|
||||||
import { OaiDataset } from "@/models/oai";
|
import { OaiDataset, OaiPerson } from "@/models/oai";
|
||||||
import xml2js from "xml2js";
|
import xml2js from "xml2js";
|
||||||
|
|
||||||
class DatasetService {
|
class DatasetService {
|
||||||
|
@ -162,7 +162,7 @@ class DatasetService {
|
||||||
const path = "/api/sitelinks/" + year;
|
const path = "/api/sitelinks/" + year;
|
||||||
const base = host + path;
|
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');
|
// this.messageService.add('HeroService: fetched heroes');
|
||||||
return documents;
|
return documents;
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ class DatasetService {
|
||||||
return dataset;
|
return dataset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getOAI(): Observable<OaiDataset[]> {
|
public getOaiDatasets(): Observable<OaiDataset[]> {
|
||||||
const apiUrl = "https://data.tethys.at/oai?verb=ListRecords&metadataPrefix=oai_datacite";
|
const apiUrl = "https://data.tethys.at/oai?verb=ListRecords&metadataPrefix=oai_datacite";
|
||||||
const oaiDatasets = api.get<string>(apiUrl).pipe(
|
const oaiDatasets = api.get<string>(apiUrl).pipe(
|
||||||
map(
|
map(
|
||||||
|
@ -237,8 +237,8 @@ class DatasetService {
|
||||||
|
|
||||||
let creator = "";
|
let creator = "";
|
||||||
if (dc.creators.creator instanceof Array) {
|
if (dc.creators.creator instanceof Array) {
|
||||||
dc.creators.creator.forEach((person: any) => {
|
dc.creators.creator.forEach((person: OaiPerson) => {
|
||||||
creator += person.creatorName._ + "; ";
|
creator += person.creatorName + "; ";
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
creator += dc.creators.creator.creatorName._;
|
creator += dc.creators.creator.creatorName._;
|
||||||
|
@ -247,7 +247,7 @@ class DatasetService {
|
||||||
let contributor = "";
|
let contributor = "";
|
||||||
if (dc.contributors) {
|
if (dc.contributors) {
|
||||||
if (dc.contributors.contributor instanceof Array) {
|
if (dc.contributors.contributor instanceof Array) {
|
||||||
dc.contributors.contributor.forEach((person: any) => {
|
dc.contributors.contributor.forEach((person: OaiPerson) => {
|
||||||
contributor += person.contributorName + "; ";
|
contributor += person.contributorName + "; ";
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { Suggestion, Dataset, SearchType } from "@/models/dataset";
|
||||||
import { SolrResponse, FacetFields, FacetItem, FacetResults, FacetInstance } from "@/models/headers";
|
import { SolrResponse, FacetFields, FacetItem, FacetResults, FacetInstance } from "@/models/headers";
|
||||||
import { ActiveFilterCategories } from "@/models/solr";
|
import { ActiveFilterCategories } from "@/models/solr";
|
||||||
import { SOLR_HOST, SOLR_CORE } from "@/constants";
|
import { SOLR_HOST, SOLR_CORE } from "@/constants";
|
||||||
|
import { Pagination } from "@/models/pagination";
|
||||||
|
|
||||||
@Options({
|
@Options({
|
||||||
name: "SearchViewComponent",
|
name: "SearchViewComponent",
|
||||||
|
@ -35,7 +36,7 @@ export default class SearchViewComponent extends Vue {
|
||||||
searchTerm: string | Suggestion = "";
|
searchTerm: string | Suggestion = "";
|
||||||
// activeFilterCategories: Object = {};
|
// activeFilterCategories: Object = {};
|
||||||
activeFilterCategories: ActiveFilterCategories = new ActiveFilterCategories(); // = new Array<ActiveFilterCategory>();
|
activeFilterCategories: ActiveFilterCategories = new ActiveFilterCategories(); // = new Array<ActiveFilterCategory>();
|
||||||
pagination: any = {
|
pagination: Pagination = {
|
||||||
total: 0,
|
total: 0,
|
||||||
per_page: 2,
|
per_page: 2,
|
||||||
current_page: 0,
|
current_page: 0,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user