From 162ce9c5fc78a20388c83041a08ca7b8f4a375ed Mon Sep 17 00:00:00 2001 From: keerthieaaswar Date: Fri, 17 Jan 2025 13:19:05 +0530 Subject: [PATCH 1/5] Update Player.js --- .../nulp_elite/src/pages/content/Player.js | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/nulp_elite/src/pages/content/Player.js b/packages/nulp_elite/src/pages/content/Player.js index cb5ae015..9386afcb 100644 --- a/packages/nulp_elite/src/pages/content/Player.js +++ b/packages/nulp_elite/src/pages/content/Player.js @@ -255,6 +255,21 @@ const Player = () => { [isEnrolled, _userId, contentId, courseId, batchId] ); + const replaceDomain = (obj, oldDomain, newDomain) => { + if (typeof obj === "string") { + return obj.replace(new RegExp(oldDomain, "g"), newDomain); + } else if (Array.isArray(obj)) { + return obj.map((item) => replaceDomain(item, oldDomain, newDomain)); + } else if (typeof obj === "object" && obj !== null) { + return Object.entries(obj).reduce((acc, [key, value]) => { + acc[key] = replaceDomain(value, oldDomain, newDomain); + return acc; + }, {}); + } + + return obj; + }; + useEffect( async () => { setPreviousRoute(sessionStorage.getItem("previousRoutes")); @@ -270,7 +285,12 @@ const Player = () => { if (!response.ok) throw new Error("Failed to fetch course data"); const data = await response.json(); console.log("data.result.content", data.result.content); - setLesson(data.result.content); + const updatedResponse = replaceDomain( + data.result.content, + "devnewnulp.blob.core.windows.net", + "devnewnulpblob.blob.core.windows.net" + ); + setLesson(updatedResponse); } catch (error) { console.error("Error fetching course data:", error); } @@ -387,7 +407,12 @@ const Player = () => { if (!response.ok) throw new Error("Failed to fetch course data"); const data = await response.json(); console.log("data.result.content", data.result.content); - setLesson(data.result.content); + const updatedResponse = replaceDomain( + data.result.content, + "devnewnulp.blob.core.windows.net", + "devnewnulpblob.blob.core.windows.net" + ); + setLesson(updatedResponse); } catch (error) { console.error("Error fetching course data:", error); } From 2833e4dc7c512a7af21f911666a4989c63427a0b Mon Sep 17 00:00:00 2001 From: keerthieaaswar Date: Sun, 19 Jan 2025 18:32:55 +0530 Subject: [PATCH 2/5] Update Player.js --- packages/nulp_elite/src/pages/content/Player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nulp_elite/src/pages/content/Player.js b/packages/nulp_elite/src/pages/content/Player.js index 9386afcb..627f8064 100644 --- a/packages/nulp_elite/src/pages/content/Player.js +++ b/packages/nulp_elite/src/pages/content/Player.js @@ -409,8 +409,8 @@ const Player = () => { console.log("data.result.content", data.result.content); const updatedResponse = replaceDomain( data.result.content, - "devnewnulp.blob.core.windows.net", - "devnewnulpblob.blob.core.windows.net" + "nulpstorage1.blob.core.windows.net", + "nulpstorage.blob.core.windows.net" ); setLesson(updatedResponse); } catch (error) { From d65b280c292efa06f55462b159b9cdf98ba05551 Mon Sep 17 00:00:00 2001 From: keerthieaaswar Date: Sun, 19 Jan 2025 19:24:31 +0530 Subject: [PATCH 3/5] Update Player.js --- packages/nulp_elite/src/pages/content/Player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nulp_elite/src/pages/content/Player.js b/packages/nulp_elite/src/pages/content/Player.js index 627f8064..0f29c32d 100644 --- a/packages/nulp_elite/src/pages/content/Player.js +++ b/packages/nulp_elite/src/pages/content/Player.js @@ -287,8 +287,8 @@ const Player = () => { console.log("data.result.content", data.result.content); const updatedResponse = replaceDomain( data.result.content, - "devnewnulp.blob.core.windows.net", - "devnewnulpblob.blob.core.windows.net" + "nulpstorage1.blob.core.windows.net", + "nulpstorage.blob.core.windows.net" ); setLesson(updatedResponse); } catch (error) { From 5e15d9ec7734cf3631f266005433d7b2a6fe0ce6 Mon Sep 17 00:00:00 2001 From: keerthieaaswar Date: Sun, 19 Jan 2025 19:27:20 +0530 Subject: [PATCH 4/5] Update Player.js --- packages/nulp_elite/src/pages/content/Player.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/nulp_elite/src/pages/content/Player.js b/packages/nulp_elite/src/pages/content/Player.js index 0f29c32d..8df9526b 100644 --- a/packages/nulp_elite/src/pages/content/Player.js +++ b/packages/nulp_elite/src/pages/content/Player.js @@ -290,6 +290,7 @@ const Player = () => { "nulpstorage1.blob.core.windows.net", "nulpstorage.blob.core.windows.net" ); + console.log("updatedResponse", updatedResponse); setLesson(updatedResponse); } catch (error) { console.error("Error fetching course data:", error); @@ -412,6 +413,7 @@ const Player = () => { "nulpstorage1.blob.core.windows.net", "nulpstorage.blob.core.windows.net" ); + console.log("updatedResponse", updatedResponse); setLesson(updatedResponse); } catch (error) { console.error("Error fetching course data:", error); From aed4c839e4ec24f2b3a82804259c95db8bfb5a3b Mon Sep 17 00:00:00 2001 From: keerthieaaswar Date: Tue, 21 Jan 2025 20:00:50 +0530 Subject: [PATCH 5/5] added loader and modified the note --- .../public/locales/as/translation.json | 2 +- .../public/locales/en/translation.json | 2 +- .../public/locales/kn/translation.json | 2 +- .../public/locales/or/translation.json | 2 +- .../public/locales/pa/translation.json | 2 +- .../public/locales/ur/translation.json | 2 +- packages/nulp_elite/src/pages/FAQPage.js | 14 +- .../src/pages/learnathon/lernCreatorForm.js | 582 ++++++++++-------- 8 files changed, 355 insertions(+), 253 deletions(-) diff --git a/packages/nulp_elite/public/locales/as/translation.json b/packages/nulp_elite/public/locales/as/translation.json index 698afc56..cdf347f8 100644 --- a/packages/nulp_elite/public/locales/as/translation.json +++ b/packages/nulp_elite/public/locales/as/translation.json @@ -378,7 +378,7 @@ "NAME_OF_ORG": "Name Of Organisation", "NEED_HELP": "Need help?", "CONFIRM_DELETE": "Are you sure you want to delete this submission?", - "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links", + "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links. Maximum file size for Video is 500 MB. Videos above 500 MB to be uploaded on YouTube and the link can be submitted.", "STAR_CITY_MSG": "State & City fields are not mandatory. Those submitting from Industry, Academia and other Non-Government entities may wish to avoid filling the same.", "IMG_GUIDELINES": "Upload png, jpeg (Max File size: 1MB)", "NO_CONTENT_TO_PLAY": "No content available to play", diff --git a/packages/nulp_elite/public/locales/en/translation.json b/packages/nulp_elite/public/locales/en/translation.json index c44635fe..c7c29e7a 100644 --- a/packages/nulp_elite/public/locales/en/translation.json +++ b/packages/nulp_elite/public/locales/en/translation.json @@ -380,7 +380,7 @@ "NAME_OF_ORG": "Name Of Organisation", "NEED_HELP": "Need help?", "CONFIRM_DELETE": "Are you sure you want to delete this submission?", - "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links", + "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links. Maximum file size for Video is 500 MB. Videos above 500 MB to be uploaded on YouTube and the link can be submitted.", "STAR_CITY_MSG": "State & City fields are not mandatory. Those submitting from Industry, Academia and other Non-Government entities may wish to avoid filling the same.", "IMG_GUIDELINES": "Upload png, jpeg (Max File size: 1MB)", "NO_CONTENT_TO_PLAY": "No content available to play", diff --git a/packages/nulp_elite/public/locales/kn/translation.json b/packages/nulp_elite/public/locales/kn/translation.json index 698afc56..cdf347f8 100644 --- a/packages/nulp_elite/public/locales/kn/translation.json +++ b/packages/nulp_elite/public/locales/kn/translation.json @@ -378,7 +378,7 @@ "NAME_OF_ORG": "Name Of Organisation", "NEED_HELP": "Need help?", "CONFIRM_DELETE": "Are you sure you want to delete this submission?", - "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links", + "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links. Maximum file size for Video is 500 MB. Videos above 500 MB to be uploaded on YouTube and the link can be submitted.", "STAR_CITY_MSG": "State & City fields are not mandatory. Those submitting from Industry, Academia and other Non-Government entities may wish to avoid filling the same.", "IMG_GUIDELINES": "Upload png, jpeg (Max File size: 1MB)", "NO_CONTENT_TO_PLAY": "No content available to play", diff --git a/packages/nulp_elite/public/locales/or/translation.json b/packages/nulp_elite/public/locales/or/translation.json index 698afc56..cdf347f8 100644 --- a/packages/nulp_elite/public/locales/or/translation.json +++ b/packages/nulp_elite/public/locales/or/translation.json @@ -378,7 +378,7 @@ "NAME_OF_ORG": "Name Of Organisation", "NEED_HELP": "Need help?", "CONFIRM_DELETE": "Are you sure you want to delete this submission?", - "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links", + "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links. Maximum file size for Video is 500 MB. Videos above 500 MB to be uploaded on YouTube and the link can be submitted.", "STAR_CITY_MSG": "State & City fields are not mandatory. Those submitting from Industry, Academia and other Non-Government entities may wish to avoid filling the same.", "IMG_GUIDELINES": "Upload png, jpeg (Max File size: 1MB)", "NO_CONTENT_TO_PLAY": "No content available to play", diff --git a/packages/nulp_elite/public/locales/pa/translation.json b/packages/nulp_elite/public/locales/pa/translation.json index 698afc56..cdf347f8 100644 --- a/packages/nulp_elite/public/locales/pa/translation.json +++ b/packages/nulp_elite/public/locales/pa/translation.json @@ -378,7 +378,7 @@ "NAME_OF_ORG": "Name Of Organisation", "NEED_HELP": "Need help?", "CONFIRM_DELETE": "Are you sure you want to delete this submission?", - "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links", + "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links. Maximum file size for Video is 500 MB. Videos above 500 MB to be uploaded on YouTube and the link can be submitted.", "STAR_CITY_MSG": "State & City fields are not mandatory. Those submitting from Industry, Academia and other Non-Government entities may wish to avoid filling the same.", "IMG_GUIDELINES": "Upload png, jpeg (Max File size: 1MB)", "NO_CONTENT_TO_PLAY": "No content available to play", diff --git a/packages/nulp_elite/public/locales/ur/translation.json b/packages/nulp_elite/public/locales/ur/translation.json index 698afc56..cdf347f8 100644 --- a/packages/nulp_elite/public/locales/ur/translation.json +++ b/packages/nulp_elite/public/locales/ur/translation.json @@ -378,7 +378,7 @@ "NAME_OF_ORG": "Name Of Organisation", "NEED_HELP": "Need help?", "CONFIRM_DELETE": "Are you sure you want to delete this submission?", - "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links", + "CONT_FORMAT": "Supported formats: MP4, PDF, HTML5, YouTube links. Maximum file size for Video is 500 MB. Videos above 500 MB to be uploaded on YouTube and the link can be submitted.", "STAR_CITY_MSG": "State & City fields are not mandatory. Those submitting from Industry, Academia and other Non-Government entities may wish to avoid filling the same.", "IMG_GUIDELINES": "Upload png, jpeg (Max File size: 1MB)", "NO_CONTENT_TO_PLAY": "No content available to play", diff --git a/packages/nulp_elite/src/pages/FAQPage.js b/packages/nulp_elite/src/pages/FAQPage.js index 41796171..f8e57a6a 100644 --- a/packages/nulp_elite/src/pages/FAQPage.js +++ b/packages/nulp_elite/src/pages/FAQPage.js @@ -26,19 +26,19 @@ const FAQPage = () => { const setLanguage = localStorage.getItem('lang') || 'en'; let url; if (setLanguage === 'en') { - url = "https://nulpstorage1.blob.core.windows.net/public/portal-faq/resources/res/faq-en.json"; + url = "https://nulpstorage.blob.core.windows.net/public/portal-faq/resources/res/faq-en.json"; } else if (setLanguage === 'hi') { - url = "https://nulpstorage1.blob.core.windows.net/public/portal-faq/resources/res/faq-hi.json"; + url = "https://nulpstorage.blob.core.windows.net/public/portal-faq/resources/res/faq-hi.json"; } else if (setLanguage === 'gg') { - url = "https://nulpstorage1.blob.core.windows.net/public/portal-faq/resources/res/faq-gu.json"; + url = "https://nulpstorage.blob.core.windows.net/public/portal-faq/resources/res/faq-gu.json"; } else if (setLanguage === 'ta') { - url = "https://nulpstorage1.blob.core.windows.net/public/portal-faq/resources/res/faq-ta.json"; + url = "https://nulpstorage.blob.core.windows.net/public/portal-faq/resources/res/faq-ta.json"; } else if (setLanguage === 'be') { - url = "https://nulpstorage1.blob.core.windows.net/public/portal-faq/resources/res/faq-be.json"; + url = "https://nulpstorage.blob.core.windows.net/public/portal-faq/resources/res/faq-be.json"; } else if (setLanguage === 'ma') { - url = "https://nulpstorage1.blob.core.windows.net/public/portal-faq/resources/res/faq-mr.json"; + url = "https://nulpstorage.blob.core.windows.net/public/portal-faq/resources/res/faq-mr.json"; } else if (setLanguage === 'mal') { - url = "https://nulpstorage1.blob.core.windows.net/public/portal-faq/resources/res/faq-ml.json"; + url = "https://nulpstorage.blob.core.windows.net/public/portal-faq/resources/res/faq-ml.json"; } useEffect(() => { diff --git a/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js b/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js index 3d67337a..2208c528 100644 --- a/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js +++ b/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js @@ -11,6 +11,7 @@ import { Autocomplete, Radio, RadioGroup, + CircularProgress, } from "@mui/material"; import HelpOutlineIcon from "@mui/icons-material/HelpOutline"; @@ -29,7 +30,7 @@ import industrytnc from "../../assets/tnc.pdf"; import acdemiatnc from "../../assets/tnc.pdf"; import statetnc from "../../assets/tnc.pdf"; import Loader from "components/Loader"; -import Checkbox from '@mui/material/Checkbox'; +import Checkbox from "@mui/material/Checkbox"; import Alert from "@mui/material/Alert"; const routeConfig = require("../../configs/routeConfig.json"); @@ -309,7 +310,10 @@ const LernCreatorForm = () => { tempErrors.name_of_organisation = "Name of Organisation is required"; if (!formData.indicative_theme) tempErrors.indicative_theme = "Indicative Theme is required"; - if (!formData.indicative_sub_theme && formData.indicative_theme !=="Miscellaneous/ Others") + if ( + !formData.indicative_sub_theme && + formData.indicative_theme !== "Miscellaneous/ Others" + ) tempErrors.indicative_sub_theme = "Indicative Sub Theme is required"; if ( formData.indicative_theme == "Miscellaneous/ Others" && @@ -499,13 +503,6 @@ const LernCreatorForm = () => { }; const handleFileChange = async (e, type) => { if (type == "file") { - // let mimeType; - // if (e.target.files[0].type == "application/zip") { - // mimeType = "application/vnd.ekstep.html-archive"; - // } else { - // mimeType = e.target.files[0].type; - // } - const _uuid = uuidv4(); const assetBody = { request: { @@ -522,7 +519,6 @@ const LernCreatorForm = () => { e.target.files[0].type == "application/zip" ? "application/vnd.ekstep.html-archive" : e.target.files[0].type, - // mimeType: mimeType, createdBy: _userId, organisation: [userInfo.rootOrg.channel], createdFor: [userInfo.rootOrg.id], @@ -545,7 +541,8 @@ const LernCreatorForm = () => { } const result = await response.json(); - console.log("suceesss----", result); + console.log("success----", result); + const imgId = result.result.identifier; const uploadBody = { request: { @@ -554,6 +551,7 @@ const LernCreatorForm = () => { }, }, }; + try { const response = await fetch( `${urlConfig.URLS.ASSET.UPLOADURL}/${result.result.identifier}`, @@ -571,12 +569,10 @@ const LernCreatorForm = () => { } const uploadResult = await response.json(); - console.log("upload suceesss------", uploadResult); - const imgId = result.result.identifier; + console.log("upload success------", uploadResult); + const url = uploadResult.result.pre_signed_url; const file = e.target.files[0]; - const csp = "azure"; // Cloud provider (azure, aws, etc.) - const uploader = new SunbirdFileUploadLib.FileUploader(); uploader @@ -586,28 +582,21 @@ const LernCreatorForm = () => { csp: "azure", }) .on("error", (error) => { - console.log("0000", error); + console.log("error", error); }) .on("completed", async (completed) => { - console.log("1111", completed); - - console.log("url", url); - // console.log("mimeType", mimeType); - + console.log("completed", completed); const fileURL = url.split("?")[0]; - console.log("fileUrl", fileURL); + const data = new FormData(); const mimeType = e.target.files[0].type == "application/zip" ? "application/vnd.ekstep.html-archive" : e.target.files[0].type; + data.append("fileUrl", fileURL); data.append("mimeType", mimeType); - data.forEach((value, key) => { - console.log(`${key}:`, value); - }); - try { const response = await fetch( `${urlConfig.URLS.ASSET.UPLOAD}/${imgId}`, @@ -622,7 +611,7 @@ const LernCreatorForm = () => { } const uploadResult = await response.json(); - console.log("upload suceesss------", uploadResult); + console.log("final upload success------", uploadResult); setFormData({ ...formData, content_id: uploadResult.result.identifier, @@ -631,20 +620,21 @@ const LernCreatorForm = () => { } catch (error) { console.log("error---", error); } finally { + setLoading(false); } }); setErrors({ ...errors, content_id: "" }); } catch (error) { console.log("error---", error); } finally { + setLoading(false); } } catch (error) { console.log("error---", error); - // setError(error.message); } finally { + setLoading(false); } } else if (type == "url") { - console.log("------------------", youtubeUrl); const youtubeRegex = /^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be)\/.+$/; @@ -669,6 +659,7 @@ const LernCreatorForm = () => { }, }; try { + setLoading(true); const response = await fetch(`${urlConfig.URLS.ASSET.CREATE}`, { method: "POST", headers: { @@ -682,16 +673,13 @@ const LernCreatorForm = () => { } const result = await response.json(); - console.log("suceesss----", result); + console.log("success----", result); + const cont_id = result.result.identifier; const data = new FormData(); data.append("fileUrl", youtubeUrl); data.append("mimeType", "video/x-youtube"); - data.forEach((value, key) => { - console.log(`${key}:`, value); - }); - try { const response = await fetch( `${urlConfig.URLS.ASSET.UPLOAD}/${cont_id}`, @@ -706,21 +694,21 @@ const LernCreatorForm = () => { } const uploadResult = await response.json(); - console.log("upload suceesss------", uploadResult); + console.log("upload success------", uploadResult); setFormData({ ...formData, content_id: uploadResult.result.identifier, }); - setLoading(true); setErrors({ ...errors, icon: "" }); } catch (error) { console.log("error---", error); } finally { + setLoading(false); } } catch (error) { console.log("error---", error); - // setError(error.message); } finally { + setLoading(false); } } else { let tempErrors = {}; @@ -1390,16 +1378,20 @@ const LernCreatorForm = () => { {uploadType === "file" ? ( - handleFileChange(event, "file")} - error={!!errors.content_id} - inputProps={{ - accept: "video/mp4,application/pdf,text/html", - }} - sx={{ border: "1px dashed" }} - /> + {!loading ? ( + handleFileChange(event, "file")} + error={!!errors.content_id} + inputProps={{ + accept: "video/mp4,application/pdf,text/html", + }} + sx={{ border: "1px dashed" }} + /> + ) : ( + + )} ) : ( @@ -1466,7 +1458,7 @@ const LernCreatorForm = () => { > - + - - - + +
  • + Sexually Explicit Content +
      +
    • + Content must not include pornography, + sexually explicit material, or depictions of + sexual acts. +
    • +
    +
  • +
  • + + Sexual Violence and Exploitation + +
      +
    • + Content must not depict or promote the + sexual exploitation of minors or incidents + of sexual violence. +
    • +
    +
  • +
  • + Nudity and Vulgarity +
      +
    • + Content must not display nudity unless it is + educational, documentary, scientific, or + artistic with clear context. +
    • +
    • + Content must not include vulgarity, + obscenity, or degrading material. +
    • +
    +
  • +
  • + Violence +
      +
    • + Content must not promote, encourage, or + glorify violent actions or behaviors. +
    • +
    +
  • +
  • + Discrimination and Bullying +
      +
    • + Content must not degrade, shame, or harass + individuals or groups. +
    • +
    +
  • +
  • + Harmful or Dangerous Content +
      +
    • + Content must not incite dangerous or illegal + activities. +
    • +
    +
  • +
  • + Involvement of Children +
      +
    • + Content must not depict children subjected + to abuse or violence. +
    • +
    +
  • +
  • + Substance Abuse +
      +
    • + Content must not encourage or glorify the + use of alcohol, drugs, or tobacco. +
    • +
    +
  • +
  • + Defamation +
      +
    • + Content must not defame or ridicule + individuals, groups, or people with + disabilities. +
    • +
    +
  • +
  • + + Content Sensitive to Children with Special + Needs + +
      +
    • + Content must be accessible and sensitive to + children with special needs. +
    • +
    +
  • +
  • + Environmental Sensitivity +
      +
    • + Content must not glorify activities causing + environmental damage. +
    • +
    +
  • +
  • + Copyright Compliance +
      +
    • + You confirm that you own the rights to the + submitted content or have the necessary + permissions/licenses. +
    • +
    • + NULP is not liable for copyright + infringement claims arising from your + content. +
    • +
    +
  • +
  • + + User Responsibility and Agreement + +
      +
    • + By submitting content, you certify that your + submission complies with these terms and + conditions. +
    • +
    • + You agree to take full responsibility for + any content you submit, including any + consequences arising from non-compliance. +
    • +
    • + NULP reserves the right to review, remove, + or reject any content that violates these + terms or fails to align with the platform's + standards. +
    • +
    • + Users submitting content that repeatedly + violates these terms may face account + suspension or termination. +
    • +
    • + If any copyright issue or participation + through unfair means is identified by + competent authority, your entry will be + deleted from NULP, prize money will be + forfeited, and you will be banned from + further participation. +
    • +
    +
  • + +

    + Content Review and Moderation +

    +

    + The NULP team reserves the right to moderate, + monitor, and take action against any submitted + content that breaches these terms. In this regard + decisions made by the team will be final. +

    +

    + By proceeding with the submission, you acknowledge + and agree to abide by these Terms and Conditions. +

    + + + {/* Modal Actions */} + + } + label={t( + "I hereby confirm that I accept the above-mentioned terms and conditions." + )} + /> -
    - - - )} - + + + + + + + + + + + )}