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

TASK :#0000 [Direct Connect] If list is empty then sow the empty as m… #614

Merged
merged 2 commits into from
Sep 16, 2024
Merged
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
30 changes: 26 additions & 4 deletions packages/nulp_elite/src/pages/SelectPreference.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const SelectPreference = ({ isOpen, onClose }) => {
const [toasterMessage, setToasterMessage] = useState("");
const [orgId, setOrgId] = useState();
const [framworkname, setframworkname] = useState(false);
const [toastMessage, setToastMessage] = useState("");
const [showToast, setShowToast] = useState(false);

const showErrorMessage = (msg) => {
setToasterMessage(msg);
Expand Down Expand Up @@ -298,11 +300,22 @@ const SelectPreference = ({ isOpen, onClose }) => {
},
body: JSON.stringify(requestBody),
});

if (!response.ok) {
showErrorMessage(t("FAILED_TO_FETCH_DATA"));
if (response.ok) {
setToastMessage(t("Preferences updated successfully!"));
setShowToast(true);
onClose();
} else {
showErrorMessage(t("FAILED_TO_FETCH_DATA"));
throw new Error(t("FAILED_TO_FETCH_DATA"));
}
// if (!response.ok) {
// showErrorMessage(t("FAILED_TO_FETCH_DATA"));
// throw new Error(t("FAILED_TO_FETCH_DATA"));
// }
// if(response.ok){
// setToastMessage("Preferance Updated Successfully");
// setShowToast(true);
// }

const responseData = await response.json();
} catch (error) {
Expand All @@ -317,6 +330,10 @@ const SelectPreference = ({ isOpen, onClose }) => {
onClose();
};

const closeToast = () => {
setShowToast(false);
};

const handleClose = () => {
onClose();
};
Expand Down Expand Up @@ -355,7 +372,8 @@ const SelectPreference = ({ isOpen, onClose }) => {
]);

return (
<Dialog
<>
<Dialog
open={isOpen}
// onClose={handleClose}
maxWidth="sm"
Expand Down Expand Up @@ -468,6 +486,10 @@ const SelectPreference = ({ isOpen, onClose }) => {
</Button>
</DialogActions>
</Dialog>
{showToast && (
<ToasterCommon response={toastMessage} onClose={closeToast} />
)}
</>
);
};

Expand Down
8 changes: 7 additions & 1 deletion packages/nulp_elite/src/pages/connections/AddConnections.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const AddConnections = () => {
useState();
const [loggedInUserId, setLoggedInUserId] = useState();
const location = useLocation();
const [invitationReceiverByUser, setInvitationReceivedUserByIds] = useState();
const [invitationReceiverByUser, setInvitationReceivedUserByIds] = useState([]);
const [userChat, setUserChat] = useState();
const [isModalOpen, setIsModalOpen] = useState(false);
const [showModal, setShowModal] = useState(false);
Expand Down Expand Up @@ -1582,6 +1582,12 @@ const AddConnections = () => {
</TabPanel>
<TabPanel value="2">
<Box className="scroll">
{invitationReceiverByUser.length ===0 && (
<Box marginTop="26px" marginLeft="163px">
{t("NO Chat Request")}
</Box>

)}
{invitationReceiverByUser &&
invitationReceiverByUser.map((item) => (
<List
Expand Down
1 change: 1 addition & 0 deletions packages/nulp_elite/src/pages/connections/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ const Chat = ({
placeholder="Enter your message here..."
fullWidth
sx={{ fontSize: "13px" }}
inputProps={{ maxLength: charLimit }}
/>
<Box mt={1} textAlign="right" sx={{ fontSize: "12px", color: "#484848" ,marginTop: "0px",backgroundColor:"#ffffff", padding: "25px"}}>
{`${textValue.length}/${charLimit}`}
Expand Down
8 changes: 8 additions & 0 deletions packages/nulp_elite/src/pages/content/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,14 @@ const attemptid = ()=>{
<Typography>{t("ABOUTTHECONTENT")}</Typography>
</AccordionSummary>
<AccordionDetails>
{lesson?.attributions && (
<>
<Box sx={{ fontWeight: 'bold' }}>{t("ATTRIBUTIONS")}</Box>
<Box>
{lesson?.attributions.join(', ')}
</Box>
</>
)}
<Box sx={{ fontWeight: 'bold' }}>{t("LICENSEDETAILS")} : </Box>
{lesson?.licenseDetails && (
<Typography className="mb-10">
Expand Down
13 changes: 12 additions & 1 deletion packages/nulp_elite/src/pages/profileData.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const PopupForm = ({ open, handleClose }) => {

const [initialFirstName, setInitialFirstName] = useState("");
const [initialLastName, setInitialLastName] = useState("");
const maxChars = 500;
const { t } = useTranslation();

useEffect(() => {
Expand Down Expand Up @@ -123,6 +124,12 @@ const PopupForm = ({ open, handleClose }) => {
handleClose();
};

const handleBioChange = (e) => {
if (e.target.value.length <= maxChars) {
setBio(e.target.value);
}
};

return (
<Modal
open={open}
Expand Down Expand Up @@ -172,8 +179,12 @@ const PopupForm = ({ open, handleClose }) => {
type="text"
fullWidth
value={bio}
onChange={(e) => setBio(e.target.value)}
onChange={handleBioChange}
inputProps={{ maxLength: maxChars }}
/>
<Typography variant="body2" color="textSecondary">
{bio.length}/{maxChars}
</Typography>
<FormControl fullWidth margin="dense">
<Select
options={designations}
Expand Down
Loading