Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/Edit Administrations #754

Merged
merged 9 commits into from
Aug 24, 2024
4 changes: 2 additions & 2 deletions cypress/e2e/participant/default-tests/checkLegalDoc.cy.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export const timeout = Cypress.env('timeout');

// userId in gse-roar-admin: NZouDdq6ZwYNyFdCbnuclw2fLJ82
// userId in gse-roar-admin-dev: XAq5qOuXnNPHClK0xZXXhfGsWX22
// userId in gse-roar-admin-dev: O75V6IcVeiTwW8TRjXb76uydlwV2

describe('Test to maintain that assent form shows in when signing in with an un-assented user', () => {
it('passes', () => {
// this is a user that has an assignment of roarVocab -- how can we create a user that can
// ALWAYS play the game
let test_login = 'DO_NOT_ACCEPT_DOC';
let test_login = '[email protected]';
let test_pw = 'passwordLEGAL';
// how can we write some logic to reset the already played
cy.login(test_login, test_pw);
Expand Down
18 changes: 16 additions & 2 deletions src/components/ConsentPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</div>
</div>
<div class="flex justify-content-center mt-2">
<PvCheckbox v-model="noConsent" input-id="no-consent" class="flex" value="noConsent" />
<PvCheckbox v-model="noConsent" :binary="true" input-id="no-consent" class="flex" value="noConsent" />
<label class="ml-2 flex text-center" for="no-consent"
>This administration does not require consent or assent forms</label
>
Expand Down Expand Up @@ -547,6 +547,20 @@ function processConsentAssent(consent, targetArray) {
});
}

// Declare a computed property to watch the legal prop
const computedLegalProps = computed(() => {
return props.legal ?? {};
});

// Watch the computed property and set the noConsent value accordingly
watch(computedLegalProps, (newValue) => {
if (newValue.consent === 'No Consent') {
noConsent.value = true;
} else {
noConsent.value = false;
}
});

watch(amount, (newValue) => {
result.amount = newValue;
emit('consent-selected', result);
Expand All @@ -558,7 +572,7 @@ watch(expectedTime, (newValue) => {
});

watch(noConsent, () => {
if (noConsent.value && noConsent.value?.find((item) => item === 'noConsent')) {
if (noConsent.value) {
emit('consent-selected', 'No Consent');
} else {
emit('consent-selected', '');
Expand Down
Loading