Skip to content

Commit

Permalink
SF-3016 Fix loading console error on collaborators component (#2771)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondLuong3 authored Oct 7, 2024
1 parent b259f2c commit 6a5ccb1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h2>{{ t(canCreateQuestion ? "manage_questions" : "my_progress") }}</h2>
{{ t("import_questions") }}
</button>
}
@if (!isLoading) {
@if (!isLoadingData) {
<button
class="add-question-button hide-lt-sm"
mat-flat-button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ng-container *transloco="let t; read: 'join'">
@if (!isLoading) {
@if (!isLoadingData) {
<h1 [innerHTML]="inviteText"></h1>
@if (!isOnline) {
<app-notice type="error" icon="cloud_off">{{ t("please_connect_to_use_link") }}</app-notice>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<mat-card-content>
<mat-card-title>{{ t("translate") }}</mat-card-title>
<div class="tool-setting">
@if (!isLoading && !isLoggedInToParatext && isAppOnline) {
@if (!isLoadingData && !isLoggedInToParatext && isAppOnline) {
<div class="paratext-login-container">
<button
class="action-button"
Expand Down Expand Up @@ -41,7 +41,7 @@
[resources]="resources"
[nonSelectableProjects]="nonSelectableProjects"
[hiddenParatextIds]="projectParatextId ? [projectParatextId] : []"
[isDisabled]="!isAppOnline || isLoading || (projectLoadingFailed && resourceLoadingFailed)"
[isDisabled]="!isAppOnline || isLoadingData || (projectLoadingFailed && resourceLoadingFailed)"
></app-project-select>
<app-write-status
[state]="getControlState('sourceParatextId')"
Expand Down Expand Up @@ -134,7 +134,7 @@
[resources]="resources"
[nonSelectableProjects]="nonSelectableProjects"
[hiddenParatextIds]="projectParatextId ? [projectParatextId] : []"
[isDisabled]="!isAppOnline || isLoading || (projectLoadingFailed && resourceLoadingFailed)"
[isDisabled]="!isAppOnline || isLoadingData || (projectLoadingFailed && resourceLoadingFailed)"
></app-project-select>
<app-write-status
[state]="getControlState('alternateSourceParatextId')"
Expand Down Expand Up @@ -168,7 +168,7 @@
[resources]="resources"
[nonSelectableProjects]="nonSelectableProjects"
[hiddenParatextIds]="projectParatextId ? [projectParatextId] : []"
[isDisabled]="!isAppOnline || isLoading || (projectLoadingFailed && resourceLoadingFailed)"
[isDisabled]="!isAppOnline || isLoadingData || (projectLoadingFailed && resourceLoadingFailed)"
></app-project-select>
<app-write-status
[state]="getControlState('alternateTrainingSourceParatextId')"
Expand Down Expand Up @@ -204,7 +204,7 @@
[resources]="resources"
[nonSelectableProjects]="nonSelectableProjects"
[hiddenParatextIds]="projectParatextId ? [projectParatextId] : []"
[isDisabled]="!isAppOnline || isLoading || (projectLoadingFailed && resourceLoadingFailed)"
[isDisabled]="!isAppOnline || isLoadingData || (projectLoadingFailed && resourceLoadingFailed)"
></app-project-select>
<app-write-status
[state]="getControlState('additionalTrainingSourceParatextId')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ <h2 id="title">{{ t("synchronize_project", { projectName: projectName }) }}</h2>
{{ t("log_in_to_paratext") }}
</button>
}
@if (isLoggedIntoParatext || isLoading || !isAppOnline) {
@if (isLoggedIntoParatext || isLoadingData || !isAppOnline) {
@if (!syncActive) {
<button
mat-flat-button
color="primary"
type="button"
(click)="syncProject()"
[disabled]="isLoading || !isAppOnline || syncDisabled"
[disabled]="isLoadingData || !isAppOnline || syncDisabled"
id="btn-sync"
>
<mat-icon>sync</mat-icon>
Expand All @@ -39,7 +39,7 @@ <h2 id="title">{{ t("synchronize_project", { projectName: projectName }) }}</h2>
mat-button
type="button"
(click)="cancelSync()"
[disabled]="isLoading || !isAppOnline || syncDisabled"
[disabled]="isLoadingData || !isAppOnline || syncDisabled"
id="btn-cancel-sync"
>
{{ t("cancel") }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export abstract class DataLoadingComponent extends SubscriptionDisposable implem
super();
}

get isLoading$(): Observable<boolean> {
get isLoadingData$(): Observable<boolean> {
return this._isLoading$.asObservable();
}

get isLoading(): boolean {
get isLoadingData(): boolean {
return this._isLoading$.value;
}

Expand All @@ -42,15 +42,15 @@ export abstract class DataLoadingComponent extends SubscriptionDisposable implem
}

protected loadingStarted(): void {
if (!this.isLoading) {
if (!this.isLoadingData) {
this.noticeService.loadingStarted();
this._isLoading$.next(true);
this._isLoaded$.next(false);
}
}

protected loadingFinished(): void {
if (this.isLoading) {
if (this.isLoadingData) {
this.noticeService.loadingFinished();
this._isLoading$.next(false);
this._isLoaded$.next(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<input matInput id="user-filter" (input)="updateSearchTerm($event.target)" />
</mat-form-field>
</div>
@if (!isLoading) {
@if (!isLoadingData) {
@if (totalRecordCount > 0) {
<table mat-table id="users-table" [dataSource]="userRows">
<ng-container matColumnDef="avatar">
Expand Down

0 comments on commit 6a5ccb1

Please sign in to comment.