From f09df855ee9d16ab115e27d30b6f6662a54dddc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mats=20Paul=20Ton=C4=8Dik?= Date: Tue, 2 Jun 2026 10:24:15 +0200 Subject: [PATCH] Updated gitignore --- .gitignore | 4 +- webapp/src/app/api/api.base.service.ts | 83 +++++++++++++++++++ .../api/model/collaborationNetworkNodeType.ts | 18 ++++ webapp/src/app/api/model/filterInformation.ts | 32 +++++++ webapp/src/app/api/model/filterProperties.ts | 22 +++++ .../app/api/model/institutionInformation.ts | 22 +++++ webapp/src/app/api/model/workList.ts | 23 +++++ webapp/src/app/api/model/workSummary.ts | 27 ++++++ .../src/app/api/model/workTopicInformation.ts | 22 +++++ webapp/src/app/api/provide-api.ts | 15 ++++ .../person-network-graph.component.scss | 1 + 11 files changed, 266 insertions(+), 3 deletions(-) create mode 100644 webapp/src/app/api/api.base.service.ts create mode 100644 webapp/src/app/api/model/collaborationNetworkNodeType.ts create mode 100644 webapp/src/app/api/model/filterInformation.ts create mode 100644 webapp/src/app/api/model/filterProperties.ts create mode 100644 webapp/src/app/api/model/institutionInformation.ts create mode 100644 webapp/src/app/api/model/workList.ts create mode 100644 webapp/src/app/api/model/workSummary.ts create mode 100644 webapp/src/app/api/model/workTopicInformation.ts create mode 100644 webapp/src/app/api/provide-api.ts diff --git a/.gitignore b/.gitignore index a4500526..f3bf63bc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,4 @@ src/python/account/ *.pyc node_modules/ -angular-app/.angular - -webapp/src/app/api \ No newline at end of file +angular-app/.angular \ No newline at end of file diff --git a/webapp/src/app/api/api.base.service.ts b/webapp/src/app/api/api.base.service.ts new file mode 100644 index 00000000..dcf56358 --- /dev/null +++ b/webapp/src/app/api/api.base.service.ts @@ -0,0 +1,83 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from './encoder'; +import { Configuration } from './configuration'; + +export class BaseService { + protected basePath = 'http://localhost:8000'; + public defaultHeaders = new HttpHeaders(); + public configuration: Configuration; + public encoder: HttpParameterCodec; + + constructor(basePath?: string|string[], configuration?: Configuration) { + this.configuration = configuration || new Configuration(); + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } + + protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); + } + return this.addToHttpParamsRecursive(httpParams, value, key); + } + + protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { + if (value === null || value === undefined) { + return httpParams; + } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach(k => { + const paramKey = key ? `${key}.${k}` : k; + httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); + }); + } + return httpParams; + } else if (key != null) { + return httpParams.append(key, value); + } + throw Error("key may not be null if value is not object or array"); + } +} diff --git a/webapp/src/app/api/model/collaborationNetworkNodeType.ts b/webapp/src/app/api/model/collaborationNetworkNodeType.ts new file mode 100644 index 00000000..752e35b0 --- /dev/null +++ b/webapp/src/app/api/model/collaborationNetworkNodeType.ts @@ -0,0 +1,18 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const CollaborationNetworkNodeType = { + Author: 'author', + Institution: 'institution', + Work: 'work' +} as const; +export type CollaborationNetworkNodeType = typeof CollaborationNetworkNodeType[keyof typeof CollaborationNetworkNodeType]; + diff --git a/webapp/src/app/api/model/filterInformation.ts b/webapp/src/app/api/model/filterInformation.ts new file mode 100644 index 00000000..b2078376 --- /dev/null +++ b/webapp/src/app/api/model/filterInformation.ts @@ -0,0 +1,32 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { InstitutionInformation } from './institutionInformation'; +import { WorkTopicInformation } from './workTopicInformation'; + + +export interface FilterInformation { + /** + * The minimum publication year of the works in the collaboration network. + */ + min_possible_year: number; + /** + * The maximum publication year of the works in the collaboration network. + */ + max_possible_year: number; + /** + * The list of institutions associated with the works in the collaboration network. + */ + institutions: Array; + /** + * The list of topics associated with the works in the collaboration network. + */ + topics: Array; +} + diff --git a/webapp/src/app/api/model/filterProperties.ts b/webapp/src/app/api/model/filterProperties.ts new file mode 100644 index 00000000..daeb08ee --- /dev/null +++ b/webapp/src/app/api/model/filterProperties.ts @@ -0,0 +1,22 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface FilterProperties { + start_year: number | null; + end_year: number | null; + allowed_institutions: Array | null; + allowed_topics: Array | null; + min_collaborators: number | null; + max_collaborators: number | null; + min_collaborations: number | null; + max_collaborations: number | null; +} + diff --git a/webapp/src/app/api/model/institutionInformation.ts b/webapp/src/app/api/model/institutionInformation.ts new file mode 100644 index 00000000..e287b0fa --- /dev/null +++ b/webapp/src/app/api/model/institutionInformation.ts @@ -0,0 +1,22 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InstitutionInformation { + /** + * The raw institution ID of the institution. + */ + raw_id: string; + /** + * The display name of the institution. + */ + display_name: string; +} + diff --git a/webapp/src/app/api/model/workList.ts b/webapp/src/app/api/model/workList.ts new file mode 100644 index 00000000..71a23f39 --- /dev/null +++ b/webapp/src/app/api/model/workList.ts @@ -0,0 +1,23 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Work } from './work'; + + +export interface WorkList { + /** + * All works. + */ + elements?: Array; + /** + * The total number of works. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/workSummary.ts b/webapp/src/app/api/model/workSummary.ts new file mode 100644 index 00000000..11293352 --- /dev/null +++ b/webapp/src/app/api/model/workSummary.ts @@ -0,0 +1,27 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface WorkSummary { + doi?: string | null; + title?: string | null; + type?: string | null; + language?: string | null; + publication_year?: number | null; + /** + * The number of citations. + */ + cited_by_count?: number; + /** + * The display names of the work topics. + */ + topics?: Array; +} + diff --git a/webapp/src/app/api/model/workTopicInformation.ts b/webapp/src/app/api/model/workTopicInformation.ts new file mode 100644 index 00000000..ca3b9454 --- /dev/null +++ b/webapp/src/app/api/model/workTopicInformation.ts @@ -0,0 +1,22 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface WorkTopicInformation { + /** + * The ID of the topic. + */ + raw_topic_id: string; + /** + * The name of the topic. + */ + display_name: string; +} + diff --git a/webapp/src/app/api/provide-api.ts b/webapp/src/app/api/provide-api.ts new file mode 100644 index 00000000..19c762ac --- /dev/null +++ b/webapp/src/app/api/provide-api.ts @@ -0,0 +1,15 @@ +import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; +import { Configuration, ConfigurationParameters } from './configuration'; +import { BASE_PATH } from './variables'; + +// Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). +export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === "string" + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: Configuration, + useValue: new Configuration({ ...configOrBasePath }), + }, + ]); +} \ No newline at end of file diff --git a/webapp/src/app/modules/person-network-graph/person-network-graph.component.scss b/webapp/src/app/modules/person-network-graph/person-network-graph.component.scss index 199a7d8f..ebdd5e69 100644 --- a/webapp/src/app/modules/person-network-graph/person-network-graph.component.scss +++ b/webapp/src/app/modules/person-network-graph/person-network-graph.component.scss @@ -7,6 +7,7 @@ mat-card { display: flex; flex-direction: column; width: 100%; + background: transparent; } mat-card-content {