Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New blob name #845

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/nulp_elite/public/locales/as/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/nulp_elite/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/nulp_elite/public/locales/kn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/nulp_elite/public/locales/or/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/nulp_elite/public/locales/pa/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/nulp_elite/public/locales/ur/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions packages/nulp_elite/src/pages/FAQPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
31 changes: 29 additions & 2 deletions packages/nulp_elite/src/pages/content/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -270,7 +285,13 @@ 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,
"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);
}
Expand Down Expand Up @@ -387,7 +408,13 @@ 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,
"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);
}
Expand Down
Loading
Loading