Skip to content

Commit ed7981b

Browse files
author
David Lebee
committed
litle fancy touches :P
1 parent da4e77b commit ed7981b

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

AcmeWeb/AcmeWeb.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageReference Include="Bogus" Version="24.3.1" />
1515
<PackageReference Include="Microsoft.AspNetCore.App" />
1616
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
17-
<PackageReference Include="PoweredSoft.DynamicQuery" Version="1.0.3" />
17+
<PackageReference Include="PoweredSoft.DynamicQuery" Version="1.0.4" />
1818
</ItemGroup>
1919

2020
</Project>

AcmeWeb/spa/src/pages/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="d-flex">
44
<div class="align-self-center p-2 d-flex-shrink-1">Route: </div>
55
<div class="align-self-center p-2 w-100">
6-
<select [(ngModel)]="route" class="form-control">
6+
<select [(ngModel)]="route" class="form-control" (change)="routeChanged()">
77
<option *ngFor="let r of routes" [value]="r">{{r}}</option>
88
</select>
99
</div>

AcmeWeb/spa/src/pages/home/home.component.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { Subject } from "rxjs";
99
})
1010
export class HomeComponent
1111
{
12-
13-
criteria: IQueryCriteria = {
12+
defaultCriteria: IQueryCriteria = {
1413
filters: [],
1514
sorts: [],
1615
groups: [],
@@ -19,6 +18,8 @@ export class HomeComponent
1918
page: 1
2019
};
2120

21+
criteria: IQueryCriteria;
22+
2223
route: string = 'api/tickets';
2324
routes: string[] = ['api/orders', 'api/order-items', 'api/items', 'api/customers', 'api/tickets', 'api/tasks'];
2425
lastResult: any;
@@ -51,8 +52,8 @@ export class HomeComponent
5152
'LastOrDefault'
5253
];
5354

54-
constructor(private dynamicQueryService: DynamicQueryService) {
55-
55+
constructor(private dynamicQueryService: DynamicQueryService) {
56+
this.reset();
5657
}
5758

5859
removeSort(sort: ISort) {
@@ -115,6 +116,15 @@ export class HomeComponent
115116
this.go();
116117
}
117118

119+
reset() {
120+
this.lastResult = "press go to start";
121+
this.criteria = { ... this.defaultCriteria };
122+
}
123+
124+
routeChanged() {
125+
this.reset();
126+
}
127+
118128
groupingSample() {
119129
if (this.route == 'api/tickets') {
120130
this.criteria = {

0 commit comments

Comments
 (0)