can now pass params to commands.

This commit is contained in:
David Lebee
2021-09-03 17:32:52 -04:00
parent 21a93e1a1a
commit e7f9f2c52d
8 changed files with 20 additions and 11 deletions
@@ -1,12 +1,13 @@
{
"name": "@poweredsoft/ngx-bootstrap",
"version": "0.0.12",
"version": "0.0.13",
"description": "an internal use libary for handling data souces grid filtering sorting, add commands etc",
"keywords": [
"angular",
"ngx-bootstrap"
],
"peerDependencies": {
"@poweredsoft/data": "^0.0.36",
"@angular/common": "^9.1.9",
"@angular/core": "^9.1.9",
"ngx-bootstrap": "^5.6.1"
@@ -25,6 +25,7 @@ export class CommandModalDirective {
@Input() disableValidationSummary: boolean;
@Input() backdrop: boolean;
@Input() ignoreBackdropClick: boolean;
@Input() params: any;
@Output() success: EventEmitter<any> = new EventEmitter<any>();
@@ -32,7 +33,8 @@ export class CommandModalDirective {
wasClicked() {
this.dataSource.resolveCommandModelByName({
command: this.command,
model: this.model
model: this.model,
params: this.params
}).subscribe(commandModel => {
const initialState = {
dataSource: this.dataSource,
@@ -16,6 +16,7 @@ export class CommandDirective {
@Input() model: any;
@Input() refreshOnSuccess: boolean;
@Input() animated: boolean;
@Input() params: any;
@Input() confirm: boolean;
@Input() confirmMessage: string;
@@ -31,7 +32,8 @@ export class CommandDirective {
private doCommand() {
this.dataSource.resolveCommandModelByName({
command: this.command,
model: this.model
model: this.model,
params: this.params
}).subscribe(commandModel => {
this.loading.emit(true);
this.dataSource.executeCommandByName(this.command, commandModel)
@@ -31,6 +31,7 @@ export class FormGroupCommandModalDirective {
@Input() cancelText: string;
@Input() backdrop: boolean;
@Input() ignoreBackdropClick: boolean;
@Input() params: any;
@Output() formCreate: EventEmitter<IModelFormCreateEvent> = new EventEmitter<IModelFormCreateEvent>();
@@ -43,7 +44,8 @@ export class FormGroupCommandModalDirective {
wasClicked() {
this.dataSource.resolveCommandModelByName({
command: this.command,
model: this.model
model: this.model,
params: this.params,
}).subscribe(commandModel => {
const event = <IModelFormCreateEvent>{
commandName: this.command,
+2 -2
View File
@@ -1,10 +1,10 @@
{
"name": "@poweredsoft/ngx-cdk-ui",
"version": "0.0.16",
"version": "0.0.17",
"peerDependencies": {
"@angular/common": "^9.1.9",
"@angular/core": "^9.1.9",
"@poweredsoft/data": "^0.0.35"
"@poweredsoft/data": "^0.0.36"
},
"dependencies": {
"tslib": "^1.10.0"
@@ -24,6 +24,7 @@ export class DsCommandComponent implements OnInit, OnDestroy {
private _refreshOnSuccess: boolean = true;
@Input() params: any;
@Input() dataSource: IDataSource<any>;
@Input() name: string;
@Input() model: any;
@@ -131,7 +132,8 @@ export class DsCommandComponent implements OnInit, OnDestroy {
resolveModel() {
this.dataSource.resolveCommandModelByName({
model: this.model,
command: this.name
command: this.name,
params: this.params
}).subscribe(
commandModel => {
this.command = commandModel;