Commit 6dc9440b authored by El Mghazli Yacine's avatar El Mghazli Yacine

confirm dialog

parent 1fadb0c1
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { Observable } from 'rxjs/internal/Observable'; import { Observable } from 'rxjs/internal/Observable';
import { map } from 'rxjs/internal/operators/map'; import { map } from 'rxjs/internal/operators/map';
import { mergeMap } from 'rxjs/internal/operators/mergeMap';
import { CommandsApi, IArgType, IColumn } from 'src/app/api/commands.api'; import { CommandsApi, IArgType, IColumn } from 'src/app/api/commands.api';
import { CmdCtrl } from 'src/app/controls/cmd.control'; import { CmdCtrl } from 'src/app/controls/cmd.control';
import { RowCtrl } from 'src/app/controls/row.control'; import { RowCtrl } from 'src/app/controls/row.control';
...@@ -87,7 +88,10 @@ export class CommandsComponent { ...@@ -87,7 +88,10 @@ export class CommandsComponent {
} }
onCmdSubmit(control: CmdCtrl) { onCmdSubmit(control: CmdCtrl) {
this.rows$ = this.commandsApi.runCommand$(control.api(), `${this.selectedModule!.nameFC.value}`).pipe(
this.rows$ = this.dialogService.openConfirmDialog().pipe(
mergeMap(() => this.commandsApi.runCommand$(control.api(), `${this.selectedModule!.nameFC.value}`)),
map(iresp => { map(iresp => {
this.columns = iresp.columns this.columns = iresp.columns
this.displayedColumns = this.columns.map(col => col.name) this.displayedColumns = this.columns.map(col => col.name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment