import {Injectable} from "@angular/core";
import {AppProgressIndicationService} from "../../app/service/app-progress-indication.service";
import {
  AppProgressIndicationComponent
} from "../../app/component/app-progress-indication.component";


@Injectable({providedIn: 'root'})
export class MfeProgressIndicationService extends AppProgressIndicationService {

  protected showProgressIndicator() {
    const options = {...this.options};
    options.container = this.getContainerForProgressIndication();
    this.ngbModalRef = this.ngbModal.open(AppProgressIndicationComponent, options);
  }

  getContainerForProgressIndication(): HTMLElement {
    return document.querySelector('mfe-webbpm')
        .shadowRoot.querySelector('[webbpm]');
  }
}
