Skip to content

Commit

Permalink
Merge pull request #81 from suvarnakale/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #0000 fix: issue fixes in search , filter, sortby functionality
  • Loading branch information
itsvick authored Nov 12, 2024
2 parents 510b833 + 74a0551 commit e48eb24
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/components/SearchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const SearchBox: React.FC<SearchBarProps> = ({
<Box sx={{ mt: 2, px: theme.spacing(2.5) }}>
<Paper
component="form"
onSubmit={(e) => e.preventDefault()}
sx={{
display: "flex",
alignItems: "center",
Expand Down
16 changes: 12 additions & 4 deletions src/pages/workspace/content/allContents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const AllContentsPage = () => {
];
const query = debouncedSearchTerm || "";
const primaryCategory = filter.length ? filter : [];
const order = sortBy === "Modified On" ? "desc" : "asc";
const order = sortBy === "Created On" ? "asc" : "desc";
const sort_by = {
lastUpdatedOn: order,
};
Expand Down Expand Up @@ -159,8 +159,13 @@ const AllContentsPage = () => {
<Layout selectedKey={selectedKey} onSelect={setSelectedKey}>
<WorkspaceText />
<Box p={3}>
<Box sx={{background: "#FFFFFF"}} p={2}>
<Typography variant="h4" sx={{fontWeight:"bold", fontSize: "16px"}}>All My Contents</Typography>
<Box sx={{ background: "#FFFFFF" }} p={2}>
<Typography
variant="h4"
sx={{ fontWeight: "bold", fontSize: "16px" }}
>
All My Contents
</Typography>
</Box>
{/* <Typography mb={2}>Here you see all your content.</Typography> */}

Expand Down Expand Up @@ -197,7 +202,10 @@ const AllContentsPage = () => {
sx={{ cursor: "pointer" }}
>
{content?.appIcon ? (
<img src={content?.appIcon || '/logo.png'} height={"25px"} />
<img
src={content?.appIcon || "/logo.png"}
height={"25px"}
/>
) : (
<UpReviewTinyImage fontSize="small" />
)}
Expand Down
13 changes: 9 additions & 4 deletions src/pages/workspace/content/draft/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const DraftPage = () => {
const query = debouncedSearchTerm || "";
const offset = page * LIMIT;
const primaryCategory = filter.length ? filter : [];
const order = sortBy === "Modified On" ? "desc" : "asc";
const order = sortBy === "Created On" ? "asc" : "desc";
const sort_by = { lastUpdatedOn: order };
const response = await getContent(
["Draft", "FlagDraft"],
Expand Down Expand Up @@ -118,8 +118,13 @@ const DraftPage = () => {
<Layout selectedKey={selectedKey} onSelect={setSelectedKey}>
<WorkspaceText />
<Box p={3}>
<Box sx={{background: "#FFFFFF"}} p={2}>
<Typography variant="h4" sx={{fontWeight: "bold", fontSize: "16px"}}>Drafts</Typography>
<Box sx={{ background: "#FFFFFF" }} p={2}>
<Typography
variant="h4"
sx={{ fontWeight: "bold", fontSize: "16px" }}
>
Drafts
</Typography>
</Box>
{/* <Typography mb={2}>
Create, organize, and manage all types of content in one place.
Expand Down Expand Up @@ -160,7 +165,7 @@ const DraftPage = () => {
<TableCell onClick={() => openEditor(content)}>
<Box display="flex" alignItems="center">
<img
src={content?.appIcon || '/logo.png'}
src={content?.appIcon || "/logo.png"}
alt={content.name}
style={{
width: 60,
Expand Down
11 changes: 8 additions & 3 deletions src/pages/workspace/content/publish/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const PublishPage = () => {
const query = debouncedSearchTerm || "";
const offset = page * LIMIT;
const primaryCategory = filter.length ? filter : [];
const order = sortBy === "Modified On" ? "desc" : "asc";
const order = sortBy === "Created On" ? "asc" : "desc";
const sort_by = { lastUpdatedOn: order };
const response = await getContent(
["Live"],
Expand Down Expand Up @@ -119,7 +119,12 @@ const PublishPage = () => {
<WorkspaceText />
<Box p={3}>
<Box sx={{ background: "#FFFFFF" }} p={2}>
<Typography variant="h4" sx={{ fontWeight: "bold", fontSize: "16px" }}>Published</Typography>
<Typography
variant="h4"
sx={{ fontWeight: "bold", fontSize: "16px" }}
>
Published
</Typography>
</Box>
{/* <Typography mb={2}>Here you see all your published content.</Typography> */}

Expand Down Expand Up @@ -158,7 +163,7 @@ const PublishPage = () => {
<TableCell onClick={() => openEditor(content)}>
<Box display="flex" alignItems="center">
<img
src={content?.appIcon || '/logo.png'}
src={content?.appIcon || "/logo.png"}
alt={content.name}
style={{
width: 60,
Expand Down
19 changes: 13 additions & 6 deletions src/pages/workspace/content/submitted/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const SubmittedForReviewPage = () => {
const query = debouncedSearchTerm || "";
const offset = page * LIMIT;
const primaryCategory = filter.length ? filter : [];
const order = sortBy === "Modified On" ? "desc" : "asc";
const order = sortBy === "Created On" ? "asc" : "desc";
const sort_by = { lastUpdatedOn: order };
const response = await getContent(
["Review", "FlagReview"],
Expand Down Expand Up @@ -101,7 +101,10 @@ const SubmittedForReviewPage = () => {
content?.mimeType &&
MIME_TYPE.GENERIC_MIME_TYPE.includes(content?.mimeType)
) {
router.push({ pathname: `/workspace/content/review`, query: { identifier, mode } });
router.push({
pathname: `/workspace/content/review`,
query: { identifier, mode },
});
} else if (
content?.mimeType &&
MIME_TYPE.COLLECTION_MIME_TYPE.includes(content?.mimeType)
Expand All @@ -114,9 +117,13 @@ const SubmittedForReviewPage = () => {
<Layout selectedKey={selectedKey} onSelect={setSelectedKey}>
<WorkspaceText />
<Box p={3}>

<Box sx={{background: "#FFFFFF"}} p={2}>
<Typography variant="h4" sx={{fontWeight: "bold", fontSize: "16px"}}>Submitted For Review</Typography>
<Box sx={{ background: "#FFFFFF" }} p={2}>
<Typography
variant="h4"
sx={{ fontWeight: "bold", fontSize: "16px" }}
>
Submitted For Review
</Typography>
</Box>
{/* <Typography mb={2}>
Here you can see all your content submitted for review.
Expand Down Expand Up @@ -157,7 +164,7 @@ const SubmittedForReviewPage = () => {
<TableCell onClick={() => openEditor(content)}>
<Box display="flex" alignItems="center">
<img
src={content?.appIcon || '/logo.png'}
src={content?.appIcon || "/logo.png"}
alt={content?.name}
style={{
width: 60,
Expand Down
8 changes: 4 additions & 4 deletions src/services/ContentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MIME_TYPE, TENANTID } from "@/utils/app.config";
const authToken = process.env.NEXT_PUBLIC_AUTH_API_TOKEN;
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL;
import { v4 as uuidv4 } from "uuid";
import { ChannelID } from "@/utils/app.constant";
import { ChannelID, PrimaryCategoryValue } from "@/utils/app.constant";

const userId = getLocalStoredUserData();
console.log("userId ==>", userId);
Expand Down Expand Up @@ -54,9 +54,9 @@ const getReqBodyWithStatus = (
sort_by: any
) => {
if (typeof window !== "undefined" && typeof localStorage !== "undefined") {
var PrimaryCategory = JSON.parse(
localStorage.getItem("PrimaryCategory") as string
);
var PrimaryCategory =
JSON.parse(localStorage.getItem("PrimaryCategory") as string) ||
PrimaryCategoryValue;
}
primaryCategory =
primaryCategory.length === 0 ? PrimaryCategory : primaryCategory;
Expand Down
11 changes: 11 additions & 0 deletions src/utils/app.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ export const SortOptions = ["Modified On", "Created On"];

export const LIMIT = 6;
export const ChannelID = "test-k12-channel";

export const PrimaryCategoryValue = [
"Course",
"Course Assessment",
"eTextbook",
"Explanation Content",
"Learning Resource",
"Practice Question Set",
"Teacher Resource",
"Exam Question",
];

0 comments on commit e48eb24

Please sign in to comment.