Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/components/account/browse/account-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { autobind } from "core-decorators";
import { List } from "immutable";
import { Observable } from "rxjs";

import { LoadingStatus } from "app/components/base/loading";
import { AccountResource } from "app/models";
import { AccountService, SubscriptionService } from "app/services";
import { Filter, FilterBuilder, FilterMatcher, Operator } from "app/utils/filter-builder";
Expand All @@ -22,6 +23,7 @@ export class AccountListComponent {
public get filter(): Filter { return this._filter; }

public displayedAccounts: Observable<List<AccountResource>>;
public loadingStatus: LoadingStatus = LoadingStatus.Loading;

private _filter: Filter = FilterBuilder.none();

Expand All @@ -31,6 +33,10 @@ export class AccountListComponent {
sidebarManager: SidebarManager,
subscriptionService: SubscriptionService) {
this._updateDisplayedAccounts();

this.accountService.accountsLoaded.filter(x => x).first().subscribe(() => {
this.loadingStatus = LoadingStatus.Ready;
});
}

@autobind()
Expand Down
1 change: 1 addition & 0 deletions app/components/account/browse/account-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ <h4 bl-quick-list-item-title>{{account.name}}</h4>
</div>
</bl-quick-list-item>
</bl-quick-list>
<bl-loading [status]="loadingStatus"></bl-loading>
1 change: 1 addition & 0 deletions app/services/account.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class AccountService {
private subscriptionService: SubscriptionService) {

this.accountLoaded = this._accountLoaded.asObservable();
this.accountsLoaded = this._accountsLoaded.asObservable();
this._accountLoaded.next(true);
this.accounts = this._accounts.asObservable();
this._currentAccount.subscribe((selection) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe("AccountListComponent", () => {

beforeEach(() => {
accountService = {
accountsLoaded: Observable.of(true),
accounts: Observable.of([
Fixtures.account.create({ id: "acc-1", name: "Batch 1", location: "westus", subscription: sub1 }),
Fixtures.account.create({ id: "acc-2", name: "Account 2", location: "eastus", subscription: sub1 }),
Expand Down