From 358624429ea4665a560a31e390baf9a2b97bc799 Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Wed, 6 Nov 2024 16:03:25 +0530 Subject: [PATCH 1/5] #0000 image responsive issue fixed --- src/components/Practice/Mechanics3.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Practice/Mechanics3.jsx b/src/components/Practice/Mechanics3.jsx index 1d26fccc..e89913f0 100644 --- a/src/components/Practice/Mechanics3.jsx +++ b/src/components/Practice/Mechanics3.jsx @@ -255,7 +255,7 @@ const Mechanics2 = ({ left: { xs: 0, // For extra small screens sm: 0, // For small screens - md: "-40px", // Adjust position for medium screens + md: "0px", // Adjust position for medium screens lg: "0px", xl: "0px", }, From 48fac2ebf6b5e6b7a2afe4df88ceb28dfdb89e4a Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Thu, 7 Nov 2024 20:15:56 +0530 Subject: [PATCH 2/5] Issueid #230114 feat: accessing data from morigal to cloudfrontIssueid #230114 feat: accessing data from morigal to cloudfront --- src/App.js | 178 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 104 insertions(+), 74 deletions(-) diff --git a/src/App.js b/src/App.js index a2c813c9..519cafe8 100644 --- a/src/App.js +++ b/src/App.js @@ -1,85 +1,115 @@ -import React, { useEffect, useRef } from 'react'; -import { ThemeProvider } from '@mui/material'; -import { BrowserRouter as Router } from 'react-router-dom'; -import { StyledEngineProvider } from '@mui/material/styles'; -import FingerprintJS from '@fingerprintjs/fingerprintjs'; -import routes from './routes'; -import { AppContent } from './views'; -import theme from './assets/styles/theme'; -import { initialize } from './services/telementryService'; -import { startEvent } from './services/callTelemetryIntract'; -import '@project-sunbird/telemetry-sdk/index.js'; +import React, { useEffect, useRef } from "react"; +import { ThemeProvider } from "@mui/material"; +import { BrowserRouter as Router } from "react-router-dom"; +import { StyledEngineProvider } from "@mui/material/styles"; +import FingerprintJS from "@fingerprintjs/fingerprintjs"; +import routes from "./routes"; +import { AppContent } from "./views"; +import theme from "./assets/styles/theme"; +import { initialize } from "./services/telementryService"; +import { startEvent } from "./services/callTelemetryIntract"; +import "@project-sunbird/telemetry-sdk/index.js"; const App = () => { - const ranonce = useRef(false); - useEffect(() => { - const initService = async () => { - var did; - if (localStorage.getItem('fpDetails_v2') !== null) { - let fpDetails_v2 = localStorage.getItem('fpDetails_v2'); - did = fpDetails_v2.result; - } else { - did = localStorage.getItem('did'); - } + const ranonce = useRef(false); + useEffect(() => { + const initService = async () => { + var did; + if (localStorage.getItem("fpDetails_v2") !== null) { + let fpDetails_v2 = localStorage.getItem("fpDetails_v2"); + did = fpDetails_v2.result; + } else { + did = localStorage.getItem("did"); + } - await initialize({ - context: { - mode: process.env.REACT_APP_MODE, // To identify preview used by the user to play/edit/preview - authToken: '', // Auth key to make api calls - did: did, // Unique id to identify the device or browser - uid: 'anonymous', - channel: process.env.REACT_APP_CHANNEL, // Unique id of the channel(Channel ID) - env: process.env.REACT_APP_ENV, + await initialize({ + context: { + mode: process.env.REACT_APP_MODE, // To identify preview used by the user to play/edit/preview + authToken: "", // Auth key to make api calls + did: did, // Unique id to identify the device or browser + uid: "anonymous", + channel: process.env.REACT_APP_CHANNEL, // Unique id of the channel(Channel ID) + env: process.env.REACT_APP_ENV, - pdata: { - // optional - id: process.env.REACT_APP_ID, // Producer ID. For ex: For sunbird it would be "portal" or "genie" - ver: process.env.REACT_APP_VER, // Version of the App - pid: process.env.REACT_APP_PID, // Optional. In case the component is distributed, then which instance of that component - }, - tags: [ - // Defines the tags data - '', - ], - timeDiff: 0, // Defines the time difference// Defines the object roll up data - host: process.env.REACT_APP_HOST, // Defines the from which domain content should be load - endpoint: process.env.REACT_APP_ENDPOINT, - apislug: process.env.REACT_APP_APISLUG, - }, - config: {}, - // tslint:disable-next-line:max-line-length - metadata: {}, - }); - if (!ranonce.current) { - if (localStorage.getItem('contentSessionId') === null) { - startEvent(); - } - ranonce.current = true; - } - }; + pdata: { + // optional + id: process.env.REACT_APP_ID, // Producer ID. For ex: For sunbird it would be "portal" or "genie" + ver: process.env.REACT_APP_VER, // Version of the App + pid: process.env.REACT_APP_PID, // Optional. In case the component is distributed, then which instance of that component + }, + tags: [ + // Defines the tags data + "", + ], + timeDiff: 0, // Defines the time difference// Defines the object roll up data + host: process.env.REACT_APP_HOST, // Defines the from which domain content should be load + endpoint: process.env.REACT_APP_ENDPOINT, + apislug: process.env.REACT_APP_APISLUG, + }, + config: {}, + // tslint:disable-next-line:max-line-length + metadata: {}, + }); + if (!ranonce.current) { + if (localStorage.getItem("contentSessionId") === null) { + startEvent(); + } + ranonce.current = true; + } + }; - const setFp = async () => { - const fp = await FingerprintJS.load(); + const setFp = async () => { + const fp = await FingerprintJS.load(); - const { visitorId } = await fp.get(); - if (!localStorage.getItem('did')) { - localStorage.setItem('did', visitorId); - } - initService(); - }; + const { visitorId } = await fp.get(); + if (!localStorage.getItem("did")) { + localStorage.setItem("did", visitorId); + } + initService(); + }; - setFp(); - }, []); + setFp(); + }, []); - return ( - - - - - - - - ); + useEffect(() => { + const handleMessage = (event) => { + // Destructure the message data + const { token, buddyToken, messageType, contentSessionId, virtualId } = + event.data; + + // Check if the expected data exists + if (messageType === "customData") { + if (token) { + localStorage.setItem("token", token); + } + if (buddyToken) { + localStorage.setItem("buddyToken", buddyToken); + } + if (contentSessionId) { + localStorage.setItem("contentSessionId", contentSessionId); + } + if (virtualId) { + localStorage.setItem("virtualId", virtualId); + } + } + }; + + window.addEventListener("message", handleMessage); + + return () => { + window.removeEventListener("message", handleMessage); + }; + }, []); + + return ( + + + + + + + + ); }; export default App; From 56d12e8651683b5ac87f0223ed28c25c2d35795c Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Fri, 8 Nov 2024 14:27:37 +0530 Subject: [PATCH 3/5] Issueid #230114 feat: accessing data from morigal to cloudfront --- src/App.js | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/App.js b/src/App.js index 519cafe8..bf7c78f8 100644 --- a/src/App.js +++ b/src/App.js @@ -74,28 +74,17 @@ const App = () => { useEffect(() => { const handleMessage = (event) => { // Destructure the message data - const { token, buddyToken, messageType, contentSessionId, virtualId } = - event.data; - - // Check if the expected data exists + const { messageType, localStorageKeyValue } = event.data; if (messageType === "customData") { - if (token) { - localStorage.setItem("token", token); - } - if (buddyToken) { - localStorage.setItem("buddyToken", buddyToken); - } - if (contentSessionId) { - localStorage.setItem("contentSessionId", contentSessionId); - } - if (virtualId) { - localStorage.setItem("virtualId", virtualId); + for (const item of localStorageKeyValue) { + const key = item.key; + const value = item.value; + + localStorage.setItem(key, value); } } }; - window.addEventListener("message", handleMessage); - return () => { window.removeEventListener("message", handleMessage); }; From cf8b655543df37965dde44e2e4f30e7f2a9f60a7 Mon Sep 17 00:00:00 2001 From: Gourav More Date: Fri, 8 Nov 2024 19:17:06 +0530 Subject: [PATCH 4/5] Issue #0000 fix: enabled m6 an m7 level for mechanics --- src/utils/constants.js | 47 ++++++++++++++++++++++++++++++--- src/views/Practice/Practice.jsx | 17 +++++++++--- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/src/utils/constants.js b/src/utils/constants.js index 5802c37f..70729517 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -3331,7 +3331,13 @@ export const practiceSteps = [ export const levelGetContent = { en: { 0: [ - { title: "P1", criteria: "word", template: "simple", tags: "CEFR_ENG" }, + { + title: "P1", + criteria: "word", + template: "simple", + tags: "CEFR_ENG", + storyMode: true, + }, { title: "P2", criteria: "word", template: "simple", tags: "CEFR_ENG" }, { title: "P3", criteria: "word", template: "simple", tags: "CEFR_ENG" }, { title: "P4", criteria: "word", template: "simple", tags: "CEFR_ENG" }, @@ -3343,7 +3349,13 @@ export const levelGetContent = { { title: "S2", criteria: "word", template: "simple", tags: "CEFR_ENG" }, ], 1: [ - { title: "P1", criteria: "word", template: "simple", tags: "CEFR_ENG" }, + { + title: "P1", + criteria: "word", + template: "simple", + tags: "CEFR_ENG", + storyMode: true, + }, { title: "P2", criteria: "word", template: "simple", tags: "CEFR_ENG" }, { title: "P3", criteria: "word", template: "simple", tags: "CEFR_ENG" }, { title: "P4", criteria: "word", template: "simple", tags: "CEFR_ENG" }, @@ -3355,7 +3367,13 @@ export const levelGetContent = { { title: "S2", criteria: "word", template: "simple", tags: "CEFR_ENG" }, ], 2: [ - { title: "P1", criteria: "word", template: "simple", tags: "CEFR_ENG" }, + { + title: "P1", + criteria: "word", + template: "simple", + tags: "CEFR_ENG", + storyMode: true, + }, { title: "P2", criteria: "word", template: "simple", tags: "CEFR_ENG" }, { title: "P3", @@ -3392,6 +3410,7 @@ export const levelGetContent = { criteria: "word", template: "simple", tags: "CEFR_ENG", + storyMode: true, }, { title: "P2", @@ -3454,6 +3473,7 @@ export const levelGetContent = { criteria: "sentence", template: "simple", competency: "L1.1", + storyMode: true, mechanism: { id: "mechanic_1", name: "fillInTheBlank" }, }, { @@ -3525,6 +3545,7 @@ export const levelGetContent = { criteria: "sentence", template: "simple", competency: "L1.5", + storyMode: true, mechanism: { id: "mechanic_1", name: "fillInTheBlank" }, }, { @@ -3595,18 +3616,22 @@ export const levelGetContent = { criteria: "sentence", template: "simple", competency: "L1.3", + storyMode: true, }, { title: "P2", criteria: "sentence", template: "simple", competency: "L1.3", + storyMode: true, + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P3", criteria: "paragraph", template: "simple", competency: "L1.3", + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P4", @@ -3619,24 +3644,29 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.3", + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P5", criteria: "sentence", template: "simple", competency: "L1.3", + storyMode: true, }, { title: "P6", criteria: "paragraph", template: "simple", competency: "L1.3", + storyMode: true, + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P7", criteria: "paragraph", template: "simple", competency: "L1.3", + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P8", @@ -3649,6 +3679,7 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.3", + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, ], 7: [ @@ -3657,18 +3688,22 @@ export const levelGetContent = { criteria: "sentence", template: "simple", competency: "L1.8", + storyMode: true, }, { title: "P2", criteria: "sentence", template: "simple", competency: "L1.8", + storyMode: true, + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P3", criteria: "paragraph", template: "simple", competency: "L1.8", + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P4", @@ -3681,24 +3716,29 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.8", + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P5", criteria: "paragraph", template: "simple", competency: "L1.8", + storyMode: true, }, { title: "P6", criteria: "paragraph", template: "simple", competency: "L1.8", + storyMode: true, + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P7", criteria: "paragraph", template: "simple", competency: "L1.8", + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P8", @@ -3711,6 +3751,7 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.8", + mechanism: { id: "mechanic_2", name: "readTheImage" }, }, ], 8: [ diff --git a/src/views/Practice/Practice.jsx b/src/views/Practice/Practice.jsx index 330b2019..d627ac72 100644 --- a/src/views/Practice/Practice.jsx +++ b/src/views/Practice/Practice.jsx @@ -315,7 +315,12 @@ const Practice = () => { (currentGetContent?.competency ? `&level_competency=${currentGetContent?.competency}` : "") + - (currentGetContent?.tags ? `&tags=${currentGetContent?.tags}` : "") + (currentGetContent?.tags + ? `&tags=${currentGetContent?.tags}` + : "") + + (currentGetContent?.storyMode + ? `&story_mode=${currentGetContent?.storyMode}` + : "") ); //TODO: required only for S1 and S2 @@ -480,7 +485,10 @@ const Practice = () => { (currentGetContent?.competency ? `&level_competency=${currentGetContent?.competency}` : "") + - (currentGetContent?.tags ? `&tags=${currentGetContent?.tags}` : "") + (currentGetContent?.tags ? `&tags=${currentGetContent?.tags}` : "") + + (currentGetContent?.storyMode + ? `&story_mode=${currentGetContent?.storyMode}` + : "") ); // TODO: handle error if resWord is empty @@ -583,7 +591,10 @@ const Practice = () => { (currentGetContent?.competency ? `&level_competency=${currentGetContent?.competency}` : "") + - (currentGetContent?.tags ? `&tags=${currentGetContent?.tags}` : "") + (currentGetContent?.tags ? `&tags=${currentGetContent?.tags}` : "") + + (currentGetContent?.storyMode + ? `&story_mode=${currentGetContent?.storyMode}` + : "") ); setTotalSyllableCount(resWord?.data?.totalSyllableCount); setLivesData({ From 7d473a8b35c78e631904c54110cdd7a875e33552 Mon Sep 17 00:00:00 2001 From: Gourav More Date: Fri, 8 Nov 2024 21:00:35 +0530 Subject: [PATCH 5/5] Issue #update config --- src/utils/constants.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/utils/constants.js b/src/utils/constants.js index 70729517..75c5cd60 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -3624,14 +3624,13 @@ export const levelGetContent = { template: "simple", competency: "L1.3", storyMode: true, - mechanism: { id: "mechanic_2", name: "readTheImage" }, + mechanism: { id: "mechanic_1", name: "fillInTheBlank" }, }, { title: "P3", criteria: "paragraph", template: "simple", competency: "L1.3", - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P4", @@ -3644,7 +3643,6 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.3", - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P5", @@ -3658,15 +3656,12 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.3", - storyMode: true, - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P7", criteria: "paragraph", template: "simple", competency: "L1.3", - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P8", @@ -3679,7 +3674,6 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.3", - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, ], 7: [ @@ -3703,7 +3697,6 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.8", - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P4", @@ -3716,7 +3709,6 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.8", - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P5", @@ -3731,14 +3723,12 @@ export const levelGetContent = { template: "simple", competency: "L1.8", storyMode: true, - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P7", criteria: "paragraph", template: "simple", competency: "L1.8", - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, { title: "P8", @@ -3751,7 +3741,6 @@ export const levelGetContent = { criteria: "paragraph", template: "simple", competency: "L1.8", - mechanism: { id: "mechanic_2", name: "readTheImage" }, }, ], 8: [