Merge branch 'angular-14' of code-repo.d4science.org:MaDgIK/openaire-library into angular-14

This commit is contained in:
Konstantinos Triantafyllou 2022-10-31 13:30:29 +02:00
commit 7b89e369a3
3 changed files with 134 additions and 123 deletions

View File

@ -104,12 +104,12 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
ngAfterViewInit() { ngAfterViewInit() {
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user; this.user = user;
if (this.user) { if (this.paramsSubscription instanceof Subscription) {
if(this.paramsSubscription instanceof Subscription) {
this.paramsSubscription.unsubscribe(); this.paramsSubscription.unsubscribe();
} }
this.paramsSubscription = this.route.queryParams.subscribe(params => { this.paramsSubscription = this.route.queryParams.subscribe(params => {
if (params && params['verify']) { if (params && params['verify']) {
if (this.user) {
this.subscriptions.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => { this.subscriptions.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => {
this.verification = verification; this.verification = verification;
if (this.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) { if (this.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) {
@ -126,8 +126,6 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
}, error => { }, error => {
this.openErrorModal(); this.openErrorModal();
})); }));
}
});
} else { } else {
this.router.navigate(['/user-info'], { this.router.navigate(['/user-info'], {
queryParams: { queryParams: {
@ -136,11 +134,13 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
} }
}); });
} }
}
});
})); }));
} }
ngOnDestroy() { ngOnDestroy() {
if(this.paramsSubscription instanceof Subscription) { if (this.paramsSubscription instanceof Subscription) {
this.paramsSubscription.unsubscribe(); this.paramsSubscription.unsubscribe();
} }
this.subscriptions.forEach(subscription => { this.subscriptions.forEach(subscription => {

View File

@ -17,11 +17,14 @@
<div [class.dark]="dark"> <div [class.dark]="dark">
<form (ngSubmit)="queryChanged()" class="uk-card uk-card-default uk-box-shadow-medium"> <form (ngSubmit)="queryChanged()" class="uk-card uk-card-default uk-box-shadow-medium">
<button type="submit" class="uk-hidden"></button> <button type="submit" class="uk-hidden"></button>
<div class="uk-card-body uk-height-medium uk-overflow-auto"> <div class="uk-grid uk-grid-small uk-grid-divider uk-flex-between" uk-grid>
<div class="uk-width-expand">
<div class="uk-padding-small uk-padding-remove-left uk-overflow-auto" style="height: 200px; overflow-x: hidden; direction: rtl; scrollbar-gutter: stable;">
<div style="direction: ltr;">
<table class="uk-table uk-text-small uk-table-responsive uk-table-small uk-margin-remove"> <table class="uk-table uk-text-small uk-table-responsive uk-table-small uk-margin-remove">
<tr> <tr>
<td class="uk-text-bold uk-text-uppercase uk-width-2-5">Searching Fields</td> <td class="uk-text-bold uk-text-uppercase uk-width-1-3">Searching Fields</td>
<td class="uk-text-bold uk-text-uppercase uk-width-1-3">Terms</td> <td class="uk-text-bold uk-text-uppercase uk-width-2-5">Terms</td>
</tr> </tr>
<tr *ngFor="let selectedField of selectedFields; let i = index"> <tr *ngFor="let selectedField of selectedFields; let i = index">
<td> <td>
@ -95,7 +98,6 @@
<td class="uk-width-small"> <td class="uk-width-small">
<div *ngIf="i+1 <selectedFields.length" [(value)]="selectedFields[i+1].operatorId" (valueChange)="fieldOperatorChanged(i+1, $event, $event)" <div *ngIf="i+1 <selectedFields.length" [(value)]="selectedFields[i+1].operatorId" (valueChange)="fieldOperatorChanged(i+1, $event, $event)"
input [options]="operators" inputClass="border-bottom" type="select"></div> input [options]="operators" inputClass="border-bottom" type="select"></div>
<!-- <div *ngIf="i+1 <selectedFields.length && onlyAndSupported(i)">and</div>-->
</td> </td>
<td [class.uk-invisible]="selectedFields.length === 1"> <td [class.uk-invisible]="selectedFields.length === 1">
<button class="uk-icon uk-close" <button class="uk-icon uk-close"
@ -105,12 +107,12 @@
</td> </td>
</tr> </tr>
</table> </table>
<div class="uk-margin-small-top"> <!-- <div class="uk-margin-small-top">
<button type="button" (click)="addField()" class="uk-button uk-button-link uk-flex uk-flex-middle"> <button type="button" (click)="addField()" class="uk-button uk-button-link uk-flex uk-flex-middle">
<icon name="add" [flex]="true"></icon> <icon name="add" [flex]="true"></icon>
<span class="uk-margin-small-left">Add rule</span> <span class="uk-margin-small-left">Add rule</span>
</button> </button>
</div> </div> -->
<div class=" uk-text-center uk-margin-small-top"> <div class=" uk-text-center uk-margin-small-top">
<div *ngIf="!validDateFrom && validDateTo" class="uk-text-danger"> <div *ngIf="!validDateFrom && validDateTo" class="uk-text-danger">
Please check your <u>from</u> date Please check your <u>from</u> date
@ -123,11 +125,20 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
<div class="uk-flex uk-flex-column uk-flex-center uk-margin-right">
<button type="button" (click)="addField()" class="uk-icon-button uk-icon-button-xsmall uk-flex uk-flex-middle">
<icon name="add" [flex]="true"></icon>
</button>
</div>
</div>
<a (click)="queryChanged()" class="uk-card-footer uk-link-reset uk-tile-primary uk-flex uk-flex-center uk-light"> <a (click)="queryChanged()" class="uk-card-footer uk-link-reset uk-tile-primary uk-flex uk-flex-center uk-light">
<button class="uk-button uk-button-text"> <button class="uk-button uk-button-text">
<span class="uk-flex uk-flex-middle"> <span class="uk-flex uk-flex-middle">
<icon name="search" [flex]="true"></icon> <icon name="search" [flex]="true"></icon>
<span class="uk-margin-small-left">Search</span> <span class="uk-margin-small-left">Search</span>
<span *ngIf="selectedFields.length >= 2" class="uk-margin-xsmall-left">({{selectedFields.length}} Rules)</span>
</span> </span>
</button> </button>
</a> </a>

View File

@ -129,7 +129,7 @@
</div> </div>
</div> </div>
<div class="uk-position-relative"> <div class="uk-position-relative">
<div class="uk-container uk-container-small uk-section uk-section-small uk-margin-bottom" id="searchForm"> <div class="uk-container uk-section uk-section-small uk-margin-bottom" id="searchForm">
<div class="uk-grid uk-flex uk-flex-middle uk-flex-center" uk-grid> <div class="uk-grid uk-flex uk-flex-middle uk-flex-center" uk-grid>
<div [class]="'uk-width-1-1'+(simpleView?' uk-width-auto@m' : '')"><div id="searchImage"></div></div> <div [class]="'uk-width-1-1'+(simpleView?' uk-width-auto@m' : '')"><div id="searchImage"></div></div>
<advanced-search-form class="uk-width-expand uk-padding uk-padding-remove-vertical" <advanced-search-form class="uk-width-expand uk-padding uk-padding-remove-vertical"