Skip to content

Commit

Permalink
Issue #PS-2413 feat: Integration of V1 Content Player in Teachers app
Browse files Browse the repository at this point in the history
  • Loading branch information
rajnishdargan committed Nov 7, 2024
2 parents b75c283 + b5eaed4 commit 1d63b75
Show file tree
Hide file tree
Showing 28 changed files with 990 additions and 517 deletions.
22 changes: 11 additions & 11 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"code": "or"
}
],
"firebaseConfig": {
"apiKey": "process.env.NEXT_PUBLIC_FCM_API_KEY",
"authDomain": "backend-e99c8.firebaseapp.com",
"projectId": "backend-e99c8",
"storageBucket": "backend-e99c8.appspot.com",
"messagingSenderId": "839139131975",
"appId": "1:839139131975:web:90af50d01e2eb0f510e762",
"measurementId": "G-5237RSF3TC"
},
"vapidKey": "process.env.NEXT_PUBLIC_VAPID_KEY"
}
"firebaseConfig": {
"apiKey": "AIzaSyCmhNz-HMkkf42QNmnf7pnZm49FP5g4INw",
"authDomain": "backend-e99c8.firebaseapp.com",
"projectId": "backend-e99c8",
"storageBucket": "backend-e99c8.appspot.com",
"messagingSenderId": "839139131975",
"appId": "1:839139131975:web:90af50d01e2eb0f510e762",
"measurementId": "G-5237RSF3TC"
},
"vapidKey": "BOZ_JkC62vr767LoC7APU26ZdGYW5htBkfqIEtsVX6zmE3Fi-XgcN_TggSaXKh5rGKcaa4vuQxaYiRPU2B955GI"
}
2 changes: 1 addition & 1 deletion firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const firebaseApp = initializeApp(config.firebaseConfig);
let messaging;

if (typeof window !== 'undefined') {
messaging = getMessaging();
messaging = getMessaging();
}

export const requestPermission = async () => {
Expand Down
12 changes: 10 additions & 2 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@
"CENTER": "Center",
"AND_COUNT_MORE": "and {{count}} more",
"RETURN_TO_LOGIN": "Return to Login",
"NO_CENTER_FOUND": "No Center found"
"NO_CENTER_FOUND": "No Center found",
"FILTER_BY":"Filter By",
"ALL":"All"
},
"LOGIN_PAGE": {
"USERNAME": "Username",
Expand Down Expand Up @@ -600,7 +602,13 @@
"NOT_STARTED":"Not Started",
"COMPLETED":"Completed",
"INPROGRESS":"In-Progress",
"NO_DATA_FOUND":"No {{entity}} found"
"NO_DATA_FOUND":"No {{entity}} found",
"NO_RESULT_FOUND":"No Observations found for {{entity}}",
"NO_OBSERVATION_EXPIRED":"No observation expired for {{entity}}",
"DAYS_LEFT":"Days left",
"THIS_OBSERVATION_EXPIRED":"This observation is expired"


}

}
2 changes: 1 addition & 1 deletion src/components/AddFacilitator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
id: 'facilitator-updated-success',
type: Telemetry.CLICK,
subtype: '',
pageid: 'cleanedUrl',
pageid: cleanedUrl
},
};
telemetryFactory.interact(telemetryInteract);
Expand Down
38 changes: 38 additions & 0 deletions src/components/FilterSelect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react';
import { FormControl, InputLabel, Select, MenuItem, SelectChangeEvent } from '@mui/material';

interface FilterSelectProps {
menuItems: { value: string; label: string }[];
selectedOption: string;
handleFilterChange: (event: SelectChangeEvent) => void;
label: string;
sx?: object;
}

const FilterSelect: React.FC<FilterSelectProps> = ({
menuItems,
selectedOption,
handleFilterChange,
label,
sx = {}
}) => {
return (
<FormControl sx={{ minWidth: 200, marginLeft: "20px", backgroundColor: "#F0F0F0", ...sx }} variant="outlined" margin="normal">
<InputLabel id="filter-label">{label}</InputLabel>
<Select
labelId="filter-label"
value={selectedOption}
onChange={handleFilterChange}
label={label}
>
{menuItems.map((item) => (
<MenuItem key={item.value} value={item.value}>
{item.label}
</MenuItem>
))}
</Select>
</FormControl>
);
};

export default FilterSelect;
5 changes: 4 additions & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useTranslation } from 'next-i18next';
import StyledMenu from './StyledMenu';
import AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';
import { useDirection } from '../hooks/useDirection';
import useStore from '../store/store';

interface HeaderProps {
toggleDrawer?: (newOpen: boolean) => () => void;
Expand All @@ -34,6 +35,8 @@ const Header: React.FC<HeaderProps> = ({ toggleDrawer, openDrawer }) => {
const { t } = useTranslation();
const pathname = usePathname();
const theme = useTheme<any>();
const store = useStore();
const isActiveYear = store.isActiveYearSelected;

const [userId, setUserId] = useState<string>('');
const [openMenu, setOpenMenu] = useState<boolean>(false);
Expand Down Expand Up @@ -170,7 +173,7 @@ const Header: React.FC<HeaderProps> = ({ toggleDrawer, openDrawer }) => {
width={44}
src={logoLight}
alt="logo"
onClick={() => router.push('/dashboard')}
onClick={() => isActiveYear && router.push('/dashboard')}
style={{ marginRight: isRTL ? '20px' : '0px' }}
/>

Expand Down
5 changes: 3 additions & 2 deletions src/components/LearnersListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const LearnersListItem: React.FC<LearnerListProps> = ({
const setCohortLearnerDeleteId = manageUserStore(
(state) => state.setCohortLearnerDeleteId
);
const isActiveYear = userStore.isActiveYearSelected;

useEffect(() => {
if (reloadState) {
Expand Down Expand Up @@ -625,7 +626,7 @@ const LearnersListItem: React.FC<LearnerListProps> = ({
)}
</Box>
</Box>
<MoreVertIcon
{isActiveYear && <MoreVertIcon
onClick={(event) => {
isMobile
? toggleDrawer('bottom', true)(event)
Expand All @@ -636,7 +637,7 @@ const LearnersListItem: React.FC<LearnerListProps> = ({
color: theme.palette.warning['300'],
cursor: 'pointer',
}}
/>
/>}
</Box>
</Box>
</Box>
Expand Down
3 changes: 2 additions & 1 deletion src/components/ManageUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const ManageUser: React.FC<ManageUsersProps> = ({
const newStore = useStore();
const queryClient = useQueryClient();
const { dir, isRTL } = useDirection();
const isActiveYear = newStore.isActiveYearSelected;

const [value, setValue] = React.useState(1);
const [users, setUsers] = useState<
Expand Down Expand Up @@ -506,7 +507,7 @@ const ManageUser: React.FC<ManageUsersProps> = ({
<Box>
{value === 1 && (
<>
{!isFromFLProfile && (
{!isFromFLProfile && isActiveYear && (
<Grid
px={'18px'}
spacing={2}
Expand Down
Loading

0 comments on commit 1d63b75

Please sign in to comment.