@@ -18,6 +18,8 @@ import { MetadataService } from '@app/metadata/services/metadata';
1818import { ConfigService } from '@app/shared/services/config' ;
1919import { NavigationTrackingService } from '@app/shared/services/navigation' ;
2020
21+ const MAX_DATASETS = 100 ;
22+
2123/**
2224 * Component for the study page
2325 */
@@ -41,6 +43,7 @@ export class StudyDetailsComponent implements OnInit {
4143 #location = inject ( NavigationTrackingService ) ;
4244 #study = this . #metadataService. study ;
4345 #config = inject ( ConfigService ) ;
46+ #massUrl = this . #config. massUrl ;
4447 #rtsUrl = this . #config. rtsUrl ;
4548
4649 id = input . required < string > ( ) ;
@@ -52,25 +55,22 @@ export class StudyDetailsComponent implements OnInit {
5255 /**
5356 * The list of datasets queried via mass.
5457 */
55- datasetsRequest = httpResource < SearchResults > ( ( ) => {
58+ #datasetsResource = httpResource < SearchResults > ( ( ) => {
5659 return (
57- '/api/mass/search?class_name=EmbeddedDataset&filter_by=study.accession&value=' +
58- this . id ( ) +
59- '&limit=100'
60+ `${ this . #massUrl} /search?class_name=EmbeddedDataset` +
61+ `&filter_by=study.accession&value=${ this . id ( ) } &limit=${ MAX_DATASETS } `
6062 ) ;
6163 } ) . asReadonly ( ) ;
6264
63- datasets = computed ( ( ) => {
64- if ( this . datasetsRequest . hasValue ( ) ) {
65- return this . datasetsRequest . value ( ) ;
66- } else {
67- return { hits : [ ] , total : 0 } ;
68- }
69- } ) ;
70- datasetsLoading = computed ( ( ) => this . datasetsRequest . isLoading ( ) ) ;
71- datasetsError = computed ( ( ) => this . datasetsRequest . error ( ) ) ;
65+ datasets = computed ( ( ) =>
66+ this . #datasetsResource. hasValue ( )
67+ ? this . #datasetsResource. value ( )
68+ : { hits : [ ] , total : 0 } ,
69+ ) ;
70+ datasetsLoading = computed ( ( ) => this . #datasetsResource. isLoading ( ) ) ;
71+ datasetsError = computed ( ( ) => this . #datasetsResource. error ( ) ) ;
7272
73- #updateSourceEffect = effect ( ( ) => ( this . source . data = this . datasets ( ) ? .hits || [ ] ) ) ;
73+ #updateSourceEffect = effect ( ( ) => ( this . source . data = this . datasets ( ) . hits ) ) ;
7474
7575 /**
7676 * Called on component initialization
0 commit comments