build: Use prettier for html

Stop ignoring html files in prettier and fix existing issues.
This commit is contained in:
Ralph Hopman
2024-12-19 09:36:50 +01:00
committed by Adam Saghy
parent c5fc3925fb
commit 2ec9ba81d6
651 changed files with 28935 additions and 20624 deletions
@@ -1,18 +1,14 @@
<div class="container">
<mat-card>
<form [formGroup]="roleForm" (ngSubmit)="submit()">
<mat-card-content>
<div fxLayout="column">
<mat-form-field>
<mat-label>{{ 'labels.inputs.Name' | translate }}</mat-label>
<input matInput required formControlName="name">
<input matInput required formControlName="name" />
<mat-error *ngIf="roleForm.controls.name.hasError('required')">
{{ 'labels.inputs.Role Name' | translate }} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
{{ 'labels.inputs.Role Name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
@@ -20,21 +16,21 @@
<mat-label>{{ 'labels.inputs.Description' | translate }}</mat-label>
<textarea matInput required formControlName="description"></textarea>
<mat-error *ngIf="roleForm.controls.description.hasError('required')">
{{ 'labels.inputs.Role Description' | translate }} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
{{ 'labels.inputs.Role Description' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
</div>
</mat-card-content>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button color="primary" [disabled]="!roleForm.valid">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>
</form>
</mat-card>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button mat-raised-button color="primary" [disabled]="!roleForm.valid">
{{ 'labels.buttons.Submit' | translate }}
</button>
</mat-card-actions>
</form>
</mat-card>
</div>
@@ -1,37 +1,32 @@
<div class="container">
<mat-card>
<form [formGroup]="roleForm" (ngSubmit)="submit()">
<mat-card-content>
<div fxLayout="column">
<mat-form-field>
<mat-label>{{ 'labels.inputs.Role Name' | translate }}</mat-label>
<input matInput disabled formControlName="name" />
</mat-form-field>
<div fxLayout="column">
<mat-form-field>
<mat-label>{{ 'labels.inputs.Role Name' | translate }}</mat-label>
<input matInput disabled formControlName="name">
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Role Description' | translate }}</mat-label>
<input matInput required formControlName="description">
<mat-error *ngIf="roleForm.controls.description.hasError('required')">
{{ 'labels.inputs.Description' | translate }} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
</div>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Role Description' | translate }}</mat-label>
<input matInput required formControlName="description" />
<mat-error *ngIf="roleForm.controls.description.hasError('required')">
{{ 'labels.inputs.Description' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
</div>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button color="primary" [disabled]="!roleForm.valid || roleForm.pristine">{{'labels.buttons.Submit' | translate}}</button>
<button type="button" mat-raised-button [routerLink]="['../../']">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button mat-raised-button color="primary" [disabled]="!roleForm.valid || roleForm.pristine">
{{ 'labels.buttons.Submit' | translate }}
</button>
</mat-card-actions>
</form>
</mat-card>
</div>
@@ -2,87 +2,135 @@
<div #buttonAddRole class="in-block">
<button mat-raised-button color="primary">
<fa-icon icon="plus" class="m-r-10"></fa-icon>
{{'labels.buttons.Add Role' | translate}}
{{ 'labels.buttons.Add Role' | translate }}
</button>
</div>
</div>
<div class="container">
<div #filter fxLayout="row" fxLayoutGap="20px">
<mat-form-field fxFlex>
<mat-label>{{'labels.inputs.Filter' | translate}}</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)">
<mat-label>{{ 'labels.inputs.Filter' | translate }}</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)" />
</mat-form-field>
</div>
<div #tableRolesandPermissions class="mat-elevation-z8">
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Name' | translate}} </th>
<td mat-cell *matCellDef="let role"> {{ role.name }} </td>
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Name' | translate }}</th>
<td mat-cell *matCellDef="let role">{{ role.name }}</td>
</ng-container>
<ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'labels.inputs.Description' | translate }} </th>
<td mat-cell *matCellDef="let role"> {{ role.description }} </td>
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Description' | translate }}</th>
<td mat-cell *matCellDef="let role">{{ role.description }}</td>
</ng-container>
<ng-container matColumnDef="disabled">
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'labels.inputs.Status' | translate }} </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Status' | translate }}</th>
<td mat-cell *matCellDef="let role">
<div [className]="role.disabled === true ? 'false' : 'true'">
<fa-icon [matTooltip]="role.disabled === true ? (('labels.inputs.Disabled' | translate)) : (('labels.inputs.Enabled' | translate))" matTooltipPosition="right" icon="circle" size="lg"></fa-icon>
<fa-icon
[matTooltip]="
role.disabled === true ? ('labels.inputs.Disabled' | translate) : ('labels.inputs.Enabled' | translate)
"
matTooltipPosition="right"
icon="circle"
size="lg"
></fa-icon>
</div>
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let role;" >
<button *ngIf="role.name !== 'Super user'" mat-icon-button color="primary" (click)="routeEdit($event)" [routerLink]="[role.id, 'edit']">
<fa-icon icon="edit"> {{'labels.buttons.Edit' | translate }} </fa-icon>
<td mat-cell *matCellDef="let role">
<button
*ngIf="role.name !== 'Super user'"
mat-icon-button
color="primary"
(click)="routeEdit($event)"
[routerLink]="[role.id, 'edit']"
>
<fa-icon icon="edit"> {{ 'labels.buttons.Edit' | translate }} </fa-icon>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [routerLink]="[row.id]" class="select-row"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns" [routerLink]="[row.id]" class="select-row"></tr>
</table>
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
</div>
</div>
<ng-template #templateButtonAddRole let-popover="popover">
<h2>{{'labels.buttons.Add Role' | translate}}</h2>
<p class="mw300">{{'labels.text.To create a new role' | translate}}.</p>
<h2>{{ 'labels.buttons.Add Role' | translate }}</h2>
<p class="mw300">{{ 'labels.text.To create a new role' | translate }}.</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{'labels.buttons.Close' | translate }}</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStep();">{{'labels.buttons.Back' | translate}}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter, filter, 'bottom', true);">{{'labels.buttons.Next' | translate }}</button>
<button mat-raised-button color="warn" (click)="popover.close(); configurationWizardService.closeConfigWizard()">
{{ 'labels.buttons.Close' | translate }}
</button>
<button mat-raised-button color="primary" (click)="popover.close(); previousStep()">
{{ 'labels.buttons.Back' | translate }}
</button>
<button
mat-raised-button
color="primary"
(click)="popover.close(); showPopover(templateFilter, filter, 'bottom', true)"
>
{{ 'labels.buttons.Next' | translate }}
</button>
</div>
</ng-template>
<ng-template #templateFilter let-popover="popover">
<h4>{{'labels.heading.Search bar to filter roles' | translate }}.</h4>
<h4>{{ 'labels.heading.Search bar to filter roles' | translate }}.</h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{'labels.buttons.Close' | translate }}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateButtonAddRole, buttonAddRole, 'bottom', true)">{{'labels.buttons.Back' | translate}}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateTableRolesandPermissions, tableRolesandPermissions, 'top', true)">{{'labels.buttons.Next' | translate }}</button>
<button mat-raised-button color="warn" (click)="popover.close(); configurationWizardService.closeConfigWizard()">
{{ 'labels.buttons.Close' | translate }}
</button>
<button
mat-raised-button
color="primary"
(click)="popover.close(); showPopover(templateButtonAddRole, buttonAddRole, 'bottom', true)"
>
{{ 'labels.buttons.Back' | translate }}
</button>
<button
mat-raised-button
color="primary"
(click)="popover.close(); showPopover(templateTableRolesandPermissions, tableRolesandPermissions, 'top', true)"
>
{{ 'labels.buttons.Next' | translate }}
</button>
</div>
</ng-template>
<ng-template #templateTableRolesandPermissions let-popover="popover">
<h4 class="mw300">{{'labels.heading.List of roles defined within the organization' | translate}}: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67895364/Manage+Roles+and+Permissions" target="_blank">{{'labels.inputs.Manage Roles and Permission' | translate}}</a></h4>
<h4 class="mw300">
{{ 'labels.heading.List of roles defined within the organization' | translate }}:
<a
href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67895364/Manage+Roles+and+Permissions"
target="_blank"
>{{ 'labels.inputs.Manage Roles and Permission' | translate }}</a
>
</h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{'labels.buttons.Close' | translate }}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter, filter, 'bottom', true);">{{'labels.buttons.Back' | translate}}</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">{{'labels.buttons.Next' | translate }}</button>
<button mat-raised-button color="warn" (click)="popover.close(); configurationWizardService.closeConfigWizard()">
{{ 'labels.buttons.Close' | translate }}
</button>
<button
mat-raised-button
color="primary"
(click)="popover.close(); showPopover(templateFilter, filter, 'bottom', true)"
>
{{ 'labels.buttons.Back' | translate }}
</button>
<button mat-raised-button color="primary" (click)="popover.close(); nextStep()">
{{ 'labels.buttons.Next' | translate }}
</button>
</div>
</ng-template>
@@ -1,36 +1,53 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="primary" (click)="editRoles(); backupCheckValues();" [disabled]="rolePermissionService.name === 'Super user'">
<button
mat-raised-button
color="primary"
(click)="editRoles(); backupCheckValues()"
[disabled]="rolePermissionService.name === 'Super user'"
>
<fa-icon icon="edit" class="m-r-10"></fa-icon>
{{ 'labels.text.Edit Role' | translate }}
</button>
<button *ngIf="!isRoleEnable(rolePermissionService.disabled)" mat-raised-button color="danger" (click)="disableRolesConfirmation()" [disabled]="rolePermissionService.name === 'Super user'">
<button
*ngIf="!isRoleEnable(rolePermissionService.disabled)"
mat-raised-button
color="danger"
(click)="disableRolesConfirmation()"
[disabled]="rolePermissionService.name === 'Super user'"
>
<fa-icon icon="lock" class="m-r-10"></fa-icon>
{{ 'labels.buttons.Disable' | translate }} {{ 'labels.inputs.Role' | translate }}
</button>
<button *ngIf="isRoleEnable(rolePermissionService.disabled)" mat-raised-button color="primary" (click)="enableRolesConfirmation()" [disabled]="rolePermissionService.name === 'Super user'">
<button
*ngIf="isRoleEnable(rolePermissionService.disabled)"
mat-raised-button
color="primary"
(click)="enableRolesConfirmation()"
[disabled]="rolePermissionService.name === 'Super user'"
>
<fa-icon icon="lock-open" class="m-r-10"></fa-icon>
{{ 'labels.buttons.Enable' | translate }} {{ 'labels.inputs.Role' | translate }}
</button>
<button mat-raised-button color="warn" (click)="deleteRole()" [disabled]="rolePermissionService.name === 'Super user'">
<button
mat-raised-button
color="warn"
(click)="deleteRole()"
[disabled]="rolePermissionService.name === 'Super user'"
>
<fa-icon icon="trash" class="m-r-10"></fa-icon>
{{'labels.buttons.Delete' | translate }} {{ 'labels.inputs.Role' | translate }}
{{ 'labels.buttons.Delete' | translate }} {{ 'labels.inputs.Role' | translate }}
</button>
</div>
<div class="container m-b-20">
<mat-card class="mat-elevation-z8">
<mat-card-content>
<div fxLayout="row wrap" class="content">
<div fxFlex="40%" fxFlex.lt-md="50%" class="header">
<b>{{'labels.inputs.Name' | translate}}:</b>
<b>{{ 'labels.inputs.Name' | translate }}:</b>
</div>
<div fxFlex="60%" fxFlex.lt-md="50%">
@@ -44,77 +61,79 @@
<div fxFlex="60%" fxFlex.lt-md="50%">
{{ rolePermissionService.description }}
</div>
</div>
</mat-card-content>
</mat-card>
</div>
<div class="mat-elevation-z8 container">
<mat-card>
<ng-container>
<div fxLayout="row" class="permissionSelected">
<div fxFlex="75">
<h3>
{{'labels.buttons.Permissions' | translate }}: <strong>{{ formatName(previousGrouping) }}</strong>
{{ 'labels.buttons.Permissions' | translate }}: <strong>{{ formatName(previousGrouping) }}</strong>
</h3>
</div>
<div fxFlex= "25" fxLayout="row" fxLayout.xs="column" fxLayoutAlign="end" fxLayoutGap="5px" *ngIf="!isDisabled" class="selectDeselect">
<button mat-raised-button color="primary" (click)="selectAll()">{{'labels.buttons.Select All' | translate }}</button>
<button mat-raised-button color="default" (click)="deselectAll()">{{'labels.buttons.Deselect All' | translate }}</button>
<div
fxFlex="25"
fxLayout="row"
fxLayout.xs="column"
fxLayoutAlign="end"
fxLayoutGap="5px"
*ngIf="!isDisabled"
class="selectDeselect"
>
<button mat-raised-button color="primary" (click)="selectAll()">
{{ 'labels.buttons.Select All' | translate }}
</button>
<button mat-raised-button color="default" (click)="deselectAll()">
{{ 'labels.buttons.Deselect All' | translate }}
</button>
</div>
</div>
<div fxLayout="row">
<div fxFlex="30" fxLayout="column">
<mat-list>
<mat-list-item [ngClass]="selectedItem === grouping ? 'active' : 'inactive'" *ngFor="let grouping of groupings" (click)="showPermissions(grouping)">
<mat-list-item
[ngClass]="selectedItem === grouping ? 'active' : 'inactive'"
*ngFor="let grouping of groupings"
(click)="showPermissions(grouping)"
>
<span class="groupingName">
{{ formatName(grouping) }}
</span>
</mat-list-item>
</mat-list>
</div>
<mat-divider [vertical]="true"></mat-divider>
<div fxFlex="70" fxLayout="column" class="listPermission">
<form [formGroup]="formGroup" (submit)="submit()">
<div *ngFor="let permission of permissions.permissions" class="displayPermissions">
<div formArrayName="roster">
<div [formGroupName]="permission.id">
<mat-checkbox name="cp" id="{{ permission.code }}" formControlName="selected">
<div formArrayName="roster">
<div [formGroupName]="permission.id">
<mat-checkbox name="cp" id="{{ permission.code }}" formControlName="selected">
{{ permissionName(permission.code) }}
</mat-checkbox>
</div>
</div>
</div>
</form>
</div>
</form>
</div>
</div>
</ng-container>
<div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px" *ngIf="!isDisabled">
<mat-card-actions>
<button type="button" mat-raised-button (click)="cancel(); restoreCheckboxes();">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button color="primary" (click)="submit()">{{'labels.buttons.Submit' | translate}}</button>
<button type="button" mat-raised-button (click)="cancel(); restoreCheckboxes()">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button mat-raised-button color="primary" (click)="submit()">{{ 'labels.buttons.Submit' | translate }}</button>
</mat-card-actions>
</div>
</mat-card>
</div>