Skip to content

Commit 1fc4dd5

Browse files
committed
address comments
1 parent 1660eaa commit 1fc4dd5

File tree

1 file changed

+41
-15
lines changed

1 file changed

+41
-15
lines changed

src/main/webapp/app/pages/apiAccessGroup/APIAccessPage.tsx

+41-15
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ function getMinorVersion(versionString: string): number | undefined {
5252
const BUTTON_CLASS_NAME = 'mr-2 my-1';
5353
const DownloadButtonGroups: React.FunctionComponent<{
5454
data: DownloadAvailabilityWithDate;
55+
authenticationStore: AuthenticationStore;
5556
}> = props => {
5657
const majorVersion = getMajorVersion(props.data.version) ?? 0;
5758
const minorVersion = getMinorVersion(props.data.version) ?? 0;
@@ -82,22 +83,43 @@ const DownloadButtonGroups: React.FunctionComponent<{
8283
buttonText="Cancer Gene List"
8384
/>
8485
) : null}
85-
{props.data.hasAllAnnotatedVariants && (
86-
<AuthDownloadButton
87-
className={BUTTON_CLASS_NAME}
88-
fileName={`all_annotated_variants_${props.data.version}.tsv`}
89-
getDownloadData={async () => {
90-
const data = await oncokbClient.utilsAllAnnotatedVariantsTxtGetUsingGET(
91-
{
92-
version: props.data.version,
93-
}
94-
);
95-
return data;
96-
}}
97-
buttonText="All Annotated Variants"
98-
/>
86+
{props.authenticationStore.account?.authorities.includes(
87+
USER_AUTHORITY.ROLE_PREMIUM_USER
88+
) && (
89+
<>
90+
{props.data.hasAllActionableVariants && (
91+
<AuthDownloadButton
92+
className={BUTTON_CLASS_NAME}
93+
fileName={`all_actionable_variants_${props.data.version}.tsv`}
94+
getDownloadData={async () => {
95+
const data = await oncokbClient.utilsAllActionableVariantsTxtGetUsingGET(
96+
{
97+
version: props.data.version,
98+
}
99+
);
100+
return data;
101+
}}
102+
buttonText="All Actionable Variants"
103+
/>
104+
)}
105+
{props.data.hasAllAnnotatedVariants && (
106+
<AuthDownloadButton
107+
className={BUTTON_CLASS_NAME}
108+
fileName={`all_annotated_variants_${props.data.version}.tsv`}
109+
getDownloadData={async () => {
110+
const data = await oncokbClient.utilsAllAnnotatedVariantsTxtGetUsingGET(
111+
{
112+
version: props.data.version,
113+
}
114+
);
115+
return data;
116+
}}
117+
buttonText="All Annotated Variants"
118+
/>
119+
)}
120+
</>
99121
)}
100-
{props.data.hasAllActionableVariants ? (
122+
{props.data.hasSqlDump ? (
101123
<>
102124
<AuthDownloadButton
103125
className={BUTTON_CLASS_NAME}
@@ -291,6 +313,7 @@ export default class APIAccessPage extends React.Component<{
291313
</p>
292314
<DownloadButtonGroups
293315
data={this.dataAvailability.result[0]}
316+
authenticationStore={this.props.authenticationStore}
294317
/>
295318

296319
{this.dataAvailability.result.length > 1 ? (
@@ -326,6 +349,9 @@ export default class APIAccessPage extends React.Component<{
326349
<Col>
327350
<DownloadButtonGroups
328351
data={this.selectedData}
352+
authenticationStore={
353+
this.props.authenticationStore
354+
}
329355
/>
330356
</Col>
331357
</Row>

0 commit comments

Comments
 (0)