mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
[task 97298][wip] showing domains for which registration can be done
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<h2>{{MESSAGE_PREFIX + '.header'|translate}}</h2>
|
<h2>{{MESSAGE_PREFIX + '.header'|translate}}</h2>
|
||||||
<p>{{MESSAGE_PREFIX + '.info' | translate}}</p>
|
<p>{{MESSAGE_PREFIX + '.info' | translate}}</p>
|
||||||
|
{{valid_mail_domains.length}}
|
||||||
|
<p *ngIf="valid_mail_domains.length!= 0">Accounts can be registered for mail addresses of the domanins <span *ngFor="let valid_domain of valid_mail_domains">{{valid_domain}}</span> </p>
|
||||||
|
|
||||||
<form [class]="'ng-invalid'" [formGroup]="form" (ngSubmit)="register()">
|
<form [class]="'ng-invalid'" [formGroup]="form" (ngSubmit)="register()">
|
||||||
|
|
||||||
@@ -29,7 +31,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<button class="btn btn-primary"
|
<button class="btn btn-primary"
|
||||||
[disabled]="form.invalid"
|
[disabled]="form.invalid"
|
||||||
(click)="register()">{{MESSAGE_PREFIX + '.submit'| translate}}</button>
|
(click)="register()">{{MESSAGE_PREFIX + '.submit'| translate}}</button>
|
||||||
|
@@ -1,11 +1,13 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import {Component, Input, OnInit} from '@angular/core';
|
||||||
import { EpersonRegistrationService } from '../core/data/eperson-registration.service';
|
import {EpersonRegistrationService} from '../core/data/eperson-registration.service';
|
||||||
import { NotificationsService } from '../shared/notifications/notifications.service';
|
import {NotificationsService} from '../shared/notifications/notifications.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
import { Router } from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
|
||||||
import { Registration } from '../core/shared/registration.model';
|
import {Registration} from '../core/shared/registration.model';
|
||||||
import { RemoteData } from '../core/data/remote-data';
|
import {RemoteData} from '../core/data/remote-data';
|
||||||
|
import {ConfigurationDataService} from "../core/data/configuration-data.service";
|
||||||
|
import {getFirstCompletedRemoteData} from "../core/shared/operators";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-register-email-form',
|
selector: 'ds-register-email-form',
|
||||||
@@ -27,14 +29,16 @@ export class RegisterEmailFormComponent implements OnInit {
|
|||||||
@Input()
|
@Input()
|
||||||
MESSAGE_PREFIX: string;
|
MESSAGE_PREFIX: string;
|
||||||
|
|
||||||
|
valid_mail_domains: string[];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private epersonRegistrationService: EpersonRegistrationService,
|
private epersonRegistrationService: EpersonRegistrationService,
|
||||||
private notificationService: NotificationsService,
|
private notificationService: NotificationsService,
|
||||||
private translateService: TranslateService,
|
private translateService: TranslateService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private formBuilder: FormBuilder
|
private formBuilder: FormBuilder,
|
||||||
|
private configurationService: ConfigurationDataService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@@ -45,7 +49,13 @@ export class RegisterEmailFormComponent implements OnInit {
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
this.valid_mail_domains = [];
|
||||||
|
this.configurationService.findByPropertyName('authentication-password.domain.valid')
|
||||||
|
.pipe(getFirstCompletedRemoteData())
|
||||||
|
.subscribe((remoteData) =>{
|
||||||
|
this.valid_mail_domains.push(remoteData.payload.values[0]);
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user