From e7f9f2c52d06deb103c20cd762182a45b6deb28b Mon Sep 17 00:00:00 2001 From: David Lebee Date: Fri, 3 Sep 2021 17:32:52 -0400 Subject: [PATCH] can now pass params to commands. --- package-lock.json | 6 +++--- package.json | 2 +- projects/poweredsoft/ngx-bootstrap/package.json | 3 ++- .../lib/command-modal/directives/command-modal.directive.ts | 4 +++- .../src/lib/command/directives/command.directive.ts | 4 +++- .../directives/form-group-command-modal.directive.ts | 4 +++- projects/poweredsoft/ngx-cdk-ui/package.json | 4 ++-- .../ngx-cdk-ui/src/lib/ds-command/ds-command.component.ts | 4 +++- 8 files changed, 20 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba47c49..a2ca76b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1676,9 +1676,9 @@ } }, "@poweredsoft/data": { - "version": "0.0.35", - "resolved": "https://registry.npmjs.org/@poweredsoft/data/-/data-0.0.35.tgz", - "integrity": "sha512-od4w5sorQmV/M74yHXn/xTwh6YdoYBzq79bS8F/BHBuoE2FEuY0o8JD5rime4gKqtClFvBD5O9k4aqlpNNdkpw==", + "version": "0.0.36", + "resolved": "https://registry.npmjs.org/@poweredsoft/data/-/data-0.0.36.tgz", + "integrity": "sha512-Jgns+OVwcBX/UFrgAaaOM3SGiVIlD+bXTIBkvdE0EvcxOlH1Zcqx4xB7KLAqNha7WtSzu+MvvYFPIwwjMlGUOA==", "requires": { "tslib": "^1.9.0" } diff --git a/package.json b/package.json index 24fac9b..10df4fe 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@angular/platform-browser-dynamic": "~9.1.4", "@angular/router": "~9.1.4", "@ng-select/ng-select": "^4.0.1", - "@poweredsoft/data": "0.0.35", + "@poweredsoft/data": "0.0.36", "@poweredsoft/ngx-data": "0.0.22", "@poweredsoft/ngx-data-apollo": "0.0.10", "apollo-angular": "^1.8.0", diff --git a/projects/poweredsoft/ngx-bootstrap/package.json b/projects/poweredsoft/ngx-bootstrap/package.json index dffc810..4453816 100644 --- a/projects/poweredsoft/ngx-bootstrap/package.json +++ b/projects/poweredsoft/ngx-bootstrap/package.json @@ -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" diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/directives/command-modal.directive.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/directives/command-modal.directive.ts index 57d5a5e..aa4b6ad 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/directives/command-modal.directive.ts +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/command-modal/directives/command-modal.directive.ts @@ -25,6 +25,7 @@ export class CommandModalDirective { @Input() disableValidationSummary: boolean; @Input() backdrop: boolean; @Input() ignoreBackdropClick: boolean; + @Input() params: any; @Output() success: EventEmitter = new EventEmitter(); @@ -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, diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/command/directives/command.directive.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/command/directives/command.directive.ts index 03b3b44..a19a343 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/lib/command/directives/command.directive.ts +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/command/directives/command.directive.ts @@ -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) diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/form-group-command-modal/directives/form-group-command-modal.directive.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/form-group-command-modal/directives/form-group-command-modal.directive.ts index 05df693..2c14e09 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/lib/form-group-command-modal/directives/form-group-command-modal.directive.ts +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/form-group-command-modal/directives/form-group-command-modal.directive.ts @@ -31,6 +31,7 @@ export class FormGroupCommandModalDirective { @Input() cancelText: string; @Input() backdrop: boolean; @Input() ignoreBackdropClick: boolean; + @Input() params: any; @Output() formCreate: EventEmitter = new EventEmitter(); @@ -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 = { commandName: this.command, diff --git a/projects/poweredsoft/ngx-cdk-ui/package.json b/projects/poweredsoft/ngx-cdk-ui/package.json index c8fc20b..08ebafe 100644 --- a/projects/poweredsoft/ngx-cdk-ui/package.json +++ b/projects/poweredsoft/ngx-cdk-ui/package.json @@ -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" diff --git a/projects/poweredsoft/ngx-cdk-ui/src/lib/ds-command/ds-command.component.ts b/projects/poweredsoft/ngx-cdk-ui/src/lib/ds-command/ds-command.component.ts index 19f8b6f..d779939 100644 --- a/projects/poweredsoft/ngx-cdk-ui/src/lib/ds-command/ds-command.component.ts +++ b/projects/poweredsoft/ngx-cdk-ui/src/lib/ds-command/ds-command.component.ts @@ -24,6 +24,7 @@ export class DsCommandComponent implements OnInit, OnDestroy { private _refreshOnSuccess: boolean = true; + @Input() params: any; @Input() dataSource: IDataSource; @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;