Skip to content

Commit

Permalink
Merge branch 'release-1.0.0' of github.com:tekdi/shiksha-admin into r…
Browse files Browse the repository at this point in the history
…elease-1.0.0
  • Loading branch information
itsvick committed Nov 21, 2024
2 parents 5b11f45 + 25333b4 commit f719a0f
Show file tree
Hide file tree
Showing 14 changed files with 384 additions and 173 deletions.
12 changes: 12 additions & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@
"VIEW_PLANS": "View Plans",
"FOUNDATION_COURSE": "Foundation Course",
"MAIN_COURSE": "Main Course",
"CONTENT_CREATOR_REVIEWER": "Content Creator/Reviewer",
"SCTA":"State Content Team Associate",


"WORKSPACE": "Workspace"
},
"FACILITATORS": {
Expand Down Expand Up @@ -438,5 +442,13 @@
"WORKSPACE": {
"EDITOR_WORKSPACE": "Editor Workspace",
"COURSE": "Course"

},

"CONTENT_CREATOR_REVIEWER": {
"CONTENT_CREATOR": "Content Creator",
"CONTENT_REVIEWER": "Content Reviewer",
"CONTENT_CREATOR_REVIEWER": "Content Creator/Reviewer",
"SEARCH_CONTENT_CREATOR":"Search content creator..."
}
}
2 changes: 1 addition & 1 deletion src/components/ActionIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const ActionIcon: React.FC<ActionCellProps> = ({
</Box>
</Tooltip>

{ userAction && ( <Tooltip title={reassignType}>
{ userAction && reassignType && ( <Tooltip title={reassignType}>
<Box
onClick={() => {
if(reassignCohort)
Expand Down
135 changes: 72 additions & 63 deletions src/components/AreaSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { useEffect, useState } from "react";
import MultipleSelectCheckmarks from "./FormControl";
import { capitalizeFirstLetterOfEachWordInArray } from "@/utils/Helper";
import { useMediaQuery } from "@mui/material";
import { Role } from "@/utils/app.constant";
import { FormContextType, Role } from "@/utils/app.constant";

interface State {
value: string;
Expand Down Expand Up @@ -117,15 +117,15 @@ const AreaSelection: React.FC<DropdownBoxProps> = ({
},
}}
>
{userType && !reAssignModal && (
{userType && !reAssignModal && inModal===false && (
<Box>
<Typography marginTop="20px" variant="h1">
{userType}
{userType=== Role.CONTENT_CREATOR?t("SIDEBAR.SCTA"):userType}
</Typography>
</Box>
)}

<Box
{ (<Box
sx={{
width: inModal ? "100%" : "62%",
"@media (max-width: 900px)": {
Expand Down Expand Up @@ -156,72 +156,80 @@ const AreaSelection: React.FC<DropdownBoxProps> = ({
defaultValue={stateDefaultValue}
/>
</Grid>
<Grid
item
xs={12}
sm={inModal ? 12 : 6}
md={inModal ? 12 : 4}
lg={inModal ? 12 : isCenterSelection ? 3 : 4}
>


{userType!== FormContextType.CONTENT_CREATOR && inModal &&
(
<><Grid
item
xs={12}
sm={inModal ? 12 : 6}
md={inModal ? 12 : 4}
lg={inModal ? 12 : isCenterSelection ? 3 : 4}
>
<MultipleSelectCheckmarks
names={districts?.map((district) => district.label)}
codes={districts?.map((district) => district.value)}
tagName={t("FACILITATORS.DISTRICT")}
selectedCategories={selectedDistrict}
onCategoryChange={handleDistrictChangeWrapper}
disabled={
districts?.length <= 0 ||
(selectedState.length === 0 &&
stateDefaultValue === t("COMMON.ALL_STATES"))
}
overall={!inModal}
defaultValue={
reAssignModal
? districtDefaultValue
: selectedState.length > 0 && districts?.length === 0
? t("COMMON.NO_DISTRICTS")
: t("COMMON.ALL_DISTRICTS")
}
/>
</Grid>
<Grid
item
xs={12}
sm={inModal ? 12 : 6}
md={inModal ? 12 : 4}
lg={inModal ? 12 : isCenterSelection ? 3 : 4}
>
{shouldRenderSelectCheckmarks &&(
<MultipleSelectCheckmarks
names={districts?.map((district) => district.label)}
codes={districts?.map((district) => district.value)}
tagName={t("FACILITATORS.DISTRICT")}
selectedCategories={selectedDistrict}
onCategoryChange={handleDistrictChangeWrapper}
names={capitalizeFirstLetterOfEachWordInArray(
blocks?.length > 0 ? blocks.map((block) => block.label) : []
// blocks.map((block) => block.label)

)}
codes={

blocks?.length > 0 ? blocks?.map((block) => block.value) : []
// blocks?.map((block) => block.value)
}
tagName={t("FACILITATORS.BLOCK")}
selectedCategories={capitalizeFirstLetterOfEachWordInArray(
selectedBlock
)}
onCategoryChange={handleBlockChangeWrapper}
disabled={
districts?.length <= 0 ||
(selectedState.length === 0 &&
stateDefaultValue === t("COMMON.ALL_STATES"))
blocks?.length <= 0 ||
selectedDistrict?.length === 0 ||
selectedDistrict[0] === t("COMMON.ALL_DISTRICTS")
}
overall={!inModal}
defaultValue={
reAssignModal
? districtDefaultValue
: selectedState.length > 0 && districts?.length === 0
? t("COMMON.NO_DISTRICTS")
: t("COMMON.ALL_DISTRICTS")
selectedDistrict?.length > 0 && (blocks?.length === 0)
? t("COMMON.NO_BLOCKS")
: t("COMMON.ALL_BLOCKS")
}
/>
</Grid>
<Grid
item
xs={12}
sm={inModal ? 12 : 6}
md={inModal ? 12 : 4}
lg={inModal ? 12 : isCenterSelection ? 3 : 4}
>
{shouldRenderSelectCheckmarks &&(
<MultipleSelectCheckmarks
names={capitalizeFirstLetterOfEachWordInArray(
blocks?.length > 0 ? blocks.map((block) => block.label) : []
// blocks.map((block) => block.label)
)}
</Grid>
</>)
}


)}
codes={

blocks?.length > 0 ? blocks?.map((block) => block.value) : []
// blocks?.map((block) => block.value)
}
tagName={t("FACILITATORS.BLOCK")}
selectedCategories={capitalizeFirstLetterOfEachWordInArray(
selectedBlock
)}
onCategoryChange={handleBlockChangeWrapper}
disabled={
blocks?.length <= 0 ||
selectedDistrict?.length === 0 ||
selectedDistrict[0] === t("COMMON.ALL_DISTRICTS")
}
overall={!inModal}
defaultValue={
selectedDistrict?.length > 0 && (blocks?.length === 0)
? t("COMMON.NO_BLOCKS")
: t("COMMON.ALL_BLOCKS")
}
/>
)}
</Grid>
{isCenterSelection && (
<Grid
item
Expand Down Expand Up @@ -252,8 +260,9 @@ const AreaSelection: React.FC<DropdownBoxProps> = ({
/>
</Grid>
)}

</Grid>
</Box>
</Box>)}
</Box>
</Box>
);
Expand Down
Loading

0 comments on commit f719a0f

Please sign in to comment.