mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-09 20:15:07 +00:00
(apps/ecommerce/inventory) Performance improvements, decreased the mockApi delay
This commit is contained in:
parent
cfca19dc68
commit
95bc7dc4db
|
@ -50,7 +50,7 @@ export class ECommerceInventoryMockApi
|
||||||
// @ Products - GET
|
// @ Products - GET
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
this._fuseMockApiService
|
this._fuseMockApiService
|
||||||
.onGet('api/apps/ecommerce/inventory/products', 625)
|
.onGet('api/apps/ecommerce/inventory/products', 300)
|
||||||
.reply(({request}) => {
|
.reply(({request}) => {
|
||||||
|
|
||||||
// Get available queries
|
// Get available queries
|
||||||
|
|
|
@ -221,6 +221,14 @@
|
||||||
mat-cell
|
mat-cell
|
||||||
*matCellDef="let product"
|
*matCellDef="let product"
|
||||||
[attr.colspan]="productsTableColumns.length">
|
[attr.colspan]="productsTableColumns.length">
|
||||||
|
<ng-container *ngIf="selectedProduct?.id === product.id">
|
||||||
|
<ng-container *ngTemplateOutlet="rowDetailsTemplate; context: {$implicit: product}"></ng-container>
|
||||||
|
</ng-container>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<ng-template
|
||||||
|
#rowDetailsTemplate
|
||||||
|
let-product>
|
||||||
<div
|
<div
|
||||||
class="shadow-lg overflow-hidden"
|
class="shadow-lg overflow-hidden"
|
||||||
[@expandCollapse]="selectedProduct?.id === product.id ? 'expanded' : 'collapsed'">
|
[@expandCollapse]="selectedProduct?.id === product.id ? 'expanded' : 'collapsed'">
|
||||||
|
@ -403,7 +411,7 @@
|
||||||
<!-- Tags -->
|
<!-- Tags -->
|
||||||
<ng-container *ngIf="selectedProduct && selectedProduct.tags.length">
|
<ng-container *ngIf="selectedProduct && selectedProduct.tags.length">
|
||||||
<span class="font-semibold">Tags</span>
|
<span class="font-semibold">Tags</span>
|
||||||
<div class="mt-1 rounded-md border shadow-sm overflow-hidden">
|
<div class="mt-1 rounded-md border border-gray-300 shadow-sm overflow-hidden">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="flex items-center my-2 mx-3">
|
<div class="flex items-center my-2 mx-3">
|
||||||
<div class="flex items-center flex-auto min-w-0">
|
<div class="flex items-center flex-auto min-w-0">
|
||||||
|
@ -525,7 +533,7 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</ng-template>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<tr
|
<tr
|
||||||
|
|
|
@ -239,9 +239,6 @@ export class InventoryListComponent implements OnInit, AfterViewInit, OnDestroy
|
||||||
// Set the selected product
|
// Set the selected product
|
||||||
this.selectedProduct = product;
|
this.selectedProduct = product;
|
||||||
|
|
||||||
// Mark for check
|
|
||||||
this._changeDetectorRef.markForCheck();
|
|
||||||
|
|
||||||
// Fill the form
|
// Fill the form
|
||||||
this.selectedProductForm.patchValue(product);
|
this.selectedProductForm.patchValue(product);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user