Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring

This commit is contained in:
mchouliara 2024-10-15 16:10:34 +03:00
commit 9e431b0fb9
4 changed files with 25 additions and 3 deletions

View File

@ -1058,6 +1058,10 @@ public class UserServiceImpl implements UserService {
if (userInviteToTenantRequest == null) if (userInviteToTenantRequest == null)
throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{action.getId(), UserInviteToTenantRequestEntity.class.getSimpleName()}, LocaleContextHolder.getLocale())); throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{action.getId(), UserInviteToTenantRequestEntity.class.getSimpleName()}, LocaleContextHolder.getLocale()));
UserContactInfoEntity contactInfoEntity = this.queryFactory.query(UserContactInfoQuery.class).disableTracking().userIds(this.userScope.getUserId()).values(userInviteToTenantRequest.getEmail()).types(ContactInfoType.Email).first();
if (contactInfoEntity == null){
throw new MyValidationException(this.errors.getAnotherUserToken().getCode(), this.errors.getAnotherUserToken().getMessage());
}
TenantEntity tenantEntity = null; TenantEntity tenantEntity = null;
if (!userInviteToTenantRequest.getTenantCode().equals(this.tenantScope.getTenantCode())) { if (!userInviteToTenantRequest.getTenantCode().equals(this.tenantScope.getTenantCode())) {
tenantEntity = this.queryFactory.query(TenantQuery.class).disableTracking().authorize(AuthorizationFlags.AllExceptPublic).codes(userInviteToTenantRequest.getTenantCode()).isActive(IsActive.Active).first(); tenantEntity = this.queryFactory.query(TenantQuery.class).disableTracking().authorize(AuthorizationFlags.AllExceptPublic).codes(userInviteToTenantRequest.getTenantCode()).isActive(IsActive.Active).first();

View File

@ -1,6 +1,7 @@
import { HttpErrorResponse } from '@angular/common/http'; import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { AuthService } from '@app/core/services/auth/auth.service';
import { SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; import { SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
import { UserService } from '@app/core/services/user/user.service'; import { UserService } from '@app/core/services/user/user.service';
@ -28,6 +29,7 @@ export class UserInviteConfirmation extends BaseComponent implements OnInit {
private router: Router, private router: Router,
private language: TranslateService, private language: TranslateService,
private routerUtils: RouterUtilsService, private routerUtils: RouterUtilsService,
private authentication: AuthService,
private httpErrorHandlingService: HttpErrorHandlingService private httpErrorHandlingService: HttpErrorHandlingService
) { super(); } ) { super(); }
@ -46,6 +48,7 @@ export class UserInviteConfirmation extends BaseComponent implements OnInit {
onConfirm(): void { onConfirm(): void {
if (this.showForm === false) return; if (this.showForm === false) return;
if(this.isAuthenticated()){
this.userService.confirmInviteUser(this.token) this.userService.confirmInviteUser(this.token)
.subscribe(result => { .subscribe(result => {
if (result) { if (result) {
@ -53,6 +56,15 @@ export class UserInviteConfirmation extends BaseComponent implements OnInit {
} }
}, },
error => this.onCallbackError(error)); error => this.onCallbackError(error));
} else {
let returnUrl = `login/invitation/confirmation/${this.token}`;
this.router.navigate([this.routerUtils.generateUrl('login')], {queryParams:{returnUrl: this.routerUtils.generateUrl(returnUrl)}});
}
}
public isAuthenticated(): boolean {
return this.authentication.currentAccountIsAuthenticated();
} }
onCallbackConfirmationSuccess() { onCallbackConfirmationSuccess() {

View File

@ -245,9 +245,9 @@
<mat-menu #rankMenu="matMenu" xPosition="before"> <mat-menu #rankMenu="matMenu" xPosition="before">
<button mat-menu-item *ngFor='let evaluator of evaluatorService.availableEvaluatorsFor(evaluatorEntityTypeEnum.Plan)' <button mat-menu-item *ngFor='let evaluator of evaluatorService.availableEvaluatorsFor(evaluatorEntityTypeEnum.Plan)'
(click)="onEvaluatePlan(plan.id, evaluator.evaluatorId, evaluator.format, evaluator.rankConfig, isPublicView)"> (click)="onEvaluatePlan(plan.id, evaluator.evaluatorId, evaluator.format, evaluator.rankConfig, isPublicView)">
<span class="evaluator-id pr-2">{{ (evaluator.evaluatorId?.toUpperCase()) | translate }}</span>
<img *ngIf="evaluator.hasLogo" class="logo" [src]="logos.get(evaluator.evaluatorId)"> <img *ngIf="evaluator.hasLogo" class="logo" [src]="logos.get(evaluator.evaluatorId)">
<img *ngIf="!evaluator.hasLogo" class="logo" src="assets/images/repository-placeholder.png"> <img *ngIf="!evaluator.hasLogo" class="logo" src="assets/images/repository-placeholder.png">
<span class="evaluator-id pr-2">{{ (evaluator.evaluatorId?.toUpperCase()) | translate }}</span>
</button> </button>
</mat-menu> </mat-menu>

View File

@ -237,6 +237,12 @@
width: 100%; width: 100%;
} }
.logo {
margin-right: 16px;
max-width: 24px;
max-height: 24px;
}
// ********CENTER ELEMENTS******** // ********CENTER ELEMENTS********
.mat-mini-fab, .mat-mini-fab,