How to use the @clr/angular.ClrLoadingState.LOADING function in @clr/angular

To help you get started, we’ve selected a few @clr/angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inspursoft / board / src / ui-adminserver / src / app / account / installation / installation.component.ts View on Github external
onStartBoard() {
    // for test
    if (this.debugMode) {
      this.startBtnState = ClrLoadingState.LOADING;
      this.submitBtnState = ClrLoadingState.LOADING;
      this.isStart = true;
      setTimeout(() => {
        this.openSSH = false;
        this.installStep += 2;
        this.ignoreStep2 = true;
        this.installProgress = 100;
        this.startBtnState = ClrLoadingState.DEFAULT;
        this.submitBtnState = ClrLoadingState.DEFAULT;
      }, 20000);
      return;
    }

    this.startBtnState = ClrLoadingState.LOADING;
    this.submitBtnState = ClrLoadingState.LOADING;
    this.isStart = true;
    this.boardService.start(this.user).subscribe(
github ForetagInc / fullstack-ts-boilerplate / libs / login / src / lib / login.component.ts View on Github external
onSubmit() {
    this.loginBtnState = ClrLoadingState.LOADING;
    const action = new AuthLogin(this.loginForm.value);

    this.store.dispatch(action).subscribe(
      () => this.handleLoginSuccess(),
      (err) => this.handleLoginError(err),
    );
  }
}
github vmware / clarity / src / dev / src / app / _utils / fake-loader.ts View on Github external
ngOnInit() {
    if (this.fake) {
      this.loading.loadingState = ClrLoadingState.LOADING;
      setTimeout(() => {
        this.load();
        this.loading.loadingState = ClrLoadingState.DEFAULT;
      }, LATENCY);
    } else {
      this.load();
    }
  }
github goharbor / harbor / src / portal / src / app / config / scanner / new-scanner-modal / new-scanner-modal.component.spec.ts View on Github external
it('test connection button should not be disabled', fakeAsync(() => {
    let nameInput = fixture.nativeElement.querySelector('#scanner-name');
    nameInput.value = "test2";
    nameInput.dispatchEvent(new Event('input'));
    let urlInput = fixture.nativeElement.querySelector('#scanner-endpoint');
    urlInput.value = "http://168.0.0.1";
    urlInput.dispatchEvent(new Event('input'));
    expect(component.canTestEndpoint).toBeTruthy();
    let el = fixture.nativeElement.querySelector('#button-test');
    el.click();
    el.dispatchEvent(new Event('click'));
    expect(component.checkBtnState).toBe(ClrLoadingState.LOADING);
    tick(10000);
    fixture.detectChanges();
    fixture.whenStable().then(() => {
       expect(component.checkBtnState).toBe(ClrLoadingState.SUCCESS);
    });
  }));
  it('add button should not be disabled', fakeAsync(() => {
github MurhafSousli / ngx-wordpress / src / app / auth / auth-page / auth-page.component.ts View on Github external
validate() {
    this.validateLoading = ClrLoadingState.LOADING;
    this.auth.validateToken().subscribe(res => {
      this.validateLoading = res.error
        ? ClrLoadingState.ERROR
        : ClrLoadingState.SUCCESS;
    });
  }
github vmware / clarity / src / ks-app / src / app / containers / buttons / buttons.component.ts View on Github external
validateDemo() {
    this.validateState = ClrLoadingState.LOADING;
    setTimeout(() => {
      this.validateState = ClrLoadingState.SUCCESS;
    }, 1500);
  }
github vmware / clarity / src / dev / src / app / buttons / button-loading.ts View on Github external
enabledDemo() {
    this.enabledState = ClrLoadingState.LOADING;
    setTimeout(() => {
      this.enabledState = ClrLoadingState.SUCCESS;
      this.enabledStateDisabled = false;
    }, 1500);
  }
github goharbor / harbor / src / portal / src / app / project / webhook / add-webhook-form / add-webhook-form.component.ts View on Github external
onTestEndpoint() {
    this.checkBtnState = ClrLoadingState.LOADING;
    this.checking = true;

    this.webhookService
      .testEndpoint(this.projectId, {
        targets: [this.webhookTarget]
      })
      .pipe(finalize(() => (this.checking = false)))
      .subscribe(
        response => {
          if (this.isModify) {
            this.inlineAlert.showInlineSuccess({
              message: "WEBHOOK.TEST_ENDPOINT_SUCCESS"
            });
          } else {
            this.checkBtnState = ClrLoadingState.SUCCESS;
          }
github goharbor / harbor / src / portal / src / app / config / scanner / new-scanner-modal / new-scanner-modal.component.ts View on Github external
create(): void {
        this.onSaving = true;
        this.saveBtnState = ClrLoadingState.LOADING;
        let scanner: Scanner = new Scanner();
        let value = this.newScannerFormComponent.newScannerForm.value;
        scanner.name = value.name;
        scanner.description = value.description;
        scanner.url = value.url;
        if (value.auth === "None") {
            scanner.auth = "";
        } else if (value.auth === "Basic") {
            scanner.auth = value.auth;
            scanner.access_credential = value.accessCredential.username + ":" + value.accessCredential.password;
        } else if (value.auth === "APIKey") {
            scanner.auth = value.auth;
            scanner.access_credential = value.accessCredential.apiKey;
        } else {
            scanner.auth = value.auth;
            scanner.access_credential = value.accessCredential.token;
github goharbor / harbor / src / portal / src / lib / components / vulnerability-scanning / result-grid.component.ts View on Github external
getProjectScanner(): void {
        this.hasEnabledScanner = false;
        this.scanBtnState = ClrLoadingState.LOADING;
        this.scanningService.getProjectScanner(this.projectId)
            .subscribe(response => {
                if (response && "{}" !== JSON.stringify(response) && !response.disabled
                    && response.health === "healthy") {
                    this.scanBtnState = ClrLoadingState.SUCCESS;
                    this.hasEnabledScanner = true;
                } else {
                    this.scanBtnState = ClrLoadingState.ERROR;
                }
            }, error => {
                this.scanBtnState = ClrLoadingState.ERROR;
            });
    }