Fixes for modal error messages when adding/removing repository admins
This commit is contained in:
parent
e452c5205b
commit
94b99f8e51
File diff suppressed because it is too large
Load Diff
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
|
||||
<confirmation-dialog #deleteRepositoryAdminModal [title]="'Remove datasource admin'" [isModalShown]="isDeleteModalShown"
|
||||
[confirmButNotCloseButton]="'Remove'" (emitObject)="deleteRepoAdmin($event)">
|
||||
[confirmButNotCloseButton]="'Remove'" (emitObject)="deleteRepoAdmin($event)" (clearAll)="clearModal()">
|
||||
|
||||
<div *ngIf="modalErrorMessage" class="uk-alert uk-alert-danger">{{modalErrorMessage}}</div>
|
||||
|
||||
|
@ -54,13 +54,6 @@
|
|||
</div>
|
||||
<div class="whiteFilm"></div>
|
||||
</div>
|
||||
|
||||
<!--<div *ngIf="!modalLoadingMessage && !modalErrorMessage">-->
|
||||
|
||||
<!--<div *ngIf="selectedAdminForDelete">-->
|
||||
<!--<h6>Are you sure you want to delete {{ selectedAdminForDelete.email }} from the list of repository admins?</h6>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<div *ngIf="selectedAdminForDelete">
|
||||
<h6>Are you sure you want to remove this user admin?</h6>
|
||||
<pre>
|
||||
|
@ -75,7 +68,7 @@
|
|||
|
||||
|
||||
<confirmation-dialog #addRepositoryAdminModal [title]="'Add new datasource admin'" [isModalShown]="isAddModalShown"
|
||||
[confirmButNotCloseButton]="'Submit'" (emitObject)="addRepositoryAdmin()">
|
||||
[confirmButNotCloseButton]="'Submit'" (emitObject)="addRepositoryAdmin()" (clearAll)="clearModal()">
|
||||
|
||||
<div *ngIf="modalErrorMessage" class="uk-alert uk-alert-danger">{{modalErrorMessage}}</div>
|
||||
|
||||
|
|
|
@ -73,10 +73,9 @@ export class UpdateRepoAdminsComponent implements OnChanges {
|
|||
}
|
||||
}
|
||||
|
||||
closeDeletionModal() {
|
||||
clearModal() {
|
||||
this.selectedAdminForDelete = null;
|
||||
this.deleteRepositoryAdminModal.hideModal();
|
||||
// UIkit.modal('#deletionModal').hide();
|
||||
this.modalErrorMessage = null;
|
||||
}
|
||||
|
||||
deleteRepoAdmin(event: any) {
|
||||
|
@ -128,11 +127,11 @@ export class UpdateRepoAdminsComponent implements OnChanges {
|
|||
}, error => {
|
||||
console.log('Error adding repository admin', error);
|
||||
this.modalLoadingMessage = '';
|
||||
if(error.status === 404) {
|
||||
if (error.status === 404) {
|
||||
this.modalErrorMessage = 'This email address is not associated with an OpenAIRE user account.\n' +
|
||||
'Please make sure the user has an OpenAIRE account and then try again.';
|
||||
} else {
|
||||
this.modalErrorMessage = 'Error deleting the user admin, please try again. If the error persists, ' +
|
||||
this.modalErrorMessage = 'Error adding the new admin, please try again. If the error persists, ' +
|
||||
'please contact helpdesk@openaire.eu';
|
||||
}
|
||||
},
|
||||
|
|
|
@ -24,6 +24,7 @@ export class ConfirmationDialogComponent {
|
|||
@Input() public hideModalButton: string = 'Cancel';
|
||||
|
||||
@Output() emitObject: EventEmitter<any> = new EventEmitter();
|
||||
@Output() clearAll: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
private _ids: string[] = [];
|
||||
|
||||
|
@ -37,6 +38,7 @@ export class ConfirmationDialogComponent {
|
|||
|
||||
public hideModal(): void {
|
||||
this.isModalShown = false;
|
||||
this.clearAll.emit();
|
||||
// this.autoShownModal.hide();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue