deprecated manage message

This commit is contained in:
David Lebee 2021-02-17 10:38:56 -05:00
parent fe2c6bfe02
commit f403025ced
6 changed files with 21 additions and 23 deletions

6
package-lock.json generated
View File

@ -1927,9 +1927,9 @@
}
},
"@poweredsoft/data": {
"version": "0.0.25",
"resolved": "https://registry.npmjs.org/@poweredsoft/data/-/data-0.0.25.tgz",
"integrity": "sha512-PUab9Q5+0eHTuxQvEyVh+iv3fwdq0lzJXq6SeS9kDIlBDYfFvvn7qiS5KTBZq+JqE+2RnlXF79agYutl4jRviA==",
"version": "0.0.31",
"resolved": "https://registry.npmjs.org/@poweredsoft/data/-/data-0.0.31.tgz",
"integrity": "sha512-J7Vl9Zk0/K3s8+n1PRUAFTDM20hi/zB8SL5ahuJVvHhc6de4fv5f19DzObwcvQeIN4PNMYD/Fhro9i0lECKlMQ==",
"requires": {
"tslib": "^1.9.0"
}

View File

@ -23,17 +23,17 @@
"@angular/platform-browser": "~8.2.4",
"@angular/platform-browser-dynamic": "~8.2.4",
"@angular/router": "~8.2.4",
"@poweredsoft/data": "0.0.25",
"@poweredsoft/data": "0.0.31",
"apollo-angular": "^1.8.0",
"apollo-angular-link-http": "^1.9.0",
"apollo-cache-inmemory": "^1.6.0",
"apollo-client": "^2.6.0",
"apollo-link": "^1.2.11",
"graphql": "^14.5.0",
"graphql-tag": "^2.10.0",
"rxjs": "~6.5.3",
"tslib": "^1.10.0",
"zone.js": "~0.9.1",
"apollo-angular-link-http": "^1.9.0",
"apollo-link": "^1.2.11",
"apollo-client": "^2.6.0",
"apollo-cache-inmemory": "^1.6.0",
"graphql-tag": "^2.10.0",
"graphql": "^14.5.0"
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.3",

View File

@ -2,7 +2,7 @@
"name": "@poweredsoft/ngx-data-apollo",
"version": "0.0.8",
"peerDependencies": {
"@poweredsoft/data": "^0.0.26",
"@poweredsoft/data": "^0.0.31",
"@angular/common": "^8.2.4",
"@angular/core": "^8.2.4",
"apollo-angular-link-http": "^1.9.0",

View File

@ -4,7 +4,7 @@
"peerDependencies": {
"@angular/common": "^8.2.4",
"@angular/core": "^8.2.4",
"@poweredsoft/data": "^0.0.26",
"@poweredsoft/data": "^0.0.31",
"rxjs": "^6.5.3"
}
}

View File

@ -12,7 +12,6 @@ export class HttpDataSourceOptionsBuilder<TModel, TKey> {
private _keyResolver: (model: TModel) => TKey;
private _defaultCriteria: IQueryCriteria;
private _query: IDataSourceQueryAdapterOptions<TModel>;
private _manageNotificationMessage: boolean = false;
constructor(private http: HttpClient) {
@ -22,17 +21,11 @@ export class HttpDataSourceOptionsBuilder<TModel, TKey> {
let ret: IDataSourceOptions<TModel> = {
resolveIdField: this._keyResolver,
defaultCriteria: this._defaultCriteria,
manageNotificationMessage: this._manageNotificationMessage,
transport: this.createTransport()
};
return ret;
}
manageNotificationMessage(shouldManage: boolean) {
this._manageNotificationMessage = shouldManage;
return this;
}
createDataSource() : IDataSource<TModel>{
return new DataSource<TModel>(this.createOptions());
}
@ -147,9 +140,15 @@ export class HttpDataSourceOptionsBuilder<TModel, TKey> {
return this;
}
public addCommandByUrl<TCommand, TCommandResult>(name: string, url: string, resolveCommandModel?: (event: IResolveCommandModelEvent<TModel>) => Observable<TCommand & any>) {
public addCommandByUrl<TCommand, TCommandResult>(name: string, url: string, resolveCommandModel?: (event: IResolveCommandModelEvent<TModel>) => Observable<TCommand & any>, beforeCommand?: (command: TCommand) => Observable<TCommand>) {
const handleWrapper = command => {
return this.http.post<TCommandResult>(url, command).pipe(catchError(this._handleErrorPipe));
const finalBeforeCommand = beforeCommand || (_ => of(command));
return finalBeforeCommand(command)
.pipe(
switchMap(finalCommand => {
return this.http.post<TCommandResult>(url, finalCommand).pipe(catchError(this._handleErrorPipe));
})
);
};
this._commands[name] = <IDataSourceCommandAdapterOptions<TModel>> {

View File

@ -62,7 +62,6 @@ export class GenericRestDataSourceService
const dataSourceOptions: IDataSourceOptions<TModel> = {
defaultCriteria: defaultCriteria,
resolveIdField: keyResolver,
manageNotificationMessage: manageNotificationMessage,
transport: dataSourceTransportOptions
};