diff --git a/lib/core/src/lib/core.module.ts b/lib/core/src/lib/core.module.ts
index 9df7a05df5..bc87763336 100644
--- a/lib/core/src/lib/core.module.ts
+++ b/lib/core/src/lib/core.module.ts
@@ -30,6 +30,7 @@ import { DataTableModule } from './datatable/datatable.module';
import { InfoDrawerModule } from './info-drawer/info-drawer.module';
import { LanguageMenuModule } from './language-menu/language-menu.module';
import { LoginModule } from './login/login.module';
+import { ForgotPasswordModule } from './forgot-password/forgot-password.module';
import { PaginationModule } from './pagination/pagination.module';
import { HostSettingsModule } from './settings/host-settings.module';
import { ToolbarModule } from './toolbar/toolbar.module';
@@ -92,6 +93,7 @@ import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
FormBaseModule,
CommentsModule,
LoginModule,
+ ForgotPasswordModule,
LanguageMenuModule,
InfoDrawerModule,
DataColumnModule,
@@ -134,6 +136,7 @@ import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
FormBaseModule,
CommentsModule,
LoginModule,
+ ForgotPasswordModule,
LanguageMenuModule,
InfoDrawerModule,
DataColumnModule,
diff --git a/lib/core/src/lib/forgot-password/forgot-password.component.html b/lib/core/src/lib/forgot-password/forgot-password.component.html
new file mode 100644
index 0000000000..88eeb36325
--- /dev/null
+++ b/lib/core/src/lib/forgot-password/forgot-password.component.html
@@ -0,0 +1,55 @@
+
;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ ForgotPasswordComponent ]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(ForgotPasswordComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/lib/core/src/lib/forgot-password/forgot-password.component.ts b/lib/core/src/lib/forgot-password/forgot-password.component.ts
new file mode 100644
index 0000000000..21f6ef1c8b
--- /dev/null
+++ b/lib/core/src/lib/forgot-password/forgot-password.component.ts
@@ -0,0 +1,54 @@
+/*
+ * Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved.
+ *
+ * License rights for this program may be obtained from Alfresco Software, Ltd.
+ * pursuant to a written agreement and any use of this program without such an
+ * agreement is prohibited.
+ */
+
+import { Component, OnInit } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { PeopleApi, ClientBody } from '@alfresco/js-api';
+import { AlfrescoApiService } from '@alfresco/adf-core';
+
+@Component({
+ selector: 'app-forgot-password',
+ templateUrl: './forgot-password.component.html',
+ styleUrls: ['./forgot-password.component.scss']
+})
+export class ForgotPasswordComponent implements OnInit{
+ private peopleApi: PeopleApi;
+ forgotPasswordForm: FormGroup;
+ isSaveInProgress : boolean = false;
+ passwordResetStatus : boolean = false;
+
+ constructor(
+ private apiService: AlfrescoApiService,
+ private formBuilder: FormBuilder) {}
+
+ ngOnInit(): void {
+ this.forgotPasswordForm = this.formBuilder.group({
+ userName: ['', [Validators.required]]
+ })
+ }
+
+ get peopleApiInstance() {
+ return (
+ this.peopleApi ||
+ (this.peopleApi = new PeopleApi(this.apiService.getInstance()))
+ );
+ }
+
+ sendInstructions() {
+ this.isSaveInProgress = true;
+ this.passwordResetStatus = true;
+ console.log("Sending Email to user ", this.forgotPasswordForm.controls.userName.value);
+
+ this.peopleApiInstance.requestPasswordReset(
+ this.forgotPasswordForm.controls.userName.value, {'client': 'adw'} as ClientBody);
+ }
+
+ isButtonDisabled(): boolean {
+ return this.forgotPasswordForm.invalid || this.isSaveInProgress;
+ }
+}
diff --git a/lib/core/src/lib/forgot-password/forgot-password.module.ts b/lib/core/src/lib/forgot-password/forgot-password.module.ts
new file mode 100644
index 0000000000..e3eda318ee
--- /dev/null
+++ b/lib/core/src/lib/forgot-password/forgot-password.module.ts
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved.
+ *
+ * License rights for this program may be obtained from Alfresco Software, Ltd.
+ * pursuant to a written agreement and any use of this program without such an
+ * agreement is prohibited.
+ */
+
+import { CommonModule } from '@angular/common';
+import { NgModule } from '@angular/core';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { RouterModule } from '@angular/router';
+import { TranslateModule } from '@ngx-translate/core';
+import { MaterialModule } from '../material.module';
+import { ForgotPasswordComponent } from './forgot-password.component';
+
+@NgModule({
+ imports: [
+ RouterModule,
+ MaterialModule,
+ FormsModule,
+ ReactiveFormsModule,
+ CommonModule,
+ TranslateModule
+ ],
+ declarations: [
+ ForgotPasswordComponent
+ ],
+ exports: [
+ ForgotPasswordComponent
+ ]
+})
+export class ForgotPasswordModule {}
diff --git a/lib/core/src/lib/i18n/en.json b/lib/core/src/lib/i18n/en.json
index 1b4fdec6c7..52e864cc32 100644
--- a/lib/core/src/lib/i18n/en.json
+++ b/lib/core/src/lib/i18n/en.json
@@ -309,12 +309,31 @@
"HELP": "NEED HELP?",
"REGISTER": "REGISTER"
},
+ "FORGOT-PASSWORD": {
+ "FORGOT-PASSWORD": "Forgot Password?"
+ },
"DIALOG": {
"CANCEL": "Cancel",
"CHOOSE": "Choose",
"LOGIN": "Sign in"
}
},
+ "PASSWORD": {
+ "RECOVER-PASSWORD": "Recover Password",
+ "MESSAGES": {
+ "USERNAME-REQUIRED": "Required",
+ "FILLER": "Don't worry, happens to the best of us.",
+ "ENTER-USERNAME": "Enter Username of your account",
+ "INVALID-USERNAME": "You've entered an invalid Email ID",
+ "RESET-PASSWORD-EMAIL-SENT": "An email has been sent to your registered Email ID. Please click this link when get it."
+ },
+ "PLACEHOLDERS": {
+ "USERNAME": "USERNAME"
+ },
+ "BUTTONS": {
+ "SEND-INSTRUCTIONS": "Send Instructions"
+ }
+ },
"ADF-DATATABLE": {
"EMPTY": {
"HEADER": "This list is empty",
diff --git a/lib/core/src/lib/login/components/login.component.html b/lib/core/src/lib/login/components/login.component.html
index 18144998b7..39bb274c91 100644
--- a/lib/core/src/lib/login/components/login.component.html
+++ b/lib/core/src/lib/login/components/login.component.html
@@ -168,6 +168,13 @@
{{ 'LOGIN.LABEL.REMEMBER' | translate }}
+