WEB-59 removed self-service from codebase (#2374)
This commit is contained in:
@@ -14,5 +14,4 @@
|
||||
<mifosx-add-client-charge *ngIf="actions['Add Charge']"></mifosx-add-client-charge>
|
||||
<mifosx-take-survey *ngIf="actions['Take Survey']"></mifosx-take-survey>
|
||||
<mifosx-client-screen-reports *ngIf="actions['Client Screen Reports']"></mifosx-client-screen-reports>
|
||||
<mifosx-create-self-service-user *ngIf="actions['Create Self Service User']"></mifosx-create-self-service-user>
|
||||
<mifosx-add-client-collateral *ngIf="actions['Create Collateral']"></mifosx-add-client-collateral>
|
||||
|
||||
@@ -28,7 +28,6 @@ export class ClientActionsComponent {
|
||||
'Add Charge': boolean;
|
||||
'Take Survey': boolean;
|
||||
'Client Screen Reports': boolean;
|
||||
'Create Self Service User': boolean;
|
||||
'Create Collateral': boolean;
|
||||
} = {
|
||||
'Assign Staff': false,
|
||||
@@ -46,7 +45,6 @@ export class ClientActionsComponent {
|
||||
'Add Charge': false,
|
||||
'Take Survey': false,
|
||||
'Client Screen Reports': false,
|
||||
'Create Self Service User': false,
|
||||
'Create Collateral': false
|
||||
};
|
||||
|
||||
|
||||
-122
@@ -1,122 +0,0 @@
|
||||
<div class="container">
|
||||
<mat-card>
|
||||
<form [formGroup]="createSelfServiceForm" (ngSubmit)="submit()">
|
||||
<mat-card-content>
|
||||
<div div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
<mat-form-field fxFlex="48%">
|
||||
<mat-label> {{ 'labels.inputs.User Name' | translate }} </mat-label>
|
||||
<input matInput required formControlName="username" />
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.username.hasError('required')">
|
||||
{{ 'labels.inputs.User Name' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="48%">
|
||||
<mat-label> {{ 'labels.inputs.First Name' | translate }} </mat-label>
|
||||
<input matInput required formControlName="firstname" />
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.firstname.hasError('required')">
|
||||
{{ 'labels.inputs.First Name' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="48%">
|
||||
<mat-label> {{ 'labels.inputs.Last Name' | translate }} </mat-label>
|
||||
<input matInput required formControlName="lastname" />
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.lastname.hasError('required')">
|
||||
{{ 'labels.inputs.Last Name' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="48%">
|
||||
<mat-label> {{ 'labels.inputs.Email' | translate }} </mat-label>
|
||||
<input matInput required formControlName="email" />
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.email.hasError('required')">
|
||||
{{ 'labels.inputs.Email' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.email.hasError('email')">
|
||||
{{ 'labels.inputs.Email should be a' | translate }}
|
||||
<strong>{{ 'labels.inputs.valid' | translate }}</strong> {{ 'labels.inputs.email' | translate }}.
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-checkbox labelPosition="before" formControlName="sendPasswordToEmail" fxFlex="48%">
|
||||
{{ 'labels.inputs.Auto Generate Password' | translate }}
|
||||
</mat-checkbox>
|
||||
|
||||
<div fxFlex="48%" fxLayoutGap="5px" fxLayout="row">
|
||||
<mat-checkbox labelPosition="before" formControlName="passwordNeverExpires">
|
||||
{{ 'labels.inputs.Override Password Expire Policy' | translate }} ?
|
||||
</mat-checkbox>
|
||||
|
||||
<i
|
||||
class="fa fa-question-circle fa fa-align-left"
|
||||
title="{{ 'labels.inputs.Determines if passwords do not expire' | translate }}"
|
||||
></i>
|
||||
</div>
|
||||
|
||||
<mat-form-field fxFlex="48%" *ngIf="!hidePasswordField">
|
||||
<mat-label>{{ 'labels.inputs.Password' | translate }}</mat-label>
|
||||
<input matInput formControlName="password" type="password" />
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.password.hasError('required')">
|
||||
{{ 'labels.inputs.Password' | translate }} <strong>{{ 'labels.commons.is required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.password.hasError('minlength')">
|
||||
{{ 'labels.commons.Password should be at least' | translate }}
|
||||
<strong>{{ 'labels.commons.12 characters long' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.password.hasError('maxlength')">
|
||||
{{ 'labels.commons.Password should not be more than' | translate }}
|
||||
<strong>{{ 'labels.commons.50 characters long' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error
|
||||
*ngIf="
|
||||
createSelfServiceForm.controls.password.hasError('pattern') &&
|
||||
!(
|
||||
createSelfServiceForm.controls.password.hasError('minlength') ||
|
||||
createSelfServiceForm.controls.password.hasError('maxlength')
|
||||
)
|
||||
"
|
||||
>
|
||||
{{ 'labels.commons.Password should include a' | translate }}
|
||||
<strong>{{ 'labels.commons.numeral' | translate }}</strong> {{ 'labels.commons.and at' | translate }}
|
||||
<strong>{{ 'labels.commons.least one uppercase' | translate }}</strong>
|
||||
, <strong>{{ 'labels.commons.lowercase and special character' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="48%" *ngIf="!hidePasswordField">
|
||||
<mat-label> {{ 'labels.inputs.Repeat Password' | translate }} </mat-label>
|
||||
<input matInput required formControlName="repeatPassword" type="password" />
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.repeatPassword.hasError('required')">
|
||||
{{ 'labels.inputs.Repeat password' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="createSelfServiceForm.controls.repeatPassword.hasError('notequal')">
|
||||
{{ 'labels.inputs.Passwords should be' | translate }}
|
||||
<strong>{{ 'labels.inputs.matched' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="48%">
|
||||
<mat-label> {{ 'labels.inputs.Status' | translate }} </mat-label>
|
||||
<input matInput formControlName="status" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<mat-card-actions fxLayoutGap="5px" fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center">
|
||||
<button type="button" mat-raised-button [routerLink]="['../../']">
|
||||
{{ 'labels.buttons.Cancel' | translate }}
|
||||
</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!createSelfServiceForm.valid">
|
||||
{{ 'labels.buttons.Activate Self Service User' | translate }}
|
||||
</button>
|
||||
<i class="fa fa-question-circle fa-2x" title="Activate Self Service User Help"></i>
|
||||
</mat-card-actions>
|
||||
</mat-card-content>
|
||||
</form>
|
||||
</mat-card>
|
||||
</div>
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
.fa-question-circle {
|
||||
color: #1abc9c;
|
||||
}
|
||||
|
||||
.fa {
|
||||
display: inline-block;
|
||||
font-family: FontAwesome;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
mat-card {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CreateSelfServiceUserComponent } from './create-self-service-user.component';
|
||||
|
||||
describe('CreateSelfServiceUserComponent', () => {
|
||||
let component: CreateSelfServiceUserComponent;
|
||||
let fixture: ComponentFixture<CreateSelfServiceUserComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [CreateSelfServiceUserComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CreateSelfServiceUserComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
-109
@@ -1,109 +0,0 @@
|
||||
/** Angular Imports. */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {
|
||||
UntypedFormBuilder,
|
||||
UntypedFormGroup,
|
||||
UntypedFormControl,
|
||||
Validators,
|
||||
AbstractControl,
|
||||
ValidationErrors,
|
||||
ValidatorFn
|
||||
} from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
/** Client Services. */
|
||||
import { ClientsService } from 'app/clients/clients.service';
|
||||
import { PasswordsUtility } from 'app/core/utils/passwords-utility';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-create-self-service-user',
|
||||
templateUrl: './create-self-service-user.component.html',
|
||||
styleUrls: ['./create-self-service-user.component.scss']
|
||||
})
|
||||
export class CreateSelfServiceUserComponent implements OnInit {
|
||||
createSelfServiceForm: UntypedFormGroup;
|
||||
clientData: any;
|
||||
hidePasswordField = true;
|
||||
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private clientService: ClientsService,
|
||||
private router: Router,
|
||||
private passwordsUtility: PasswordsUtility
|
||||
) {
|
||||
this.route.data.subscribe((data: { clientActionData: any }) => {
|
||||
this.clientData = data.clientActionData;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.createSelfServiceUser();
|
||||
this.sendPasswordToEmailChange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Password To Email Change.
|
||||
*/
|
||||
sendPasswordToEmailChange() {
|
||||
this.createSelfServiceForm.controls.sendPasswordToEmail.valueChanges.subscribe((value: any) => {
|
||||
if (value === true) {
|
||||
this.hidePasswordField = true;
|
||||
this.createSelfServiceForm.removeControl('password');
|
||||
this.createSelfServiceForm.removeControl('repeatPassword');
|
||||
} else {
|
||||
this.hidePasswordField = false;
|
||||
this.createSelfServiceForm.addControl(
|
||||
'password',
|
||||
new UntypedFormControl('', this.passwordsUtility.getPasswordValidators())
|
||||
);
|
||||
this.createSelfServiceForm.addControl(
|
||||
'repeatPassword',
|
||||
new UntypedFormControl('', [
|
||||
Validators.required,
|
||||
this.passwordsUtility.confirmPassword('password')])
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Self User Form.
|
||||
*/
|
||||
createSelfServiceUser() {
|
||||
this.createSelfServiceForm = this.formBuilder.group({
|
||||
username: new UntypedFormControl('', [Validators.required]),
|
||||
firstname: new UntypedFormControl(this.clientData.firstname, [Validators.required]),
|
||||
lastname: new UntypedFormControl(this.clientData.lastname, [Validators.required]),
|
||||
email: new UntypedFormControl('', [
|
||||
Validators.required,
|
||||
Validators.email
|
||||
]),
|
||||
sendPasswordToEmail: new UntypedFormControl(true),
|
||||
passwordNeverExpires: new UntypedFormControl(false),
|
||||
status: new UntypedFormControl({
|
||||
value: this.clientData.subStatus.active ? 'Active' : 'Inactive',
|
||||
disabled: true
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit form.
|
||||
*/
|
||||
submit() {
|
||||
if (!this.createSelfServiceForm.get('passwordNeverExpires').value) {
|
||||
this.createSelfServiceForm.removeControl('passwordNeverExpires');
|
||||
}
|
||||
const clientId = this.clientData.id.toString();
|
||||
const selfServiceForm = this.createSelfServiceForm.value;
|
||||
(selfServiceForm.roles = [2]), (selfServiceForm.isSelfServiceUser = true);
|
||||
selfServiceForm.staffId = this.clientData.staffId;
|
||||
selfServiceForm.clients = [clientId];
|
||||
selfServiceForm.officeId = this.clientData.officeId;
|
||||
this.clientService.createSelfServiceUser(selfServiceForm).subscribe(() => {
|
||||
this.router.navigate(['../../general'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -317,9 +317,6 @@
|
||||
{{ 'labels.buttons.View Standing Instructions' | translate }}
|
||||
</button>
|
||||
</span>
|
||||
<button mat-menu-item (click)="doAction('Create Self Service User')">
|
||||
{{ 'labels.buttons.Create Self Service User' | translate }}
|
||||
</button>
|
||||
</mat-menu>
|
||||
</mat-card-title-group>
|
||||
</mat-card-header>
|
||||
|
||||
@@ -75,7 +75,6 @@ export class ClientsViewComponent implements OnInit {
|
||||
case 'Undo Rejection':
|
||||
case 'Add Charge':
|
||||
case 'Create Collateral':
|
||||
case 'Create Self Service User':
|
||||
case 'Client Screen Reports':
|
||||
this.router.navigate([`actions/${name}`], { relativeTo: this.route });
|
||||
break;
|
||||
|
||||
@@ -54,7 +54,6 @@ import { ClientPreviewStepComponent } from './client-stepper/client-preview-step
|
||||
import { ClientAddressStepComponent } from './client-stepper/client-address-step/client-address-step.component';
|
||||
import { ClientFamilyMemberDialogComponent } from './client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component';
|
||||
import { CaptureImageDialogComponent } from './clients-view/custom-dialogs/capture-image-dialog/capture-image-dialog.component';
|
||||
import { CreateSelfServiceUserComponent } from './clients-view/client-actions/create-self-service-user/create-self-service-user.component';
|
||||
import { AddClientCollateralComponent } from './clients-view/client-actions/add-client-collateral/add-client-collateral.component';
|
||||
import { ClientDatatableStepComponent } from './client-stepper/client-datatable-step/client-datatable-step.component';
|
||||
|
||||
@@ -117,7 +116,6 @@ import { ClientDatatableStepComponent } from './client-stepper/client-datatable-
|
||||
ClientAddressStepComponent,
|
||||
ClientFamilyMemberDialogComponent,
|
||||
CaptureImageDialogComponent,
|
||||
CreateSelfServiceUserComponent,
|
||||
AddClientCollateralComponent,
|
||||
ClientDatatableStepComponent
|
||||
],
|
||||
|
||||
@@ -57,8 +57,6 @@ export class ClientActionsResolver implements Resolve<Object> {
|
||||
case 'Accept Transfer':
|
||||
case 'Reject Transfer':
|
||||
return this.clientsService.getClientTransferProposalDate(clientId);
|
||||
case 'Create Self Service User':
|
||||
return this.clientsService.getClientData(clientId);
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user