deprecated manage message
This commit is contained in:
parent
fe2c6bfe02
commit
f403025ced
6
package-lock.json
generated
6
package-lock.json
generated
@ -1927,9 +1927,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@poweredsoft/data": {
|
"@poweredsoft/data": {
|
||||||
"version": "0.0.25",
|
"version": "0.0.31",
|
||||||
"resolved": "https://registry.npmjs.org/@poweredsoft/data/-/data-0.0.25.tgz",
|
"resolved": "https://registry.npmjs.org/@poweredsoft/data/-/data-0.0.31.tgz",
|
||||||
"integrity": "sha512-PUab9Q5+0eHTuxQvEyVh+iv3fwdq0lzJXq6SeS9kDIlBDYfFvvn7qiS5KTBZq+JqE+2RnlXF79agYutl4jRviA==",
|
"integrity": "sha512-J7Vl9Zk0/K3s8+n1PRUAFTDM20hi/zB8SL5ahuJVvHhc6de4fv5f19DzObwcvQeIN4PNMYD/Fhro9i0lECKlMQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^1.9.0"
|
"tslib": "^1.9.0"
|
||||||
}
|
}
|
||||||
|
16
package.json
16
package.json
@ -23,17 +23,17 @@
|
|||||||
"@angular/platform-browser": "~8.2.4",
|
"@angular/platform-browser": "~8.2.4",
|
||||||
"@angular/platform-browser-dynamic": "~8.2.4",
|
"@angular/platform-browser-dynamic": "~8.2.4",
|
||||||
"@angular/router": "~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": "^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",
|
"rxjs": "~6.5.3",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
"zone.js": "~0.9.1",
|
"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"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "~0.803.3",
|
"@angular-devkit/build-angular": "~0.803.3",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "@poweredsoft/ngx-data-apollo",
|
"name": "@poweredsoft/ngx-data-apollo",
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@poweredsoft/data": "^0.0.26",
|
"@poweredsoft/data": "^0.0.31",
|
||||||
"@angular/common": "^8.2.4",
|
"@angular/common": "^8.2.4",
|
||||||
"@angular/core": "^8.2.4",
|
"@angular/core": "^8.2.4",
|
||||||
"apollo-angular-link-http": "^1.9.0",
|
"apollo-angular-link-http": "^1.9.0",
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/common": "^8.2.4",
|
"@angular/common": "^8.2.4",
|
||||||
"@angular/core": "^8.2.4",
|
"@angular/core": "^8.2.4",
|
||||||
"@poweredsoft/data": "^0.0.26",
|
"@poweredsoft/data": "^0.0.31",
|
||||||
"rxjs": "^6.5.3"
|
"rxjs": "^6.5.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -12,7 +12,6 @@ export class HttpDataSourceOptionsBuilder<TModel, TKey> {
|
|||||||
private _keyResolver: (model: TModel) => TKey;
|
private _keyResolver: (model: TModel) => TKey;
|
||||||
private _defaultCriteria: IQueryCriteria;
|
private _defaultCriteria: IQueryCriteria;
|
||||||
private _query: IDataSourceQueryAdapterOptions<TModel>;
|
private _query: IDataSourceQueryAdapterOptions<TModel>;
|
||||||
private _manageNotificationMessage: boolean = false;
|
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient) {
|
||||||
|
|
||||||
@ -22,17 +21,11 @@ export class HttpDataSourceOptionsBuilder<TModel, TKey> {
|
|||||||
let ret: IDataSourceOptions<TModel> = {
|
let ret: IDataSourceOptions<TModel> = {
|
||||||
resolveIdField: this._keyResolver,
|
resolveIdField: this._keyResolver,
|
||||||
defaultCriteria: this._defaultCriteria,
|
defaultCriteria: this._defaultCriteria,
|
||||||
manageNotificationMessage: this._manageNotificationMessage,
|
|
||||||
transport: this.createTransport()
|
transport: this.createTransport()
|
||||||
};
|
};
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
manageNotificationMessage(shouldManage: boolean) {
|
|
||||||
this._manageNotificationMessage = shouldManage;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
createDataSource() : IDataSource<TModel>{
|
createDataSource() : IDataSource<TModel>{
|
||||||
return new DataSource<TModel>(this.createOptions());
|
return new DataSource<TModel>(this.createOptions());
|
||||||
}
|
}
|
||||||
@ -147,9 +140,15 @@ export class HttpDataSourceOptionsBuilder<TModel, TKey> {
|
|||||||
return this;
|
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 => {
|
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>> {
|
this._commands[name] = <IDataSourceCommandAdapterOptions<TModel>> {
|
||||||
|
@ -62,7 +62,6 @@ export class GenericRestDataSourceService
|
|||||||
const dataSourceOptions: IDataSourceOptions<TModel> = {
|
const dataSourceOptions: IDataSourceOptions<TModel> = {
|
||||||
defaultCriteria: defaultCriteria,
|
defaultCriteria: defaultCriteria,
|
||||||
resolveIdField: keyResolver,
|
resolveIdField: keyResolver,
|
||||||
manageNotificationMessage: manageNotificationMessage,
|
|
||||||
transport: dataSourceTransportOptions
|
transport: dataSourceTransportOptions
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user