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

6
package-lock.json generated
View File

@ -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"
}

View File

@ -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",

View File

@ -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"

View File

@ -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,

View File

@ -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)

View File

@ -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,

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"

View File

@ -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;