Skip to content

Commit

Permalink
Merge pull request #517 from EscolaLMS/feature/REK-71
Browse files Browse the repository at this point in the history
Feature/rek 71
  • Loading branch information
victazzz authored Nov 28, 2024
2 parents 9f68edc + 2f246ee commit f8c684a
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 27 deletions.
4 changes: 3 additions & 1 deletion src/components/Authentication/AuthWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import styled from "styled-components";

const StyledLoginPage = styled.div`
min-height: calc(100vh - 682px);
min-height: calc(100vh - 592px);
max-height: calc(100vh - 9px);
padding: 100px 0px;
display: flex;
align-items: center;
justify-content: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,14 @@ export const EndMeetingQuestionnairesModal = ({
},
questionnaire
) => {
const questionnaireFrequency = questionnaire.models.find(
(model) => model.model_type_title === entityModel
const frequency = questionnaire.models.find(
(model) =>
model.model_type_title === entityModel &&
model.model_id === entityId
// @ts-ignore add to sdk
)?.display_frequency_minutes;

if (
questionnaireFrequency !== null &&
questionnaireFrequency !== undefined &&
questionnaireFrequency === 0
) {
if (frequency !== null && frequency !== undefined && frequency === 0) {
acc.endMeetingQuestionnaires.push(questionnaire);
}
return acc;
Expand All @@ -100,7 +98,7 @@ export const EndMeetingQuestionnairesModal = ({
...prevState,
...categorized,
}));
}, [questionnaires, entityModel]);
}, [questionnaires, entityModel, entityId]);

const moveToNextQuestionnaire = useCallback(() => {
setState((prevState) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,18 @@ export const QuestionnairesModal = ({
},
questionnaire
) => {
const questionnaireFrequency = questionnaire.models.find(
const frequency = questionnaire.models.find(
(model) =>
model.model_type_title === entityModel &&
model.model_id === entityId
// @ts-ignore add to sdk
)?.display_frequency_minutes;

if (
!questionnaireFrequency &&
questionnaireFrequency !== undefined &&
questionnaireFrequency !== 0
) {
if (!frequency && frequency !== undefined && frequency !== 0) {
acc.firstTimeQuestionnaires.push(questionnaire);
}

if (
questionnaireFrequency !== null &&
questionnaireFrequency !== undefined &&
questionnaireFrequency !== 0
) {
if (frequency !== null && frequency !== undefined && frequency !== 0) {
acc.reShowableQuestionnaires.push(questionnaire);
}
return acc;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Courses/RateCourse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const RateCourse: React.FC<Props> = ({
}
);
if (request.success) {
toast(`${t("RateCourse.ThankYouMessage")}`, "success");
toast(`${t("RateCourse.")}`, "success");
}
} catch (error) {
toast("Error", "error");
Expand Down
20 changes: 19 additions & 1 deletion src/components/Profile/ProfileConsultations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ConsultationCard from "@/components/Consultations/ConsultationCard";
import ProfileConsultationsProvider from "./ProfileConsultationsProvider";
import { CourseCardSkeleton } from "@/components/Skeletons/CourseCard";
import { API } from "@escolalms/sdk/lib";

// import { isPast } from "date-fns";
interface ProfileConsultationsProps {
type: ConsultationStatus;
}
Expand Down Expand Up @@ -37,15 +37,33 @@ const ProfileConsultations = ({ type }: ProfileConsultationsProps) => {
return uniqueConsultations;
}, [type, userConsultations.list?.data]);

// const handleRefreshIfTimePassed = useCallback(() => {
// console.log("handleRefreshIfTimePassed");
// console.log(filterConstulations);
// filterConstulations.forEach((consultation) => {
// if (
// consultation.executed_at &&
// isPast(new Date(consultation.executed_at)) &&
// consultation.categories
// ) {
// fetchUserConsultations();
// }
// });
// }, [filterConstulations, fetchUserConsultations]);

useEffect(() => {
fetchUserConsultations();
}, [type, fetchUserConsultations]);

useEffect(() => {
setConsultationsData([]);
setConsultationsData(filterConstulations);
// const interval = setInterval(() => {
// handleRefreshIfTimePassed();
// }, 5000);
return () => {
setConsultationsData([]);
// clearInterval(interval);
};
}, [type, filterConstulations]);

Expand Down
6 changes: 3 additions & 3 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ const resources = {
WriteComment: "Write comment",
RateScale: "Rate on a scale of 1 - 5",
ThankYou: "Thank you for rating this course",
ThankYouMessage: "Your rating has been saved",
ThankYouMessage: "Thank you for your reply",
OptionalComment:
"Here you can write a comment or leave a review (optional)",
SendAnswer: "Send",
Expand Down Expand Up @@ -1265,7 +1265,7 @@ const resources = {
"EscolaLms\\Consultations\\Events\\ReminderTrainerAboutTerm":
"Przypomnienie! Termin o {{date}}",
"EscolaLms\\Consultations\\Events\\ReportTerm":
"Uytkownik {{user}} zgłosił nowy termin {{date}} na konsultacje {{name}}",
"Użytkownik zgłosił nowy termin {{date}} na konsultacje {{name}}",
// WEBINAR
"EscolaLms\\Webinar\\Events\\ReminderAboutTerm":
"Przypomnienie! Webinar startuje {{date}}",
Expand Down Expand Up @@ -1332,7 +1332,7 @@ const resources = {
WriteComment: "Napisz komentarz",
RateScale: "Oceń w skali 1 - 5",
ThankYou: "Dziękujemy za wystawienie oceny",
ThankYouMessage: "Twoja ocena została zapisana",
ThankYouMessage: "Dziękujemy za udzielenie odpowiedzi",
OptionalComment:
"Tutaj możesz napisać komentarz lub zostawić opinię (nieobowiązkowe)",
SendAnswer: "Wyślij",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/register/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const StyledLink = styled(Link)`
const StyledContent = styled.div`
background-color: ${({ theme }) => theme.gray4};
padding-top: 100px;
height: calc(100vh - 452px);
/* height: calc(100vh - 452px); */
@media (max-width: 991px) {
height: 100%;
padding: 100px 0px;
Expand Down
1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ export const getNotificationTranslationObject = (
notification.data.consultationTerm?.executed_at,
APP_CONFIG.defaultDateTimeFormat
),
user: `${notification.data.consultationTerm?.user?.first_name} ${notification.data.consultationTerm?.user?.last_name}`,
},
};
case EventTypes.ApprovedTerm:
Expand Down

0 comments on commit f8c684a

Please sign in to comment.