Skip to content

Commit 17096a1

Browse files
authored
Hide matrix service export in 'Export Selected Data Section' if 2.0. Resolves #1186. (#1191)
1 parent baed9a9 commit 17096a1

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
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="!disableFeature">
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
@@ -25,6 +25,7 @@ export class HCAGetDataDownloadsComponent {
2525
public portalURL: string;
2626

2727
// Inputs
28+
@Input() disableFeature: boolean;
2829
@Input() matrixEnabled: boolean;
2930
@Input() matrixSpeciesSelectionRequired: boolean;
3031

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
<ng-container [ngSwitch]="viewState">
1111
<ng-container *ngSwitchDefault>
1212
<div *ngIf="state.matrixSupportedLoaded" [@fadeIn]>
13-
<hca-get-data-downloads [matrixEnabled]="state.matrixSupported"
13+
<hca-get-data-downloads [disableFeature]="state.disableFeature"
14+
[matrixEnabled]="state.matrixSupported"
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,11 +303,13 @@ export class HCAGetDataComponent implements OnInit {
302303
)
303304
.pipe(
304305
map(([selectedEntity, fileFacets, matrixSupported, selectedSearchTerms]) => {
305-
306+
307+
const disableFeature = this.configService.isV2();
306308
const matrixSpeciesSelectionRequired = this.isMatrixSpeciesSelectionRequired(fileFacets);
307309

308310
return {
309311
selectedEntity,
312+
disableFeature,
310313
fileFacets,
311314
matrixSpeciesSelectionRequired,
312315
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
@@ -12,6 +12,7 @@ import EntitySpec from "../shared/entity-spec";
1212

1313
export interface HCAGetDataState {
1414

15+
disableFeature: boolean;
1516
fileFacets: FileFacet[];
1617
matrixSpeciesSelectionRequired: boolean;
1718
matrixSupported: boolean;

0 commit comments

Comments
 (0)