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)
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;
if (!userInviteToTenantRequest.getTenantCode().equals(this.tenantScope.getTenantCode())) {
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 { Component, OnInit } from '@angular/core';
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 { RouterUtilsService } from '@app/core/services/router/router-utils.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 language: TranslateService,
private routerUtils: RouterUtilsService,
private authentication: AuthService,
private httpErrorHandlingService: HttpErrorHandlingService
) { super(); }
@ -46,13 +48,23 @@ export class UserInviteConfirmation extends BaseComponent implements OnInit {
onConfirm(): void {
if (this.showForm === false) return;
this.userService.confirmInviteUser(this.token)
if(this.isAuthenticated()){
this.userService.confirmInviteUser(this.token)
.subscribe(result => {
if (result) {
this.onCallbackConfirmationSuccess();
}
},
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() {

View File

@ -245,9 +245,9 @@
<mat-menu #rankMenu="matMenu" xPosition="before">
<button mat-menu-item *ngFor='let evaluator of evaluatorService.availableEvaluatorsFor(evaluatorEntityTypeEnum.Plan)'
(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="assets/images/repository-placeholder.png">
<span class="evaluator-id pr-2">{{ (evaluator.evaluatorId?.toUpperCase()) | translate }}</span>
</button>
</mat-menu>

View File

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