[
https://issues.apache.org/jira/browse/METRON-1232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16202017#comment-16202017
]
ASF GitHub Bot commented on METRON-1232:
----------------------------------------
Github user merrimanr commented on a diff in the pull request:
https://github.com/apache/metron/pull/787#discussion_r144306688
--- Diff: metron-interface/metron-alerts/src/app/service/update.service.ts
---
@@ -32,13 +33,31 @@ export class UpdateService {
defaultHeaders = {'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'};
+ alertChangedSource = new Subject<PatchRequest>();
+ alertChanged$ = this.alertChangedSource.asObservable();
constructor(private http: Http) { }
public patch(patchRequest: PatchRequest): Observable<{}> {
let url = '/api/v1/update/patch';
- return this.http.patch(url, patchRequest, new RequestOptions({headers:
new Headers(this.defaultHeaders)}))
- .catch(HttpUtil.handleError);
+ let observable = Observable.create((observer => {
--- End diff --
I'm not suggesting we move the alertChangedSource call to all the
subscribing components. Instead you can move that call to a map function
similar to:
```
this.http.patch(url, patchRequest, new RequestOptions({headers: new
Headers(this.defaultHeaders)}))
.catch(HttpUtil.handleError)
.map(res => {
this.alertChangedSource.next(patchRequest);
return res;
}
.subscribe(result => reqCompleted(result));
```
> Alert status changes are not reflected in list view
> ---------------------------------------------------
>
> Key: METRON-1232
> URL: https://issues.apache.org/jira/browse/METRON-1232
> Project: Metron
> Issue Type: Bug
> Reporter: RaghuMitra
> Assignee: RaghuMitra
>
> When escalating an alert (changing its status), the list view does not
> reflect the change until a refresh occurs.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)