Commit 01157bca authored by Alexandre Lagane's avatar Alexandre Lagane
Browse files

fix(frontend): remove services on bus deletion

Close #462
parent 313885c2
Loading
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -67,12 +67,20 @@ export class BusesEffects {
      withLatestFrom(this.store$),
      filter(([action, state]) => !!state.buses.byId[action.payload.id]),
      map(([action, state]) => {
        const { id, reason } = action.payload;
        const { id, reason, content } = action.payload;
        const bus = state.buses.byId[id];

        this.notifications.info(bus.name, reason);

        return new Buses.Removed(bus);
        return batchActions([
          new Endpoints.Clean(),
          new Interfaces.Clean(),
          new Services.Clean(),
          new Endpoints.Added(toJsTable(content.endpoints)),
          new Interfaces.Added(toJsTable(content.interfaces)),
          new Services.Added(toJsTable(content.services)),
          new Buses.Removed(bus),
        ]);
      })
    );

+11 −1
Original line number Diff line number Diff line
@@ -138,7 +138,17 @@ export namespace SseActions {
  export const BusDeletedType = '[Sse] Bus deleted';
  export class BusDeleted implements Action {
    readonly type = BusDeletedType;
    constructor(public readonly payload: { id: string; reason: string }) {}
    constructor(
      public readonly payload: {
        id: string;
        reason: string;
        content: {
          endpoints: { [key: string]: IEndpointBackendSSE };
          interfaces: { [key: string]: IInterfaceBackendSSE };
          services: { [key: string]: IServiceBackendSSE };
        };
      }
    ) {}
  }

  export const WorkspaceDeletedSse = 'WORKSPACE_DELETED';