build: Use prettier for typescript

Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
Ralph Hopman
2025-01-15 11:59:30 +00:00
committed by Adam Saghy
parent 9d6cf1514a
commit cac1d11ad7
1812 changed files with 22516 additions and 16862 deletions
@@ -8,9 +8,8 @@ describe('ManageGroupsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ManageGroupsComponent ]
})
.compileComponents();
declarations: [ManageGroupsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -11,14 +11,12 @@ import { CentersService } from 'app/centers/centers.service';
import { GroupsService } from 'app/groups/groups.service';
import { MatDialog } from '@angular/material/dialog';
@Component({
selector: 'mifosx-manage-groups',
templateUrl: './manage-groups.component.html',
styleUrls: ['./manage-groups.component.scss']
})
export class ManageGroupsComponent implements AfterViewInit {
/** Center Data */
centerData: any;
/** Group data. */
@@ -35,24 +33,26 @@ export class ManageGroupsComponent implements AfterViewInit {
* @param {GroupsService} groupsService Groups Service
* @param {MatDialog} dialog Mat Dialog
*/
constructor(private route: ActivatedRoute,
private centersService: CentersService,
private groupsService: GroupsService,
public dialog: MatDialog) {
constructor(
private route: ActivatedRoute,
private centersService: CentersService,
private groupsService: GroupsService,
public dialog: MatDialog
) {
this.route.data.subscribe((data: { centersActionData: any }) => {
this.centerData = data.centersActionData;
this.groupMembers = data.centersActionData.groupMembers;
});
}
/**
* Subscribes to Groups search filter:
*/
ngAfterViewInit() {
this.groupChoice.valueChanges.subscribe( (value: string) => {
this.groupChoice.valueChanges.subscribe((value: string) => {
if (value.length >= 2) {
this.groupsService.getFilteredGroups('name', 'ASC', value, this.centerData.officeId, 'true')
this.groupsService
.getFilteredGroups('name', 'ASC', value, this.centerData.officeId, 'true')
.subscribe((data: any) => {
this.groupsData = data;
});
@@ -66,12 +66,22 @@ export class ManageGroupsComponent implements AfterViewInit {
addGroup() {
if (this.groupMembers !== null && this.groupMembers !== undefined) {
if (!this.groupMembers.includes(this.groupChoice.value)) {
this.centersService.executeCenterActionCommand(this.centerData.id, 'associateGroups', {groupMembers: [this.groupChoice.value.id]})
.subscribe(() => { this.groupMembers.push(this.groupChoice.value); });
this.centersService
.executeCenterActionCommand(this.centerData.id, 'associateGroups', {
groupMembers: [this.groupChoice.value.id]
})
.subscribe(() => {
this.groupMembers.push(this.groupChoice.value);
});
}
} else {
this.centersService.executeCenterActionCommand(this.centerData.id, 'associateGroups', {groupMembers: [this.groupChoice.value.id]})
.subscribe(() => { this.groupMembers.push(this.groupChoice.value); });
this.centersService
.executeCenterActionCommand(this.centerData.id, 'associateGroups', {
groupMembers: [this.groupChoice.value.id]
})
.subscribe(() => {
this.groupMembers.push(this.groupChoice.value);
});
}
}
@@ -85,8 +95,11 @@ export class ManageGroupsComponent implements AfterViewInit {
});
removeMemberDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
this.centersService.executeCenterActionCommand(this.centerData.id, 'disassociateGroups', {groupMembers: [group.id]})
.subscribe(() => { this.groupMembers.splice(index, 1); });
this.centersService
.executeCenterActionCommand(this.centerData.id, 'disassociateGroups', { groupMembers: [group.id] })
.subscribe(() => {
this.groupMembers.splice(index, 1);
});
}
});
}
@@ -99,5 +112,4 @@ export class ManageGroupsComponent implements AfterViewInit {
displayGroup(group: any): string | undefined {
return group ? group.name : undefined;
}
}