mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 02:54:13 +00:00
97298: #3281 Self-register - type request query param
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
<ds-register-email-form
|
<ds-register-email-form
|
||||||
[MESSAGE_PREFIX]="'forgot-email.form'">
|
[MESSAGE_PREFIX]="'forgot-email.form'" [typeRequest]="'forgot'">
|
||||||
</ds-register-email-form>
|
</ds-register-email-form>
|
@@ -29,6 +29,12 @@ export class RegisterEmailFormComponent implements OnInit {
|
|||||||
@Input()
|
@Input()
|
||||||
MESSAGE_PREFIX: string;
|
MESSAGE_PREFIX: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of register request to be done, register new email or forgot password (same endpoint)
|
||||||
|
*/
|
||||||
|
@Input()
|
||||||
|
typeRequest: string = null;
|
||||||
|
|
||||||
validMailDomains: string[];
|
validMailDomains: string[];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -64,12 +70,8 @@ export class RegisterEmailFormComponent implements OnInit {
|
|||||||
* Register an email address
|
* Register an email address
|
||||||
*/
|
*/
|
||||||
register() {
|
register() {
|
||||||
const typeMap = new Map<string, string>([
|
|
||||||
['register-page.registration', 'register'],
|
|
||||||
['forgot-email.form', 'forgot']
|
|
||||||
]);
|
|
||||||
if (!this.form.invalid) {
|
if (!this.form.invalid) {
|
||||||
this.epersonRegistrationService.registerEmail(this.email.value, typeMap.get(this.MESSAGE_PREFIX)).subscribe((response: RemoteData<Registration>) => {
|
this.epersonRegistrationService.registerEmail(this.email.value, this.typeRequest).subscribe((response: RemoteData<Registration>) => {
|
||||||
if (response.hasSucceeded) {
|
if (response.hasSucceeded) {
|
||||||
this.notificationService.success(this.translateService.get(`${this.MESSAGE_PREFIX}.success.head`),
|
this.notificationService.success(this.translateService.get(`${this.MESSAGE_PREFIX}.success.head`),
|
||||||
this.translateService.get(`${this.MESSAGE_PREFIX}.success.content`, {email: this.email.value}));
|
this.translateService.get(`${this.MESSAGE_PREFIX}.success.content`, {email: this.email.value}));
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
<ds-register-email-form
|
<ds-register-email-form
|
||||||
[MESSAGE_PREFIX]="'register-page.registration'">
|
[MESSAGE_PREFIX]="'register-page.registration'" [typeRequest]="'register'">
|
||||||
</ds-register-email-form>
|
</ds-register-email-form>
|
||||||
|
Reference in New Issue
Block a user