Skip to content

Commit

Permalink
Merge pull request #288 from ajinkyapandetekdi/25-feb-1.4.0
Browse files Browse the repository at this point in the history
Issueid #236033 Not Able to Record Audio in TN-Staging after CSP changes
  • Loading branch information
gouravmore authored Feb 28, 2025
2 parents b42c5ee + 5fc62df commit 267acea
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 41 deletions.
34 changes: 18 additions & 16 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
name="description"
content="Base React App structure for Devigital Systems Projects"
/>

<!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
Expand All @@ -23,24 +23,26 @@
/>
<link href="https://fonts.cdnfonts.com/css/bad-comic" rel="stylesheet" />
<script src="./js/jquery-3.7.0.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js"></script>
<title>EkStep</title>

<!-- Content Security Policy -->
<meta http-equiv="Content-Security-Policy" content="
default-src 'self';
script-src 'self' https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js 'unsafe-eval';
style-src 'self' https://fonts.googleapis.com https://fonts.cdnfonts.com 'unsafe-inline';
object-src 'none';
base-uri 'self';
connect-src 'self' *.theall.ai;
font-src 'self' https://fonts.googleapis.com https://fonts.cdnfonts.com https://fonts.gstatic.com;
frame-src 'self';
img-src 'self' https://images.squarespace-cdn.com data:;
manifest-src 'self';
media-src 'self';
worker-src 'none';
" />
<meta http-equiv="Content-Security-Policy" content="
default-src 'none';
script-src 'self' https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js 'unsafe-eval';
style-src 'self' https://fonts.googleapis.com https://fonts.cdnfonts.com 'unsafe-inline';
object-src 'none';
base-uri 'self';
connect-src 'self' *.theall.ai https://all-prod-content-service.s3.ap-south-1.amazonaws.com blob:;
font-src 'self' https://fonts.googleapis.com https://fonts.cdnfonts.com https://fonts.gstatic.com;
frame-src 'self';
img-src 'self' https://images.squarespace-cdn.com https://all-prod-content-service.s3.ap-south-1.amazonaws.com https://s3.ap-south-1.amazonaws.com data: blob: https://raw.githubusercontent.com/;
manifest-src 'self';
media-src 'self' blob: https://all-prod-content-service.s3.ap-south-1.amazonaws.com;
worker-src 'self' blob: https://d114esnbvw5tst.cloudfront.net;
form-action 'self';
frame-ancestors 'self';
" />


</head>
<body>
Expand Down
18 changes: 7 additions & 11 deletions src/components/Layouts.jsx/MainLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ const MainLayout = (props) => {
>
<Stack justifyContent="center" alignItems="center">
<img
src={`https://raw.githubusercontent.com/Sunbird-ALL/all-learner-ai-app/refs/heads/all-1.3/src/assets/images/gameLost.svg`}
src={gameLost}
alt="gameLost"
style={{ height: 340 }}
/>
Expand Down Expand Up @@ -923,13 +923,10 @@ const MainLayout = (props) => {
</Box>

{elem?.correctAnswer === false ? (
<img
src="https://raw.githubusercontent.com/Sunbird-ALL/all-learner-ai-app/refs/heads/all-1.2-tn-dev/src/assets/wrong.svg"
alt="wrongImage"
/>
<img src={wrongImage} alt="wrongImage" />
) : (
<img
src="https://raw.githubusercontent.com/Sunbird-ALL/all-learner-ai-app/refs/heads/all-1.2-tn-dev/src/assets/correct.svg"
src={correctImage}
alt="correctImage"
/>
)}
Expand All @@ -944,7 +941,9 @@ const MainLayout = (props) => {
minWidth: "100px",
}}
>
{elem.selectedAnswer || "Binocular"}
{elem?.correctOption?.length > 0
? elem.correctOption
: elem.selectedAnswer || "Binocular"}
</span>
</Stack>
))}
Expand All @@ -962,10 +961,7 @@ const MainLayout = (props) => {
justifyContent={"center"}
alignItems={"center"}
>
<img
src="https://raw.githubusercontent.com/Sunbird-ALL/all-learner-ai-app/refs/heads/all-1.2-tn-dev/src/assets/turtle.svg"
alt="turtleImage"
/>
<img src={turtleImage} alt="turtleImage" />
<span
style={{
marginTop: "12px",
Expand Down
5 changes: 1 addition & 4 deletions src/services/learnerAi/learnerAiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const getHeaders = () => {
return {
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
"Content-Type": "application/json",
},
};
};
Expand Down Expand Up @@ -66,7 +66,6 @@ export const fetchGetSetResult = async (
collectionId: currentCollectionId,
totalSyllableCount: totalSyllableCount,
language: lang,
user_id: getVirtualId(),
},
getHeaders()
);
Expand All @@ -91,7 +90,6 @@ export const getSetResultPractice = async ({
sub_session_id: subSessionId,
contentType: currentContentType,
session_id: sessionId,
user_id: getVirtualId(),
totalSyllableCount: totalSyllableCount,
language: localStorage.getItem("lang"),
is_mechanics: mechanism && mechanism?.id ? true : false,
Expand All @@ -107,7 +105,6 @@ export const getSetResultPractice = async ({

export const updateLearnerProfile = async (lang, requestBody) => {
try {
requestBody.user_id = getVirtualId();
const response = await axios.post(
`${API_LEARNER_AI_APP_HOST}/${config.URLS.UPDATE_LEARNER_PROFILE}/${lang}`,
requestBody,
Expand Down
5 changes: 1 addition & 4 deletions src/services/orchestration/orchestrationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getHeaders = () => {
return {
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
"Content-Type": "application/json",
},
};
};
Expand Down Expand Up @@ -53,7 +53,6 @@ export const addPointer = async (points, milestone) => {
const response = await axios.post(
`${API_BASE_URL_ORCHESTRATION}/${config.URLS.ADD_POINTER}`,
{
userId: getVirtualId(),
sessionId: sessionId,
points: points,
language: lang,
Expand All @@ -78,7 +77,6 @@ export const createLearnerProgress = async (

try {
const requestBody = {
userId: getVirtualId(),
sessionId: sessionId,
subSessionId: subSessionId,
milestoneLevel: milestoneLevel,
Expand Down Expand Up @@ -111,7 +109,6 @@ export const addLesson = async ({
const response = await axios.post(
`${API_BASE_URL_ORCHESTRATION}/${config.URLS.ADD_LESSON}`,
{
userId: getVirtualId(),
sessionId: sessionId,
milestone: milestone,
lesson: lesson,
Expand Down
15 changes: 9 additions & 6 deletions src/views/Practice/Practice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ const Practice = () => {
{
score: score,
message: "all-test-rig-score",
}, window?.location?.ancestorOrigins?.[0] || window.parent.location.origin
},
window?.location?.ancestorOrigins?.[0] || window.parent.location.origin
);
}
};
Expand Down Expand Up @@ -419,10 +420,8 @@ const Practice = () => {
});
}

let userState = Number.isInteger(
Number(resLessons?.result?.result?.lesson)
)
? Number(resLessons.result?.result?.lesson)
let userState = Number.isInteger(Number(resLessons?.result?.lesson))
? Number(resLessons.result?.lesson)
: 0;

// TODO: revisit this - looks like not required
Expand Down Expand Up @@ -713,7 +712,11 @@ const Practice = () => {
"mechanic_1")
? 500
: stringLengths[0];
window.parent.postMessage({ type: "stringLengths", length }, window?.location?.ancestorOrigins?.[0] || window.parent.location.origin);
window.parent.postMessage(
{ type: "stringLengths", length },
window?.location?.ancestorOrigins?.[0] ||
window.parent.location.origin
);
}
}
}, [questions[currentQuestion]]);
Expand Down

0 comments on commit 267acea

Please sign in to comment.