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
2 changes: 1 addition & 1 deletion spa/src/app/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class ConfigService {
* @returns {boolean}
*/
public isV2(): boolean {

return this.version === "2.0";
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<hca-get-data-panel [loading]="isMatrixSupportedLoading(matrixEnabled)">
<hca-get-data-panel [loading]="isMatrixSupportedLoading(matrixEnabled)" *ngIf="!disableFeature">
<h4 class="fontsize-m semi-bold">Create Concatenated Expression Matrix</h4>
<ng-container *ngIf="!isMatrixSupportedLoading(matrixEnabled)">
<ng-container [ngSwitch]="matrixEnabled">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class HCAGetDataDownloadsComponent {
public portalURL: string;

// Inputs
@Input() disableFeature: boolean;
@Input() matrixEnabled: boolean;
@Input() matrixSpeciesSelectionRequired: boolean;

Expand Down
3 changes: 2 additions & 1 deletion spa/src/app/files/hca-get-data/hca-get-data.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<ng-container [ngSwitch]="viewState">
<ng-container *ngSwitchDefault>
<div *ngIf="state.matrixSupportedLoaded" [@fadeIn]>
<hca-get-data-downloads [matrixEnabled]="state.matrixSupported"
<hca-get-data-downloads [disableFeature]="state.disableFeature"
[matrixEnabled]="state.matrixSupported"
[matrixSpeciesSelectionRequired]="state.matrixSpeciesSelectionRequired"
(downloadSelected)="onDownloadSelected($event, state.fileFacets)"></hca-get-data-downloads>
</div>
Expand Down
25 changes: 14 additions & 11 deletions spa/src/app/files/hca-get-data/hca-get-data.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ import { combineLatest, Observable, Subject } from "rxjs";
import { map } from "rxjs/operators";

// App dependencies
import { ConfigService } from "../../config/config.service";
import { DownloadViewState } from "./download-view-state.model";
import { FileFacet } from "../facet/file-facet/file-facet.model";
import { FileFacetName } from "../facet/file-facet/file-facet-name.model";
import { HCAGetDataState } from "./hca-get-data.state";
import { AppState } from "../../_ngrx/app.state";
import {
selectSelectedEntity
} from "../_ngrx/file.selectors";
import { ClearIsMatrixSupportedAction } from "../_ngrx/facet/clear-is-matrix-supported.action";
import { selectFacetFileFacets, selectMatrixSupported } from "../_ngrx/facet/facet.selectors";
import { FetchIsMatrixSupportedRequestAction } from "../_ngrx/facet/fetch-is-matrix-supported-request.action";
import { selectSelectedEntity } from "../_ngrx/file.selectors";
import { selectSelectedSearchTerms } from "../_ngrx/search/search.selectors";
import { EntitySelectAction } from "../_ngrx/table/table.actions";
import EntitySpec from "../shared/entity-spec";
import { FileFacet } from "../facet/file-facet/file-facet.model";
import { DownloadViewState } from "./download-view-state.model";
import { FileFacetName } from "../facet/file-facet/file-facet-name.model";
import { Term } from "../shared/term.model";
import { HCAGetDataState } from "./hca-get-data.state";
import { selectFacetFileFacets, selectMatrixSupported } from "../_ngrx/facet/facet.selectors";
import { selectSelectedSearchTerms } from "../_ngrx/search/search.selectors";

@Component({
selector: "hca-get-data",
Expand All @@ -55,10 +54,12 @@ export class HCAGetDataComponent implements OnInit {
private viewState = DownloadViewState.NONE;

/**
* @param {ConfigService} configService
* @param {Router} router
* @param {Store<AppState>} store
*/
public constructor(private router: Router,
public constructor(private configService: ConfigService,
private router: Router,
private store: Store<AppState>) {
}

Expand Down Expand Up @@ -302,11 +303,13 @@ export class HCAGetDataComponent implements OnInit {
)
.pipe(
map(([selectedEntity, fileFacets, matrixSupported, selectedSearchTerms]) => {


const disableFeature = this.configService.isV2();
const matrixSpeciesSelectionRequired = this.isMatrixSpeciesSelectionRequired(fileFacets);

return {
selectedEntity,
disableFeature,
fileFacets,
matrixSpeciesSelectionRequired,
matrixSupported,
Expand Down
1 change: 1 addition & 0 deletions spa/src/app/files/hca-get-data/hca-get-data.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import EntitySpec from "../shared/entity-spec";

export interface HCAGetDataState {

disableFeature: boolean;
fileFacets: FileFacet[];
matrixSpeciesSelectionRequired: boolean;
matrixSupported: boolean;
Expand Down