Skip to content

Commit 3dde710

Browse files
Fran McDadeFran McDade
authored andcommitted
Hide matrix service export in 'Export Selected Data Section' if 2.0. Resolves #1186.
1 parent 8a7d685 commit 3dde710

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

spa/src/app/config/config.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class ConfigService {
178178
* @returns {boolean}
179179
*/
180180
public isV2(): boolean {
181-
181+
182182
return this.version === "2.0";
183183
}
184184

spa/src/app/files/hca-get-data/hca-get-data-downloads/hca-get-data-downloads.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<hca-get-data-panel [loading]="isMatrixSupportedLoading(matrixEnabled)">
1+
<hca-get-data-panel [loading]="isMatrixSupportedLoading(matrixEnabled)" *ngIf="matrixShow">
22
<h4 class="fontsize-m semi-bold">Create Concatenated Expression Matrix</h4>
33
<ng-container *ngIf="!isMatrixSupportedLoading(matrixEnabled)">
44
<ng-container [ngSwitch]="matrixEnabled">

spa/src/app/files/hca-get-data/hca-get-data-downloads/hca-get-data-downloads.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export class HCAGetDataDownloadsComponent {
2626

2727
// Inputs
2828
@Input() matrixEnabled: boolean;
29+
@Input() matrixShow: boolean;
2930
@Input() matrixSpeciesSelectionRequired: boolean;
3031

3132
// Outputs

spa/src/app/files/hca-get-data/hca-get-data.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<ng-container *ngSwitchDefault>
1212
<div *ngIf="state.matrixSupportedLoaded" [@fadeIn]>
1313
<hca-get-data-downloads [matrixEnabled]="state.matrixSupported"
14+
[matrixShow]="state.matrixShow"
1415
[matrixSpeciesSelectionRequired]="state.matrixSpeciesSelectionRequired"
1516
(downloadSelected)="onDownloadSelected($event, state.fileFacets)"></hca-get-data-downloads>
1617
</div>

spa/src/app/files/hca-get-data/hca-get-data.component.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,20 @@ import { combineLatest, Observable, Subject } from "rxjs";
1414
import { map } from "rxjs/operators";
1515

1616
// App dependencies
17+
import { ConfigService } from "../../config/config.service";
18+
import { DownloadViewState } from "./download-view-state.model";
19+
import { FileFacet } from "../facet/file-facet/file-facet.model";
20+
import { FileFacetName } from "../facet/file-facet/file-facet-name.model";
21+
import { HCAGetDataState } from "./hca-get-data.state";
1722
import { AppState } from "../../_ngrx/app.state";
18-
import {
19-
selectSelectedEntity
20-
} from "../_ngrx/file.selectors";
2123
import { ClearIsMatrixSupportedAction } from "../_ngrx/facet/clear-is-matrix-supported.action";
24+
import { selectFacetFileFacets, selectMatrixSupported } from "../_ngrx/facet/facet.selectors";
2225
import { FetchIsMatrixSupportedRequestAction } from "../_ngrx/facet/fetch-is-matrix-supported-request.action";
26+
import { selectSelectedEntity } from "../_ngrx/file.selectors";
27+
import { selectSelectedSearchTerms } from "../_ngrx/search/search.selectors";
2328
import { EntitySelectAction } from "../_ngrx/table/table.actions";
2429
import EntitySpec from "../shared/entity-spec";
25-
import { FileFacet } from "../facet/file-facet/file-facet.model";
26-
import { DownloadViewState } from "./download-view-state.model";
27-
import { FileFacetName } from "../facet/file-facet/file-facet-name.model";
2830
import { Term } from "../shared/term.model";
29-
import { HCAGetDataState } from "./hca-get-data.state";
30-
import { selectFacetFileFacets, selectMatrixSupported } from "../_ngrx/facet/facet.selectors";
31-
import { selectSelectedSearchTerms } from "../_ngrx/search/search.selectors";
3231

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

5756
/**
57+
* @param {ConfigService} configService
5858
* @param {Router} router
5959
* @param {Store<AppState>} store
6060
*/
61-
public constructor(private router: Router,
61+
public constructor(private configService: ConfigService,
62+
private router: Router,
6263
private store: Store<AppState>) {
6364
}
6465

@@ -302,12 +303,14 @@ export class HCAGetDataComponent implements OnInit {
302303
)
303304
.pipe(
304305
map(([selectedEntity, fileFacets, matrixSupported, selectedSearchTerms]) => {
305-
306+
307+
const matrixShow = !this.configService.isV2();
306308
const matrixSpeciesSelectionRequired = this.isMatrixSpeciesSelectionRequired(fileFacets);
307309

308310
return {
309311
selectedEntity,
310312
fileFacets,
313+
matrixShow,
311314
matrixSpeciesSelectionRequired,
312315
matrixSupported,
313316
matrixSupportedLoaded: this.isMatrixSupportedLoaded(matrixSupported),

spa/src/app/files/hca-get-data/hca-get-data.state.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import EntitySpec from "../shared/entity-spec";
1313
export interface HCAGetDataState {
1414

1515
fileFacets: FileFacet[];
16+
matrixShow: boolean,
1617
matrixSpeciesSelectionRequired: boolean;
1718
matrixSupported: boolean;
1819
matrixSupportedLoaded: boolean;

0 commit comments

Comments
 (0)