Skip to content

Conversation

@heathharrelson
Copy link
Contributor

@heathharrelson heathharrelson commented Oct 19, 2024

Update the download workflow to handle requests requiring approval from the data access committee (DAC):

  • Make login the first step in the workflow
  • Ask whether the user is requesting data for diabetes research
  • If the user answered that they are doing non-diabetes research, gather further information on the research purpose page
  • Persist all new fields
  • Automatically move requests related to diabetes research to APPROVED status, while non-diabetes requests move to AWAITING_APPROVAL

Screenshots

Updated overview page

localhost_3000_datasets_1_access

Login before new question

localhost_3000_datasets_1_access (1)

New diabetes research question

localhost_3000_datasets_1_access_login

New form fields for requests that require DAC approval

localhost_3000_datasets_1_access_login (1)

localhost_3000_datasets_1_access_login (2)

...

Update the download workflow to handle requests requiring approval
from the data access committee (DAC):

* Make login the first step in the workflow
* Ask whether the user is requesting data for diabetes research
* If the user answered that they are doing non-diabetes research,
  gather further information on the research purpose page
* Persist all new fields
* Automatically move requests related to diabetes research to
  APPROVED status, while non-diabetes requests move to AWAITING_APPROVAL
@heathharrelson
Copy link
Contributor Author

@kirenotneb, sorry this took so long, but I had more trouble stashing state across routes and validating the new form inputs than I expected. Hopefully things are in a good state for any refinements that need to be made while I'm out.

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://lemon-island-0734b751e-149.westus2.5.azurestaticapps.net

@heathharrelson heathharrelson changed the base branch from main to staging October 19, 2024 18:16
Comment on lines +136 to +156
const allValid = Object.keys(nonDiabetesRules)
.map((key) => {
const value = agreementFormState.value[key];
if (value === undefined || value === null) {
return false;
}
const min = nonDiabetesRules[key].min;
const max = nonDiabetesRules[key].max;
if (min || max) {
const tooLong = max ? value.trim().length > max : false;
const tooShort = min ? value.trim().length < min : false;
if (tooLong || tooShort) {
return false;
}
}
return true;
})
.every((validity) => validity);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really happy with this solution, but there doesn't seem to be a way to reactively get the validation state of the <n-form> component.

Copy link
Contributor

@kirenotneb kirenotneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it covers all the requested changes. We'll hold off merrging until we have concensus from Shannon and others.

One odd behavior that I'll want to think about is how to handle those who have an existing agreement, but now want to request a non-diabetes dataset. Currently, we don't update or create a new agreement if the purpose has changed and we lose the other details.

@kirenotneb kirenotneb merged commit 4d6d038 into staging Nov 4, 2024
2 checks passed
@kirenotneb kirenotneb deleted the dac-workflow branch November 4, 2024 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants