Skip to content

Commit

Permalink
Merge pull request #514 from itsvick/merge-release-1.1.0-1.2.0
Browse files Browse the repository at this point in the history
Merge release 1.1.0 1.2.0
  • Loading branch information
itsvick authored Feb 13, 2025
2 parents caa8590 + c3b4380 commit b46f81d
Show file tree
Hide file tree
Showing 23 changed files with 1,326 additions and 64 deletions.
70 changes: 70 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@aws-sdk/s3-request-presigner": "^3.726.0",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@hookform/resolvers": "^3.10.0",
"@module-federation/nextjs-mf": "^8.5.5",
"@module-federation/utilities": "3.0.11",
"@mui/icons-material": "^5.15.15",
Expand Down Expand Up @@ -49,10 +50,12 @@
"react-csv-reader": "^4.0.0",
"react-dom": "^18",
"react-ga4": "^2.1.0",
"react-hook-form": "^7.54.2",
"react-i18next": "^14.1.2",
"react-toastify": "^10.0.5",
"sharp": "^0.33.4",
"swiper": "^11.2.0",
"yup": "^1.6.1",
"zustand": "^4.5.4"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@
"FOUNDATION_COURSE": "Foundation Course",
"MAIN_COURSE": "Main Course",
"CONTENT_CREATOR_REVIEWER": "Content Creator/Reviewer",
"SCTA": "State Content Team Associate",

"WORKSPACE": "Workspace"
"SCTA":"State Content Team Associate",
"WORKSPACE": "Workspace",
"MANAGE_NOTIFICATION": "Manage Notifications"
},
"FACILITATORS": {
"STATE": "State",
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommonUserModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ const CommonUserModal: React.FC<UserModalProps> = ({
"{FirstName}": firstLetterInUpperCase(creatorName),
"{UserName}": apiBody["username"],
"{LearnerName}": firstLetterInUpperCase(
apiBody["firstName"]
apiBody["firstName"]
),
"{Password}": apiBody["username"],
"{appUrl}": process.env.NEXT_PUBLIC_TEACHER_APP_URL as string || '',
Expand Down
23 changes: 13 additions & 10 deletions src/components/CustomModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ interface CustomModalProps {
handleClose: () => void;
title?: string;
subtitle?: string;
primaryBtnText: string;
primaryBtnText?: string;
secondaryBtnText?: string;
primaryBtnClick?: () => void;
secondaryBtnClick?: () => void;
showClose?: boolean;
backdropClose?: boolean;
primaryBtnDisabled?: boolean;
children: React.ReactNode;
width?:string
width?: string
}

const CustomModal: React.FC<CustomModalProps> = ({
Expand Down Expand Up @@ -97,14 +97,17 @@ const CustomModal: React.FC<CustomModalProps> = ({
{secondaryBtnText}
</Button>
)}
<Button
// fullWidth
onClick={primaryBtnClick}
variant="contained"
disabled={primaryBtnDisabled}
>
{primaryBtnText}
</Button>
{
primaryBtnText &&
<Button
// fullWidth
onClick={primaryBtnClick}
variant="contained"
disabled={primaryBtnDisabled}
>
{primaryBtnText}
</Button>
}
</Box>
</Box>
</Modal>
Expand Down
15 changes: 11 additions & 4 deletions src/components/KaTableComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useTranslation } from "next-i18next";
import ActionIcon from "./ActionIcon";
import UserNameCell from "./UserNameCell";
import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
import TemplateTypeChip from "./notification-templates/TemplateTypeChip";

interface KaTableComponentProps {
columns: ITableProps["columns"];
Expand All @@ -30,7 +31,7 @@ interface KaTableComponentProps {
onEdit?: any;
reassignCohort?: any;
onChange?: any;
extraActions: {
extraActions?: {
name: string;
onClick: (rowData: any) => void;
icon: React.ElementType;
Expand All @@ -41,6 +42,7 @@ interface KaTableComponentProps {
pagination?: boolean;
reassignType?: string;
handleMemberClick?: any;
rowKeyField?: string
}

const KaTableComponent: React.FC<KaTableComponentProps> = ({
Expand All @@ -58,6 +60,7 @@ const KaTableComponent: React.FC<KaTableComponentProps> = ({
pagination = true,
reassignType,
handleMemberClick,
rowKeyField
}) => {
const [selectedRowIds, setSelectedRowIds] = useState<number[]>([]);
const { t, i18n } = useTranslation();
Expand All @@ -75,7 +78,7 @@ const KaTableComponent: React.FC<KaTableComponentProps> = ({
const tableProps: ITableProps = {
columns,
data,
rowKeyField: "id",
rowKeyField: rowKeyField || "id",
sortingMode: SortingMode.Single,
...(pagination && {
paging: {
Expand Down Expand Up @@ -224,10 +227,11 @@ const KaTableComponent: React.FC<KaTableComponentProps> = ({
}

if (props.column.key === DataKey.STATUS) {
if (props.rowData?.status === Status.ARCHIVED) {
if (props.rowData?.status === Status.ARCHIVED || props.rowData?.status?.toLowerCase() === Status.UNPUBLISHED.toLocaleLowerCase()) {
return (
<Chip
label={t("COMMON.INACTIVE")}
// label={t("COMMON.INACTIVE")}
label={firstLetterInUpperCase(props?.rowData?.status)}
color="error"
variant="outlined"
size={isMobile ? "small" : "medium"}
Expand Down Expand Up @@ -257,6 +261,9 @@ const KaTableComponent: React.FC<KaTableComponentProps> = ({
/>
);
}
if (props.column.key === DataKey.TEMPLATE_TYPE) {
return <TemplateTypeChip keys={props?.rowData?.templateType} />;
}

return <div className="table-cell">{props?.value}</div>;
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/RouteGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const RouteGuard: React.FC<{ children: React.ReactNode }> = ({ children }) => {
}
}

if (((user.role === Role.ADMIN || user.role === Role.CENTRAL_ADMIN) && (allowedPaths.includes(router.pathname) || isWorkspaceContent || isCoursePlannerContent)) || (user.role === Role.ADMIN && router.pathname === "/programs")) {
if (((user.role === Role.ADMIN || user.role === Role.CENTRAL_ADMIN) && (allowedPaths.includes(router.pathname) || isWorkspaceContent || isCoursePlannerContent)) || (user.role === Role.ADMIN && (router.pathname === "/programs" ||router.pathname === "/notification-templates" ))) {

if (router.pathname !== "/login" && router.pathname !== "/logout" && router.pathname !== "/edit-password") {

Expand Down
23 changes: 23 additions & 0 deletions src/components/common/BackButtonWithLabel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Box, IconButton, Typography } from "@mui/material";
import { useRouter } from "next/router";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";

interface BackButtonWithLabelProps {
label: string;
previousPagePath?: string;
}

const BackButtonWithLabel: React.FC<BackButtonWithLabelProps> = ({ label, previousPagePath }) => {
const router = useRouter();
return (
<Box
sx={{ display: "flex", alignItems: "center", mb: 2, mt: 2 }}
onClick={() => previousPagePath ? router.push(`/${previousPagePath}`) : router.back()}>
<IconButton>
<ArrowBackIcon />
</IconButton>
<Typography variant="h2">{label}</Typography>
</Box>)
};

export default BackButtonWithLabel;
7 changes: 4 additions & 3 deletions src/components/layouts/header/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ interface SearchBarProps {
placeholder: string;
}

const SearchBox = styled(Paper)<{ isSmallScreen: boolean }>(({ theme, isSmallScreen }) => ({
const SearchBox = styled(Paper, {
shouldForwardProp: (prop) => prop !== "isSmallScreen",
})<{ isSmallScreen: boolean }>(({ theme, isSmallScreen }) => ({
padding: "2px 4px",
display: "flex",
alignItems: "center",
width: "100%",
maxWidth: isSmallScreen ? "100%" : 900,
borderRadius: "8px",
backgroundColor:"#F0F0F0",
backgroundColor: "#F0F0F0",
}));

const StyledInputBase = styled(InputBase)(({ theme }) => ({
marginLeft: theme.spacing(1),
flex: 1,
Expand Down
9 changes: 8 additions & 1 deletion src/components/layouts/sidebar/MenuItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const Menuitems = [
},
],
},
{
title: "SIDEBAR.MANAGE_NOTIFICATION",
icon: centerIcon,
href: ["/notification-templates"],
},
...(isActiveYear
? [
{
Expand Down Expand Up @@ -102,7 +107,9 @@ export const getFilteredMenuItems = () => {
(item) =>
item.title !== "SIDEBAR.COURSE_PLANNER" &&
item.title !== "SIDEBAR.WORKSPACE" &&
item.title !== "PROGRAM_MANAGEMENT.PROGRAMS"
item.title !== "PROGRAM_MANAGEMENT.PROGRAMS" &&
item.title !== "SIDEBAR.MANAGE_NOTIFICATION"


);
}
Expand Down
Loading

0 comments on commit b46f81d

Please sign in to comment.