Skip to content

Commit

Permalink
Merge pull request #765 from paritshivani/learnathon
Browse files Browse the repository at this point in the history
issues
  • Loading branch information
paritshivani authored Nov 12, 2024
2 parents 35c2933 + 4fe7f55 commit 0a3fba4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
18 changes: 18 additions & 0 deletions packages/nulp_elite/src/components/Loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import CircularProgress from "@mui/material/CircularProgress";
import Box from "@mui/material/Box";

function Loader() {
return (
<Box
display="flex"
justifyContent="center"
alignItems="center"
height="100vh"
>
<CircularProgress />
</Box>
);
}

export default Loader;
5 changes: 4 additions & 1 deletion packages/nulp_elite/src/pages/content/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ const Player = () => {
setLearnathonDetails(result.result.data[0]);

setPlayerContent(result.result.data[0].content_id);
if (result.result.data[0].status == "Live") {
setIsPublished(true);
}

if (result.result.data[0].content_id === null || undefined) {
setNoPreviewAvailable(true);
Expand Down Expand Up @@ -840,7 +843,7 @@ const Player = () => {
)}
</div>
)}
{reviewEnable && (
{reviewEnable && !isPublished && (
<div className="vote-section">
<Button
type="button"
Expand Down
23 changes: 12 additions & 11 deletions packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import industryguideline from "../../assets/industry-guidelines.pdf";
import industrytnc from "../../assets/industry-tnc.pdf";
import acdemiatnc from "../../assets/academia-tnc.pdf";
import statetnc from "../../assets/state-tnc.pdf";
import Loader from "components/Loader";

import Alert from "@mui/material/Alert";
const routeConfig = require("../../configs/routeConfig.json");
Expand Down Expand Up @@ -135,6 +136,7 @@ const LernCreatorForm = () => {
const [youtubeUrl, setyoutubeURL] = useState();
const [preIndicativeTheme, setPreIndicativeThemes] = useState();
const [TNCOpen, setTNCOpen] = useState(false);
const [loading, setLoading] = useState(false);

const handleUploadTypeChange = (event) => {
console.log(event.target.value);
Expand Down Expand Up @@ -493,7 +495,12 @@ const LernCreatorForm = () => {
};
const handleFileChange = async (e, type) => {
if (type == "file") {
const mimeType = e.target.files[0].type;
if (e.target.files[0].type == "application/zip") {
const mimeType = "application/vnd.ekstep.html-archive";
} else {
const mimeType = e.target.files[0].type;
}

const _uuid = uuidv4();
const assetBody = {
request: {
Expand All @@ -512,6 +519,7 @@ const LernCreatorForm = () => {
},
};
try {
setLoading(true);
const response = await fetch(`${urlConfig.URLS.ASSET.CREATE}`, {
method: "POST",
headers: {
Expand Down Expand Up @@ -618,12 +626,6 @@ const LernCreatorForm = () => {
} finally {
}
});

console.log("file uploaded---");
setFormData({
...formData,
content_id: uploadResult.result.identifier,
});
setErrors({ ...errors, content_id: "" });
} catch (error) {
console.log("error---", error);
Expand Down Expand Up @@ -702,6 +704,7 @@ const LernCreatorForm = () => {
...formData,
content_id: uploadResult.result.identifier,
});
setLoading(true);
setErrors({ ...errors, icon: "" });
} catch (error) {
console.log("error---", error);
Expand Down Expand Up @@ -1502,18 +1505,16 @@ const LernCreatorForm = () => {
<div style={{ marginTop: "20px" }}>
<Button
variant="contained"
color="primary"
className="viewAll"
onClick={() => {
setOpenPersonalForm(true); // Proceed action
setOpenConfirmModal(false); // Close modal after proceeding
}}
style={{ marginRight: "10px" }}
>
{t("PROCEED")}
</Button>
<Button
variant="outlined"
color="secondary"
className="custom-btn-default"
onClick={() => setOpenConfirmModal(false)}
>
{"CANCEL"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const LernReviewList = () => {
};

const routeConfig = require("../../configs/routeConfig.json");

window.location.reload();
useEffect(() => {
fetchData();
fetchUserData();
Expand Down

0 comments on commit 0a3fba4

Please sign in to comment.