File tree 2 files changed +19
-1
lines changed
viewModelBuilders/azul/hca-dcp/common
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ export interface ProjectResponse {
88
88
contributedAnalyses : ProjectResponseContributedAnalyses ;
89
89
contributors : ContributorResponse [ ] ;
90
90
dataUseRestriction : string | null ;
91
+ duosId : string | null ;
91
92
estimatedCellCount : number | null ;
92
93
laboratory : ( string | null ) [ ] ;
93
94
matrices : ProjectResponseMatrices ;
Original file line number Diff line number Diff line change @@ -2180,12 +2180,20 @@ function getProjectCallToAction(
2180
2180
if ( ! isReady || isAccessGranted ) {
2181
2181
return null ;
2182
2182
}
2183
+
2184
+ // Get the DUOS ID from the project API response. Use the generic DUOS URL if the project does not hav
2185
+ // a DUOS ID.
2186
+ const duosId = getProjectDuosId ( projectsResponse ) ;
2187
+ const ctaUrl = duosId
2188
+ ? `https://duos.org/dataset/${ duosId } `
2189
+ : "https://duos.org/datalibrary/HCA" ;
2190
+
2183
2191
return C . BackPageHeroActions ( {
2184
2192
callToActionProps : {
2185
2193
callToAction : {
2186
2194
label : "Request Access" ,
2187
2195
target : ANCHOR_TARGET . BLANK ,
2188
- url : "https://duos.org/datalibrary/HCA" ,
2196
+ url : ctaUrl ,
2189
2197
} ,
2190
2198
} ,
2191
2199
linkProps : {
@@ -2196,6 +2204,15 @@ function getProjectCallToAction(
2196
2204
} ) ;
2197
2205
}
2198
2206
2207
+ /**
2208
+ * Returns the DUOS ID from the project API response.
2209
+ * @param projectsResponse - Response model return from project API.
2210
+ * @returns DUOS ID.
2211
+ */
2212
+ function getProjectDuosId ( projectsResponse : ProjectsResponse ) : string {
2213
+ return processEntityValue ( projectsResponse . projects , "duosId" , LABEL . EMPTY ) ;
2214
+ }
2215
+
2199
2216
/**
2200
2217
* Returns project file formats from the projects API response.
2201
2218
* @param projectsResponse - Response returned from projects API response.
You can’t perform that action at this time.
0 commit comments