- access-control: register DSC enrollment under factorType='DSC' instead of
the legacy 'TOKEN' alias, hydrate / disable paths match on the same code.
Pill labels in the picker and Hardware Token panel updated to 'Type · DSC'.
service.ts MfaFactorType union adds 'DSC'.
- two-factor-authentication: initialise the delivery-method form at field
declaration instead of inside ngOnInit so Angular's first change-detection
pass doesn't fire 'Cannot find control' before the form is built.
- Rename duplicate component selectors that were tripping NG0912 at runtime:
mifosx-notes-tab -> mifosx-{centers,clients,current-account,groups,loans,
savings}-notes-tab; mifosx-unassign-staff-dialog -> mifosx-{clients,groups}-
unassign-staff-dialog. Selectors aren't referenced in templates (route /
dialog open), so the rename has no usage-site impact.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
76 lines
2.3 KiB
TypeScript
76 lines
2.3 KiB
TypeScript
/**
|
|
* Copyright since 2025 Mifos Initiative
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
import { Component, OnInit, inject } from '@angular/core';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
|
/** Custom Components */
|
|
|
|
/** Custom Services */
|
|
import { LoansService } from '../../loans.service';
|
|
import { AuthenticationService } from '../../../core/authentication/authentication.service';
|
|
import { EntityNotesTabComponent } from '../../../shared/tabs/entity-notes-tab/entity-notes-tab.component';
|
|
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
|
|
|
@Component({
|
|
selector: 'mifosx-loans-notes-tab',
|
|
templateUrl: './notes-tab.component.html',
|
|
styleUrls: ['./notes-tab.component.scss'],
|
|
imports: [
|
|
...STANDALONE_SHARED_IMPORTS,
|
|
EntityNotesTabComponent
|
|
]
|
|
})
|
|
export class NotesTabComponent implements OnInit {
|
|
private route = inject(ActivatedRoute);
|
|
private loansService = inject(LoansService);
|
|
private authenticationService = inject(AuthenticationService);
|
|
|
|
entityId: string;
|
|
username: string;
|
|
entityNotes: any;
|
|
|
|
constructor() {
|
|
const savedCredentials = this.authenticationService.getCredentials();
|
|
this.username = savedCredentials.username;
|
|
this.entityId = this.route.parent.snapshot.params['loanId'];
|
|
this.route.data.subscribe((data: { loanNotes: any }) => {
|
|
this.entityNotes = data.loanNotes;
|
|
});
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
this.route.parent.params.subscribe((params) => {
|
|
this.entityId = params['loanId'];
|
|
});
|
|
}
|
|
|
|
addNote(noteContent: any) {
|
|
this.loansService.createLoanNote(this.entityId, noteContent).subscribe((response: any) => {
|
|
this.entityNotes.push({
|
|
id: response.resourceId,
|
|
createdByUsername: this.username,
|
|
createdOn: new Date(),
|
|
note: noteContent.note
|
|
});
|
|
});
|
|
}
|
|
|
|
editNote(noteId: string, noteContent: any, index: number) {
|
|
this.loansService.editLoanNote(this.entityId, noteId, noteContent).subscribe(() => {
|
|
this.entityNotes[index].note = noteContent.note;
|
|
});
|
|
}
|
|
|
|
deleteNote(noteId: string, index: number) {
|
|
this.loansService.deleteLoanNote(this.entityId, noteId).subscribe(() => {
|
|
this.entityNotes.splice(index, 1);
|
|
});
|
|
}
|
|
}
|