Skip to content

Commit

Permalink
Feature: don't show the gallery if autostorage is not set (#787)
Browse files Browse the repository at this point in the history
* Disable market if storage account is not added

* Fix
  • Loading branch information
timotheeguerin authored Oct 18, 2017
1 parent 85c8fdc commit 0703ac3
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 24 deletions.
3 changes: 1 addition & 2 deletions app/components/data/data.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ import {
DataDetailsComponent,
DownloadFileGroupDialogComponent,
} from "./details";
import { StorageErrorDisplayComponent } from "./details/errors";
import { DataHomeComponent } from "./home";

const components = [
DataContainerConfigurationComponent, DataContainerFilesComponent, DataHomeComponent,
DataDefaultComponent, DataDetailsComponent, FileGroupCreateFormComponent, DeleteContainerDialogComponent,
FileGroupListComponent, FileGroupOptionsPickerComponent, FileGroupPreviewComponent, StorageErrorDisplayComponent,
FileGroupListComponent, FileGroupOptionsPickerComponent, FileGroupPreviewComponent,
DownloadFileGroupDialogComponent,
];

Expand Down
1 change: 0 additions & 1 deletion app/components/data/details/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ export * from "./data-container-configuration.component";
export * from "./data-container-files.component";
export * from "./data-default.component";
export * from "./data-details.component";
export * from "./errors";
export * from "./download-file-group-dialog";
2 changes: 2 additions & 0 deletions app/components/data/shared/data.shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { NgModule } from "@angular/core";
import { commonModules } from "app/common";
import { FileBrowseModule } from "app/components/file/browse";
import { CloudFilePickerComponent, CloudFilePickerDialogComponent } from "./cloud-file-picker";
import { StorageErrorDisplayComponent } from "./errors";
import { FileGroupPickerComponent } from "./file-group-picker";
import { FileGroupsPickerComponent } from "./file-groups-picker";

const components = [
FileGroupPickerComponent, FileGroupsPickerComponent,
CloudFilePickerComponent, CloudFilePickerDialogComponent,
StorageErrorDisplayComponent,
];

@NgModule({
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions app/components/data/shared/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./data.shared.module";
export * from "./file-group-picker";
export * from "./file-groups-picker";
export * from "./errors";
4 changes: 2 additions & 2 deletions app/components/market/home/market.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { List } from "immutable";
import { Subscription } from "rxjs";

import { Application } from "app/models";
import { NcjTemplateService } from "app/services";
import { NcjTemplateService, StorageService } from "app/services";
import { autobind } from "core-decorators";
import "./market.scss";

Expand All @@ -24,7 +24,7 @@ export class MarketComponent implements OnInit, OnDestroy {

private _subs: Subscription[] = [];

constructor(private templateService: NcjTemplateService) {
constructor(public storageService: StorageService, private templateService: NcjTemplateService) {
this._subs.push(this.quicksearch.valueChanges.subscribe((query) => {
this.query = query;
this._filterApplications();
Expand Down
41 changes: 22 additions & 19 deletions app/components/market/home/market.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<bl-scrollable>
<div class="header">
<h1>Market applications</h1>
<div class="filter">
<bl-refresh-btn [refresh]="refreshApplications" type="round"></bl-refresh-btn>
<div class="quicksearch">
<input [formControl]="quicksearch" placeholder="Search">
<bl-storage-error-display></bl-storage-error-display>
<div *ngIf="storageService.hasAutoStorage | async">
<div class="header">
<h1>Market applications</h1>
<div class="filter">
<bl-refresh-btn [refresh]="refreshApplications" type="round"></bl-refresh-btn>
<div class="quicksearch">
<input [formControl]="quicksearch" placeholder="Search">
</div>
</div>
</div>
</div>
<div class="market-first-section">
<bl-recent-template-list></bl-recent-template-list>
</div>
<div class="applications">
<mat-card class="application local-templates" title="All your local templates" routerLink="/market/local">
<i class="fa fa-desktop logo"></i>
<div class="name">Local templates</div>
</mat-card>
<mat-card *ngFor="let application of displayedApplications" class="application" [title]="application.description" [routerLink]="['/market', application.id, 'actions']">
<img class="logo" [src]="application.icon">
<div class="name">{{application.name}}</div>
</mat-card>
<div class="market-first-section">
<bl-recent-template-list></bl-recent-template-list>
</div>
<div class="applications">
<mat-card class="application local-templates" title="All your local templates" routerLink="/market/local">
<i class="fa fa-desktop logo"></i>
<div class="name">Local templates</div>
</mat-card>
<mat-card *ngFor="let application of displayedApplications" class="application" [title]="application.description" [routerLink]="['/market', application.id, 'actions']">
<img class="logo" [src]="application.icon">
<div class="name">{{application.name}}</div>
</mat-card>
</div>
</div>
</bl-scrollable>

0 comments on commit 0703ac3

Please sign in to comment.