-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Heath Harrelson <[email protected]> Co-authored-by: Erik Benton <[email protected]> Co-authored-by: Erik Benton <[email protected]> Co-authored-by: Aydawka <[email protected]> Co-authored-by: Aydan <[email protected]>
- Loading branch information
1 parent
3887a3b
commit 2c1adc0
Showing
21 changed files
with
1,043 additions
and
934 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { DownloadAgreementFormState } from "~/types/download"; | ||
|
||
/** | ||
* Provides access to the cookie where the answers about the user's research purpose are stored. | ||
*/ | ||
export default function useDownloadAgreementForm(datasetid: string) { | ||
return useState<DownloadAgreementFormState>( | ||
`dataset-${datasetid}-research-purpose-state`, | ||
() => ({}), | ||
); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
pages/datasets/[datasetid]/access/diabetes-research.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
<script setup lang="ts"> | ||
import useDownloadAgreementForm from "~/composables/useDownloadAgreementForm"; | ||
const route = useRoute(); | ||
const { datasetid } = route.params as { datasetid: string }; | ||
const { data: dataset, error } = await useDataset(datasetid); | ||
const agreementFormState = useDownloadAgreementForm(datasetid); | ||
if (error.value) { | ||
console.error(error.value); | ||
push.error({ | ||
title: "Something went wrong", | ||
message: "Failed to fetch dataset", | ||
}); | ||
throw new Error("Failed to fetch dataset"); | ||
} | ||
// TODO: Convert to a utility or extract a component? | ||
const generateCombinedFullName = (name: string) => { | ||
const nameArray = name.split(","); | ||
if (nameArray.length > 1) { | ||
return `${nameArray[1]} ${nameArray[0]}`; | ||
} else { | ||
return name; | ||
} | ||
}; | ||
const currentStep = ref<number>(3); | ||
const researchTypeSelected = computed( | ||
() => agreementFormState.value.is_diabetes_research !== null, | ||
); | ||
</script> | ||
|
||
<template> | ||
<main class="h-screen overflow-auto bg-gradient-to-b from-white to-blue-50"> | ||
<div | ||
class="mx-auto mt-10 flex w-full max-w-screen-xl items-center justify-between px-3" | ||
> | ||
<n-flex vertical> | ||
<h1>{{ dataset?.title }}</h1> | ||
|
||
<div | ||
v-for="(creator, index) in dataset?.metadata.datasetDescription | ||
.creator" | ||
:key="index" | ||
class="flex flex-row flex-wrap items-center align-middle text-black" | ||
> | ||
<!-- if on the last index create a different span --> | ||
<span class="mr-1 text-sm font-light">{{ | ||
generateCombinedFullName(creator.creatorName) | ||
}}</span> | ||
|
||
<ButtonIdentifierBadge | ||
v-if="creator?.nameIdentifier" | ||
class="pt-1" | ||
:type="creator.nameIdentifier[0]" | ||
/> | ||
|
||
<span | ||
v-if=" | ||
dataset?.metadata.datasetDescription.creator && | ||
index != dataset?.metadata.datasetDescription.creator.length - 1 | ||
" | ||
class="text-sm" | ||
> | ||
, | ||
</span> | ||
</div> | ||
|
||
<p class="hidden">{{ dataset?.description }}</p> | ||
</n-flex> | ||
|
||
<n-image | ||
src="https://raw.githubusercontent.com/AI-READI/AI-READI-logo/main/logo/png/option2.png" | ||
:alt="dataset?.title" | ||
class="size-32 h-32 w-32 rounded-lg" | ||
object-fit="contain" | ||
/> | ||
</div> | ||
|
||
<n-divider /> | ||
|
||
<div class="mx-auto w-full max-w-screen-xl px-3 pb-8"> | ||
<div class="prose mt-0 min-h-[300px] max-w-none text-black"> | ||
<h2>Access this dataset</h2> | ||
|
||
<DownloadStepNav :current-step="currentStep" /> | ||
|
||
<TransitionFade> | ||
<div> | ||
<h4>Diabetes or non-diabetes research</h4> | ||
|
||
<n-form-item | ||
label="Is your research studying type II diabetes, or is it non-diabetes research?" | ||
> | ||
<n-radio-group | ||
v-model:value="agreementFormState.is_diabetes_research" | ||
> | ||
<n-space> | ||
<n-radio :value="true" label="Diabetes research" /> | ||
|
||
<n-radio :value="false" label="Non-diabetes research" /> | ||
</n-space> | ||
</n-radio-group> | ||
</n-form-item> | ||
|
||
<NuxtLink :to="`/datasets/${dataset?.id}/access/training`"> | ||
<n-button | ||
size="large" | ||
type="info" | ||
secondary | ||
class="my-3" | ||
:disabled="!researchTypeSelected" | ||
>Next</n-button | ||
> | ||
</NuxtLink> | ||
</div> | ||
</TransitionFade> | ||
</div> | ||
</div> | ||
</main> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,29 +86,26 @@ const currentStep = ref<number>(1); | |
|
||
<TransitionFade> | ||
<div> | ||
<n-alert title="For Type 2 Diabetes Research Only" type="info"> | ||
<p class="font-bold"> | ||
This public data is for Type 2 Diabetes research only. Please do | ||
not continue through the steps for data access if that is not | ||
the focus of your research. For requests for non-Type 2 Diabetes | ||
research, please contact the | ||
<p>To obtain access to this dataset, you must:</p> | ||
|
||
<ol> | ||
<li> | ||
Authenticate using CILogon (contact the | ||
<a href="mailto:[email protected]" | ||
>AI-READI Data Access Committee</a | ||
> | ||
to begin the access process. | ||
</p> | ||
</n-alert> | ||
if you are not at a research institution) | ||
</li> | ||
|
||
<p>To obtain access to this dataset, you must:</p> | ||
<li> | ||
Indicate whether your research is related to Type 2 Diabetes | ||
</li> | ||
|
||
<ol> | ||
<li> | ||
Answer some questions about your training in research methods | ||
and ethics | ||
</li> | ||
|
||
<li>Log in using our authentication provider</li> | ||
|
||
<li> | ||
Describe the purpose of your research <br /> | ||
This information, along with your name, will be publicly shared | ||
|
@@ -125,7 +122,7 @@ const currentStep = ref<number>(1); | |
</li> | ||
</ol> | ||
|
||
<NuxtLink :to="`/datasets/${dataset?.id}/access/training`"> | ||
<NuxtLink :to="`/datasets/${dataset?.id}/access/login`"> | ||
<n-button size="large" type="info" secondary class="my-3"> | ||
Begin | ||
</n-button> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.