Skip to content

Commit

Permalink
refactor(example-app): refactor to remove some old modules from examp…
Browse files Browse the repository at this point in the history
…le app
  • Loading branch information
Gabriel Guerrero committed Mar 20, 2024
1 parent 41a32e3 commit 57f2ee8
Show file tree
Hide file tree
Showing 34 changed files with 776 additions and 25,772 deletions.
17 changes: 0 additions & 17 deletions apps/example-app-e2e/.eslintrc.json

This file was deleted.

12 changes: 0 additions & 12 deletions apps/example-app-e2e/cypress.json

This file was deleted.

30 changes: 0 additions & 30 deletions apps/example-app-e2e/project.json

This file was deleted.

4 changes: 0 additions & 4 deletions apps/example-app-e2e/src/fixtures/example.json

This file was deleted.

13 changes: 0 additions & 13 deletions apps/example-app-e2e/src/integration/app.spec.ts

This file was deleted.

20 changes: 0 additions & 20 deletions apps/example-app-e2e/src/plugins/index.js

This file was deleted.

1 change: 0 additions & 1 deletion apps/example-app-e2e/src/support/app.po.ts

This file was deleted.

33 changes: 0 additions & 33 deletions apps/example-app-e2e/src/support/commands.ts

This file was deleted.

17 changes: 0 additions & 17 deletions apps/example-app-e2e/src/support/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions apps/example-app-e2e/tsconfig.e2e.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/example-app-e2e/tsconfig.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ import { input } from '@angular/core';
background-color: #009688;
}
mat-form-field {
width: 40px;
width: 50px;
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
}
`,
],
Expand Down

This file was deleted.

38 changes: 22 additions & 16 deletions apps/example-app/src/app/examples/examples-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,48 @@ const routes: Routes = [
},
{
path: 'product-list',
loadChildren: () =>
import('./product-list-page').then((m) => m.ProductListPageModule),
loadComponent: () =>
import('./product-list-page/product-list-page-container.component').then(
(m) => m.ProductListPageContainerComponent
),
},
{
path: 'product-list-paginated',
loadChildren: () =>
import('./product-list-paginated-page').then(
(m) => m.ProductListPaginatedPageModule
),
loadComponent: () =>
import(
'./product-list-paginated-page/product-list-paginated-page-container.component'
).then((m) => m.ProductListPaginatedPageContainerComponent),
},
{
path: 'product-picker',
loadChildren: () =>
import('./product-picker-page').then((m) => m.ProductPickerPageModule),
loadComponent: () =>
import(
'./product-picker-page/product-picker-page-container.component'
).then((m) => m.ProductPickerPageContainerComponent),
},
{
path: 'product-shop',
loadChildren: () =>
import('./product-shop-page').then((m) => m.ProductShopPageModule),
import('./product-shop-page/product-shop-page-routing.module').then(
(m) => m.ProductShopPageRoutingModule
),
},
{
path: 'cache-and-dropdowns',
loadChildren: () =>
import('./cache-and-dropdowns-page').then(
(m) => m.CacheAndDropdownsPageModule
),
loadComponent: () =>
import(
'./cache-and-dropdowns-page/cache-and-dropdowns-page.component'
).then((m) => m.CacheAndDropdownsPageComponent),
},
{ path: '**', redirectTo: '/not-found' },
];

@NgModule({
imports: [
RouterModule.forRoot(routes, {
scrollPositionRestoration: 'enabled',
paramsInheritanceStrategy: 'always'
}),
scrollPositionRestoration: 'enabled',
paramsInheritanceStrategy: 'always',
}),
],
exports: [RouterModule],
})
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Component, OnInit } from '@angular/core';
import { ProductActions, ProductSelectors } from './state/products';
import { combineLatest } from 'rxjs';
import { Product, ProductFilter } from '../models';
import { createSelector, Store } from '@ngrx/store';
import { map } from 'rxjs/operators';
import { Sort } from '@ngrx-traits/common';
import { MatButtonModule } from '@angular/material/button';
import { ProductListComponent } from '../components/product-list/product-list.component';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatCardModule } from '@angular/material/card';
import { AsyncPipe } from '@angular/common';
import { ProductSearchFormComponent } from '../components/product-search-form/product-search-form.component';
import { ProductsStateModule } from './state/products/products-state.module';

@Component({
selector: 'ngrx-traits-product-list-example-container',
Expand All @@ -20,9 +20,9 @@ import { AsyncPipe } from '@angular/common';
<mat-card-title>Product List</mat-card-title>
</mat-card-header>
<mat-card-content>
<!-- <product-search-form-->
<!-- (searchProduct)="filter($event)"-->
<!-- ></product-search-form>-->
<product-search-form
(searchProductChange)="filter($event)"
></product-search-form>
@if (data.isLoading) {
<mat-spinner></mat-spinner>
} @else {
Expand Down Expand Up @@ -65,10 +65,12 @@ import { AsyncPipe } from '@angular/common';
standalone: true,
imports: [
MatCardModule,
ProductsStateModule,
MatProgressSpinnerModule,
ProductListComponent,
MatButtonModule,
AsyncPipe,
ProductSearchFormComponent,
],
})
export class ProductListPageContainerComponent implements OnInit {
Expand All @@ -95,8 +97,8 @@ export class ProductListPageContainerComponent implements OnInit {
this.store.dispatch(ProductActions.checkout());
}

filter(filters: ProductFilter) {
this.store.dispatch(ProductActions.filterProducts({ filters }));
filter(filters: ProductFilter | undefined) {
filters && this.store.dispatch(ProductActions.filterProducts({ filters }));
}
// new event handler ↓
sort(sort: Sort<Product>) {
Expand Down

This file was deleted.

Loading

0 comments on commit 57f2ee8

Please sign in to comment.