From cc417adb6b2177eb089ddc2d63dcf8da1ae79c37 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 20 Jun 2022 16:17:26 +0300 Subject: [PATCH] Fix all dashboard modals heights. Role verification remove custom buttons. --- dashboard/divId/divIds.component.html | 2 +- dashboard/divId/divIds.component.ts | 4 - .../class-help-contents.component.ts | 2 - dashboard/entity/entities.component.html | 5 +- dashboard/entity/entities.component.ts | 6 -- .../helpTexts/page-help-contents.component.ts | 2 - dashboard/menu/menu.component.html | 3 +- dashboard/menu/menu.component.ts | 4 - dashboard/page/pages.component.html | 3 +- dashboard/page/pages.component.ts | 4 - dashboard/portal/portals.component.html | 2 +- dashboard/portal/portals.component.ts | 4 - .../role-users/role-users.component.html | 30 +++---- .../subscribers/subscribers.component.html | 6 +- .../role-verification.component.ts | 88 +++++++++---------- .../portal-search-result.component.html | 5 +- .../portal-search-result.component.ts | 4 +- .../quick-contact/quick-contact.component.ts | 1 - utils/modal/alert.ts | 11 ++- 19 files changed, 74 insertions(+), 112 deletions(-) diff --git a/dashboard/divId/divIds.component.html b/dashboard/divId/divIds.component.html index fdbfb6ea..aeb1964b 100644 --- a/dashboard/divId/divIds.component.html +++ b/dashboard/divId/divIds.component.html @@ -100,4 +100,4 @@
- + diff --git a/dashboard/divId/divIds.component.ts b/dashboard/divId/divIds.component.ts index 2305c8e9..38c6e8f3 100644 --- a/dashboard/divId/divIds.component.ts +++ b/dashboard/divId/divIds.component.ts @@ -132,8 +132,6 @@ export class DivIdsComponent implements OnInit { } private confirmModalOpen() { - this.deleteModal.cancelButton = true; - this.deleteModal.okButton = true; this.deleteModal.alertTitle = "Delete Confirmation"; this.deleteModal.message = "Are you sure you want to delete the selected class(es)?"; this.deleteModal.okButtonText = "Yes"; @@ -189,8 +187,6 @@ export class DivIdsComponent implements OnInit { } private divIdsModalOpen(title: string, yesBtn: string) { - this.editModal.cancelButton = true; - this.editModal.okButton = true; this.editModal.okButtonLeft = false; this.editModal.alertTitle = title; this.editModal.okButtonText = yesBtn; diff --git a/dashboard/divhelpcontent/class-help-contents.component.ts b/dashboard/divhelpcontent/class-help-contents.component.ts index 04667aef..b51f4653 100644 --- a/dashboard/divhelpcontent/class-help-contents.component.ts +++ b/dashboard/divhelpcontent/class-help-contents.component.ts @@ -148,8 +148,6 @@ export class ClassHelpContentsComponent implements OnInit { } private confirmModalOpen() { - this.alertModalDeletePageHelpContents.cancelButton = true; - this.alertModalDeletePageHelpContents.okButton = true; this.alertModalDeletePageHelpContents.alertTitle = 'Delete Confirmation'; this.alertModalDeletePageHelpContents.message = 'Are you sure you want to delete the selected page content(s)?'; this.alertModalDeletePageHelpContents.okButtonText = 'Yes'; diff --git a/dashboard/entity/entities.component.html b/dashboard/entity/entities.component.html index 34442628..16fe8e2f 100644 --- a/dashboard/entity/entities.component.html +++ b/dashboard/entity/entities.component.html @@ -117,6 +117,5 @@
- - - + + diff --git a/dashboard/entity/entities.component.ts b/dashboard/entity/entities.component.ts index 3ea1d8b2..3c5d38da 100644 --- a/dashboard/entity/entities.component.ts +++ b/dashboard/entity/entities.component.ts @@ -176,8 +176,6 @@ export class EntitiesComponent implements OnInit { } private confirmDeleteEntitiesModalOpen() { - this.deleteModal.cancelButton = true; - this.deleteModal.okButton = true; this.deleteModal.alertTitle = 'Delete Confirmation'; this.deleteModal.message = 'Are you sure you want to delete the selected entity(-ies)?'; this.deleteModal.okButtonText = 'Yes'; @@ -221,8 +219,6 @@ export class EntitiesComponent implements OnInit { } private entitiesModalOpen(title: string, yesBtn: string) { - this.editModal.cancelButton = true; - this.editModal.okButton = true; this.editModal.okButtonLeft = false; this.editModal.alertTitle = title; this.editModal.okButtonText = yesBtn; @@ -333,8 +329,6 @@ export class EntitiesComponent implements OnInit { } private confirmRelatedPagesModalOpen() { - this.relatedPages.cancelButton = true; - this.relatedPages.okButton = true; this.relatedPages.alertTitle = 'Warning'; this.relatedPages.message = "This action will affect all search pages related to this entity! Pages' status will change to entity's status! Do you want to continue?"; this.relatedPages.okButtonText = 'Yes'; diff --git a/dashboard/helpTexts/page-help-contents.component.ts b/dashboard/helpTexts/page-help-contents.component.ts index 054c0f72..31609e3b 100644 --- a/dashboard/helpTexts/page-help-contents.component.ts +++ b/dashboard/helpTexts/page-help-contents.component.ts @@ -152,8 +152,6 @@ export class PageHelpContentsComponent implements OnInit { } private confirmModalOpen() { - this.alertModalDeletePageHelpContents.cancelButton = true; - this.alertModalDeletePageHelpContents.okButton = true; this.alertModalDeletePageHelpContents.alertTitle = 'Delete Confirmation'; this.alertModalDeletePageHelpContents.message = 'Are you sure you want to delete the selected page content(s)?'; this.alertModalDeletePageHelpContents.okButtonText = 'Yes'; diff --git a/dashboard/menu/menu.component.html b/dashboard/menu/menu.component.html index b76f9af0..686f18e0 100644 --- a/dashboard/menu/menu.component.html +++ b/dashboard/menu/menu.component.html @@ -164,5 +164,4 @@ - - + diff --git a/dashboard/menu/menu.component.ts b/dashboard/menu/menu.component.ts index b18bec0e..a5c0671d 100644 --- a/dashboard/menu/menu.component.ts +++ b/dashboard/menu/menu.component.ts @@ -286,8 +286,6 @@ export class MenuComponent implements OnInit { } private confirmModalOpen() { - this.deleteModal.cancelButton = true; - this.deleteModal.okButton = true; this.deleteModal.alertTitle = 'Delete Confirmation'; this.deleteModal.message = 'Are you sure you want to delete this menu item?'; this.deleteModal.okButtonText = 'Yes'; @@ -328,8 +326,6 @@ export class MenuComponent implements OnInit { } private menuItemsModalOpen(title: string, yesBtn: string) { - this.editModal.cancelButton = true; - this.editModal.okButton = true; this.editModal.okButtonLeft = false; this.editModal.alertTitle = title; this.editModal.okButtonText = yesBtn; diff --git a/dashboard/page/pages.component.html b/dashboard/page/pages.component.html index 3207c6e6..8b734ccd 100644 --- a/dashboard/page/pages.component.html +++ b/dashboard/page/pages.component.html @@ -181,5 +181,4 @@ - - + diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts index 0c52cbba..5fdd77ef 100644 --- a/dashboard/page/pages.component.ts +++ b/dashboard/page/pages.component.ts @@ -225,8 +225,6 @@ export class PagesComponent implements OnInit { } private confirmModalOpen() { - this.deleteModal.cancelButton = true; - this.deleteModal.okButton = true; this.deleteModal.alertTitle = 'Delete Confirmation'; this.deleteModal.message = 'Are you sure you want to delete the selected page(s)?'; this.deleteModal.okButtonText = 'Yes'; @@ -297,8 +295,6 @@ export class PagesComponent implements OnInit { } private pagesModalOpen(title: string, yesBtn: string) { - this.editModal.cancelButton = true; - this.editModal.okButton = true; this.editModal.okButtonLeft = false; this.editModal.alertTitle = title; this.editModal.okButtonText = yesBtn; diff --git a/dashboard/portal/portals.component.html b/dashboard/portal/portals.component.html index 9e04284c..8490f084 100644 --- a/dashboard/portal/portals.component.html +++ b/dashboard/portal/portals.component.html @@ -98,4 +98,4 @@ - + diff --git a/dashboard/portal/portals.component.ts b/dashboard/portal/portals.component.ts index 8052fd0b..784c8516 100644 --- a/dashboard/portal/portals.component.ts +++ b/dashboard/portal/portals.component.ts @@ -134,8 +134,6 @@ export class PortalsComponent implements OnInit { } private confirmModalOpen() { - this.deleteModal.cancelButton = true; - this.deleteModal.okButton = true; this.deleteModal.alertTitle = 'Delete Confirmation'; this.deleteModal.message = 'Are you sure you want to delete the selected portal(-ies)?'; this.deleteModal.okButtonText = 'Yes'; @@ -198,8 +196,6 @@ export class PortalsComponent implements OnInit { }); } else { this.editModal.okButtonLeft = false; - this.editModal.cancelButton = true; - this.editModal.okButton = true; this.editModal.alertTitle = title; this.editModal.okButtonText = yesBtn; this.editModal.open(); diff --git a/dashboard/users/role-users/role-users.component.html b/dashboard/users/role-users/role-users.component.html index be3f468e..9dd42335 100644 --- a/dashboard/users/role-users/role-users.component.html +++ b/dashboard/users/role-users/role-users.component.html @@ -75,29 +75,27 @@ - -
-
-
-
-
-
-
-
+ +
+
+
+
+
+
- -
+ +
Are you sure you want to remove {{selectedUser}} from {{role}}s?
- -
+ +
Are you sure you want to cancel {{role}} invitation of {{selectedUser}}?
- -
+ +
diff --git a/dashboard/users/subscribers/subscribers.component.html b/dashboard/users/subscribers/subscribers.component.html index b631f467..683863ed 100644 --- a/dashboard/users/subscribers/subscribers.component.html +++ b/dashboard/users/subscribers/subscribers.component.html @@ -79,12 +79,10 @@
-
-
- -
+ +
Are you sure you want to remove {{selectedUser}} from subscribers?
diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index 1c7fd6d9..609ecd29 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -14,10 +14,14 @@ import {Composer} from "../utils/email/composer"; @Component({ selector: 'role-verification', template: ` - +
- You have been invited to join {{name}} {{(service === 'monitor'?'Monitor':'Research Community')}} Dashboard as a manager. - Fill in the verification code, sent to your + You have been invited to join {{name}} {{(service === 'monitor' ? 'Monitor' : 'Research Community')}} Dashboard + as a manager. + Fill in the verification code, sent to + your email, to accept the invitation request.
@@ -28,20 +32,14 @@ import {Composer} from "../utils/email/composer";
-
- - -
- +
You have been invited to join {{name}} Monitor Dashboard as a member. - Fill in the verification code, sent to + Fill in the verification code, sent + to your email, to accept the invitation request.
@@ -53,28 +51,16 @@ import {Composer} from "../utils/email/composer";
-
- - -
- Welcome! You are now a member of the OpenAIRE Monitor Dashboard for the {{name}}! + Welcome! You are now a member of the OpenAIRE Monitor Dashboard for the {{name}}! From now on, you will have access to our restricted content.
-
- -
- +
We are unable to process the request because the link is invalid, or it has expired.
@@ -127,7 +113,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn this.openManagerModal(); } else if (this.verification.verificationType === 'member' && this.service === "monitor") { this.openMemberModal(); - } else { + } else { this.openErrorModal(); } } else { @@ -159,16 +145,21 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn public openManagerModal() { this.error = null; - this.managerModal.okButton = false; - this.managerModal.cancelButton = false; + this.managerModal.okButtonLeft = false; + this.managerModal.okButtonText = 'Accept'; + this.managerModal.stayOpen = true; + this.managerModal.cancelButtonText = 'Cancel'; this.managerModal.alertTitle = 'Manager Invitation'; this.managerModal.open(); } public openMemberModal() { this.error = null; - this.memberModal.okButton = false; - this.memberModal.cancelButton = false; + this.isMember = false; + this.memberModal.okButtonLeft = false; + this.memberModal.okButtonText = 'Accept'; + this.memberModal.stayOpen = true; + this.memberModal.cancelButtonText = 'Cancel'; this.memberModal.alertTitle = 'Member Invitation'; this.memberModal.open(); } @@ -187,7 +178,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn this.managerModal.cancel(); this.error = null; this.userManagementService.updateUserInfo(() => { - if(this.service === "monitor") { + if (this.service === "monitor") { this.loading = false; this.router.navigate(['/admin/' + this.verification.entity]); } else { @@ -219,24 +210,29 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn public verifyMember() { this.loading = true; - this.subs.push(this.userRegistryService.verify(this.verification.id, this.code.value, "member").subscribe(() => { - this.loading = false; - this.error = null; - this.userManagementService.updateUserInfo(() => { - this.isMember = true; - }); - }, error => { - this.loading = false; - this.error = 'The verification code is invalid'; - })); + if (!this.isMember) { + this.subs.push(this.userRegistryService.verify(this.verification.id, this.code.value, "member").subscribe(() => { + this.loading = false; + this.error = null; + this.userManagementService.updateUserInfo(() => { + this.memberModal.cancelButton = false; + this.memberModal.okButtonText = 'Close'; + this.isMember = true; + }); + }, error => { + this.loading = false; + this.error = 'The verification code is invalid'; + })); + } else { + this.memberModal.cancel(); + } } public reset() { this.code = this.fb.control('', [Validators.required, Validators.pattern('^[+0-9]{6}$')]); } - cancel(modal: AlertModal) { - modal.cancel(); + cancel() { this.router.navigate([this.router.url.split('?')[0]]); } } diff --git a/searchPages/searchUtils/portal-search-result.component.html b/searchPages/searchUtils/portal-search-result.component.html index 07edc9fb..1f62f765 100644 --- a/searchPages/searchUtils/portal-search-result.component.html +++ b/searchPages/searchUtils/portal-search-result.component.html @@ -91,10 +91,7 @@
- -
- You will be navigated to a new tab. Are you sure that you want to proceed? -
+
diff --git a/searchPages/searchUtils/portal-search-result.component.ts b/searchPages/searchUtils/portal-search-result.component.ts index 520d54c2..28f0036f 100644 --- a/searchPages/searchUtils/portal-search-result.component.ts +++ b/searchPages/searchUtils/portal-search-result.component.ts @@ -75,14 +75,12 @@ export class PortalSearchResultComponent implements OnInit{ public confirmModalOpen(result: CommunityInfo & Stakeholder) { this.selected = result; - this.modal.cancelButton = true; - this.modal.okButton = true; if(this.type === 'stakeholder') { this.modal.alertTitle = 'You are going to visit ' + result.name + ' Monitor Dashboard'; } else if (this.type === 'community') { this.modal.alertTitle = 'You are going to visit ' + ((result.title) ? result.title : result.shortTitle) +' Gateway'; } - this.modal.alertMessage = false; + this.modal.message = 'You will be navigated to a new tab. Are you sure that you want to proceed?'; this.modal.okButtonLeft = false; this.modal.okButtonText = 'Yes'; this.modal.cancelButtonText = 'No'; diff --git a/sharedComponents/quick-contact/quick-contact.component.ts b/sharedComponents/quick-contact/quick-contact.component.ts index ca2106c8..97ecbdea 100644 --- a/sharedComponents/quick-contact/quick-contact.component.ts +++ b/sharedComponents/quick-contact/quick-contact.component.ts @@ -1,7 +1,6 @@ import {Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild} from '@angular/core'; import {FormGroup} from "@angular/forms"; import {Subscriber} from "rxjs"; -import {SearchForm} from "../../searchPages/searchUtils/newSearchPage.component"; import {Background} from "../../utils/background-utils"; declare var UIkit; diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts index 65b5e505..1d7da108 100644 --- a/utils/modal/alert.ts +++ b/utils/modal/alert.ts @@ -123,11 +123,15 @@ export class AlertModal { */ public select: boolean = true; /** - * Emitted when a ok button was clicked + * Emitted when ok button was clicked * or when Ok method is called. */ @Output() public alertOutput: EventEmitter = new EventEmitter(); - + /** + * Emitted when cancel button was clicked + * or when cancel method is called. + */ + @Output() public cancelOutput: EventEmitter = new EventEmitter(); @ViewChild('element') element: ElementRef; @@ -136,7 +140,7 @@ export class AlertModal { /** - * Opens a alert window creating backdrop. + * Opens an alert window creating backdrop. */ open() { UIkit.modal(this.element.nativeElement).show(); @@ -164,5 +168,6 @@ export class AlertModal { */ cancel() { UIkit.modal(this.element.nativeElement).hide(); + this.cancelOutput.emit(true); } }