diff --git a/i18n.js b/i18n.js
index bb5fb1bab..baba9084f 100644
--- a/i18n.js
+++ b/i18n.js
@@ -35,7 +35,7 @@ module.exports = {
'/workshops/[event_slug]': ['workshops', 'signup'],
'/join/cohort/[id]': ['dashboard', 'signup'],
'/podcast': ['podcast'],
- '/accept-invite': ['accept-invite'],
+ '/accept-invite': ['accept-invite', 'signup'],
'/bootcamp/[course_slug]': ['course', 'dashboard'],
},
locales: ['en', 'es'],
diff --git a/public/locales/en/accept-invite.json b/public/locales/en/accept-invite.json
index 0bee0ffd3..569a0774e 100644
--- a/public/locales/en/accept-invite.json
+++ b/public/locales/en/accept-invite.json
@@ -1,4 +1,10 @@
{
"heading": "You have been invited to {{name}}, please fill out the following information to start learning",
- "error": "Something went wrong"
+ "error": "Something went wrong",
+ "no-token": "You must include an invite token to see the invite",
+ "already-accepted": "The invite has been accepted already",
+ "new-invite": "You have been invited to {{course}}",
+ "invalid-user": "This invitation belongs to another user",
+ "accept-and-learn": "Accept and start learning",
+ "belongs-to-other-user": "This invitation belongs to another user"
}
\ No newline at end of file
diff --git a/public/locales/en/technologies.json b/public/locales/en/technologies.json
index 91781b5ff..609ed4dd9 100644
--- a/public/locales/en/technologies.json
+++ b/public/locales/en/technologies.json
@@ -14,13 +14,14 @@
"loading-workshops": "error loading workshops",
"no-data": "There are no assets for this technology"
},
+ "start-learning": "Start learning {{technology}}",
"backToLessons": "Back to Lessons",
"title": "{{technology}}",
"search": "Search lesson",
"description": "Browse our list of curated database of projects, exercises, and lessons to learn {{technology}}",
"tech-materials": "{{tech}} learning materials",
"tech-workshops": "{{tech}} workshops",
- "request-mentorship": "Request a mentorship",
+ "request-mentorship": "Get {{tech}} mentorship",
"popular-exercises": "Popular exercises",
"lessons-section": "Lessons section",
"exercises-section": "Exercises section",
diff --git a/public/locales/es/accept-invite.json b/public/locales/es/accept-invite.json
index 6147a5e63..09c0a5cce 100644
--- a/public/locales/es/accept-invite.json
+++ b/public/locales/es/accept-invite.json
@@ -1,4 +1,10 @@
{
"heading": "Has sido invitado a {{name}}, por favor completa la siguiente información para comenzar a aprender",
- "error": "Algo ha salido mal"
+ "error": "Algo ha salido mal",
+ "no-token": "Debes incluir un token de invitación para ver la invitación",
+ "already-accepted": "La invitacion ya fue aceptada",
+ "new-invite": "Has sido invitado a {{course}}",
+ "invalid-user": "Esta invitacion pertenece a otro usuario",
+ "accept-and-learn": "Acepta y empieza a aprender",
+ "belongs-to-other-user": "Esta invitacion pertenece a otro usuario"
}
diff --git a/public/locales/es/technologies.json b/public/locales/es/technologies.json
index 3b31352ab..8f2aa5624 100644
--- a/public/locales/es/technologies.json
+++ b/public/locales/es/technologies.json
@@ -14,13 +14,14 @@
"loading-workshops": "error cargando los workshops",
"no-data": "No se encontró assets para esta tecnología"
},
+ "start-learning": "Empezar a aprender {{technology}}",
"backToLessons": "Regresar a lecciones",
"title": "{{technology}}",
"search": "Buscar lección",
"description": "Explore nuestra lista seleccionada de proyectos, ejercicios y lecciones para aprender {{technology}}",
"tech-materials": "Materiales de aprendizaje de {{tech}}",
"tech-workshops": "{{tech}} workshops",
- "request-mentorship": "Solicitar una mentoria",
+ "request-mentorship": "Obtener mentoria de {{tech}}",
"popular-exercises": "Ejercicios populares",
"lessons-section": "Sección de lecciones",
"exercises-section": "Sección de ejercicios",
diff --git a/src/common/components/Icon/set/arrowLeft3.jsx b/src/common/components/Icon/set/arrowLeft3.jsx
new file mode 100644
index 000000000..1e47145fe
--- /dev/null
+++ b/src/common/components/Icon/set/arrowLeft3.jsx
@@ -0,0 +1,23 @@
+const arrowLeft3 = ({
+ style, width, height, color,
+}) => (
+
+);
+
+export default arrowLeft3;
diff --git a/src/common/components/MarkDownParser/ArticleMarkdown.jsx b/src/common/components/MarkDownParser/ArticleMarkdown.jsx
index 3f97078b7..1c338347a 100644
--- a/src/common/components/MarkDownParser/ArticleMarkdown.jsx
+++ b/src/common/components/MarkDownParser/ArticleMarkdown.jsx
@@ -5,7 +5,7 @@ import Toc from './toc';
import ContentHeading from './ContentHeading';
import SubTasks from './SubTasks';
import MarkDownParser from './index';
-import OpenWithLearnpackCTA from '../../../js_modules/syllabus/OpenWithLearnpackCTA';
+import ProjectInstructions from '../../../js_modules/syllabus/ProjectInstructions';
function ArticleMarkdown({
content, withToc, frontMatter, titleRightSide, currentTask, currentData,
@@ -20,8 +20,8 @@ function ArticleMarkdown({
{!isGuidedExperience && (
+ callToAction={(currentData?.interactive || currentData?.template_url) && (
+
)}
content={frontMatter}
currentData={currentData}
diff --git a/src/common/components/MarkDownParser/MDComponents/index.jsx b/src/common/components/MarkDownParser/MDComponents/index.jsx
index 6e050e7ac..385606b1b 100644
--- a/src/common/components/MarkDownParser/MDComponents/index.jsx
+++ b/src/common/components/MarkDownParser/MDComponents/index.jsx
@@ -286,11 +286,7 @@ function QuoteVersion4({ ...props }) {
);
}
export function Quote({ children }) {
- const [version, setVersion] = useState(2);
-
- useEffect(() => {
- setVersion(Math.floor(Math.random() * 4) + 1);
- }, []);
+ const version = 1;
if (version === 1 && children.length > 0) {
return (
diff --git a/src/common/components/Navbar/index.jsx b/src/common/components/Navbar/index.jsx
index 364a3307c..1b9b0bf6d 100644
--- a/src/common/components/Navbar/index.jsx
+++ b/src/common/components/Navbar/index.jsx
@@ -44,6 +44,7 @@ function NavbarWithSubNavigation({ translations, pageProps }) {
const isUtmMediumAcademy = userSession?.utm_medium === 'academy';
const { isAuthenticated, isLoading, user, logout } = useAuth();
const [ITEMS, setITEMS] = useState([]);
+ const [allSubscriptions, setAllSubscriptions] = useState([]);
const [mktCourses, setMktCourses] = useState([]);
const [userCohorts, setUserCohorts] = useState([]);
const { state } = useCohortHandler();
@@ -85,9 +86,53 @@ function NavbarWithSubNavigation({ translations, pageProps }) {
selectedProgramSlug: '/choose-program',
}, { returnObjects: true });
- const items = t('ITEMS', {
- selectedProgramSlug: selectedProgramSlug || '/choose-program',
- }, { returnObjects: true });
+ useEffect(() => {
+ if (cohortSession?.available_as_saas) {
+ bc.payment({
+ status: 'ACTIVE,FREE_TRIAL,FULLY_PAID,CANCELLED,PAYMENT_ISSUE',
+ }).subscriptions()
+ .then(async ({ data }) => {
+ const planFinancings = data?.plan_financings?.length > 0 ? data?.plan_financings : [];
+ const subscriptions = data?.subscriptions?.length > 0 ? data?.subscriptions : [];
+
+ setAllSubscriptions([...planFinancings, ...subscriptions]);
+ });
+ }
+ }, [cohortSession]);
+
+ const allowNavigation = () => {
+ const getAdditionalInfo = () => {
+ if (allSubscriptions) {
+ const currentSessionSubs = allSubscriptions?.filter((sub) => sub.academy?.id === cohortSession?.academy?.id);
+ const cohortSubscriptions = currentSessionSubs?.filter((sub) => sub.selected_cohort_set?.cohorts.some((cohort) => cohort.id === cohortSession.id));
+
+ if (cohortSubscriptions.length === 0) {
+ return false;
+ }
+
+ const fullyPaidSub = cohortSubscriptions.find((sub) => sub.status === 'FULLY_PAID' || sub.status === 'ACTIVE');
+ if (fullyPaidSub) {
+ return true;
+ }
+
+ const freeTrialSub = cohortSubscriptions.find((sub) => sub.status === 'FREE_TRIAL');
+ const freeTrialExpDate = new Date(freeTrialSub?.valid_until);
+ const todayDate = new Date();
+
+ if (todayDate > freeTrialExpDate) {
+ return false;
+ }
+ return true;
+ }
+ return false;
+ };
+
+ if (cohortSession?.available_as_saas === true && cohortSession.cohort_role === 'STUDENT') return getAdditionalInfo();
+ if (Object.keys(cohortSession).length > 0 && (cohortSession.cohort_role !== 'STUDENT' || cohortSession.available_as_saas === false)) return true;
+ return false;
+ };
+
+ const items = t('ITEMS', { selectedProgramSlug: allowNavigation() ? selectedProgramSlug : '/choose-program' }, { returnObjects: true });
axios.defaults.headers.common['Accept-Language'] = locale;
@@ -165,7 +210,7 @@ function NavbarWithSubNavigation({ translations, pageProps }) {
setITEMS(
preFilteredItems
.filter((item) => (item.disabled !== true && item.hide_on_auth !== true)
- && (item.id !== 'bootcamps' || !isBootcampStudent)),
+ && (item.id !== 'bootcamps' || !isBootcampStudent)),
);
} else {
setITEMS(preFilteredItems.filter((item) => item.disabled !== true));
diff --git a/src/common/hooks/useModuleHandler.js b/src/common/hooks/useModuleHandler.js
index 0537f0bbe..262e1235f 100644
--- a/src/common/hooks/useModuleHandler.js
+++ b/src/common/hooks/useModuleHandler.js
@@ -23,7 +23,8 @@ function useModuleHandler() {
};
try {
- await bc.todo({}).update(taskToUpdate);
+ const { cohort, ...taskData } = taskToUpdate;
+ await bc.todo().update(taskData);
const keyIndex = taskTodo.findIndex((x) => x.id === task.id);
setTaskTodo([
...taskTodo.slice(0, keyIndex), // before keyIndex (inclusive)
diff --git a/src/js_modules/syllabus/ExerciseGuidedExperience.jsx b/src/js_modules/syllabus/ExerciseGuidedExperience.jsx
index e6af549cb..a3ac766a6 100644
--- a/src/js_modules/syllabus/ExerciseGuidedExperience.jsx
+++ b/src/js_modules/syllabus/ExerciseGuidedExperience.jsx
@@ -4,7 +4,7 @@ import useTranslation from 'next-translate/useTranslation';
import PropTypes from 'prop-types';
import { intervalToDuration } from 'date-fns';
import { intervalToHours } from '../../utils';
-import OpenWithLearnpackCTA from './OpenWithLearnpackCTA';
+import ProjectInstructions from './ProjectInstructions';
import useStyle from '../../common/hooks/useStyle';
import ReactPlayerV2 from '../../common/components/ReactPlayerV2';
import KPI from '../../common/components/KPI';
@@ -168,7 +168,7 @@ function ExerciseGuidedExperience({ currentTask, currentAsset, handleStartLearnp
)}
-
+
>
)}
diff --git a/src/js_modules/syllabus/ProjectBoardGuidedExperience.jsx b/src/js_modules/syllabus/ProjectBoardGuidedExperience.jsx
index 5347db152..7640f42e6 100644
--- a/src/js_modules/syllabus/ProjectBoardGuidedExperience.jsx
+++ b/src/js_modules/syllabus/ProjectBoardGuidedExperience.jsx
@@ -7,7 +7,7 @@ import SubtasksPill from './SubtasksPill';
import StatusPill from './StatusPill';
import Topbar from './Topbar';
import TaskCodeRevisions from './TaskCodeRevisions';
-import OpenWithLearnpackCTA from './OpenWithLearnpackCTA';
+import ProjectInstructions from './ProjectInstructions';
import useModuleHandler from '../../common/hooks/useModuleHandler';
import useStyle from '../../common/hooks/useStyle';
import ReactPlayerV2 from '../../common/components/ReactPlayerV2';
@@ -59,7 +59,7 @@ function ProjectHeading({ currentAsset, isDelivered, handleStartLearnpack }) {
)}
-
+
diff --git a/src/js_modules/syllabus/OpenWithLearnpackCTA.jsx b/src/js_modules/syllabus/ProjectInstructions.jsx
similarity index 83%
rename from src/js_modules/syllabus/OpenWithLearnpackCTA.jsx
rename to src/js_modules/syllabus/ProjectInstructions.jsx
index 00d95bb16..146d86554 100644
--- a/src/js_modules/syllabus/OpenWithLearnpackCTA.jsx
+++ b/src/js_modules/syllabus/ProjectInstructions.jsx
@@ -65,19 +65,12 @@ function ProvisioningPopover({ openInLearnpackAction, provisioningLinks }) {
);
}
-function ButtonsHandler({ currentAsset, setShowCloneModal, vendors, handleStartLearnpack }) {
+function ButtonsHandler({ currentAsset, setShowCloneModal, vendors, handleStartLearnpack, isForOpenLocaly, startWithLearnpack, variant }) {
const { t } = useTranslation('common');
const { state } = useCohortHandler();
const { cohortSession } = state;
const openInLearnpackAction = t('learnpack.open-in-learnpack-button', {}, { returnObjects: true });
- const learnpackDeployUrl = currentAsset?.learnpack_deploy_url;
- const templateUrl = currentAsset?.template_url;
- // const templateUrl = 'https://google.com';
- const isInteractive = currentAsset?.interactive;
- // const isInteractive = false;
- const noLearnpackIncluded = noLearnpackAssets['no-learnpack'];
-
const accessToken = localStorage.getItem('accessToken');
const provisioningLinks = [{
@@ -96,14 +89,12 @@ function ButtonsHandler({ currentAsset, setShowCloneModal, vendors, handleStartL
markdownBody.scrollIntoView({ block: 'start', behavior: 'smooth' });
};
- const startWithLearnpack = learnpackDeployUrl && cohortSession.available_as_saas && !noLearnpackIncluded.includes(currentAsset.slug);
const showProvisioningLinks = vendors.length > 0 && currentAsset?.gitpod && !cohortSession.available_as_saas;
const isExternalExercise = currentAsset.external && currentAsset.asset_type === 'EXERCISE';
- const isToOpenLocaly = cohortSession.available_as_saas && (isInteractive || templateUrl);
if (isExternalExercise) {
return (
-