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

undefined fix #10

Merged
merged 5 commits into from
Sep 29, 2023
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
17 changes: 17 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"axios": "^1.5.0",
"framer-motion": "^10.16.2",
"papaparse": "^5.4.1",
"react-ga": "^3.3.1",
"react-hook-form": "^7.45.4",
"react-modal": "^3.16.1",
"yup": "^1.2.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/admin/src/api/studentAPI.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ const studentAPI = async (data) => {
headers: headers,
})
.then((res) => {
console.log(res);
// console.log(res.data);
console.log(res.data.data.studentId);
console.log(res.data.data.userId);
console.log(res.data.errors);

console.log(res.data.successCount);
const names = res.data.errors.map((error) => error.name).filter(Boolean);

localStorage.setItem("studentId", res.data.data.studentId);
localStorage.setItem("userId", res.data.data.userId);
Expand Down
9 changes: 4 additions & 5 deletions packages/common-lib/src/components/layout/AppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function AppBar({
titleComponent,
isBackButtonShow,
isLanguageIcon,
_text_logo ,
_text_logo,
...props
}) {
const [searchInput, setSearchInput] = useState(false)
Expand All @@ -43,7 +43,6 @@ export default function AppBar({
const setLang = (e) => {
if (e === 'logout') {
localStorage.setItem('token', '')
localStorage.clear()
eventBus.publish('AUTH', {
eventType: 'LOGOUT',
data: {}
Expand All @@ -63,7 +62,7 @@ export default function AppBar({
<Box pt={7} px={3} {...props?._box}>
<StatusBar bg='gray.600' barStyle='light-content' />
<Box safeAreaTop bg='gray.600' />
{_text_logo ? _text_logo :<React.Fragment />}
{_text_logo ? _text_logo : <React.Fragment />}
{searchInput ? (
<Stack alignItems='center'>
<InputGroup width='100%'>
Expand Down Expand Up @@ -138,7 +137,7 @@ export default function AppBar({
{LeftIcon ? LeftIcon : <React.Fragment />}
</HStack>
{titleComponent ? titleComponent : <React.Fragment />}
<HStack alignItems={'center'}>
{/* <HStack alignItems={'center'}>
{!searchInput && isEnableSearchBtn ? (
<IconByName
color={color ? color : ''}
Expand All @@ -160,7 +159,7 @@ export default function AppBar({
) : (
<React.Fragment />
)}
</HStack>
</HStack> */}
</HStack>
</React.Fragment>
) : (
Expand Down
4 changes: 2 additions & 2 deletions packages/common-lib/src/components/layout/NameTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export default function NameTag({ height = '55', parentBgColor = '#f8f8f9' }) {
Class:{' '}
{localStorage.getItem('grade') +
' ' +
localStorage.getItem('section') +
' ' +
// localStorage.getItem('section') +
// ' ' +
localStorage.getItem('medium')}
</Caption>
</Box>
Expand Down
3 changes: 2 additions & 1 deletion packages/common-lib/src/hooks/useAuthFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export const useAuthFlow = () => {

export const getAuthUser = async () => {
const resultUser = await userRegistryService.getOne()
if (resultUser) {
if (Object.keys(resultUser).length) {
let id = resultUser.id

localStorage.setItem('id', id)
localStorage.setItem('name', resultUser.name)
localStorage.setItem('grade', resultUser.grade)
Expand Down
2 changes: 2 additions & 0 deletions packages/common-lib/src/services/courseRegistryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ export const courseTrackingRead = async ({ id, ...params }, header = {}) => {
params: { questionsetId: id },
headers
})

if (result?.data?.data) {
return result.data?.data
} else {
Expand All @@ -299,6 +300,7 @@ export const courseStatus = async (params, header = {}) => {
params,
{ params, headers }
)

if (result?.data?.data) {
return result.data?.data
} else {
Expand Down
26 changes: 26 additions & 0 deletions packages/core/src/pages/StudentLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,33 @@ export default function StudentLogin({ swPath }) {
board: board,
},
};

telemetryFactory.impression(telemetryImpression);

const telemetryInteract = {
context: {
env: "sign-out",
cdata: [],
},
edata: {
id: "log-out-button",
type: "CLICK",
subtype: "",
pageid: "sign-out",
uid: id,

studentid: "student-id",

userName: userName,

grade: grade,

medium: medium,

board: board,
},
};
telemetryFactory.interact(telemetryInteract);
}, []);

const handleLogin = async () => {
Expand Down
23 changes: 10 additions & 13 deletions packages/student-app/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,17 @@
href="https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700;800&display=swap"
rel="stylesheet"
/>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-CSNKERDFGQ"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "G-CSNKERDFGQ");
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z4XM1F8HWP"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-Z4XM1F8HWP');
</script>

<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
13 changes: 13 additions & 0 deletions packages/student-app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ import teacherRoutes from "./Routes/teachers";
import adminRoutes from "./Routes/admin";
const StudentLogin = React.lazy(() => import("core/StudentLogin"));
import { teachers, students } from "./config/footerLinks";
import ReactGA from "react-ga";

function App() {
const [routes, setRoutes] = React.useState([]);
const [footerLinks, setFooterLinks] = React.useState([]);
const [theme, setTheme] = React.useState("alt");

let isGAInitialized = false;

ReactGA.initialize("G-Z4XM1F8HWP");

isGAInitialized = true;

if (isGAInitialized) {
console.log("Google Analytics is initialized.");
} else {
console.log("Google Analytics is not initialized.");
}

initializeI18n(
["studentApp"],
`${process.env.PUBLIC_URL}/locales/{{lng}}/{{ns}}.json`
Expand Down
1 change: 1 addition & 0 deletions packages/studentprogram/src/pages/courseList.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default function CourseList({ footerLinks }) {
subject: subjectname,
});
setCoursesList(data);

setLoading(false);
} catch (e) {
console.log({ e });
Expand Down
Loading