bug fixes

This commit is contained in:
Efstratios Giannopoulos 2024-01-09 18:28:04 +02:00
parent e123338a2c
commit d0157fa0e5
5 changed files with 11 additions and 6 deletions

View File

@ -137,4 +137,7 @@ public class AuditableAction {
public static final EventId Maintenance_GenerateElastic = new EventId(220000, "Maintenance_GenerateElastic"); public static final EventId Maintenance_GenerateElastic = new EventId(220000, "Maintenance_GenerateElastic");
public static final EventId Maintenance_ClearElastic = new EventId(230000, "Maintenance_ClearElastic"); public static final EventId Maintenance_ClearElastic = new EventId(230000, "Maintenance_ClearElastic");
public static final EventId Principal_Lookup = new EventId(240000, "Principal_Lookup");
} }

View File

@ -1,5 +1,6 @@
package eu.eudat.controllers.v2; package eu.eudat.controllers.v2;
import eu.eudat.audit.AuditableAction;
import eu.eudat.models.data.dataset.DatasetOverviewModel; import eu.eudat.models.data.dataset.DatasetOverviewModel;
import eu.eudat.models.data.helpers.responses.ResponseItem; import eu.eudat.models.data.helpers.responses.ResponseItem;
import eu.eudat.models.v2.AccountBuilder; import eu.eudat.models.v2.AccountBuilder;
@ -40,7 +41,7 @@ public class PrincipalController {
} }
@RequestMapping(path = "me", method = RequestMethod.GET ) @RequestMapping(path = "me", method = RequestMethod.GET )
public ResponseEntity<?> me(FieldSet fieldSet) throws InvalidApplicationException { public Account me(FieldSet fieldSet) throws InvalidApplicationException {
logger.debug("me"); logger.debug("me");
if (fieldSet == null || fieldSet.isEmpty()) { if (fieldSet == null || fieldSet.isEmpty()) {
@ -68,10 +69,10 @@ public class PrincipalController {
Account me = this.accountBuilder.build(fieldSet, principal); Account me = this.accountBuilder.build(fieldSet, principal);
//this.auditService.track(AuditableAction.Principal_Lookup); this.auditService.track(AuditableAction.Principal_Lookup);
//auditService.trackIdentity(AuditableAction.IdentityTracking_Action); //auditService.trackIdentity(AuditableAction.IdentityTracking_Action);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<Account>().status(ApiMessageCode.NO_MESSAGE).payload(me)); return me;
} }
} }

View File

@ -143,7 +143,7 @@ export class AuthService extends BaseService {
this.accessToken ? this.principalService.me(httpParams) : of(null) this.accessToken ? this.principalService.me(httpParams) : of(null)
])), ])),
map((item) => { map((item) => {
this.currentAccount(item[0]?.payload); this.currentAccount(item[0]);
return true; return true;
}) })
); );

View File

@ -2,7 +2,8 @@ import { Injectable } from '@angular/core';
import { AppAccount } from '@app/core/model/auth/principal'; import { AppAccount } from '@app/core/model/auth/principal';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { ConfigurationService } from '../configuration/configuration.service'; import { ConfigurationService } from '../configuration/configuration.service';
import { BaseHttpV2Service } from './base-http-v2.service'; import { BaseHttpV2Service } from '../http/base-http-v2.service';
import { map } from 'rxjs/operators';
@Injectable() @Injectable()
export class PrincipalService { export class PrincipalService {

View File

@ -73,7 +73,7 @@ public class UserMigrationService {
String avatarUrl = ""; String avatarUrl = "";
String culture = "en-001"; String culture = "en-001";
String language = "en"; String language = "en";
String timezone = "en"; String timezone = "UTC";
String roleOrganization = ""; String roleOrganization = "";
UUID organizationId = null; UUID organizationId = null;
if (oldUser != null){ if (oldUser != null){