diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/text-filter/text-filter.component.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/text-filter/text-filter.component.ts
index 4c9b9ed..e2b8181 100644
--- a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/text-filter/text-filter.component.ts
+++ b/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/text-filter/text-filter.component.ts
@@ -17,10 +17,10 @@ export class TextFilterComponent implements OnInit {
filterValue: string = null;
isFiltering: boolean;
filterTypes = [
- {key:'contains', value: 'Contains'},
- {key:'equal', value: 'Equal'},
- {key:'startsWith', value: 'Starts With'},
- {key:'endsWith', value: 'Ends With'}
+ {key:'Contains', value: 'Contains'},
+ {key:'Equals', value: 'Equal'},
+ {key:'Starts With', value: 'startsWith'},
+ {key:'Ends With', value: 'endsWith'}
];
filterIsOpenned: boolean = false;
diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-sorting/grid-sorting/grid-sorting.component.html b/projects/poweredsoft/ngx-bootstrap/src/lib/grid-sorting/grid-sorting/grid-sorting.component.html
index 1ae48d3..b9e62bb 100644
--- a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-sorting/grid-sorting/grid-sorting.component.html
+++ b/projects/poweredsoft/ngx-bootstrap/src/lib/grid-sorting/grid-sorting/grid-sorting.component.html
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-sorting/grid-sorting/grid-sorting.component.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/grid-sorting/grid-sorting/grid-sorting.component.ts
index 3a6f873..5043d26 100644
--- a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-sorting/grid-sorting/grid-sorting.component.ts
+++ b/projects/poweredsoft/ngx-bootstrap/src/lib/grid-sorting/grid-sorting/grid-sorting.component.ts
@@ -17,10 +17,9 @@ export class GridSortingComponent implements OnInit {
ngOnInit(): void {
}
- ascending(){
- this.isSorting = !this.isSorting;
+ sorting(){
+ this.isSorting = true;
this.isAscending = !this.isAscending;
- console.log("ascending result...")
const existingSort = this.dataSource.sorts.find(t => t.path == this.path);
if (existingSort){
existingSort.ascending = (this.isAscending)? true : false;
diff --git a/src/app/data/services/IChangeMerchantNameCommand.ts b/src/app/data/services/IChangeMerchantCommand.ts
similarity index 69%
rename from src/app/data/services/IChangeMerchantNameCommand.ts
rename to src/app/data/services/IChangeMerchantCommand.ts
index 4cc391d..6a5d769 100644
--- a/src/app/data/services/IChangeMerchantNameCommand.ts
+++ b/src/app/data/services/IChangeMerchantCommand.ts
@@ -1,11 +1,13 @@
-export interface IChangeMerchantNameCommand {
+export interface IChangeMerchantCommand {
id: string;
name: string;
address: string;
+ ordering: number;
}
export interface IAddMerchantCommand {
name: string;
address: string;
+ ordering: number;
}
export interface IRemoveMerchantCommand {
diff --git a/src/app/data/services/IMerchant.ts b/src/app/data/services/IMerchant.ts
index 98cd34f..7785995 100644
--- a/src/app/data/services/IMerchant.ts
+++ b/src/app/data/services/IMerchant.ts
@@ -2,4 +2,6 @@ export interface IMerchant {
id: string;
name: string;
address: string;
+ ordering:number;
+ openDate: Date;
}
diff --git a/src/app/data/services/merchant.service.ts b/src/app/data/services/merchant.service.ts
index eaed80f..9e689c9 100644
--- a/src/app/data/services/merchant.service.ts
+++ b/src/app/data/services/merchant.service.ts
@@ -4,7 +4,7 @@ import { IDataSource, DataSource } from '@poweredsoft/data';
import { Apollo } from 'apollo-angular';
import gql from 'graphql-tag';
import { of } from 'rxjs';
-import { IChangeMerchantNameCommand, IAddMerchantCommand, IRemoveMerchantCommand } from './IChangeMerchantNameCommand';
+import { IChangeMerchantCommand as IChangeMerchantCommand, IAddMerchantCommand, IRemoveMerchantCommand } from './IChangeMerchantCommand';
import { IMerchant } from './IMerchant';
@Injectable({
@@ -23,7 +23,7 @@ export class MerchantService {
>(
'merchants',
'GraphQLAdvanceQueryOfMerchantInput',
- 'id, name, address',
+ 'id, name, address, ordering, openDate',
(model) => model.id,
{
page: 1,
@@ -31,8 +31,8 @@ export class MerchantService {
},
true
);
-
- builder.addMutation
(
+
+ builder.addMutation(
'changeMerchant', //<-- command name
'changeMerchant', //<-- graph ql mutation name
@@ -51,10 +51,11 @@ export class MerchantService {
},
// viewModel -> transform to the form model for that command -> IChangeMerchantName
- e => of({
+ e => of({
id: e.model.id,
name: e.model.name,
- address: e.model.address
+ address: e.model.address,
+ ordering:e.model.ordering,
})
);
@@ -80,7 +81,8 @@ export class MerchantService {
// viewModel -> transform to the form model for that command -> IChangeMerchantName
e => of({
name: 'A New merchant',
- address: ''
+ address: '',
+ ordering: 11
})
);
diff --git a/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.html b/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.html
index 618f2ca..3116897 100644
--- a/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.html
+++ b/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.html
@@ -1,6 +1,4 @@
grid-filter-demo works!
-
-
@@ -10,11 +8,11 @@
[dataSource]="merchantDataSource" command="addMerchant" [template]="theModal">Create Record
-
-
+
+
ID
-
+
{{model.id}}
@@ -34,50 +32,73 @@
Name
-
+
{{model.name}}
-
+
Address
{{model.address}}
-
+
+
+
+
+ Priority
+ {{model.ordering}}
+
+
+
+
+
+
+ Open Date
+ {{model.openDate}}
+
+
+
+
+
Actions
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
Do you want to confirm?
-
-
+
Do you want to confirm?
+
+
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.ts b/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.ts
index 30b4e00..6bd9dd1 100644
--- a/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.ts
+++ b/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.ts
@@ -11,7 +11,7 @@ import { ConfirmModalService } from '@poweredsoft/ngx-bootstrap';
})
export class GridFilterDemoComponent implements OnInit {
- columns = ['id','name', 'address','commands']
+ columns = ['id','name', 'address', 'ordering','openDate', 'commands']
merchantDataSource: IDataSource;
constructor(private merchantService: MerchantService){
this.merchantDataSource = this.createDataSource();