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

TASK : #0000Course Unit Content Type Visible in Recently Added Contents #478

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
88 changes: 48 additions & 40 deletions packages/nulp_elite/src/components/drawerFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,19 @@ const fetchDataFramework = async () => {
setEventSearch(event.target.value);
};

const handleChange = (event) => {
setSearchTerm(event.target.value);
};

const handleSearch = (event) => {
setEventSearch(event.target.value);
setEventSearch(searchTerm);
};
const filteredSubCategories = searchTerm
? subCategory.filter((item) =>
item?.name?.toLowerCase().includes(searchTerm.toLowerCase())
)
: subCategory;



Expand Down Expand Up @@ -372,17 +381,15 @@ const fetchDataFramework = async () => {
)}

<Box className="filter-text mt-15">{t("SUB_DOMAIN")}</Box>
<FormControl
sx={{ m: 1, width: "25ch" }}
variant="outlined"
className="w-100"
>
<FormControl sx={{ m: 1, width: "25ch" }} variant="outlined" className="w-100">
<InputLabel htmlFor="outlined-adornment-password">
{t("SEARCH_SUB_DOMAIN")}
</InputLabel>
<OutlinedInput
id="outlined-adornment-password"
type="text"
value={searchTerm}
onChange={handleChange}
endAdornment={
<InputAdornment position="end">
<IconButton aria-label="toggle password visibility">
Expand All @@ -393,8 +400,8 @@ const fetchDataFramework = async () => {
label={t("SEARCH_SUB_DOMAIN")}
/>
</FormControl>
<List>
{subCategory.map((item) => (
<List>
{filteredSubCategories.map((item) => (
<ListItem className="filter-ul-text" key={item.code}>
<FormControlLabel
control={
Expand Down Expand Up @@ -546,23 +553,25 @@ const fetchDataFramework = async () => {
</div>
)}
<Box className="filter-text lg-mt-12 mb-20">{t("SUB_DOMAIN")}</Box>
<FormControl>
<InputLabel htmlFor="outlined-adornment-password">
{t("SEARCH_SUB_DOMAIN")}
</InputLabel>
<OutlinedInput
id="outlined-adornment-password"
type="text"
endAdornment={
<InputAdornment position="end">
<IconButton aria-label="toggle password visibility">
{<SearchOutlinedIcon />}
</IconButton>
</InputAdornment>
}
label={t("SEARCH_SUB_DOMAIN")}
/>
</FormControl>
<FormControl>
<InputLabel htmlFor="outlined-adornment-password">
{t("SEARCH_SUB_DOMAIN")}
</InputLabel>
<OutlinedInput
id="outlined-adornment-password"
type="text"
value={searchTerm}
onChange={handleChange}
endAdornment={
<InputAdornment position="end">
<IconButton aria-label="toggle password visibility">
<SearchOutlinedIcon />
</IconButton>
</InputAdornment>
}
label={t("SEARCH_SUB_DOMAIN")}
/>
</FormControl>
{/* <Autocomplete
multiple
disablePortal
Expand All @@ -571,22 +580,21 @@ const fetchDataFramework = async () => {
renderInput={(params) => <TextField label="search" />}
/> */}
<List>
{subCategory &&
subCategory.map((item) => (
<ListItem className="filter-ul-text" key={item.code}>
<FormControlLabel
control={
<Checkbox
checked={selectedSubDomain.includes(item.code)}
onChange={(event) =>
handleCheckboxChange(event, { item }, "subCategory")
}
/>
}
label={item.name}
/>
</ListItem>
))}
{filteredSubCategories.map((item) => (
<ListItem className="filter-ul-text" key={item.code}>
<FormControlLabel
control={
<Checkbox
checked={selectedSubDomain.includes(item.code)}
onChange={(event) =>
handleCheckboxChange(event, { item }, "subCategory")
}
/>
}
label={item.name}
/>
</ListItem>
))}
</List>
</Box>
)}
Expand Down
4 changes: 2 additions & 2 deletions packages/nulp_elite/src/pages/content/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const Player = () => {
{lesson.board}
</Button>
)}
{lesson.se_boards &&
{!lesson.board && lesson.se_boards &&
lesson.se_boards.map((item, index) => (
<Button
key={`se_boards-${index}`}
Expand Down Expand Up @@ -243,7 +243,7 @@ const Player = () => {
{item}
</Button>
))}
{lesson.se_gradeLevels &&
{!lesson.gradeLevel && lesson.se_gradeLevels &&
lesson.se_gradeLevels.map((item, index) => (
<Button
key={`se_gradeLevels-${index}`}
Expand Down
2 changes: 0 additions & 2 deletions packages/nulp_elite/src/pages/search/DomainList.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ const DomainList = ({ globalSearchQuery }) => {
"Collection",
"Resource",
"Content Playlist",
"Course",
"Course Assessment",
"Digital Textbook",
"eTextbook",
Expand All @@ -229,7 +228,6 @@ const DomainList = ({ globalSearchQuery }) => {
"ExperientialResource",
"Practice Resource",
"TVLesson",
"Course Unit",
"Exam Question",
],
visibility: ["Default", "Parent"],
Expand Down
Loading