Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
21 changes: 18 additions & 3 deletions src/config/config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
/* Constants to be used across the app */

export const APP_CONSTANTS = {
APP_TITLE: 'Consuli',
PAGE_NOT_FOUND: 'Page Not found',
APP_TITLE: "Consuli",
PAGE_NOT_FOUND: "Page Not found",
};

export const API_CONSTANTS = {
API_URL: 'http://localhost:3001/',
API_URL: "http://localhost:3001/",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this URL for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from beginning it s the same

};

export const POPUP_TEXT_CONSTANT = {
DEMO_MAX_MILESTONE_POPUP_TEXT: (
<>
You have reached the final milestone for the demo. To explore additional
levels, please{" "}
<a href="mailto:sunbird@tekditechnologies.com">click here</a> to contact
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should come from the env configuration

the ALL support team.
</>
),
};

export const MILESTONE_LEVEL = {
DEMO_MAX_MILESTONE_LEVEL: "m5",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be hardcoded here. this should be the part of env config

};
10 changes: 10 additions & 0 deletions src/views/Practice/Practice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { Typography } from "@mui/material";
import config from "../../utils/urlConstants.json";
import { MessageDialog } from "../../components/Assesment/Assesment";
import { Log } from "../../services/telementryService";
import { POPUP_TEXT_CONSTANT, MILESTONE_LEVEL } from "../../config/config";

const Practice = () => {
const [page, setPage] = useState("");
Expand Down Expand Up @@ -248,6 +249,15 @@ const Practice = () => {
);
}
setLocalData("previous_level", getSetData.data.previous_level);
if (
getSetData.data.previous_level ===
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use optional chaining operator

MILESTONE_LEVEL.DEMO_MAX_MILESTONE_LEVEL
) {
setOpenMessageDialog({
message: POPUP_TEXT_CONSTANT.DEMO_MAX_MILESTONE_POPUP_TEXT,
dontShowHeader: true,
});
}
if (getSetData.data.sessionResult === "pass") {
try {
await axios.post(
Expand Down