Skip to content

Commit

Permalink
Student Registration Screen | SIS-201 (#97)
Browse files Browse the repository at this point in the history
* Student Lesson Registration Page Updated and Fixed.

* Student Lesson Registration Page Updated and Fixed.
  • Loading branch information
berinkrktt authored May 22, 2022
1 parent f4cc73a commit 5fd724b
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions pages/student/lesson/registration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export async function getServerSideProps(context) {
isFirstLessonRegistrationOperationsFeatureToggleEnabled: isFirstLessonRegistrationOperationsFeatureToggleEnabled,
isSecondLessonRegistrationOperationsFeatureToggleEnabled: isSecondLessonRegistrationOperationsFeatureToggleEnabled,
isLessonRegistrationExist: false,
lessons: lessonsData.response
lessons: lessonsData.response,
operationUserId: studentId,
studentId: studentId
}
}
}
Expand All @@ -88,7 +90,9 @@ export default function StudentLessonRegistration({
isSecondLessonRegistrationOperationsFeatureToggleEnabled,
isLessonRegistrationExist,
registrationData,
lessons
lessons,
operationUserId,
studentId
}) {

if (!isPagePermissionSuccess) {
Expand Down Expand Up @@ -125,14 +129,14 @@ export default function StudentLessonRegistration({
setIsOpenFailChooseLessonNotification(true);
}

let [isOpenProcessingRegistrationNotification, setIsOpenProcessingRegistrationNotification] = useState(false);
let [isOpenProcessingRegistrationLessonNotification, setIsOpenProcessingRegistrationLessonNotification] = useState(false);

function closeProcessingRegistrationNotification() {
setIsOpenProcessingRegistrationNotification(false);
function closeProcessingRegistrationLessonNotification() {
setIsOpenProcessingRegistrationLessonNotification(false);
}

function openProcessingRegistrationNotification() {
setIsOpenProcessingRegistrationNotification(true);
function openProcessingRegistrationLessonNotification() {
setIsOpenProcessingRegistrationLessonNotification(true);
}

let [isOpenSuccessRegistrationLessonNotification, setIsOpenSuccessRegistrationLessonNotification] = useState(false);
Expand Down Expand Up @@ -178,17 +182,15 @@ export default function StudentLessonRegistration({
}

const saveRegistrationLesson = async (event) => {
openProcessingRegistrationNotification();
openProcessingRegistrationLessonNotification();

event.preventDefault();
const studentId = SisStudentStorage.getNumber();
const operationUserId = SisStudentStorage.getNumber();
const studentData = await StudentLessonRegistrationController.saveStudentLessonRegistration(operationUserId, studentLessonIds, studentId);
if (studentData.success) {
closeSuccessRegistrationLessonNotification()
openSuccessRegistrationLessonNotification()
closeProcessingRegistrationLessonNotification();
openSuccessRegistrationLessonNotification();
} else {
closeFailRegistrationLessonNotification()
closeProcessingRegistrationLessonNotification();
openFailRegistrationLessonNotification();
}
}
Expand Down Expand Up @@ -679,8 +681,8 @@ export default function StudentLessonRegistration({
/>

<ProcessNotification
isOpen={isOpenProcessingRegistrationNotification}
closeNotification={closeProcessingRegistrationNotification}
isOpen={isOpenProcessingRegistrationLessonNotification}
closeNotification={closeProcessingRegistrationLessonNotification}
title="Ders Kaydınızı Danışman Onayına Gönderme İsteğiniz İşleniyor..."
/>

Expand Down

0 comments on commit 5fd724b

Please sign in to comment.