From 7a86995c1ef93a998df13f6f432873567427d845 Mon Sep 17 00:00:00 2001 From: Agit Rubar Demir <61833677+agitrubard@users.noreply.github.com> Date: Sun, 27 Mar 2022 11:21:20 +0300 Subject: [PATCH] Feature Toggle API Changes and Integrated to Note Operation Screens | SIS-148 (#60) * START_DATE and END_DATE Fields Changes in Feature Toggle API Has Been Integrated to Feature Toggle Listing Page * MIDTERM_NOTE_OPERATIONS, FINAL_NOTE_OPERATIONS and RESIT_NOTE_OPERATIONS Enums Have Been Added to FeatureToggleName.js File * Feature Toggle Controller Has Been Integrated to Teacher My Lessons Page * Feature Toggle Controller Has Been Integrated to Teacher Lesson Notes Page --- .../university/feature-toggle/index.js | 16 +++++++++++--- pages/teacher/lesson/index.js | 9 +++++++- pages/teacher/lesson/note/[lessonId]/index.js | 22 ++++++++++++++++--- .../constants/university/FeatureToggleName.js | 20 ++++++++++++++++- 4 files changed, 59 insertions(+), 8 deletions(-) diff --git a/pages/officer/operation/university/feature-toggle/index.js b/pages/officer/operation/university/feature-toggle/index.js index f2ddf664..124970b4 100644 --- a/pages/officer/operation/university/feature-toggle/index.js +++ b/pages/officer/operation/university/feature-toggle/index.js @@ -67,13 +67,13 @@ export default function FeatureToggleList({isPagePermissionSuccess, operationUse scope="col" className="select-none px-6 py-3 tracking-wider" > - OTOMATİK ETKİNLEŞTİRİLME TARİHİ + BAŞLAMA TARİHİ - STATÜSÜ + BİTİŞ TARİHİ @@ -101,7 +101,17 @@ export default function FeatureToggleList({isPagePermissionSuccess, operationUse
- {featureToggle.date} + {featureToggle.startDate} +
+
+ + + +
+
+
+ {featureToggle.endDate}
diff --git a/pages/teacher/lesson/index.js b/pages/teacher/lesson/index.js index 1b94d420..bdf30b5a 100644 --- a/pages/teacher/lesson/index.js +++ b/pages/teacher/lesson/index.js @@ -6,6 +6,8 @@ import UnauthorizedAccessPage from "../../401"; import TeacherLessonController from "../../../public/api/teacher/lesson/TeacherLessonController"; import LessonCompulsoryOrElective from "../../../public/constants/lesson/LessonCompulsoryOrElective"; import LessonStatus from "../../../public/constants/lesson/LessonStatus"; +import FeatureToggleController from "../../../public/api/university/FeatureToggleController"; +import FeatureToggleName from "../../../public/constants/university/FeatureToggleName"; export async function getServerSideProps(context) { const teacherId = SisTeacherStorage.getNumberWithContext(context); @@ -17,18 +19,21 @@ export async function getServerSideProps(context) { } } + const noteOperationsToggleData = await FeatureToggleController.isFeatureToggleEnabled(FeatureToggleName.NOTE_OPERATIONS); + const lessonsData = await TeacherLessonController.getTeacherLessonsByTeacherId(teacherId); if (lessonsData.success) { return { props: { isPagePermissionSuccess: true, + isNoteOperationsFeatureToggleEnabled: noteOperationsToggleData.response.isFeatureToggleEnabled, lessons: lessonsData.response } } } } -export default function TeacherLessonsList({isPagePermissionSuccess, lessons}) { +export default function TeacherLessonsList({isPagePermissionSuccess, isNoteOperationsFeatureToggleEnabled, lessons}) { if (!isPagePermissionSuccess) { return ( @@ -144,6 +149,8 @@ export default function TeacherLessonsList({isPagePermissionSuccess, lessons}) { {( lesson.lessonResponse.status === LessonStatus.ACTIVE + && + isNoteOperationsFeatureToggleEnabled ? + ) + } + const router = useRouter(); diff --git a/public/constants/university/FeatureToggleName.js b/public/constants/university/FeatureToggleName.js index 6d2fc6aa..74f21af1 100644 --- a/public/constants/university/FeatureToggleName.js +++ b/public/constants/university/FeatureToggleName.js @@ -6,16 +6,34 @@ const getAll = [ { enum: 'NOTE_OPERATIONS', tr: 'Not İşlemleri' + }, + { + enum: 'MIDTERM_NOTE_OPERATIONS', + tr: 'Vize Not İşlemleri' + }, + { + enum: 'FINAL_NOTE_OPERATIONS', + tr: 'Final Not İşlemleri' + }, + { + enum: 'RESIT_NOTE_OPERATIONS', + tr: 'Bütünleme Not İşlemleri' } ] const LESSON_REGISTRATION_OPERATIONS = 'LESSON_REGISTRATION_OPERATIONS'; const NOTE_OPERATIONS = 'NOTE_OPERATIONS'; +const MIDTERM_NOTE_OPERATIONS = 'MIDTERM_NOTE_OPERATIONS'; +const FINAL_NOTE_OPERATIONS = 'FINAL_NOTE_OPERATIONS'; +const RESIT_NOTE_OPERATIONS = 'RESIT_NOTE_OPERATIONS'; const FeatureToggleName = { getAll, LESSON_REGISTRATION_OPERATIONS, - NOTE_OPERATIONS + NOTE_OPERATIONS, + MIDTERM_NOTE_OPERATIONS, + FINAL_NOTE_OPERATIONS, + RESIT_NOTE_OPERATIONS }; export default FeatureToggleName; \ No newline at end of file