Chore: Upgraded to Angular v17 and all the refactoring for that

Chore: Updated all dependencies in overlord
This commit is contained in:
2024-04-30 12:48:11 +05:30
parent 43cb697737
commit 34b4227148
89 changed files with 776 additions and 613 deletions
@@ -38,17 +38,21 @@
formControlName="account"
autocomplete="off"
/>
<mat-hint *ngIf="accBal">
Balance as on Date: <strong>{{ accBal.date | currency: 'INR' | accounting }}</strong> / Final balance:
<strong>{{ accBal.total | currency: 'INR' | accounting }}</strong>
</mat-hint>
@if (accBal) {
<mat-hint>
Balance as on Date: <strong>{{ accBal.date | currency: 'INR' | accounting }}</strong> / Final balance:
<strong>{{ accBal.total | currency: 'INR' | accounting }}</strong>
</mat-hint>
}
<mat-autocomplete
#autoA="matAutocomplete"
autoActiveFirstOption
[displayWith]="displayFn"
(optionSelected)="accountSelected($event)"
>
<mat-option *ngFor="let account of accounts | async" [value]="account">{{ account.name }}</mat-option>
@for (account of accounts | async; track account) {
<mat-option [value]="account">{{ account.name }}</mat-option>
}
</mat-autocomplete>
</mat-form-field>
<mat-form-field class="flex-auto basis-1/5">
@@ -75,7 +79,9 @@
[displayWith]="displayFn"
(optionSelected)="productSelected($event)"
>
<mat-option *ngFor="let product of products | async" [value]="product">{{ product.name }}</mat-option>
@for (product of products | async; track product) {
<mat-option [value]="product">{{ product.name }}</mat-option>
}
</mat-autocomplete>
</mat-form-field>
<mat-form-field class="flex-auto basis-1/10 mr-5">
@@ -155,12 +161,14 @@
<textarea matInput matAutosizeMinRows="5" formControlName="narration"></textarea>
</mat-form-field>
<div class="flex flex-row justify-center items-stretch mr-5">
<div class="img-container" class="flex-auto mr-5 basis-1/5" *ngFor="let item of voucher.files">
<img [src]="item.thumbnail" (click)="zoomImage(item)" />
<button mat-icon-button class="overlay" (click)="deleteImage(item)">
<mat-icon>delete</mat-icon>
</button>
</div>
@for (item of voucher.files; track item) {
<div class="img-container" class="flex-auto mr-5 basis-1/5">
<img [src]="item.thumbnail" (click)="zoomImage(item)" />
<button mat-icon-button class="overlay" (click)="deleteImage(item)">
<mat-icon>delete</mat-icon>
</button>
</div>
}
<div class="img-container" class="flex flex-auto basis-1/5">
<label ng-href for="fileUp">
<img
@@ -183,24 +191,25 @@
<button mat-raised-button color="primary" (click)="save()" [disabled]="!canSave()" class="mr-5">
{{ voucher.id ? 'Update' : 'Save' }}
</button>
<button
mat-raised-button
(click)="post()"
*ngIf="voucher.id"
[disabled]="voucher.posted || !auth.allowed('post-vouchers')"
class="mr-5"
>
{{ voucher.posted ? 'Posted' : 'Post' }}
</button>
<button mat-raised-button color="warn" (click)="confirmDelete()" *ngIf="voucher.id" [disabled]="!canSave()">
Delete
</button>
@if (voucher.id) {
<button
mat-raised-button
(click)="post()"
[disabled]="voucher.posted || !auth.allowed('post-vouchers')"
class="mr-5"
>
{{ voucher.posted ? 'Posted' : 'Post' }}
</button>
<button mat-raised-button color="warn" (click)="confirmDelete()" [disabled]="!canSave()">Delete</button>
}
<span class="fill-remaining-space"></span>
<span *ngIf="voucher.id" class="flex">
Created on&nbsp;<strong>{{ voucher.creationDate | localTime }}</strong
>&nbsp;and Last Edited on&nbsp; <strong>{{ voucher.lastEditDate | localTime }}</strong
>&nbsp;by&nbsp; <strong>{{ voucher.user.name }}</strong
>. {{ voucher.poster ? 'Posted by ' + voucher.poster : '' }}
</span>
@if (voucher.id) {
<span class="flex">
Created on&nbsp;<strong>{{ voucher.creationDate | localTime }}</strong
>&nbsp;and Last Edited on&nbsp; <strong>{{ voucher.lastEditDate | localTime }}</strong
>&nbsp;by&nbsp; <strong>{{ voucher.user.name }}</strong
>. {{ voucher.poster ? 'Posted by ' + voucher.poster : '' }}
</span>
}
</mat-card-actions>
</mat-card>