Skip to content

Commit

Permalink
build: Run stylelint and prettier during build (#2239)
Browse files Browse the repository at this point in the history
Stylelint and prettier checks are added to the build workflow, to maintain formatting consistency.

Existing issues are fixed.
  • Loading branch information
rhopman authored Jan 29, 2025
1 parent 06693a6 commit 43d2a29
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 57 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ jobs:
- name: Run eslint
run: npx ng lint

- name: Run stylelint
run: npx stylelint "src/**/*.scss"

- name: Run prettier
run: npx prettier . --check

- name: Run build
run: npm run build:prod

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,14 @@ MIFOS_DISPLAY_BACKEND_INFO=false

For more information look the env.sample file in the root directory of the project


# Jira Links

Jira Board Link: [Kanban Board]
https://mifosforge.jira.com/jira/your-work
Jira Board Link: [Kanban Board]
https://mifosforge.jira.com/jira/your-work

Jira Web App Project Link:
https://mifosforge.jira.com/jira/software/c/projects/WEB/boards/62


## Want to help? [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/openMF/web-app/issues)

Want to file a bug, request a feature, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contributing](.github/CONTRIBUTING.md) and then check out one of our [issues](https://github.com/openMF/web-app/issues). Make sure you follow the guidelines before sending a contribution!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<div class="container">
<div *ngFor="let loanTermVariation of loanTermVariationsData">

<h3 class="m-t-20">{{ 'labels.heading.' + loanTermVariation.label | translate }}</h3>
<table mat-table [dataSource]="loanTermVariation.data">
<ng-container matColumnDef="row">
Expand Down Expand Up @@ -32,12 +31,24 @@ <h3 class="m-t-20">{{ 'labels.heading.' + loanTermVariation.label | translate }}
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let item">
<span *ngIf="allowActions(item.termType.value)">
<button class="button" mat-icon-button color="primary" matTooltip="{{ 'tooltips.Edit' | translate }}"
matTooltipPosition="right" (click)="manageRequest(item, 'Edit')">
<button
class="button"
mat-icon-button
color="primary"
matTooltip="{{ 'tooltips.Edit' | translate }}"
matTooltipPosition="right"
(click)="manageRequest(item, 'Edit')"
>
<fa-icon icon="edit" size="lg"></fa-icon>
</button>
<button class="button" mat-icon-button color="warn" matTooltip="{{ 'tooltips.Delete' | translate }}"
matTooltipPosition="left" (click)="manageRequest(item, 'Delete')">
<button
class="button"
mat-icon-button
color="warn"
matTooltip="{{ 'tooltips.Delete' | translate }}"
matTooltipPosition="left"
(click)="manageRequest(item, 'Delete')"
>
<fa-icon icon="trash" size="lg"></fa-icon>
</button>
</span>
Expand All @@ -48,5 +59,4 @@ <h3 class="m-t-20">{{ 'labels.heading.' + loanTermVariation.label | translate }}
<tr mat-row *matRowDef="let row; columns: loanDTermVariationsColumns"></tr>
</table>
</div>

</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -52,115 +52,115 @@ export class LoanTermVariationsTabComponent {
) {
this.interestPausesData = [];
this.clientId = this.route.parent.parent.snapshot.paramMap.get('clientId');
this.route.data.subscribe((data: { loanDetailsData: any; }) => {
this.route.data.subscribe((data: { loanDetailsData: any }) => {
this.loanId = data.loanDetailsData.id;
this.loanTermVariationsData = [];
data.loanDetailsData.loanTermVariations?.forEach((item: any) => {
item.days = dates.calculateDiff(new Date(item.termVariationApplicableFrom), new Date(item.dateValue)) + 1;
switch (item.termType.value) {
case 'emiAmount':
this.emiAmountData.push(item);
this.emiAmountData.push(item);
break;
case 'interestRate':
this.interestRateData.push(item);
this.interestRateData.push(item);
break;
case 'deleteInstallment':
this.deleteInstallmentData.push(item);
this.deleteInstallmentData.push(item);
break;
case 'dueDate':
this.dueDateData.push(item);
this.dueDateData.push(item);
break;
case 'insertInstallment':
this.insertInstallmentData.push(item);
this.insertInstallmentData.push(item);
break;
case 'principalAmount':
this.principalAmountData.push(item);
this.principalAmountData.push(item);
break;
case 'graceOnInterest':
this.graceOnInterestData.push(item);
this.graceOnInterestData.push(item);
break;
case 'graceOnPrincipal':
this.graceOnPrincipalData.push(item);
this.graceOnPrincipalData.push(item);
break;
case 'extendRepaymentPeriod':
this.extendRepaymentPeriodData.push(item);
this.extendRepaymentPeriodData.push(item);
break;
case 'interestRateForInstallment':
this.interestRateFromInstallmentData.push(item);
this.interestRateFromInstallmentData.push(item);
break;
case 'interestPause':
this.interestPausesData.push(item);
this.interestPausesData.push(item);
break;
default:
this.invalidData.push(item);
this.invalidData.push(item);
break;
}
});

if (this.deleteInstallmentData.length > 0) {
this.loanTermVariationsData.push({
"label": "Delete Installment",
"data": this.deleteInstallmentData
label: 'Delete Installment',
data: this.deleteInstallmentData
});
}
if (this.dueDateData.length > 0) {
this.loanTermVariationsData.push({
"label": "Due Date",
"data": this.dueDateData
label: 'Due Date',
data: this.dueDateData
});
}
if (this.emiAmountData.length > 0) {
this.loanTermVariationsData.push({
"label": "EMI Amount",
"data": this.emiAmountData
label: 'EMI Amount',
data: this.emiAmountData
});
}
if (this.extendRepaymentPeriodData.length > 0) {
this.loanTermVariationsData.push({
"label": "Extend Repayment Period",
"data": this.extendRepaymentPeriodData
label: 'Extend Repayment Period',
data: this.extendRepaymentPeriodData
});
}
if (this.graceOnInterestData.length > 0) {
this.loanTermVariationsData.push({
"label": "Grace On Interest",
"data": this.graceOnInterestData
label: 'Grace On Interest',
data: this.graceOnInterestData
});
}
if (this.graceOnPrincipalData.length > 0) {
this.loanTermVariationsData.push({
"label": "Grace On Principal",
"data": this.graceOnPrincipalData
label: 'Grace On Principal',
data: this.graceOnPrincipalData
});
}
if (this.insertInstallmentData.length > 0) {
this.loanTermVariationsData.push({
"label": "Insert Installment",
"data": this.insertInstallmentData
label: 'Insert Installment',
data: this.insertInstallmentData
});
}
if (this.interestPausesData.length > 0) {
this.loanTermVariationsData.push({
"label": "Interest Pauses",
"data": this.interestPausesData
label: 'Interest Pauses',
data: this.interestPausesData
});
}
if (this.interestRateData.length > 0) {
this.loanTermVariationsData.push({
"label": "Interest Rate",
"data": this.interestRateData
label: 'Interest Rate',
data: this.interestRateData
});
}
if (this.interestRateFromInstallmentData.length > 0) {
this.loanTermVariationsData.push({
"label": "Interest Rate From Installment",
"data": this.interestRateFromInstallmentData
label: 'Interest Rate From Installment',
data: this.interestRateFromInstallmentData
});
}
if (this.principalAmountData.length > 0) {
this.loanTermVariationsData.push({
"label": "Principal Amount",
"data": this.principalAmountData
label: 'Principal Amount',
data: this.principalAmountData
});
}
});
Expand Down Expand Up @@ -241,6 +241,6 @@ export class LoanTermVariationsTabComponent {
}

allowActions(termType: string): boolean {
return (termType === 'interestPause')
return termType === 'interestPause';
}
}
10 changes: 5 additions & 5 deletions src/assets/translations/cs-CS.json
Original file line number Diff line number Diff line change
Expand Up @@ -1139,15 +1139,15 @@
"You can drag and drop the rows to set a Payment Allocations order": "Řádky můžete přetáhnout a nastavit tak příkaz přidělení plateb",
"successfully select option": "úspěšně. Chcete-li pokračovat dále, vyberte si z níže uvedených možností.",
"Map Charge-off reasons to Expense accounts": "Mapujte důvody pro zúčtování na výdajové účty",
"Interest Rate From Installment": "Úroková sazba ze splátky",
"Due Date": "Datum splatnosti",
"Delete Installment": "Smazat splátku",
"EMI Amount": "Částka EMI",
"Interest Rate From Installment": "Úroková sazba ze splátky",
"Due Date": "Datum splatnosti",
"Delete Installment": "Smazat splátku",
"EMI Amount": "Částka EMI",
"Extend Repayment Period": "Prodloužit dobu splácení",
"Grace On Interest": "Grace On Interest",
"Grace On Principal": "Grace na ředitelce",
"Insert Installment": "Vložit splátku",
"Interest Rate": "Úroková sazba",
"Interest Rate": "Úroková sazba",
"Principal Amount": "Částka jistiny"
},
"inputs": {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@
"Grace On Interest": "Grace On Interest",
"Grace On Principal": "Grace On Principal",
"Insert Installment": "Insert Installment",
"Interest Rate": "Interest Rate",
"Interest Rate": "Interest Rate",
"Principal Amount": "Principal Amount"
},
"inputs": {
Expand Down
3 changes: 2 additions & 1 deletion src/assets/translations/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,8 @@
"successfully select option": "con successo. Seleziona una delle opzioni seguenti per procedere ulteriormente.",
"Map Charge-off reasons to Expense accounts": "Associa i motivi di addebito ai conti spese",
"Interest Rate From Installment": "Tasso di interesse dalla rata",
"Due Date": "Scadenza", "Delete Installment": "Elimina rata",
"Due Date": "Scadenza",
"Delete Installment": "Elimina rata",
"EMI Amount": "Importo EMI",
"Extend Repayment Period": "Estendere il periodo di rimborso",
"Grace On Interest": "Grazia sugli interessi",
Expand Down
6 changes: 3 additions & 3 deletions src/assets/translations/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1140,15 +1140,15 @@
"You can drag and drop the rows to set a Payment Allocations order": "Você pode arrastar e soltar as linhas para definir um pedido de alocações de pagamento",
"successfully select option": "com sucesso. Selecione uma das opções abaixo para prosseguir.",
"Map Charge-off reasons to Expense accounts": "Mapear os motivos de baixa para as contas de despesas",
"Interest Rate From Installment": "Taxa de juros da parcela",
"Interest Rate From Installment": "Taxa de juros da parcela",
"Due Date": "Data de vencimento",
"Delete Installment": "Excluir parcela",
"EMI Amount": "Valor EMI",
"Extend Repayment Period": "Estender o período de reembolso",
"Grace On Interest": "Graça em juros",
"Grace On Principal": "Graça no diretor",
"Grace On Principal": "Graça no diretor",
"Insert Installment": "Inserir parcela",
"Interest Rate": "Taxa de juro",
"Interest Rate": "Taxa de juro",
"Principal Amount": "Valor principal"
},
"inputs": {
Expand Down

0 comments on commit 43d2a29

Please sign in to comment.