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

WIP: Parent SignUp with OrgCode #527

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 19 additions & 18 deletions src/components/auth/RegisterStudent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<div class="card">
<form class="p-fluid">
<div v-for="(student, outerIndex) in state.students" :key="outerIndex" class="student-form-border">
<!-- <section class="form-section">
<!-- orgCode -->
<section class="form-section">
<div class="p-input-icon-right">
<div class="flex justify-content-between">
<label for="activationCode">Activation code <span class="required">*</span></label>
Expand Down Expand Up @@ -41,7 +42,7 @@
<small class="p-error">{{ error.$message.replace('Value', 'Activation Code') }}</small>
</span>
</span>
</section> -->
</section>
<section class="form-section">
<div class="p-input-icon-right">
<label for="studentUsername">Student Username <span class="required">*</span></label>
Expand Down Expand Up @@ -317,14 +318,14 @@ const closeErrorDialog = () => {
isDialogVisible.value = false;
};

// const noActivationCodeRef = ref(false);
const noActivationCodeRef = ref(false);
const yearOnlyCheckRef = ref(false);

const emit = defineEmits(['submit']);
const state = reactive({
students: [
{
// activationCode: '',
activationCode: '',
studentUsername: '',
password: '',
confirmPassword: '',
Expand All @@ -340,7 +341,7 @@ const state = reactive({
race: [],
hispanicEthnicity: '',
homeLanguage: [],
// noActivationCode: noActivationCodeRef.value,
noActivationCode: noActivationCodeRef.value,
yearOnlyCheck: yearOnlyCheckRef.value,
},
],
Expand All @@ -349,7 +350,7 @@ const state = reactive({
const rules = {
students: {
$each: helpers.forEach({
// activationCode: { required },
activationCode: { required },
studentUsername: { required },
password: { required, minLength: minLength(6) },
confirmPassword: { required },
Expand All @@ -365,15 +366,15 @@ const rules = {
race: {},
hispanicEthnicity: {},
homeLanguage: {},
// noActivationCode: {},
noActivationCode: {},
yearOnlyCheck: {},
}),
},
};

function addStudent() {
state.students.push({
// activationCode: '',
activationCode: '',
studentUsername: '',
password: '',
confirmPassword: '',
Expand All @@ -389,20 +390,20 @@ function addStudent() {
race: [],
hispanicEthnicity: '',
homeLanguage: [],
// noActivationCode: noActivationCodeRef.value,
noActivationCode: noActivationCodeRef.value,
yearOnlyCheck: yearOnlyCheckRef.value,
});
}

// function updateActivationCode() {
// state.students.forEach((student) => {
// if (student.noActivationCode) {
// student.activationCode = 'noActivationCode';
// } else {
// student.activationCode = '';
// }
// });
// }
function updateActivationCode() {
state.students.forEach((student) => {
if (student.noActivationCode) {
student.activationCode = 'noActivationCode';
} else {
student.activationCode = '';
}
});
}

function deleteStudentForm(student) {
if (state.students.length > 1) {
Expand Down