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

Student/Teacher/Officer | Password Operations Screens | SIS-116 #41

Merged
merged 61 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
42a6910
404 Not Found Page Function Has Been Renamed
agitrubard Feb 26, 2022
f291a45
UnauthorizedAccessPage Has Been Created
agitrubard Feb 26, 2022
aedc823
Authorization Check Has Been Added to StudentDashboard Page
agitrubard Feb 26, 2022
5c3f14a
UnauthorizedAccessPage Has Been Updated for User
agitrubard Feb 26, 2022
755365f
Authorization Check Has Been Updated in StudentDashboard Page
agitrubard Feb 26, 2022
4c08729
Authorization Check Has Been Added to StudentMyInformation Page
agitrubard Feb 26, 2022
e976b60
Authorization Check Has Been Updated in StudentDashboard Page
agitrubard Feb 26, 2022
b1fe83c
Authorization Check Has Been Added to StudentLessonScheduleFile Page
agitrubard Feb 26, 2022
23ffc4d
Authorization Check Has Been Added to StudentExamScheduleFile Page
agitrubard Feb 26, 2022
415df51
Authorization Check Has Been Added to TeacherMyInformation Page
agitrubard Feb 26, 2022
072c0a0
UnauthorizedAccessPage User Has Been Fixed in TeacherMyInformation Page
agitrubard Feb 26, 2022
11daf2f
Authorization Check Has Been Added to TeacherDashboard Page
agitrubard Feb 26, 2022
682d902
Authorization Check Has Been Added to TeacherExamScheduleFile Page
agitrubard Feb 26, 2022
ba5e9d8
StudentExamScheduleFile and StudentLessonScheduleFile Page Functions …
agitrubard Feb 26, 2022
a8d135c
Authorization Check Has Been Added to TeacherLessonScheduleFile Page
agitrubard Feb 26, 2022
9b0391f
Authorization Check Has Been Added to OfficerDashboard Page
agitrubard Feb 26, 2022
1064498
Authorization Check Has Been Added to OfficerMyInformation Page
agitrubard Feb 26, 2022
7c93349
homePagePath Has Been Updated for User in PageNotFound Page
agitrubard Feb 26, 2022
90f49da
Authorization Check and Data Check Have Been Added to DepartmentDetai…
agitrubard Feb 26, 2022
6474d3b
Authorization Check Has Been Added to DepartmentList Page
agitrubard Feb 26, 2022
c8ca63b
Authorization Check Has Been Added to DepartmentSave Page
agitrubard Feb 26, 2022
ca39393
Authorization Check Has Been Added to Home Page
agitrubard Feb 26, 2022
0617d51
clearCookies Method Has Been Created
agitrubard Feb 26, 2022
37102c5
Save and Get Local Storage Methods Have Been Created for Student
agitrubard Feb 26, 2022
95d220c
Save and Get Local Storage Methods Have Been Created for Teacher
agitrubard Feb 26, 2022
218d6c7
Save and Get Local Storage Methods Have Been Created for Officer
agitrubard Feb 26, 2022
c3d84fb
Save Local Storage Method Has Been Added to Student Login Page
agitrubard Feb 26, 2022
52c36a8
Save Local Storage Method Has Been Added to Teacher Login Page
agitrubard Feb 26, 2022
225c360
Save Local Storage Method Has Been Added to Officer Login Page
agitrubard Feb 26, 2022
ec47983
Get Local Storage Methods Have Been Added to Student Navbar
agitrubard Feb 26, 2022
2b727d8
Get Local Storage Methods Have Been Added to Teacher Navbar
agitrubard Feb 26, 2022
aac71b5
Get Local Storage Methods Have Been Added to Officer Navbar
agitrubard Feb 26, 2022
12b9547
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
950c568
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
ce6f020
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
101f7ee
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
466285d
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
027020c
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
309f42c
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
b455418
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
13ab52a
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
05246a8
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
41c482d
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
14cec9b
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
5bd54e9
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
44f7597
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
b9c02e4
Authorization Check and Get Local Storage Methods Have Been Added to …
agitrubard Feb 26, 2022
433fe02
SIS_FE_URL Has Been Added to .env.sis.live File
agitrubard Feb 27, 2022
5992e12
SIS_FE_URL Has Been Added to .env.sis.local File
agitrubard Feb 27, 2022
5e2eb3d
isPagePermissionSuccess Field Has Been Added to getServerSideProps
agitrubard Feb 27, 2022
9b41bad
SIS_FE_URL Has Been Added to Student Save Process
agitrubard Feb 27, 2022
da72f16
StudentForgotPassword Page Has Been Updated
agitrubard Feb 27, 2022
3c3a3e4
Student Change Password Page Has Been Created
agitrubard Feb 27, 2022
36b26e7
SIS_FE_URL Has Been Added to Teacher Save Process
agitrubard Feb 27, 2022
28bb0f0
Fail Messages Has Been Fixed in Student Change Password Page
agitrubard Feb 27, 2022
1a948a8
TeacherForgotPassword Page Has Been Updated
agitrubard Feb 27, 2022
4fae64f
Teacher Change Password Page Has Been Created
agitrubard Feb 27, 2022
c06d68f
SIS_FE_URL Has Been Added to Officer Save Process
agitrubard Mar 1, 2022
b67a8b6
SIS_FE_URL Has Been Added to Officer Forgot Password Process
agitrubard Mar 1, 2022
c238ef5
Officer Change Password Page Has Been Created
agitrubard Mar 1, 2022
979b035
Merge remote-tracking branch 'origin/master' into changePasswordScree…
agitrubard Mar 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.sis.live
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

SIS_PROFILE=live
SIS_API_URL=https://sis-be.herokuapp.com
SIS_API_URL=https://sis-be.herokuapp.com
SIS_FE_URL=https://sis-fe.herokuapp.com
3 changes: 2 additions & 1 deletion .env.sis.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

PORT=8586
SIS_PROFILE=local
SIS_API_URL=http://localhost:8585
SIS_API_URL=http://localhost:8585
SIS_FE_URL=http://localhost:8586
429 changes: 429 additions & 0 deletions pages/login/officer/change-password/[operationId]/index.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions pages/login/officer/forgot-password/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import {Dialog, Transition} from "@headlessui/react";
export async function getServerSideProps() {
return {
props: {
SIS_API_URL: process.env.SIS_API_URL
SIS_API_URL: process.env.SIS_API_URL,
SIS_FE_URL: process.env.SIS_FE_URL
}
}
}

export default function OfficerForgotPassword({SIS_API_URL}) {
export default function OfficerForgotPassword({SIS_API_URL, SIS_FE_URL}) {

const router = useRouter();

Expand Down Expand Up @@ -58,8 +59,11 @@ export default function OfficerForgotPassword({SIS_API_URL}) {
openProcessingModal();

event.preventDefault();
const res = await fetch(`${SIS_API_URL}/login/officer/forgot-password`, {
body: JSON.stringify({officerId: officerNumber}),
const res = await fetch(`${SIS_API_URL}/officer/password-operation/forgot-password`, {
body: JSON.stringify({
officerId: officerNumber,
feUrl: SIS_FE_URL
}),
headers: {'Content-Type': 'application/json'},
method: 'POST'
});
Expand Down
426 changes: 426 additions & 0 deletions pages/login/student/change-password/[operationId]/index.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions pages/login/student/forgot-password/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import {Dialog, Transition} from "@headlessui/react";
export async function getServerSideProps() {
return {
props: {
SIS_API_URL: process.env.SIS_API_URL
SIS_API_URL: process.env.SIS_API_URL,
SIS_FE_URL: process.env.SIS_FE_URL
}
}
}

export default function StudentForgotPassword({SIS_API_URL}) {
export default function StudentForgotPassword({SIS_API_URL, SIS_FE_URL}) {

const router = useRouter();

Expand Down Expand Up @@ -58,8 +59,11 @@ export default function StudentForgotPassword({SIS_API_URL}) {
openProcessingModal();

event.preventDefault();
const res = await fetch(`${SIS_API_URL}/login/student/forgot-password`, {
body: JSON.stringify({studentId: studentNumber}),
const res = await fetch(`${SIS_API_URL}/student/password-operation/forgot-password`, {
body: JSON.stringify({
studentId: studentNumber,
feUrl: SIS_FE_URL
}),
headers: {'Content-Type': 'application/json'},
method: 'POST'
});
Expand Down
426 changes: 426 additions & 0 deletions pages/login/teacher/change-password/[operationId]/index.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions pages/login/teacher/forgot-password/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import {Dialog, Transition} from "@headlessui/react";
export async function getServerSideProps() {
return {
props: {
SIS_API_URL: process.env.SIS_API_URL
SIS_API_URL: process.env.SIS_API_URL,
SIS_FE_URL: process.env.SIS_FE_URL
}
}
}

export default function TeacherForgotPassword({SIS_API_URL}) {
export default function TeacherForgotPassword({SIS_API_URL, SIS_FE_URL}) {

const router = useRouter();

Expand Down Expand Up @@ -58,8 +59,11 @@ export default function TeacherForgotPassword({SIS_API_URL}) {
openProcessingModal();

event.preventDefault();
const res = await fetch(`${SIS_API_URL}/login/teacher/forgot-password`, {
body: JSON.stringify({teacherId: teacherNumber}),
const res = await fetch(`${SIS_API_URL}/teacher/password-operation/forgot-password`, {
body: JSON.stringify({
teacherId: teacherNumber,
feUrl: SIS_FE_URL
}),
headers: {'Content-Type': 'application/json'},
method: 'POST'
});
Expand Down
7 changes: 5 additions & 2 deletions pages/officer/operation/staff/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export async function getServerSideProps(context) {
}

const SIS_API_URL = process.env.SIS_API_URL;
const SIS_FE_URL = process.env.SIS_FE_URL;
const facultyResponses = await fetch(`${SIS_API_URL}/faculty?status=ACTIVE`, {
headers: {'Content-Type': 'application/json'},
method: 'GET'
Expand All @@ -28,13 +29,14 @@ export async function getServerSideProps(context) {
isPagePermissionSuccess: true,
operationUserId: officerId,
SIS_API_URL: SIS_API_URL,
SIS_FE_URL: SIS_FE_URL,
faculties: facultyDatas.response
}
}
}
}

export default function SaveOfficer({isPagePermissionSuccess, operationUserId, SIS_API_URL, faculties}) {
export default function SaveOfficer({isPagePermissionSuccess, operationUserId, SIS_API_URL, SIS_FE_URL, faculties}) {

if (!isPagePermissionSuccess) {
return (
Expand Down Expand Up @@ -142,7 +144,8 @@ export default function SaveOfficer({isPagePermissionSuccess, operationUserId, S
phoneNumber: officerPhone
},
operationInfoRequest: {
userId: operationUserId
userId: operationUserId,
feUrl: SIS_FE_URL
},
personalInfoRequest: {
address: officerAddress,
Expand Down
19 changes: 11 additions & 8 deletions pages/officer/operation/student/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export async function getServerSideProps(context) {
}

const SIS_API_URL = process.env.SIS_API_URL;
const SIS_FE_URL = process.env.SIS_FE_URL;
const departmentResponses = await fetch(`${SIS_API_URL}/department?status=ACTIVE`, {
headers: {'Content-Type': 'application/json'},
method: 'GET'
Expand All @@ -29,14 +30,15 @@ export async function getServerSideProps(context) {
isPagePermissionSuccess: true,
operationUserId: officerId,
SIS_API_URL: SIS_API_URL,
SIS_FE_URL: SIS_FE_URL,
departments: departmentDatas.response
}
}
}
}


export default function SaveStudent({isPagePermissionSuccess, operationUserId, SIS_API_URL, departments}) {
export default function SaveStudent({isPagePermissionSuccess, operationUserId, SIS_API_URL, SIS_FE_URL, departments}) {

if (!isPagePermissionSuccess) {
return (
Expand Down Expand Up @@ -151,7 +153,8 @@ export default function SaveStudent({isPagePermissionSuccess, operationUserId, S
classLevel: studentClassLevel,
},
operationInfoRequest: {
userId: operationUserId
userId: operationUserId,
feUrl: SIS_FE_URL
},
personalInfoRequest: {
address: studentAddress,
Expand Down Expand Up @@ -250,13 +253,13 @@ export default function SaveStudent({isPagePermissionSuccess, operationUserId, S
let birthdayLength = e.target.value.length;
if (birthdayLength > 1 && birthdayLength < 3) {
if (e.target.value <= 31) {
e.target.value = e.target.value + ".";
e.target.value = e.target.value + ".";
} else {
e.target.value = "";
}
}
if (birthdayLength > 4 && birthdayLength < 7) {
e.target.value = e.target.value + ".";
e.target.value = e.target.value + ".";
}
changeStudentBirthday(e)
}}
Expand Down Expand Up @@ -298,13 +301,13 @@ export default function SaveStudent({isPagePermissionSuccess, operationUserId, S
e.target.value = "+90 (" + e.target.value;
}
if (pNumberLength > 7 && pNumberLength < 10) {
e.target.value = e.target.value + ") ";
e.target.value = e.target.value + ") ";
}
if (pNumberLength > 12 && pNumberLength < 15) {
e.target.value = e.target.value + " ";
e.target.value = e.target.value + " ";
}
if (pNumberLength > 15 && pNumberLength < 18) {
e.target.value = e.target.value + " ";
e.target.value = e.target.value + " ";
}
changeStudentPhoneNumber(e)
}}
Expand Down Expand Up @@ -575,4 +578,4 @@ export default function SaveStudent({isPagePermissionSuccess, operationUserId, S
</div>
</div>
)
}
}
7 changes: 5 additions & 2 deletions pages/officer/operation/teacher/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export async function getServerSideProps(context) {
}

const SIS_API_URL = process.env.SIS_API_URL;
const SIS_FE_URL = process.env.SIS_FE_URL;
const departmentResponses = await fetch(`${SIS_API_URL}/department?status=ACTIVE`, {
headers: {'Content-Type': 'application/json'},
method: 'GET'
Expand All @@ -29,14 +30,15 @@ export async function getServerSideProps(context) {
isPagePermissionSuccess: true,
operationUserId: officerId,
SIS_API_URL: SIS_API_URL,
SIS_FE_URL: SIS_FE_URL,
departments: departmentDatas.response
}
}
}
}


export default function SaveTeacher({isPagePermissionSuccess, operationUserId, SIS_API_URL, departments}) {
export default function SaveTeacher({isPagePermissionSuccess, operationUserId, SIS_API_URL, SIS_FE_URL, departments}) {

if (!isPagePermissionSuccess) {
return (
Expand Down Expand Up @@ -165,7 +167,8 @@ export default function SaveTeacher({isPagePermissionSuccess, operationUserId, S
role: teacherRole
},
operationInfoRequest: {
userId: operationUserId
userId: operationUserId,
feUrl: SIS_FE_URL
},
personalInfoRequest: {
address: teacherAddress,
Expand Down
1 change: 1 addition & 0 deletions pages/student/schedule/exam/file/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export async function getServerSideProps(context) {
} else {
return {
props: {
isPagePermissionSuccess: true,
examScheduleFile: null
}
}
Expand Down