Skip to content

Commit

Permalink
Merge branch 'release-1.0.0' into reassign
Browse files Browse the repository at this point in the history
  • Loading branch information
Aar-if authored Jul 30, 2024
2 parents 221f9d2 + 0e6a7bf commit e5d8b4e
Show file tree
Hide file tree
Showing 61 changed files with 951 additions and 829 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
}
],
"prefer-const": "error",
"react-hooks/exhaustive-deps": "error"
"react-hooks/exhaustive-deps": "off"
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Shiksha is a next-generation scalable open-source learning solution for teachers
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## new changes

### Prerequisites

<table>
Expand Down
2 changes: 1 addition & 1 deletion app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ export const fullWidthPages = [
'/500',
'/offline',
'/unauthorized',
];
];
11 changes: 8 additions & 3 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
"MY_PROFILE": "My Profile",
"VIEW_MORE": "View More",
"VIEW_LESS": "View Less",
"DATA_RANAGE": "Data Range",
"DATA_RANGE": "Data Range",
"LEARNER_DETAILS": "Learner Details",
"VIEW_DAY_WISE": "View Day-Wise",
"SUBMITTED_ON": "Submitted On",
Expand Down Expand Up @@ -266,8 +266,8 @@
"STEP_2": "Use the calendar to view day-wise attendance of learners",
"STEP_3": "Check daily attendance percentage for each Center",
"STEP_4": "Mark each day’s attendance of learners",
"STEP_5": "Check Center attendance over the last 7 days",
"STEP_6": "View learners with low attendance in the past 7 days",
"STEP_5": "Check Center attendance over the last {{numberOfDays}} days",
"STEP_6": "View learners with low attendance in the past {{numberOfDays}} days",
"PREVIOUS": "Previous",
"NEXT": "Next",
"SKIP": "Skip",
Expand Down Expand Up @@ -428,5 +428,10 @@
"MIN_LENGTH_CHARACTERS_ERROR": "Minimum {{minLength}} characters required",
"MAX_LENGTH_CHARACTERS_ERROR": "Maximum {{maxLength}} characters allowed",
"NUMBER_AND_SPECIAL_CHARACTERS_NOT_ALLOWED": "Numbers and special characters are not allowed"
},
"COURSE_PLANNER": {
"COURSE_PLANNER": "Course Plan",
"FOUNDATION_COURSE": "Foundation Course",
"MAIN_COURSE": "Main Course"
}
}
6 changes: 3 additions & 3 deletions public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"MY_PROFILE": "मेरी प्रोफ़ाइल",
"VIEW_MORE": "अधिक देखें",
"VIEW_LESS": "कम देखें",
"DATA_RANAGE": "डेटा रेंज़",
"DATA_RANGE": "डेटा रेंज़",
"LEARNER_DETAILS": "विद्यार्थी विवरण",
"VIEW_DAY_WISE": "दिन-वार देखें",
"SUBMITTED_ON": "प्रस्तुत किया गया",
Expand Down Expand Up @@ -243,8 +243,8 @@
"STEP_2": "शिक्षार्थियों की दिन-वार उपस्थिति देखने के लिए कैलेंडर का उपयोग करें",
"STEP_3": "प्रत्येक केंद्र के लिए दैनिक उपस्थिति प्रतिशत की जाँच करें",
"STEP_4": "शिक्षार्थियों की प्रत्येक दिन की उपस्थिति को चिह्नित करें",
"STEP_5": "पिछले 7 दिनों में केंद्र की उपस्थिति की जाँच करें",
"STEP_6": "पिछले 7 दिनों में कम उपस्थिति वाले शिक्षार्थियों को देखें",
"STEP_5": "पिछले {{numberOfDays}} दिनों में केंद्र की उपस्थिति की जाँच करें",
"STEP_6": "पिछले {{numberOfDays}} दिनों में कम उपस्थिति वाले शिक्षार्थियों को देखें",
"PREVIOUS": "पिछला",
"NEXT": "अगला",
"SKIP": "छोड़ें",
Expand Down
6 changes: 3 additions & 3 deletions public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"MY_PROFILE": "माझी प्रोफाइल",
"VIEW_MORE": "अधिक पाहा",
"VIEW_LESS": "कमी करा",
"DATA_RANAGE": "डेटा श्रेणी",
"DATA_RANGE": "डेटा श्रेणी",
"LEARNER_DETAILS": "विद्यार्थी तपशील",
"VIEW_DAY_WISE": "दिवस-निहाय पहा",
"SUBMITTED_ON": "सादर केले",
Expand Down Expand Up @@ -243,8 +243,8 @@
"STEP_2": "शिक्षार्थ्यांची दिवसवार उपस्थिती पाहण्यासाठी कॅलेंडर वापरा",
"STEP_3": "प्रत्येक केंद्रासाठी दैनंदिन उपस्थिती टक्केवारी तपासा",
"STEP_4": "शिक्षार्थ्यांची प्रत्येक दिवसाची उपस्थिती चिन्हांकित करा",
"STEP_5": "शेवटच्या 7 दिवसांत केंद्राची उपस्थिती तपासा",
"STEP_6": "शेवटच्या 7 दिवसांत कमी उपस्थिती असलेले शिक्षार्थी पहा",
"STEP_5": "शेवटच्या {{numberOfDays}} दिवसांत केंद्राची उपस्थिती तपासा",
"STEP_6": "शेवटच्या {{numberOfDays}} दिवसांत कमी उपस्थिती असलेले शिक्षार्थी पहा",
"PREVIOUS": "मागील",
"NEXT": "पुढे",
"SKIP": "वगळा",
Expand Down
10 changes: 4 additions & 6 deletions public/locales/or/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"AS_OF_TODAY_DATE": "ଆଜି ଅନୁସାରେ {{day_date}}",
"LEARNER": "ଶିକ୍ଷାର୍ଥୀ",
"ATTENDANCE_COMPARISON": "ଉପସ୍ଥିତି ତୁଳନ",
"CENTER_TYPE":"କେନ୍ଦ୍ର ପ୍ରକାର",
"CENTER_TYPE": "କେନ୍ଦ୍ର ପ୍ରକାର",
"BLOCK_AVERAGE_ATTENDANCE": "ବ୍ଲକ ହାରାହାର ଉପସ୍ଥିତି"
},
"ATTENDANCE": {
Expand Down Expand Up @@ -151,7 +151,7 @@
"MY_PROFILE": "ମୋ ପ୍ରୋଫାଇଲ",
"VIEW_MORE": "ଅଧିକ ଦେଖନ୍ତୁ",
"VIEW_LESS": "କମ୍ ଦେଖନ୍ତୁ",
"DATA_RANAGE": "ଡାଟା ରେଞ୍ଜ",
"DATA_RANGE": "ଡାଟା ରେଞ୍ଜ",
"LEARNER_DETAILS": "ଶିକ୍ଷାର୍ଥୀ ବିବରଣୀ",
"VIEW_DAY_WISE": "ଦିନ-ଅନୁସାରେ ବିବରଣୀ ଦେଖନ୍ତୁ",
"SUBMITTED_ON": "ସବ୍ମିଟ୍/ଦାଖଲ କରାଯାଇଛି",
Expand Down Expand Up @@ -220,12 +220,10 @@
"REQUEST_TO_DELETE": "ହଟାଇବାକୁ ଅନୁରୋଧ",
"RENAME": "ପୁନ ame ନାମ କରନ୍ତୁ",
"CENTER_RENAMED": "କେନ୍ଦ୍ରର ନାମ ସଫଳତାର ସହ ଚାଲିଛି!",
"SEND_REQUEST":"ଅନୁରୋଧ ପଠାନ୍ତୁ",
"SEND_REQUEST": "ଅନୁରୋଧ ପଠାନ୍ତୁ",
"REQUEST_TO_DELETE_HAS_BEEN_SENT": "ହଟାଇବାକୁ ଅନୁରୋଧ ପଠାଯାଇଛି",
"YOU_ARE_SENDING_REQUEST_TO_THE_STATE_ADMIN": "ଆପଣ ଏହି କେନ୍ଦ୍ରଟିକୁ ବିଲୋପ କରିବା ପାଇଁ ରାଜ୍ୟ ପ୍ରଶାସନକୁ ଅନୁରୋଧ ପଠାଉଛନ୍ତି",
"THE_USER_BELONGS_TO_THE_FOLLOWING_COHORT": "ୟୁଜର ନିମ୍ନଲିଖିତ ସମୁହର ସଦସ୍ୟ: ",
"PLEASE_REMOVE_THE_USER_FROM_COHORT": "ଦୟାକରି ହଟାଇବା ପୂର୍ବରୁ ୟୁଜରକୁ ଏହି ସମୁହଗୁଡିକରୁ କାଢ଼ି ଦିଅନ୍ତୁ।"

}
}

}
50 changes: 22 additions & 28 deletions src/components/AddFacilitator.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import { FormContext, FormContextType } from '@/utils/app.constant';
import {
GenerateSchemaAndUiSchema,
customFields,
} from '@/components/GeneratedSchemas';
import { FormContext, FormContextType, RoleId } from '@/utils/app.constant';
import React, { useEffect } from 'react';

import { Box } from '@mui/material';
import DynamicForm from '@/components/DynamicForm';
import { Field } from '@/utils/Interfaces';
import { FormData } from '@/utils/Interfaces';
import { IChangeEvent } from '@rjsf/core';
import ISubmitEvent from '@rjsf/core';
import { RJSFSchema } from '@rjsf/utils';
import SendCredentialModal from '@/components/SendCredentialModal';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { createUser, getFormRead } from '@/services/CreateUserService';
import { RoleId } from '@/utils/app.constant';
import SimpleModal from '@/components/SimpleModal';
import { createUser, getFormRead } from '@/services/CreateUserService';
import { generateUsernameAndPassword } from '@/utils/Helper';
import { Field, FormData } from '@/utils/Interfaces';
import { IChangeEvent } from '@rjsf/core';
import { RJSFSchema } from '@rjsf/utils';
import { useTranslation } from 'next-i18next';

interface AddFacilitatorModalprops {
Expand All @@ -41,10 +36,11 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
FormContextType.TEACHER
);
console.log('sortedFields', response);
let centerOptionsList;
if (typeof window !== 'undefined' && window.localStorage) {
const CenterList = localStorage.getItem('CenterList');
const centerOptions = CenterList ? JSON.parse(CenterList) : [];
var centerOptionsList = centerOptions.map(
centerOptionsList = centerOptions.map(
(center: { cohortId: string; cohortName: string }) => ({
value: center.cohortId,
label: center.cohortName,
Expand Down Expand Up @@ -114,7 +110,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({

const { username, password } = generateUsernameAndPassword('MH', 'F');

let apiBody: any = {
const apiBody: any = {
username: username,
password: password,
tenantCohortRoleMapping: [
Expand All @@ -138,27 +134,25 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
if (typeof fieldValue !== 'object') {
apiBody[fieldKey] = fieldValue;
}
} else if (
Object.hasOwn(fieldSchema, 'isDropdown') ||
Object.hasOwn(fieldSchema, 'isCheckbox')
) {
apiBody.customFields.push({
fieldId: fieldId,
value: [String(fieldValue)],
});
} else {
if (
fieldSchema?.hasOwnProperty('isDropdown') ||
fieldSchema.hasOwnProperty('isCheckbox')
) {
apiBody.customFields.push({
fieldId: fieldId,
value: [String(fieldValue)],
});
} else {
apiBody.customFields.push({
fieldId: fieldId,
value: String(fieldValue),
});
}
apiBody.customFields.push({
fieldId: fieldId,
value: String(fieldValue),
});
}
});

if (typeof window !== 'undefined' && window.localStorage) {
var teamLeaderData = JSON.parse(
localStorage.getItem('teamLeadApp') || ''
const teamLeaderData = JSON.parse(
localStorage.getItem('teamLeadApp') ?? ''
);
console.log(teamLeaderData);
}
Expand Down
Loading

0 comments on commit e5d8b4e

Please sign in to comment.