Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BusyIndicator: Doesnt work on page container #746

Closed
Fruko opened this issue Feb 21, 2020 · 5 comments · Fixed by infor-design/enterprise#4666
Closed

BusyIndicator: Doesnt work on page container #746

Fruko opened this issue Feb 21, 2020 · 5 comments · Fixed by infor-design/enterprise#4666
Assignees
Labels
timebox Set a time limit to fix type: bug 🐛 [5] Velocity rating (Fibonacci)

Comments

@Fruko
Copy link

Fruko commented Feb 21, 2020

Describe the bug
When busy indicator is used on the div with page-container class, it shifts the whole div if busy indicator is active

To Reproduce
Steps to reproduce the behavior:

  1. Go to demo app and use this html and js for app component
<a href="#maincontent" class="skip-link" data-translate="text">SkipToMain</a>

<soho-icons *ngIf="!useUpliftIcons"></soho-icons>
<soho-icons-uplift *ngIf="useUpliftIcons"></soho-icons-uplift>

<soho-icons-empty *ngIf="!useUpliftIcons"></soho-icons-empty>
<soho-icons-empty-uplift *ngIf="useUpliftIcons"></soho-icons-empty-uplift>

<app-masthead-demo></app-masthead-demo>

<nav soho-application-menu class="is-personalizable" [filterable]="true" [openOnLarge]="false"
  [dismissOnClickMobile]="true" (menuVisibility)="onMenuVisibility($event)">
  <div soho-searchfield-wrapper>
    <label class="audible" for="application-menu-searchfield">Search</label>
    <input soho-searchfield id="application-menu-searchfield" [clearable]="true" />
  </div>
  <application-menu-demo></application-menu-demo>
</nav>
<div class="page-container no-scroll">
  <app-header-dynamic-demo></app-header-dynamic-demo>
  <div id="maincontent" class="page-container scrollable" role="main" soho-busyindicator [activated]="active$ | async" [blockUI]="true">
    <button soho-button="primary" (click)="click()">click me</button>
      <router-outlet></router-outlet>
  </div>
</div>
<div soho-personalize (changetheme)="onChangeTheme($event)"></div>
import {
  Component,
  HostBinding,
  ViewEncapsulation,
  ViewChild,
  AfterViewInit
} from '@angular/core';

import { HeaderDynamicDemoRefService } from './header/header-dynamic-demo-ref.service';
import {
  SohoPersonalizeDirective,
  SohoRenderLoopService,
  SohoApplicationMenuComponent
} from 'ids-enterprise-ng';
import {BehaviorSubject, Subject} from 'rxjs';

@Component({
  selector: 'body', // tslint:disable-line
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ],
  providers: [ HeaderDynamicDemoRefService ],
  encapsulation: ViewEncapsulation.None
})
export class AppComponent implements AfterViewInit {
  /**
   * Local Storage Key
   */
  private static IS_APPLICATION_MENU_OPEN_KEY = 'is-application-menu-open';

  @ViewChild(SohoApplicationMenuComponent, { static: true })
  public applicationMenu: SohoApplicationMenuComponent;

  @ViewChild(SohoPersonalizeDirective, { static: true }) personalize: SohoPersonalizeDirective;

  @HostBinding('class.no-scroll') get isNoScroll() { return true; }

  /**
   * Include the uplift icons only if required by the current theme, this
   * is not quite perfect, as we need to listen for the theme change here.
   * Maybe wrap all the icons into their own component?
   */
  public useUpliftIcons = false;
  public active$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);

  public personalizeOptions: SohoPersonalizeOptions = {};

  constructor(private readonly renderLoop: SohoRenderLoopService) {
    // Init render loop manually for Angular applications
    // Ensures requestAnimationFrame is running outside of Angular Zone
    this.renderLoop.start();
  }

  ngAfterViewInit(): void {

    /**
    * Note: If using an input like [triggers]="[ '.application-menu-trigger' ]"
    * hookup the app menu trigger once the afterViewInit is called. This will
    * ensure that the toolbar has had a chance to create the application-menu-trugger
    * button.
    * this.applicationMenu.triggers = [ '.application-menu-trigger' ];
    */
    if (this.isApplicationMenuOpen) {
      this.applicationMenu.openMenu(true, true);
    } else {
      this.applicationMenu.closeMenu();
    }
  }

  public get isApplicationMenuOpen(): boolean {
    const valueString = localStorage.getItem(AppComponent.IS_APPLICATION_MENU_OPEN_KEY);
    return valueString ? (valueString === 'true') : true;
  }

  public set isApplicationMenuOpen(open: boolean) {
    localStorage.setItem(AppComponent.IS_APPLICATION_MENU_OPEN_KEY, open ? 'true' : 'false');
  }

  onChangeTheme(ev: SohoPersonalizeEvent) {
    this.useUpliftIcons = ev.data.theme === 'theme-uplift-light'
      || ev.data.theme === 'theme-uplift-dark'
      || ev.data.theme === 'theme-uplift-contrast';
  }

  click() {
    this.active$.next(!this.active$.getValue());
    setTimeout(() => this.active$.next(false), 5 * 1000);
  }

  public onMenuVisibility(visible: boolean): void {
    if (this.isApplicationMenuOpen !== visible) {
      this.isApplicationMenuOpen = visible;
    }
  }
}

  1. Click on "click me" button
  2. See app getting shifted

Expected behavior
Busy indicator will not affter page layout

Version

  • ids-enterprise-ng: 6.4.1
@bthharper
Copy link
Collaborator

Glad you raised this as I was going to raise this too.

@tmcconechy
Copy link
Member

tmcconechy commented Feb 21, 2020

In this example/test we place it in the body of the page and it works well. https://master-enterprise.demo.design.infor.com/components/busyindicator/example-body.html

Perhaps that's an option. Not sure if we can guarantee all places where you place? Probably shouldn't be on the scrollable part.

@tmcconechy tmcconechy added [5] Velocity rating (Fibonacci) type: bug 🐛 labels Feb 21, 2020
@tmcconechy tmcconechy changed the title Busy indicator breaks page container BusyIndicator: Doesnt work on page container Feb 21, 2020
@bthharper
Copy link
Collaborator

@tmcconechy - any news on if we can get this looked at, we get this quite a bit in our applications.

@tmcconechy tmcconechy added this to To do in Enterprise 4.35.x (Nov 2020) Sprint via automation Oct 29, 2020
@tmcconechy
Copy link
Member

Put it in next sprint to find some time to look

@tmcconechy tmcconechy added this to To do in Enterprise 4.36.x (Dec 2020) Sprint via automation Nov 24, 2020
@tmcconechy tmcconechy added the timebox Set a time limit to fix label Dec 1, 2020
@deep7102 deep7102 self-assigned this Dec 3, 2020
@tmcconechy tmcconechy moved this from To do to In progress in Enterprise 4.36.x (Dec 2020) Sprint Dec 8, 2020
@tmcconechy tmcconechy moved this from In progress to Pending Review in Enterprise 4.36.x (Dec 2020) Sprint Dec 8, 2020
@tmcconechy tmcconechy moved this from Pending Review to Ready for QA (beta) in Enterprise 4.36.x (Dec 2020) Sprint Dec 9, 2020
@janahintal janahintal moved this from Ready for QA (beta) to Done in Enterprise 4.36.x (Dec 2020) Sprint Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
timebox Set a time limit to fix type: bug 🐛 [5] Velocity rating (Fibonacci)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants