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

Merge pull request #48 from NKCxEIC-official/ab-dev-execute #49

Open
wants to merge 29 commits into
base: ab-dev-execute
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
eb9d864
exam-portal-added
sreekanthgodeskless Aug 21, 2022
f1c9142
exam-page-added
cureius Aug 21, 2022
855ca67
ui-fix
cureius Aug 21, 2022
d3090c7
modal-added
cureius Aug 21, 2022
8bfe964
dialog-added
cureius Aug 22, 2022
9ab8636
question-form-added
cureius Aug 23, 2022
949ca2c
add-recurring-event
cureius Aug 25, 2022
13eb032
timeline
cureius Aug 25, 2022
55b65bb
Merge branch 'frontend-dev' of https://github.com/NKCxEIC-official/ed…
cureius Aug 25, 2022
3eb2176
create class
cureius Aug 25, 2022
94df6b5
conflict-resolved
cureius Aug 25, 2022
6c9a163
dynamic-video
cureius Aug 25, 2022
8b89d4a
added-listener
cureius Aug 25, 2022
4ba4f7d
margeed-from-origin
cureius Aug 25, 2022
f780445
Merge branches 'frontend-dev' and 'frontend-dev' of https://github.co…
cureius Aug 25, 2022
52d7cb4
Merge remote-tracking branch 'origin/frontend-dev' into exam-portal
errorinc0de Aug 25, 2022
ef261b2
animation-set
cureius Aug 25, 2022
5d0c523
Merge branch 'frontend-dev' of https://github.com/NKCxEIC-official/ed…
errorinc0de Aug 25, 2022
e6e2c4d
node-package-error-fixed-for_react-lottie
cureius Aug 25, 2022
ad0e882
added poc in user
cureius Aug 25, 2022
cf41ef7
Merge pull request #48 from NKCxEIC-official/ab-dev-execute
aritrabanerjee11 Aug 25, 2022
2bbfbaf
Merge remote-tracking branch 'origin/frontend-dev' into exam-portal
errorinc0de Aug 25, 2022
30bd9ac
poc login
cureius Aug 26, 2022
e7d374b
local button
cureius Aug 26, 2022
0a2ad61
dynamic-lang
cureius Aug 26, 2022
f0cd0b6
changes
errorinc0de Aug 26, 2022
0beda37
Merge branch 'frontend-dev' of https://github.com/NKCxEIC-official/ed…
errorinc0de Aug 26, 2022
b4aa1c5
changes
errorinc0de Aug 26, 2022
f6be368
Merge pull request #50 from NKCxEIC-official/exam-portal
errorinc0de Aug 26, 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
11,194 changes: 6,318 additions & 4,876 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@
"crypto-js": "^4.1.1",
"date-fns": "^2.28.0",
"firebase": "^9.9.0",
"formik": "^2.2.9",
"history": "^5.3.0",
"i18n-react": "^0.7.0",
"i18next": "^21.9.1",
"i18next-browser-languagedetector": "^6.1.5",
"i18next-http-backend": "^1.4.1",
"lodash": "^4.17.21",
Expand All @@ -88,6 +90,7 @@
"react-hook-form": "^7.33.1",
"react-i18next": "^11.18.4",
"react-jitsi": "^1.0.4",
"react-lottie": "^1.2.3",
"react-places-autocomplete": "^7.3.0",
"react-razorpay": "^1.1.5",
"react-redux": "^8.0.2",
Expand Down
Binary file added public/static/icons/bengali_lang.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/icons/eng_lang.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/icons/english_lang.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/icons/hindi_lang.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/icons/tamil_lang.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/Form/PhoneSchema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import * as Yup from 'yup';
import 'yup-phone';

export const phoneSchema = Yup.string().phone().required();
33 changes: 33 additions & 0 deletions src/Form/Schema/AddExamSettings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as Yup from 'yup';

export const ADD_EXAM_SETTINGS_SCHEMA = Yup.object().shape({
examTitle: Yup.string().trim().required('Please enter a exam title'),
examDesc: Yup.string().trim().required('Please enter exam description'),
examSettings: Yup.array(
Yup.object({
category: Yup.string().trim().required('category is required'),
noOfQuestions: Yup.string().trim().required('No. Of questions is required'),
marksPerQuestion: Yup.string().trim().required('Marks per question is required'),
})
).min(1, 'Minimum one section is required'),
startsFrom: Yup.date()
.typeError('Please enter date in proper format - mm/dd/yyyy hh:mm (am/pm)')
.required('Exam starts from is required'),
endsOn: Yup.date()
.typeError('Please enter date in proper format - mm/dd/yyyy hh:mm (am/pm)')
.required('Exam ends on is required'),
});

export const ADD_EXAM_SETTINGS_SCHEMA_INITIAL = {
examTitle: '',
examDesc: '',
startsFrom: new Date(),
endsOn: new Date(),
examSettings: [
{
category: '',
noOfQuestions: '',
marksPerQuestion: '',
},
],
};
107 changes: 107 additions & 0 deletions src/Form/Schema/AddQuestion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import * as Yup from 'yup';

export const ADD_QUESTION_SCHEMA = Yup.object().shape({
name: Yup.string().required('Question Set Title is required'),
description: Yup.string(),
color: Yup.string(),
duration: Yup.string().required('Question Set Duration is required'),
questions: Yup.array(
Yup.object({
question: Yup.string().required('Question Title is required'),
options: Yup.array(
Yup.object({
option: Yup.string().required('Option is required'),
isCorrect: Yup.boolean().required('Correct answer is required'),
})
)
.min(2)
.max(4, 'Maximum no. of options allowed is 4'),
})
)
})
// Yup.object().shape([
// {
// questionTitle: Yup.string().required('Question Title is required'),
// options: Yup.array(
// Yup.object({
// label: Yup.string().required('Option is required'),
// correctAnswer: Yup.boolean().required('Correct answer is required'),
// })
// )
// .min(2)
// .max(4, 'Maximum no. of options allowed is 4'),
// },
// ])

// Yup.object().shape({
// questionTitle: Yup.string().required('Question Title is required'),
// options: Yup.array(
// Yup.object({
// label: Yup.string().required('Option is required'),
// correctAnswer: Yup.boolean().required('Correct answer is required'),
// })
// )
// .min(2)
// .max(4, 'Maximum no. of options allowed is 4'),
// });

//
// "values": {
// "fullName": "",
// "donationsAmount": 0,
// "termsAndConditions": false,
// "donations": [
// {
// "institution": "",
// "percentage": 0
// },
// {
// "institution": "",
// "percentage": 0
// },
// {
// "institution": "",
// "percentage": 0
// },
// {
// "institution": "",
// "percentage": 0
// },
// {
// "institution": "",
// "percentage": 0
// },
// {
// "institution": "",
// "percentage": 0
// }
// ]
// },

export const ADD_QUESTION_SCHEMA_INITIAL = [
{
name: '',
description: '',
color: '',
duration: '',
questions: [
{
question: '',
options: [
{
option: '',
isCorrect: false,
}
]
}
]
},
];

export const ADD_CATEGORY_SCHEMA = Yup.object().shape({
categoryName: Yup.string().trim().required('Category name is required'),
});

export const ADD_CATEGORY_SCHEMA_INITIAL = {
categoryName: '',
};
32 changes: 32 additions & 0 deletions src/Form/Schema/AssetForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import * as Yup from 'yup';

export const ASSETS_SCHEMA = Yup.object().shape({
assetName: Yup.string().required('Asset Name is required'),
assetId: Yup.string().required('Asset ID is required'),
});

export const ASSETS_SCHEMA_INITIAL = {
assetName: '',
assetId: '',
comment: '',
};

export const ALLOCATE_ASSET_SCHEMA = Yup.object().shape({
employee: Yup.object().required('Please select an employee'),
asset: Yup.object().required('Please select an Asset'),
});

export const ALLOCATE_ASSET_SCHEMA_INITIAL = {
employee: '',
asset: '',
};

export const REQUEST_ASSET_SCHEMA = Yup.object().shape({
asset: Yup.string().required('Please write the name / title of asset'),
specification: Yup.string().trim().required('Please write the specifications'),
});

export const REQUEST_ASSET_SCHEMA_INITIAL = {
asset: '',
specification: '',
};
137 changes: 137 additions & 0 deletions src/Form/Schema/EmployeeForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
import * as Yup from 'yup';
import moment from 'moment';

export const ADD_EMPLOYEE_SCHEMA = Yup.object().shape({
email: Yup.string().email('Must be a valid email').max(255).required('Employee email is required'),
firstName: Yup.string().required('Employee first name is required'),
lastName: Yup.string().required('Employee last name is required'),
contactNumber: Yup.string().required('Employee phone number is required'),
employeeCode: Yup.string().required('Employee Code is required'),
});

export const ADD_EMPLOYEE_SCHEMA_INITIAL = {
email: '',
firstName: '',
lastName: '',
contactNumber: '',
employeeCode: '',
};

export const ADD_EMPLOYEE_DETAILS_SCHEMA = Yup.object().shape({
jobTitle: Yup.string().required('Employee job title is required'),
startDate: Yup.string().required('Please enter a start date'),
primaryManager: Yup.object()
.shape({ label: Yup.string(), empId: Yup.string() })
.typeError('Please select a primary manager')
.required('Please select a primary manager'),
secondaryManager: Yup.object()
.shape({ label: Yup.string(), empId: Yup.string() })
.typeError('Please select a primary manager'),
probationPeriod: Yup.number()
.positive()
.min(0)
.typeError('Probation period must be a number')
.required('Please enter a probation period in month'),
allowedLeaves: Yup.number()
.positive()
.min(0)
.typeError('Allowed leaves must be in number')
.required('Please enter total number of allowed leaves'),

workHours: Yup.number()
.positive()
.typeError('Work hours must be in number')
.required('Please enter total number of work hours per day'),
salary: Yup.number().positive().typeError('Salary must be in number').required('Please enter total salary per annum'),

paySchedule: Yup.object()
.shape({ label: Yup.string() })
.typeError('Please select payment schedule')
.required('Please select payment schedule'),
});
export const ADD_EMPLOYEE_DETAILS_SCHEMA_INITIAL = {
jobTitle: '',
startDate: new Date(),
probationPeriod: '',
primaryManager: {},
secondaryManager: {},
allowedLeaves: '',
workHours: '',
salary: '',
paySchedule: {},
};

export const EMPLOYEE_PERSONAL_DETAILS_SCHEMA = Yup.object().shape({
contactNumber: Yup.string()
.required('Contact number is required')
.matches(
/^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/,
'Phone number is not valid'
),
dob: Yup.string().trim().required('Date of Birth is required'),
sex: Yup.string().trim().required('Gender is required'),
country: Yup.string().trim().required('Country is required'),
address: Yup.string()
.trim()
.min(5)
.typeError('Address must be at least 5 characters')
.required('Address is required'),
state: Yup.string().trim().min(3).typeError('Address must be at least 3 characters').required('Address is required'),
pincode: Yup.string()
.trim()
.min(3)
.typeError('Pincode must be at least 3 characters')
.required('Pincode is required'),
});

export const EMPLOYEE_PERSONAL_DETAILS_SCHEMA_INITIAL = {
contactNumber: '',
dob: moment(new Date()).subtract('years', 20),
sex: 'male',
address: '',
country: 'India',
state: '',
pincode: '',
};

export const EMPLOYEE_EMERGENCY_CONTACT_SCHEMA = Yup.object().shape({
emergencyContactNumber: Yup.string()
.required('Emergency contact number is required')
.matches(
/^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/,
'Phone number is not valid'
),
emergencyContactName: Yup.string().trim().required('Emergency contact name is required'),
emergencyContactaddress: Yup.string().trim().required('Emergency contact address is required'),
});

export const EMPLOYEE_EMERGENCY_CONTACT_SCHEMA_INITIAL = {
emergencyContactNumber: '',
emergencyContactName: '',
emergencyContactaddress: '',
};

export const EMPLOYEE_BANK_DETAILS_SCHEMA = Yup.object().shape({
bank_account_no: Yup.number().positive().required('Bank Account Number is required'),
bank_ifsc_code: Yup.string().required('Bank IFSC code is required'),
bank_account_name: Yup.string().required('Bank account name is required'),
});

export const EMPLOYEE_BANK_DETAILS_SCHEMA_INITIAL = {
bank_account_no: '',
bank_ifsc_code: '',
bank_account_name: '',
};

export const EMPLOYEE_WORK_ELIGIBILITY_SCHEMA = Yup.object().shape({});

export const EMPLOYEE_WORK_ELIGIBILITY_SCHEMA_INITIAL = {};

export const EMPLOYEE_MEDICAL_DETAILS_SCHEMA = Yup.object().shape({
medicalDisability: Yup.string().required('Employee disability details is required'),
});

export const EMPLOYEE_MEDICAL_DETAILS_SCHEMA_INITIAL = {
medicalDisability: 'false',
comment_medicalDisability: '',
};
11 changes: 11 additions & 0 deletions src/Form/Schema/Exam.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as Yup from 'yup';

export const EMAIL_VERIFY_SCHEMA = Yup.object().shape({
email: Yup.string().trim().email('Please enter a valid email address.').required('Email is required'),
agreed: Yup.boolean().isTrue('Please check the box above'),
});

export const EMAIL_VERIFY_SCHEMA_INITIAL = {
email: '',
agreed: false,
};
20 changes: 20 additions & 0 deletions src/Form/Schema/LeaveForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as Yup from 'yup';

export const ADD_LEAVE_SCHEMA = Yup.object().shape({
startDate: Yup.date().required('Please enter a Start Date'),
endDate: Yup.date().required('Please enter a End Date'),
reason: Yup.string().required('Please enter leave reason'),
title: Yup.string().required('Please enter title for leave'),
requestedTo: Yup.array().min(1, 'Please select the approval authorities for leave'),
});

export const ADD_LEAVE_SCHEMA_INITIAL = {
endDate: new Date(),
startDate: new Date(),
reason: '',
halfDay: false,
title: '',
applicantEmployeeCode: '',
requestedTo: [],
approvedBy: [],
};
19 changes: 19 additions & 0 deletions src/Form/Schema/QueryForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Yup from 'yup';

export const ADD_QUERY_SCHEMA = Yup.object().shape({
queryTitle: Yup.string().trim().required('Please enter a query title'),
message: Yup.string().trim().required('Please describe your query'),
});

export const ADD_QUERY_SCHEMA_INITIAL = {
queryTitle: '',
message: '',
};

export const ANSWER_QUERY_SCHEMA = Yup.object().shape({
answer: Yup.string().required('Answer is required'),
});

export const ANSWER_QUERY_SCHEMA_INITIAL = {
answer: '',
};
Loading