1. added delay dialog when merging an account
2. added configuration: footer-items
This commit is contained in:
parent
fe97a14274
commit
0d569528e8
|
@ -166,6 +166,11 @@ export class ConfigurationService extends BaseComponent {
|
||||||
get sidebar(): Sidebar {
|
get sidebar(): Sidebar {
|
||||||
return this._sidebar;
|
return this._sidebar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _mergeAccountDelayInSeconds: number;
|
||||||
|
get mergeAccountDelayInSeconds(): number {
|
||||||
|
return this._mergeAccountDelayInSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
private _researcherId: any;
|
private _researcherId: any;
|
||||||
get researcherId(): boolean {
|
get researcherId(): boolean {
|
||||||
|
@ -266,6 +271,7 @@ export class ConfigurationService extends BaseComponent {
|
||||||
this._authProviders = AuthProviders.parseValue(config.authProviders);
|
this._authProviders = AuthProviders.parseValue(config.authProviders);
|
||||||
this._analyticsProviders = AnalyticsProviders.parseValue(config.analytics);
|
this._analyticsProviders = AnalyticsProviders.parseValue(config.analytics);
|
||||||
this._sidebar = Sidebar.parseValue(config.sidebar);
|
this._sidebar = Sidebar.parseValue(config.sidebar);
|
||||||
|
this._mergeAccountDelayInSeconds = config.mergeAccountDelayInSeconds;
|
||||||
this._researcherId = config.referenceTypes.researcherId;
|
this._researcherId = config.referenceTypes.researcherId;
|
||||||
this._grantId = config.referenceTypes.grantId;
|
this._grantId = config.referenceTypes.grantId;
|
||||||
this._organizationId = config.referenceTypes.organizationId;
|
this._organizationId = config.referenceTypes.organizationId;
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
import { MergeEmailConfirmation } from './merge-email-confirmation/merge-email-confirmation.component';
|
import { MergeEmailConfirmation } from './merge-email-confirmation/merge-email-confirmation.component';
|
||||||
import { UnlinkEmailConfirmation } from './unlink-email-confirmation/unlink-email-confirmation.component';
|
import { UnlinkEmailConfirmation } from './unlink-email-confirmation/unlink-email-confirmation.component';
|
||||||
import { UserInviteConfirmation } from './user-invite-confirmation/user-invite-confirmation.component';
|
import { UserInviteConfirmation } from './user-invite-confirmation/user-invite-confirmation.component';
|
||||||
|
import { MergeEmailLoaderDialogComponent } from './merge-email-confirmation/merge-email-loader-dialog/merge-email-loader-dialog.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -18,7 +19,8 @@ import { UserInviteConfirmation } from './user-invite-confirmation/user-invite-c
|
||||||
LoginComponent,
|
LoginComponent,
|
||||||
MergeEmailConfirmation,
|
MergeEmailConfirmation,
|
||||||
UnlinkEmailConfirmation,
|
UnlinkEmailConfirmation,
|
||||||
UserInviteConfirmation
|
UserInviteConfirmation,
|
||||||
|
MergeEmailLoaderDialogComponent,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
LoginComponent
|
LoginComponent
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
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 { MatDialog } from "@angular/material/dialog";
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
import { SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } 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";
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
|
@ -9,6 +10,7 @@ import { HttpError, HttpErrorHandlingService } from "@common/modules/errors/erro
|
||||||
import { Guid } from "@common/types/guid";
|
import { Guid } from "@common/types/guid";
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { takeUntil } from "rxjs/operators";
|
import { takeUntil } from "rxjs/operators";
|
||||||
|
import { MergeEmailLoaderDialogComponent } from "./merge-email-loader-dialog/merge-email-loader-dialog.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-email-confirmation-component',
|
selector: 'app-email-confirmation-component',
|
||||||
|
@ -31,7 +33,9 @@ export class MergeEmailConfirmation extends BaseComponent implements OnInit {
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private language: TranslateService,
|
private language: TranslateService,
|
||||||
private httpErrorHandlingService: HttpErrorHandlingService,
|
private httpErrorHandlingService: HttpErrorHandlingService,
|
||||||
private routerUtils: RouterUtilsService
|
private routerUtils: RouterUtilsService,
|
||||||
|
private dialog: MatDialog,
|
||||||
|
private uiNotificationService: UiNotificationService,
|
||||||
) { super(); }
|
) { super(); }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -55,13 +59,24 @@ export class MergeEmailConfirmation extends BaseComponent implements OnInit {
|
||||||
onConfirm(): void {
|
onConfirm(): void {
|
||||||
if (this.showForm === false) return;
|
if (this.showForm === false) return;
|
||||||
|
|
||||||
this.userService.confirmMergeAccount(this.token)
|
let confirmMergeAccountObservable = this.userService.confirmMergeAccount(this.token);
|
||||||
.subscribe(result => {
|
|
||||||
if (result) {
|
const dialogRef = this.dialog.open(MergeEmailLoaderDialogComponent, {
|
||||||
this.onCallbackEmailConfirmationSuccess();
|
maxWidth: '600px',
|
||||||
}
|
disableClose: true,
|
||||||
},
|
data: {
|
||||||
error => this.onCallbackError(error));
|
confirmMergeAccountObservable: confirmMergeAccountObservable,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||||
|
if (result.result) {
|
||||||
|
this.onCallbackEmailConfirmationSuccess();
|
||||||
|
} else {
|
||||||
|
if (result.error) this.onCallbackError(result.error);
|
||||||
|
else this.onCallbackError();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onCallbackEmailConfirmationSuccess() {
|
onCallbackEmailConfirmationSuccess() {
|
||||||
|
@ -73,10 +88,17 @@ export class MergeEmailConfirmation extends BaseComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onCallbackError(errorResponse: HttpErrorResponse) {
|
onCallbackError(errorResponse?: HttpErrorResponse) {
|
||||||
|
|
||||||
|
if (!errorResponse) {
|
||||||
|
this.uiNotificationService.snackBarNotification('GENERAL.SNACK-BAR.GENERIC-ERROR', SnackBarNotificationLevel.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const errorOverrides = new Map<number, string>();
|
const errorOverrides = new Map<number, string>();
|
||||||
errorOverrides.set(302, this.language.instant('EMAIL-CONFIRMATION.EMAIL-FOUND'));
|
errorOverrides.set(302, this.language.instant('EMAIL-CONFIRMATION.EMAIL-FOUND'));
|
||||||
errorOverrides.set(403, this.language.instant('EMAIL-CONFIRMATION.EXPIRED-EMAIL'));
|
errorOverrides.set(403, this.language.instant('EMAIL-CONFIRMATION.EXPIRED-EMAIL'));
|
||||||
|
|
||||||
this.httpErrorHandlingService.handleBackedRequestError(errorResponse, errorOverrides, SnackBarNotificationLevel.Error)
|
this.httpErrorHandlingService.handleBackedRequestError(errorResponse, errorOverrides, SnackBarNotificationLevel.Error)
|
||||||
|
|
||||||
const error: HttpError = this.httpErrorHandlingService.getError(errorResponse);
|
const error: HttpError = this.httpErrorHandlingService.getError(errorResponse);
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
<div mat-dialog-title>
|
||||||
|
<div class="row align-items-center mb-2">
|
||||||
|
<div class="col-auto pr-0">
|
||||||
|
<mat-spinner [diameter]="20"></mat-spinner>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<span>{{ 'MERGE-ACCOUNT.MERGE-DIALOG.TITLE' | translate }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<mat-dialog-content>
|
||||||
|
<div class="row mt-4">
|
||||||
|
<div class="col-12">
|
||||||
|
<p class="message ml-2">
|
||||||
|
{{ 'MERGE-ACCOUNT.MERGE-DIALOG.MESSAGE' | translate: { s: mergeAccountDelayInSeconds } }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-dialog-content>
|
|
@ -0,0 +1,5 @@
|
||||||
|
.message {
|
||||||
|
font-weight: lighter;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
line-height: 1.9rem;
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
import { Component, Inject, OnDestroy, OnInit } from "@angular/core";
|
||||||
|
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog";
|
||||||
|
import { ConfigurationService } from "@app/core/services/configuration/configuration.service";
|
||||||
|
import { Subscription, takeUntil } from "rxjs";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'merge-email-loader',
|
||||||
|
templateUrl: './merge-email-loader-dialog.component.html',
|
||||||
|
styleUrls: ['./merge-email-loader-dialog.component.scss'],
|
||||||
|
})
|
||||||
|
export class MergeEmailLoaderDialogComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
confirmMergeAccountSubscription: Subscription;
|
||||||
|
mergeAccountDelay: number = 60000;
|
||||||
|
get mergeAccountDelayInSeconds(): number {
|
||||||
|
return this.mergeAccountDelay/1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private dialogRef: MatDialogRef<MergeEmailLoaderDialogComponent>,
|
||||||
|
private configurationService: ConfigurationService,
|
||||||
|
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
if (this.configurationService.mergeAccountDelayInSeconds) this.mergeAccountDelay = this.configurationService.mergeAccountDelayInSeconds*1000;
|
||||||
|
|
||||||
|
if (this.data.confirmMergeAccountObservable) {
|
||||||
|
this.confirmMergeAccountSubscription = this.data.confirmMergeAccountObservable.subscribe(result => {
|
||||||
|
if (result) {
|
||||||
|
setTimeout( _ => this.onClose(true), this.mergeAccountDelay)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error => this.onClose(false, error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClose(success: boolean, error: any = null) {
|
||||||
|
this.dialogRef.close({ result: success, error: error});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy(): void {
|
||||||
|
this.confirmMergeAccountSubscription?.unsubscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -109,12 +109,32 @@
|
||||||
],
|
],
|
||||||
"footerItems": [
|
"footerItems": [
|
||||||
{
|
{
|
||||||
"routerPath": "/feedback",
|
"routerPath": "/about",
|
||||||
"title": "SIDE-BAR.FEEDBACK",
|
"title": "FOOTER.ABOUT",
|
||||||
"icon": "feedback",
|
"icon": "feedback",
|
||||||
"externalUrl": "https://docs.google.com/forms/d/12RSCrUjdSDp2LZLpjDKOi44cN1fLDD2q1-F66SqZIis/viewform?edit_requested=true",
|
"accessLevel": "public"
|
||||||
"accessLevel": true
|
},
|
||||||
|
{
|
||||||
|
"routerPath": "/terms-and-conditions",
|
||||||
|
"title": "FOOTER.TERMS-OF-SERVICE",
|
||||||
|
"accessLevel": "public"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"routerPath": "/glossary",
|
||||||
|
"title": "FOOTER.GLOSSARY",
|
||||||
|
"accessLevel": "public"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"routerPath": "/user-guide",
|
||||||
|
"title": "FOOTER.GUIDE",
|
||||||
|
"accessLevel": "public"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"routerPath": "/contact-support",
|
||||||
|
"title": "FOOTER.CONTACT-SUPPORT",
|
||||||
|
"accessLevel": "authenticated"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"mergeAccountDelayInSeconds": 30
|
||||||
}
|
}
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
|
@ -2274,6 +2274,10 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Confirm"
|
"CONFIRM": "Confirm"
|
||||||
|
},
|
||||||
|
"MERGE-DIALOG": {
|
||||||
|
"TITLE": "Please wait while we are merging your account.",
|
||||||
|
"MESSAGE": "Please keep this tab open and allow {{ s }} seconds while we are setting things up for you. Be sure to close any other opened tab."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UNLINK-ACCOUNT": {
|
"UNLINK-ACCOUNT": {
|
||||||
|
|
Loading…
Reference in New Issue