Skip to content

Commit

Permalink
Merge pull request #17 from Aar-if/main
Browse files Browse the repository at this point in the history
observation integration update
  • Loading branch information
snehal0904 authored Nov 6, 2023
2 parents d32ad50 + c2cb860 commit e4b4447
Show file tree
Hide file tree
Showing 18 changed files with 504 additions and 277 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"packages/schools",
"packages/teacher-app",
"packages/cohort",
"packages/observation"
"packages/observation",
"packages/mylearning"
]
},
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions packages/assessment/modulefederation.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { dependencies } = require("./package.json");
module.exports = {
name: "assessment",
exposes: {
"./TestPage": "./src/pages/TestPage.js",
"./App": "./src/App",
"./Assessment": "./src/pages",
"./AssessmentGiven": "./src/pages/AssessmentGiven",
Expand All @@ -29,6 +30,9 @@ module.exports = {
},
remotes: {
core: `core@[window.appModules.core.url]/moduleEntry.js`,
observation: `observation@[window.appModules.observation.url]/moduleEntry.js`,


},
filename: "moduleEntry.js",
shared: {
Expand Down
6 changes: 6 additions & 0 deletions packages/assessment/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import PastAssessments from "./pages/PastAssessments";
import PastExaminationsList from "./pages/PastExaminations";
import AssessmentGiven from "pages/AssessmentGiven";
import StudentReport from "pages/StudentReport";
import TestPage from "pages/TestPage";

function App() {
initializeI18n(
Expand Down Expand Up @@ -116,6 +117,11 @@ function App() {
path: "/",
component: Assessment,
},
{
moduleName: "assessment",
path: "/testPage",
component: TestPage,
},
];
const LoginComponent = React.lazy(() => import("core/Login"));
const skipLogin = !(
Expand Down
10 changes: 10 additions & 0 deletions packages/assessment/src/pages/TestPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
const Observation = React.lazy(() => import("observation/Observation"));

function TestPage() {
return (
<div><Observation /></div>
)
}

export default TestPage
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ export const getAll = async ({ ...params } = {}, header = {}) => {
...header,
Authorization: 'Bearer ' + localStorage.getItem('token')
}
const result = await post(
process.env.REACT_APP_API_URL + '/coursetracking/search',
const result = await get(
`https://diksha.gov.in/api/course/v1/hierarchy/do_313316673200873472111821`,
null,
{ params, headers }
)
if (result.data.data) {
return await getDataWithCourse(result.data.data)
if (result) {
return result
// return await getDataWithCourse(result.data.data)
} else {
return []
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mylearning/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function App() {
const routes = [
{
moduleName: "mylearning",
path: "/mylearning",
path: "/",
component: CourseList,
},
// {
Expand Down
66 changes: 35 additions & 31 deletions packages/mylearning/src/pages/CourseList.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,18 @@ export default function MyLearning({ footerLinks, appName }) {
};
})
);
setCourses(
await coursetrackingRegistryService.getAll({
...filterObject,
limit: 10,
userId,
status: state,
})
);

const dikshaData = await coursetrackingRegistryService.getAll({
...filterObject,
limit: 10,
userId,
status: state,
})

setCourses(dikshaData.data.result.content.children);



setLoading(false);
const telemetryData = telemetryFactory.interact({
appName,
Expand Down Expand Up @@ -228,27 +232,27 @@ export default function MyLearning({ footerLinks, appName }) {
<Layout
_header={{
title: getTitle(),
// iconComponent: (
// <Button
// rounded="full"
// variant="outline"
// bg={"mylearning.primaryLight"}
// px={4}
// py={1}
// rightIcon={
// <IconByName
// name="ArrowDownSLineIcon"
// isDisabled
// _icon={{ size: 20 }}
// />
// }
// onPress={(e) => setShowModalSort(true)}
// >
// <BodyLarge textTransform="capitalize" color={"mylearning.primary"}>
// {t("SORT")}
// </BodyLarge>
// </Button>
// ),
iconComponent: (
<Button
rounded="full"
variant="outline"
bg={"mylearning.primaryLight"}
px={4}
py={1}
rightIcon={
<IconByName
name="ArrowDownSLineIcon"
isDisabled
_icon={{ size: 20 }}
/>
}
onPress={(e) => setShowModalSort(true)}
>
<BodyLarge textTransform="capitalize" color={"mylearning.primary"}>
{t("SORT")}
</BodyLarge>
</Button>
),
}}
_appBar={{
languages: manifest.languages,
Expand Down Expand Up @@ -321,13 +325,13 @@ const Children = ({

return (
<Stack>
{/* <FilterButton
<FilterButton
getObject={handleFilter}
_box={{ pt: 5, px: 5 }}
_actionSheet={{ bg: "mylearning.cardBg" }}
resetButtonText={t("COLLAPSE")}
filters={filters}
/> */}
/>
<VStack>
<Box
bg={"mylearning.white"}
Expand Down
2 changes: 1 addition & 1 deletion packages/observation/modulefederation.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
exposes: {
"./App": "./src/App",
"./SampleComponent": "./src/components/SampleComponent",
"./Observation": "./src/pages/Observation",
"./Observation": "./src/pages/Observation.js",
},
remotes: {
core: `core@[window.appModules.core.url]/moduleEntry.js`,
Expand Down
3 changes: 2 additions & 1 deletion packages/observation/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "observationmodule",
"name": "observation",
"version": "0.1.0",
"private": true,
"homepage": "modules/observation",
"dependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
Expand Down
16 changes: 10 additions & 6 deletions packages/observation/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ import Observation from "pages/Observation";

function App() {
const routes = [
{
moduleName: "observation",
path: "/sample",
component: Sample,
},

{
moduleName: "observation",
path: "/",
component: Observation,
},
];
const LoginComponent = React.lazy(() => import("core/Login"));
const skipLogin = !(
process.env.REACT_APP_OAUTH_PROXY_ENABLED == undefined ||
JSON.parse(process.env.REACT_APP_OAUTH_PROXY_ENABLED) == false
);

return <AppShell routes={routes} AuthComponent={LoginComponent} />;
return <AppShell basename={process.env.PUBLIC_URL}
routes={routes}
AuthComponent={LoginComponent}
skipLogin={skipLogin}
_authComponent={{ swPath: "/modules/observation" }} />;
}

export default App;
Loading

0 comments on commit e4b4447

Please sign in to comment.