From 2617f1a6314f8768eedab11eb946e3490a4f6993 Mon Sep 17 00:00:00 2001 From: Gourav More Date: Fri, 25 Oct 2024 10:32:10 +0530 Subject: [PATCH 1/5] Issue #new env for tn --- .github/workflows/all-dev-tn-new.yml | 95 ++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/all-dev-tn-new.yml diff --git a/.github/workflows/all-dev-tn-new.yml b/.github/workflows/all-dev-tn-new.yml new file mode 100644 index 00000000..481aff75 --- /dev/null +++ b/.github/workflows/all-dev-tn-new.yml @@ -0,0 +1,95 @@ +name: ALL tn new dev Deployment + +on: + push: + branches: + - all-1.3-tn-dev + +jobs: + deploy: + runs-on: ubuntu-latest + environment: all-dev-tn + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "18" + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Clean up node_modules and package-lock.json + run: | + rm -rf node_modules + rm -f package-lock.json + + - name: Install Dependencies + run: npm install --legacy-peer-deps + + - name: Run Husky Install + run: npm run prepare + + - name: Build and Package Application + env: + SKIP_PREFLIGHT_CHECK: ${{ vars.SKIP_PREFLIGHT_CHECK }} + REACT_APP_MODE: ${{ vars.REACT_APP_MODE }} + REACT_APP_authToken: ${{ vars.REACT_APP_authToken }} + REACT_APP_PID: ${{ vars.REACT_APP_PID }} + REACT_APP_UID: ${{ vars.REACT_APP_UID }} + REACT_APP_ID: ${{ vars.REACT_APP_ID }} + REACT_APP_VER: ${{ vars.REACT_APP_VER }} + REACT_APP_TIMEDIFF: ${{ vars.REACT_APP_TIMEDIFF }} + REACT_APP_HOST: ${{ vars.REACT_APP_HOST }} + REACT_APP_ENDPOINT: ${{ vars.REACT_APP_ENDPOINT }} + REACT_APP_APISLUG: ${{ vars.REACT_APP_APISLUG }} + REACT_APP_CHANNEL: ${{ vars.REACT_APP_CHANNEL }} + REACT_APP_ENV: ${{ vars.REACT_APP_ENV }} + REACT_APP_BATCHSIZE: ${{ vars.REACT_APP_BATCHSIZE }} + REACT_APP_CONTENT_SIZE: ${{ vars.REACT_APP_CONTENT_SIZE }} + REACT_APP_LANGUAGE: ${{ vars.REACT_APP_LANGUAGE }} + REACT_APP_TELEMETRY_MODE: ${{ vars.REACT_APP_TELEMETRY_MODE }} + REACT_APP_VIRTUAL_ID_HOST: ${{ vars.REACT_APP_VIRTUAL_ID_HOST }} + REACT_APP_LEARNER_AI_ORCHESTRATION_HOST: ${{ vars.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST }} + REACT_APP_LEARNER_AI_APP_HOST: ${{ vars.REACT_APP_LEARNER_AI_APP_HOST }} + REACT_APP_CONTENT_SERVICE_APP_HOST: ${{ vars.REACT_APP_CONTENT_SERVICE_APP_HOST }} + REACT_APP_CAPTURE_AUDIO: ${{ vars.REACT_APP_CAPTURE_AUDIO }} + REACT_APP_AWS_S3_BUCKET_NAME: ${{ vars.REACT_APP_AWS_S3_BUCKET_NAME }} + REACT_APP_AWS_S3_BUCKET_URL: ${{ vars.REACT_APP_AWS_S3_BUCKET_URL }} + REACT_APP_AWS_S3_REGION: ${{ vars.REACT_APP_AWS_S3_REGION }} + REACT_APP_AWS_S3_BUCKET_CONTENT_URL: ${{ vars.REACT_APP_AWS_S3_BUCKET_CONTENT_URL }} + REACT_APP_MIN_DECIBELS: ${{ vars.REACT_APP_MIN_DECIBELS }} + REACT_APP_IS_AUDIOPREPROCESSING: ${{ vars.REACT_APP_IS_AUDIOPREPROCESSING }} + REACT_APP_POST_LEARNER_PROGRESS: ${{ vars.REACT_APP_POST_LEARNER_PROGRESS }} + REACT_APP_IS_APP_IFRAME: ${{ vars.REACT_APP_IS_APP_IFRAME }} + REACT_APP_IS_IN_APP_AUTHORISATION: ${{ vars.REACT_APP_IS_IN_APP_AUTHORISATION }} + REACT_APP_LANGUAGES: ${{ vars.REACT_APP_LANGUAGES }} + REACT_APP_AWS_ACCESS_KEY_ID: ${{ secrets.REACT_APP_AWS_ACCESS_KEY_ID }} + REACT_APP_AWS_SECRET_ACCESS_KEY: ${{ secrets.REACT_APP_AWS_SECRET_ACCESS_KEY }} + CI: false # Disabling CI to not treat warnings as errors + run: npm run build + + - name: Deploy to S3 Bucket + run: aws s3 sync ./build s3://all-tn-app-dev/assets/test-rig/ + + - name: Debug Environment Variables + run: | + echo "REACT_APP_AWS_S3_BUCKET_NAME: $REACT_APP_AWS_S3_BUCKET_NAME" + echo "AWS_REGION: $AWS_REGION" + echo "secrate": ${{ vars.REACT_APP_AWS_S3_BUCKET_NAME }} + + - name: Cloudfront Invalidation + uses: chetan/invalidate-cloudfront-action@master + env: + DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION_NEW }} + PATHS: "/*" + AWS_REGION: ${{ secrets.AWS_REGION }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From ef82f92090a8cd41e398b33fe85a0f8833143482 Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Mon, 28 Oct 2024 12:30:40 +0530 Subject: [PATCH 2/5] Issueid #229204 fix: Even after speaking correct word,showing wrong answer on result page. PFA --- src/utils/VoiceAnalyser.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/utils/VoiceAnalyser.js b/src/utils/VoiceAnalyser.js index e3bc3d02..9d7260d4 100644 --- a/src/utils/VoiceAnalyser.js +++ b/src/utils/VoiceAnalyser.js @@ -501,6 +501,15 @@ function VoiceAnalyser(props) { ); setApiResponse(callUpdateLearner ? data.status : "success"); + + if ( + callUpdateLearner && + (props.pageName === "wordsorimage" || props.pageName === "m5") + ) { + const isMatching = + responseText.toLowerCase() === originalText.toLowerCase(); + props.updateStoredData(recordedAudio, isMatching); + } if (props.handleNext) { props.handleNext(); if (temp_audio !== null) { @@ -712,12 +721,6 @@ function VoiceAnalyser(props) { { - if ( - props.pageName === "wordsorimage" || - props.pageName === "m5" - ) { - props.updateStoredData(recordedAudio, isMatching); - } if (props.setIsNextButtonCalled) { props.setIsNextButtonCalled(true); } else { From cc3d78ed6fc3f61ea34dc4138b28514954a61a14 Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Mon, 28 Oct 2024 16:31:03 +0530 Subject: [PATCH 3/5] Issueid #229204 fix: Even after speaking correct word,showing wrong answer on result page. PFA --- src/utils/VoiceAnalyser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/VoiceAnalyser.js b/src/utils/VoiceAnalyser.js index 9d7260d4..ca9fa094 100644 --- a/src/utils/VoiceAnalyser.js +++ b/src/utils/VoiceAnalyser.js @@ -507,8 +507,10 @@ function VoiceAnalyser(props) { (props.pageName === "wordsorimage" || props.pageName === "m5") ) { const isMatching = - responseText.toLowerCase() === originalText.toLowerCase(); - props.updateStoredData(recordedAudio, isMatching); + data?.createScoreData?.session?.error_rate?.character === 0; + if (typeof props.updateStoredData === "function") { + props.updateStoredData(recordedAudio, isMatching); + } } if (props.handleNext) { props.handleNext(); From 24f489fc428b732b7c52e974857607365bb05f1e Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Mon, 28 Oct 2024 18:09:56 +0530 Subject: [PATCH 4/5] Issueid #229204 fix: Even after speaking correct word,showing wrong answer on result page. PFA --- src/views/Practice/Practice.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/Practice/Practice.jsx b/src/views/Practice/Practice.jsx index a2bfe855..5fd15360 100644 --- a/src/views/Practice/Practice.jsx +++ b/src/views/Practice/Practice.jsx @@ -716,11 +716,11 @@ const Practice = () => { questions[currentQuestion]?.contentSourceData || []; const stringLengths = contentSourceData.map((item) => item.text.length); const length = - questions[currentQuestion]?.mechanics_data && - (questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === - "mechanic_2" || + (questions[currentQuestion]?.mechanics_data && questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === - "mechanic_1") + "mechanic_2") || + questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === + "mechanic_1" ? 500 : stringLengths[0]; window.parent.postMessage({ type: "stringLengths", length }, "*"); From bd17773997e7d2cdbdc5536da85b16ca02ce1a4d Mon Sep 17 00:00:00 2001 From: Gourav More Date: Wed, 30 Oct 2024 11:34:03 +0530 Subject: [PATCH 5/5] Issue #zoomicon changes for images --- src/components/Practice/Mechanics5.jsx | 104 +++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 6 deletions(-) diff --git a/src/components/Practice/Mechanics5.jsx b/src/components/Practice/Mechanics5.jsx index 1a1f8dd7..c08d93cd 100644 --- a/src/components/Practice/Mechanics5.jsx +++ b/src/components/Practice/Mechanics5.jsx @@ -4,6 +4,9 @@ import MainLayout from "../Layouts.jsx/MainLayout"; import { PlayAudioButton, StopAudioButton } from "../../utils/constants"; import VoiceAnalyser from "../../utils/VoiceAnalyser"; import PropTypes from "prop-types"; +import { Modal } from "@mui/material"; +import ZoomInIcon from "@mui/icons-material/ZoomIn"; +import CloseIcon from "@mui/icons-material/Close"; const Mechanics5 = ({ background, @@ -54,6 +57,7 @@ const Mechanics5 = ({ const audiosRef = useRef( new Array(options.length).fill(null).map(() => React.createRef()) ); + const [zoomOpen, setZoomOpen] = useState(false); const questionAudioRef = useRef(); const [playingIndex, setPlayingIndex] = useState(null); const [selectedOption, setSelectedOption] = useState(null); // Add state to track selected radio button @@ -179,13 +183,101 @@ const Mechanics5 = ({ container sx={{ width: "80%", justifyContent: "center", mb: 2, mt: 8 }} > - - + + {/* Image with full-width gradient overlay on top */} + + contentImage setZoomOpen(true)} // Open modal on click + /> + + {/* Subtle gradient overlay across the top */} + + {/* Zoom icon positioned in the top-left corner */} + setZoomOpen(true)} + sx={{ color: "white", fontSize: "22px", cursor: "pointer" }} + /> + + + + {/* Modal for zoomed image with gradient and close icon */} + setZoomOpen(false)} + sx={{ + display: "flex", + alignItems: "center", + justifyContent: "center", + }} + > + + {/* Subtle gradient overlay at the top of the zoomed image */} + + {/* Close icon positioned within the gradient overlay */} + setZoomOpen(false)} + sx={{ + color: "white", + fontSize: "24px", + cursor: "pointer", + backgroundColor: "rgba(0, 0, 0, 0.5)", + borderRadius: "50%", + padding: "4px", + }} + /> + + + Zoomed content + + +