Merge Angular 16 Irish Monitor to develop #33

Merged
k.triantafyllou merged 151 commits from angular-16-irish-monitor into develop 2024-02-13 09:32:41 +01:00
3 changed files with 72 additions and 0 deletions
Showing only changes of commit f27b8e11f7 - Show all commits

View File

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {LogService} from "./log.service";
@NgModule({
imports: [
CommonModule, FormsModule,
],
declarations: [
],
providers: [ LogService ],
exports: [
]
})
export class LogServiceModule { }

47
utils/log/log.service.ts Normal file
View File

@ -0,0 +1,47 @@
import {HttpClient} from "@angular/common/http";
import {EnvProperties} from '../properties/env-properties';
import {Injectable} from "@angular/core";
export abstract class Log{
action:string;
message:string;
protected constructor(action, message){
this.action =action;
this.message = message;
}
}
export class LinkLog extends Log{
constructor() {
super("linking","a user linked");
}
}
export class OrcidLinkLog extends Log{
constructor( action:'added'|'removed', title: string, doi: string) {
super("orcid-claim","user with ORCID iD " + action + " research product \"" + title+ "\" (" + doi + ") " + (action == 'added'?'to':'from')
+ " their ORCID record.");
}
}
export class UploadLog extends Log{
constructor(dois:number) {
super("upload-dois","a user uploaded a list of " + dois +" DOIs to the Irish Monitor to check their presence and retrieve the Open Access types and additional key metadata");
}
}
@Injectable()
export class LogService {
constructor(private http: HttpClient) {
}
logUploadDOIs(properties: EnvProperties, dois:number){
return this.http.post(properties.logFilesService, new UploadLog(dois) );
}
logLink(properties: EnvProperties){
return this.http.post(properties.logFilesService, new LinkLog() );
}
logOrcidLink(properties: EnvProperties, action:'added'|'removed', title: string, doi: string){
return this.http.post(properties.logFilesService, new OrcidLinkLog(action, title, doi) );
}
}

View File

@ -145,6 +145,10 @@ export interface EnvProperties {
eoscDataTransferLoginUrl?; eoscDataTransferLoginUrl?;
eoscDataTransferDestinations?; eoscDataTransferDestinations?;
hasMachineCache?: boolean; hasMachineCache?: boolean;
// irish
logFilesPath?:string;
logServiceUrl?:string;
} }
export function checkPropertyValues(properties:EnvProperties){ export function checkPropertyValues(properties:EnvProperties){