From fbd6888cd88e13f25e8461c7ae4df47779c19152 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Sat, 12 Apr 2025 10:58:58 +0300 Subject: [PATCH 01/12] fix: change the information in the Materials section --- dev-data/about-course.data.tsx | 48 ++++++++++++++++------------------ 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/dev-data/about-course.data.tsx b/dev-data/about-course.data.tsx index 64e31db9d..396ebdde3 100644 --- a/dev-data/about-course.data.tsx +++ b/dev-data/about-course.data.tsx @@ -8,6 +8,7 @@ import planetIcon from '@/shared/assets/icons/planet.webp'; import { REGISTRATION_WILL_OPEN_SOON, REGISTRATION_WILL_OPEN_SOON_RU } from '@/shared/constants'; import { LinkCustom } from '@/shared/ui/link-custom'; import { List } from '@/shared/ui/list'; +import { Paragraph } from '@/shared/ui/paragraph'; import type { AboutCourseInfo } from 'data'; import { COURSE_TITLES, CourseNamesChannels, DISCORD_LINKS } from 'data'; @@ -35,6 +36,26 @@ const preSchoolIntro = { 'Подготовительный этап поможет тем, кто мало знаком или совсем не знаком с программированием и хотел бы впоследствии учиться на основном курсе «JavaScript/Front-end».', }; +//const infoMaterialsTextEn = ['All materials are publicly available on the', 'channel and']; +//const infoMaterialsTextRu = ['Все материалы находятся в открытом доступе на канале', 'и']; + +const infoMaterialsEn = ( + + All materials are publicly available on the + {' '} + + YouTube + + {' '} + channel and + {' '} + + GitHub + + . + +); + export const introLocalizedContent = { [COURSE_TITLES.JS_PRESCHOOL_RU]: preSchoolIntro, [COURSE_TITLES.JS_EN]: enIntro, @@ -68,28 +89,6 @@ const listData = { }, ], ], - reactEn: [ - [ - { - id: 1, - text: 'School ', - title: 'documentation', - link: 'https://docs.rs.school', - }, - ], - 'All materials are publicly available on the YouTube channel and GitHub', - ], - reactRu: [ - [ - { - id: 1, - text: '', - title: 'Документация школы', - link: 'https://docs.rs.school', - }, - ], - 'Все материалы находятся в открытом доступе на YouTube и GitHub.Также предлагаем ознакомиться с конспектом первого этапа обучения.', - ], }; const angularNodejsAwsFundamentals: (course: string) => AboutCourseInfo[] = () => [ @@ -102,7 +101,7 @@ const angularNodejsAwsFundamentals: (course: string) => AboutCourseInfo[] = () = { id: 2, title: 'Materials', - info: 'Everyone can study at RS School, regardless of age, professional employment, or place of residence. However, you should have sufficient base knowledge before the program begins.', + info: infoMaterialsEn, icon: paperIcon, }, { @@ -222,8 +221,7 @@ const reactEn: AboutCourseInfo[] = javaScriptEN().map((item) => { return { ...item, title: 'Materials', - info: , - icon: paperIcon, + info: infoMaterialsEn }; } if (item.id === 5) { From 888d62a17fd9c5e4d020556a937decbd88cab1a8 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Mon, 14 Apr 2025 09:32:14 +0300 Subject: [PATCH 02/12] feat: add schedule and documentation links to the trainingProgram component --- dev-data/about-course.data.tsx | 10 +- dev-data/training-program.data.tsx | 15 +++ src/entities/course/types.ts | 1 + src/shared/__tests__/constants.ts | 10 +- src/shared/constants.ts | 22 ++++ .../getScheduleAndDocumentationLinks.tsx | 103 ++++++++++++++++++ 6 files changed, 155 insertions(+), 6 deletions(-) create mode 100644 src/shared/helpers/getScheduleAndDocumentationLinks.tsx diff --git a/dev-data/about-course.data.tsx b/dev-data/about-course.data.tsx index 396ebdde3..119ed28a4 100644 --- a/dev-data/about-course.data.tsx +++ b/dev-data/about-course.data.tsx @@ -36,20 +36,20 @@ const preSchoolIntro = { 'Подготовительный этап поможет тем, кто мало знаком или совсем не знаком с программированием и хотел бы впоследствии учиться на основном курсе «JavaScript/Front-end».', }; -//const infoMaterialsTextEn = ['All materials are publicly available on the', 'channel and']; -//const infoMaterialsTextRu = ['Все материалы находятся в открытом доступе на канале', 'и']; +// const infoMaterialsTextEn = ['All materials are publicly available on the', 'channel and']; +// const infoMaterialsTextRu = ['Все материалы находятся в открытом доступе на канале', 'и']; const infoMaterialsEn = ( All materials are publicly available on the {' '} - + YouTube {' '} channel and {' '} - + GitHub . @@ -221,7 +221,7 @@ const reactEn: AboutCourseInfo[] = javaScriptEN().map((item) => { return { ...item, title: 'Materials', - info: infoMaterialsEn + info: infoMaterialsEn, }; } if (item.id === 5) { diff --git a/dev-data/training-program.data.tsx b/dev-data/training-program.data.tsx index f9df39365..c196de50a 100644 --- a/dev-data/training-program.data.tsx +++ b/dev-data/training-program.data.tsx @@ -16,6 +16,12 @@ import jsImg from '@/shared/assets/rs-slope-js.webp'; import nodejsImg from '@/shared/assets/rs-slope-nodejs.webp'; import reactEnImg from '@/shared/assets/rs-slope-react-en.webp'; import { REGISTRATION_WILL_OPEN_SOON, REGISTRATION_WILL_OPEN_SOON_RU } from '@/shared/constants'; +import { + scheduleDocumentationEN, + scheduleDocumentationJS_PRESCHOOL_RU, + scheduleDocumentationJS_RU, + scheduleDocumentationReact, +} from '@/shared/helpers/getScheduleAndDocumentationLinks'; import { LinkCustom } from '@/shared/ui/link-custom'; import { List } from '@/shared/ui/list'; import { Paragraph } from '@/shared/ui/paragraph'; @@ -60,6 +66,7 @@ export const contentMap: ContentMap = { 'Implement backend-for-frontend using API Gateway', ]} />, + scheduleDocumentationEN(COURSE_TITLES.AWS_CLOUD_DEVELOPER), ], image: awsDevImg, }, @@ -81,6 +88,7 @@ export const contentMap: ContentMap = { During the course, you will have access to online sessions led by AWS User Groups and RS School Mentors, where you can ask questions, discuss the materials, and get feedback. , + scheduleDocumentationEN(COURSE_TITLES.AWS_FUNDAMENTALS), ], image: awsFundamentalsImg, }, @@ -109,6 +117,7 @@ export const contentMap: ContentMap = { 'Nest.js', ]} />, + scheduleDocumentationEN(COURSE_TITLES.NODE), ], image: nodejsImg, }, @@ -131,6 +140,7 @@ export const contentMap: ContentMap = { . Theoretical materials are provided as recorded lectures from previous courses. , + scheduleDocumentationEN(COURSE_TITLES.ANGULAR), ], image: angularImg, }, @@ -155,6 +165,7 @@ export const contentMap: ContentMap = { {` that practical tasks’ deadlines are not suggestions, and should be respected.`} , + scheduleDocumentationEN(COURSE_TITLES.JS_EN), ], image: jsImg, }, @@ -180,6 +191,7 @@ export const contentMap: ContentMap = { {`, что сроки выполнения практических заданий не являются рекомендацией и должны быть соблюдены.`} , + scheduleDocumentationJS_RU(), ], image: jsImg, }, @@ -229,6 +241,7 @@ export const contentMap: ContentMap = { type="unmarked" /> , + scheduleDocumentationJS_PRESCHOOL_RU(), ], image: jsImg, }, @@ -250,6 +263,7 @@ export const contentMap: ContentMap = { 'Understanding of RESTful services', ]} />, + scheduleDocumentationReact(), ], image: reactEnImg, }, @@ -297,6 +311,7 @@ export const contentMap: ContentMap = { 'Community-based education: the community will help you explore emerging technologies and best practices, ensuring you are equipped with the knowledge that the current market seeks', ]} />, + scheduleDocumentationEN(COURSE_TITLES.AWS_DEVOPS), ], image: awsDevImg, }, diff --git a/src/entities/course/types.ts b/src/entities/course/types.ts index eb0a9d8cc..57c7c8053 100644 --- a/src/entities/course/types.ts +++ b/src/entities/course/types.ts @@ -38,6 +38,7 @@ export type Course = { iconSmall: StaticImageData; iconFooter: StaticImageData; startDate: string; + scheduleUrl: string | string[] | null; registrationEndDate: string; language: Language; mode: 'online' | 'offline'; diff --git a/src/shared/__tests__/constants.ts b/src/shared/__tests__/constants.ts index 27dfc604b..36e2a06b0 100644 --- a/src/shared/__tests__/constants.ts +++ b/src/shared/__tests__/constants.ts @@ -6,7 +6,7 @@ import { Course } from '@/entities/course'; import { MentorFeedback } from '@/entities/mentor'; import type { Trainer } from '@/entities/trainer'; import nodejsImg1 from '@/shared/assets/mentors/m-shylau.webp'; -import { COURSE_LINKS } from '@/shared/constants'; +import { COURSE_LINKS, COURSE_SCHEDULE_LINKS } from '@/shared/constants'; import { FaqDataItem, FaqDataItemWithLink } from '@/widgets/faq/types'; import { COURSE_TITLES } from 'data'; @@ -32,6 +32,7 @@ export const mockedCourses: Course[] = [ subTitle: 'Pre-school RU', descriptionUrl: COURSE_LINKS.JS_PRESCHOOL_RU, startDate: 'Jun 24, 2024', + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_PRESCHOOL_RU], registrationEndDate: 'Jun 24, 2024', language: 'ru', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.JS_PRESCHOOL_RU}`, @@ -55,6 +56,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.JS_EN, startDate: 'Oct, 2024', + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_EN], registrationEndDate: 'Jun 24, 2025', language: 'en', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.JS}`, @@ -78,6 +80,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.JS_RU, startDate: 'Oct, 2024', + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_RU], registrationEndDate: 'Jun 24, 2025', language: 'ru', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.JS_RU}`, @@ -101,6 +104,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.REACT, startDate: 'Jul 1, 2024', + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.REACT], registrationEndDate: 'Jun 24, 2024', language: 'en', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.REACT}`, @@ -123,6 +127,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.ANGULAR, startDate: 'Jul 1, 2024', + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.ANGULAR], registrationEndDate: 'Jun 24, 2025', language: 'en', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.ANGULAR}`, @@ -145,6 +150,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.AWS_FUNDAMENTALS, startDate: 'Jul 1, 2024', + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_FUNDAMENTALS], registrationEndDate: 'Jun 24, 2025', language: 'en', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.AWS_FUNDAMENTALS}`, @@ -171,6 +177,7 @@ export const mockedCourses: Course[] = [ iconFooter: MOCKED_IMAGE_PATH, secondaryIcon: MOCKED_IMAGE_PATH, startDate: 'Jul 1, 2024', + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_CLOUD_DEVELOPER], registrationEndDate: 'Jun 24, 2025', language: 'en', mode: 'online', @@ -193,6 +200,7 @@ export const mockedCourses: Course[] = [ iconFooter: MOCKED_IMAGE_PATH, secondaryIcon: MOCKED_IMAGE_PATH, startDate: 'Jul 1, 2024', + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_DEVOPS], registrationEndDate: 'Jun 24, 2025', language: 'en', mode: 'online', diff --git a/src/shared/constants.ts b/src/shared/constants.ts index c2b8ab3b9..87e7fca4c 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -1,3 +1,5 @@ +import { COURSE_TITLES } from '../../dev-data/courseTitles.data'; + export const RS_INTRO_URL = 'https://www.youtube.com/embed/n4unZLVpnaU'; export const RS_FOUNDATION_YEAR = '2013'; export const RS_EMAIL = 'rolling.scopes@gmail.com'; @@ -34,3 +36,23 @@ export const COURSE_LINKS = { }; export const KEY_CODES = { ESCAPE: 'Escape' } as const; + +export const COURSE_SCHEDULE_LINKS = { + [COURSE_TITLES.JS_PRESCHOOL_RU]: 'https://github.com/rolling-scopes-school/tasks/tree/master/stage0', + [COURSE_TITLES.JS_EN]: 'https://github.com/rolling-scopes-school/js-fe-course-en', + [COURSE_TITLES.JS_RU]: [ + 'https://github.com/rolling-scopes-school/tasks/tree/master/stage1', + 'https://github.com/rolling-scopes-school/tasks/tree/master/stage2', + ], + [COURSE_TITLES.REACT]: null, + [COURSE_TITLES.ANGULAR]: 'https://github.com/rolling-scopes-school/tasks/tree/master/angular', + [COURSE_TITLES.NODE]: 'https://github.com/rolling-scopes-school/tasks/tree/master/node', + [COURSE_TITLES.AWS_FUNDAMENTALS]: 'https://github.com/rolling-scopes-school/aws/tree/main/aws-fundamentals', + [COURSE_TITLES.AWS_CLOUD_DEVELOPER]: 'https://github.com/rolling-scopes-school/aws/tree/main/aws-developer', + [COURSE_TITLES.AWS_DEVOPS]: 'https://github.com/rolling-scopes-school/tasks/tree/master/devops', +}; + +export const DOCUMENTATION_LINKS = { + 'RU': 'https://rs.school/docs/ru', + 'EN': 'https://docs.rs.school', +}; diff --git a/src/shared/helpers/getScheduleAndDocumentationLinks.tsx b/src/shared/helpers/getScheduleAndDocumentationLinks.tsx new file mode 100644 index 000000000..17baeb26e --- /dev/null +++ b/src/shared/helpers/getScheduleAndDocumentationLinks.tsx @@ -0,0 +1,103 @@ +import { COURSE_TITLES } from '@/../dev-data/courseTitles.data'; +import { COURSE_SCHEDULE_LINKS, DOCUMENTATION_LINKS } from '@/shared/constants'; +import { LinkCustom } from '@/shared/ui/link-custom'; +import { Paragraph } from '@/shared/ui/paragraph'; + +export const scheduleDocumentationEN = (courseName: keyof typeof COURSE_SCHEDULE_LINKS) => ( + + The course + {' '} + + shcedule + + and school + {' '} + + documentation + + . + +); + +export const scheduleDocumentationReact = () => ( + + The school + {' '} + + documentation + + . + +); + +export const scheduleDocumentationJS_PRESCHOOL_RU = () => ( + + + Рассписание + + {' '} + курса и + {' '} + + документация + + {' '} + школы. + +); + +export const scheduleDocumentationJS_RU = () => ( + + Рассписания + {' '} + + первого + + {' '} + и + {' '} + + второго + + {' '} + этапа курса и + {' '} + + документация + + {' '} + школы. + +); From de046f17470da78eefa6a8255283d7a8aadf7934 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Mon, 14 Apr 2025 10:00:34 +0300 Subject: [PATCH 03/12] fix: added scheduleURL to the courses const --- dev-data/courses.data.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dev-data/courses.data.ts b/dev-data/courses.data.ts index 486b69f47..e7e43a5fd 100644 --- a/dev-data/courses.data.ts +++ b/dev-data/courses.data.ts @@ -8,7 +8,7 @@ import javascriptBlack from '@/shared/assets/icons/javascript-black.svg'; import javascript from '@/shared/assets/icons/javascript.svg'; import nodejs from '@/shared/assets/icons/node-js.svg'; import react from '@/shared/assets/icons/react.svg'; -import { COURSE_LINKS, TO_BE_DETERMINED } from '@/shared/constants'; +import { COURSE_LINKS, COURSE_SCHEDULE_LINKS, TO_BE_DETERMINED } from '@/shared/constants'; import { COURSE_TITLES } from 'data'; export const courses: Course[] = [ @@ -23,6 +23,7 @@ export const courses: Course[] = [ iconFooter: html5, secondaryIcon: javascriptBlack, startDate: TO_BE_DETERMINED, + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_PRESCHOOL_RU], registrationEndDate: TO_BE_DETERMINED, language: 'ru', mode: 'online', @@ -46,6 +47,7 @@ export const courses: Course[] = [ iconFooter: javascript, secondaryIcon: javascriptBlack, startDate: TO_BE_DETERMINED, + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_EN], registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -69,6 +71,7 @@ export const courses: Course[] = [ iconFooter: javascript, secondaryIcon: javascriptBlack, startDate: TO_BE_DETERMINED, + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_RU], registrationEndDate: TO_BE_DETERMINED, language: 'ru', mode: 'online', @@ -91,6 +94,7 @@ export const courses: Course[] = [ iconFooter: react, secondaryIcon: react, startDate: TO_BE_DETERMINED, + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.REACT], registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -113,6 +117,7 @@ export const courses: Course[] = [ iconFooter: angular, secondaryIcon: angular, startDate: TO_BE_DETERMINED, + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.ANGULAR], registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -135,6 +140,7 @@ export const courses: Course[] = [ iconFooter: nodejs, secondaryIcon: nodejs, startDate: TO_BE_DETERMINED, + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.NODE], registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -157,6 +163,7 @@ export const courses: Course[] = [ iconFooter: awsWhite, secondaryIcon: awsBlack, startDate: TO_BE_DETERMINED, + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_FUNDAMENTALS], registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -180,6 +187,7 @@ export const courses: Course[] = [ secondaryIcon: awsBlack, iconFooter: awsWhite, startDate: TO_BE_DETERMINED, + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_CLOUD_DEVELOPER], registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -202,6 +210,7 @@ export const courses: Course[] = [ secondaryIcon: awsBlack, iconFooter: awsWhite, startDate: TO_BE_DETERMINED, + scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_DEVOPS], registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', From 8b7e1eb42fb7f665f361be91a37eaa64f0891318 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Mon, 14 Apr 2025 10:08:43 +0300 Subject: [PATCH 04/12] fix: apdate coursesMock const --- src/shared/helpers/getActualData.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/helpers/getActualData.test.ts b/src/shared/helpers/getActualData.test.ts index 4ce9ecbf9..83e2d186c 100644 --- a/src/shared/helpers/getActualData.test.ts +++ b/src/shared/helpers/getActualData.test.ts @@ -40,6 +40,7 @@ const coursesMock: Course[] = [ width: 100, }, startDate: staleDayInPast, + scheduleUrl: 'link', registrationEndDate: staleDayInPast, language: 'ru', mode: 'online', @@ -75,6 +76,7 @@ const coursesMock: Course[] = [ width: 100, }, startDate: dayInFuture, + scheduleUrl: 'link', registrationEndDate: staleDayInPast, language: 'ru', mode: 'online', @@ -110,6 +112,7 @@ const coursesMock: Course[] = [ width: 100, }, startDate: nonStaleDayInPast, + scheduleUrl: 'link', registrationEndDate: staleDayInPast, language: 'ru', mode: 'online', From ef148fc6915fc8a219a4b2441ef15f957b22d778 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Mon, 14 Apr 2025 11:10:47 +0300 Subject: [PATCH 05/12] refactor: add link to the react course schedule --- dev-data/training-program.data.tsx | 3 +-- src/shared/constants.ts | 2 +- .../getScheduleAndDocumentationLinks.tsx | 19 ++----------------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/dev-data/training-program.data.tsx b/dev-data/training-program.data.tsx index c196de50a..466b326d5 100644 --- a/dev-data/training-program.data.tsx +++ b/dev-data/training-program.data.tsx @@ -20,7 +20,6 @@ import { scheduleDocumentationEN, scheduleDocumentationJS_PRESCHOOL_RU, scheduleDocumentationJS_RU, - scheduleDocumentationReact, } from '@/shared/helpers/getScheduleAndDocumentationLinks'; import { LinkCustom } from '@/shared/ui/link-custom'; import { List } from '@/shared/ui/list'; @@ -263,7 +262,7 @@ export const contentMap: ContentMap = { 'Understanding of RESTful services', ]} />, - scheduleDocumentationReact(), + scheduleDocumentationEN(COURSE_TITLES.REACT), ], image: reactEnImg, }, diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 87e7fca4c..067e132c0 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -44,7 +44,7 @@ export const COURSE_SCHEDULE_LINKS = { 'https://github.com/rolling-scopes-school/tasks/tree/master/stage1', 'https://github.com/rolling-scopes-school/tasks/tree/master/stage2', ], - [COURSE_TITLES.REACT]: null, + [COURSE_TITLES.REACT]: 'https://github.com/rolling-scopes-school/tasks/blob/master/react/README.md', [COURSE_TITLES.ANGULAR]: 'https://github.com/rolling-scopes-school/tasks/tree/master/angular', [COURSE_TITLES.NODE]: 'https://github.com/rolling-scopes-school/tasks/tree/master/node', [COURSE_TITLES.AWS_FUNDAMENTALS]: 'https://github.com/rolling-scopes-school/aws/tree/main/aws-fundamentals', diff --git a/src/shared/helpers/getScheduleAndDocumentationLinks.tsx b/src/shared/helpers/getScheduleAndDocumentationLinks.tsx index 17baeb26e..ceea28671 100644 --- a/src/shared/helpers/getScheduleAndDocumentationLinks.tsx +++ b/src/shared/helpers/getScheduleAndDocumentationLinks.tsx @@ -8,7 +8,7 @@ export const scheduleDocumentationEN = (courseName: keyof typeof COURSE_SCHEDULE The course {' '} @@ -17,22 +17,7 @@ export const scheduleDocumentationEN = (courseName: keyof typeof COURSE_SCHEDULE and school {' '} - documentation - - . - -); - -export const scheduleDocumentationReact = () => ( - - The school - {' '} - From 8eb94e4f4698d557f678742620224ee1822654d8 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Mon, 14 Apr 2025 11:17:08 +0300 Subject: [PATCH 06/12] style: remove spaces accoding to the linter --- src/shared/helpers/getScheduleAndDocumentationLinks.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/helpers/getScheduleAndDocumentationLinks.tsx b/src/shared/helpers/getScheduleAndDocumentationLinks.tsx index ceea28671..be41b79fa 100644 --- a/src/shared/helpers/getScheduleAndDocumentationLinks.tsx +++ b/src/shared/helpers/getScheduleAndDocumentationLinks.tsx @@ -8,7 +8,7 @@ export const scheduleDocumentationEN = (courseName: keyof typeof COURSE_SCHEDULE The course {' '} @@ -17,7 +17,7 @@ export const scheduleDocumentationEN = (courseName: keyof typeof COURSE_SCHEDULE and school {' '} From a1b4a0eee9ae98197634bf955fe58fb5f893dd08 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Tue, 15 Apr 2025 07:39:01 +0300 Subject: [PATCH 07/12] refactor: change direct links to the constants --- dev-data/about-course.data.tsx | 25 +++++++++++-------- dev-data/training-program.data.tsx | 2 +- src/shared/constants.ts | 2 +- ... get-schedule-and-documentation-links.tsx} | 0 4 files changed, 17 insertions(+), 12 deletions(-) rename src/shared/helpers/{getScheduleAndDocumentationLinks.tsx => get-schedule-and-documentation-links.tsx} (100%) diff --git a/dev-data/about-course.data.tsx b/dev-data/about-course.data.tsx index 119ed28a4..ed0527154 100644 --- a/dev-data/about-course.data.tsx +++ b/dev-data/about-course.data.tsx @@ -11,6 +11,8 @@ import { List } from '@/shared/ui/list'; import { Paragraph } from '@/shared/ui/paragraph'; import type { AboutCourseInfo } from 'data'; import { COURSE_TITLES, CourseNamesChannels, DISCORD_LINKS } from 'data'; +import { DOCUMENTATION_LINKS } from '@/shared/constants'; +import { communityGroups } from 'data'; type ContentMap = { [key in CourseNamesChannels]: AboutCourseInfo[]; @@ -36,20 +38,23 @@ const preSchoolIntro = { 'Подготовительный этап поможет тем, кто мало знаком или совсем не знаком с программированием и хотел бы впоследствии учиться на основном курсе «JavaScript/Front-end».', }; -// const infoMaterialsTextEn = ['All materials are publicly available on the', 'channel and']; -// const infoMaterialsTextRu = ['Все материалы находятся в открытом доступе на канале', 'и']; - +const youtubeHref = communityGroups.find((sosial) => sosial.title === 'YouTube EN')?.href; const infoMaterialsEn = ( All materials are publicly available on the {' '} - - YouTube - - {' '} - channel and - {' '} - + {youtubeHref && ( + <> + + YouTube + + {' '}channel and{' '} + + )} + GitHub . diff --git a/dev-data/training-program.data.tsx b/dev-data/training-program.data.tsx index 466b326d5..3d0c25814 100644 --- a/dev-data/training-program.data.tsx +++ b/dev-data/training-program.data.tsx @@ -20,7 +20,7 @@ import { scheduleDocumentationEN, scheduleDocumentationJS_PRESCHOOL_RU, scheduleDocumentationJS_RU, -} from '@/shared/helpers/getScheduleAndDocumentationLinks'; +} from '@/shared/helpers/get-schedule-and-documentation-links'; import { LinkCustom } from '@/shared/ui/link-custom'; import { List } from '@/shared/ui/list'; import { Paragraph } from '@/shared/ui/paragraph'; diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 067e132c0..be026baeb 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -1,4 +1,4 @@ -import { COURSE_TITLES } from '../../dev-data/courseTitles.data'; +import { COURSE_TITLES } from 'data'; export const RS_INTRO_URL = 'https://www.youtube.com/embed/n4unZLVpnaU'; export const RS_FOUNDATION_YEAR = '2013'; diff --git a/src/shared/helpers/getScheduleAndDocumentationLinks.tsx b/src/shared/helpers/get-schedule-and-documentation-links.tsx similarity index 100% rename from src/shared/helpers/getScheduleAndDocumentationLinks.tsx rename to src/shared/helpers/get-schedule-and-documentation-links.tsx From 0de317e575865c31573c2e47b70efc0ad9a62bd6 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Tue, 15 Apr 2025 07:48:52 +0300 Subject: [PATCH 08/12] style: remove import duplications accoding to the linter --- dev-data/about-course.data.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dev-data/about-course.data.tsx b/dev-data/about-course.data.tsx index ed0527154..81dabbcfa 100644 --- a/dev-data/about-course.data.tsx +++ b/dev-data/about-course.data.tsx @@ -5,14 +5,16 @@ import noteIcon from '@/shared/assets/icons/note-icon.webp'; import paperIcon from '@/shared/assets/icons/paper-icon.webp'; import personIcon from '@/shared/assets/icons/person-icon.webp'; import planetIcon from '@/shared/assets/icons/planet.webp'; -import { REGISTRATION_WILL_OPEN_SOON, REGISTRATION_WILL_OPEN_SOON_RU } from '@/shared/constants'; +import { + DOCUMENTATION_LINKS, + REGISTRATION_WILL_OPEN_SOON, + REGISTRATION_WILL_OPEN_SOON_RU, +} from '@/shared/constants'; import { LinkCustom } from '@/shared/ui/link-custom'; import { List } from '@/shared/ui/list'; import { Paragraph } from '@/shared/ui/paragraph'; import type { AboutCourseInfo } from 'data'; -import { COURSE_TITLES, CourseNamesChannels, DISCORD_LINKS } from 'data'; -import { DOCUMENTATION_LINKS } from '@/shared/constants'; -import { communityGroups } from 'data'; +import { COURSE_TITLES, CourseNamesChannels, DISCORD_LINKS, communityGroups } from 'data'; type ContentMap = { [key in CourseNamesChannels]: AboutCourseInfo[]; @@ -51,7 +53,9 @@ const infoMaterialsEn = ( > YouTube - {' '}channel and{' '} + {' '} + channel and + {' '} )} From bab1ac7022167ebb646514b0c258319ac89e8a35 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Fri, 2 May 2025 17:13:57 +0300 Subject: [PATCH 09/12] refactor: schedule-and-documentation function to the object --- dev-data/courses.data.ts | 18 +++++----- .../schedule-and-documentation.data.tsx | 33 +++++++++++++++---- dev-data/training-program.data.tsx | 24 ++++++-------- src/shared/__tests__/constants.ts | 16 ++++----- src/shared/constants.ts | 20 +++++------ 5 files changed, 63 insertions(+), 48 deletions(-) rename src/shared/helpers/get-schedule-and-documentation-links.tsx => dev-data/schedule-and-documentation.data.tsx (56%) diff --git a/dev-data/courses.data.ts b/dev-data/courses.data.ts index e7e43a5fd..064a0b0d6 100644 --- a/dev-data/courses.data.ts +++ b/dev-data/courses.data.ts @@ -23,7 +23,7 @@ export const courses: Course[] = [ iconFooter: html5, secondaryIcon: javascriptBlack, startDate: TO_BE_DETERMINED, - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_PRESCHOOL_RU], + scheduleUrl: COURSE_SCHEDULE_LINKS.JS_PRESCHOOL_RU, registrationEndDate: TO_BE_DETERMINED, language: 'ru', mode: 'online', @@ -47,7 +47,7 @@ export const courses: Course[] = [ iconFooter: javascript, secondaryIcon: javascriptBlack, startDate: TO_BE_DETERMINED, - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_EN], + scheduleUrl: COURSE_SCHEDULE_LINKS.JS_EN, registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -71,7 +71,7 @@ export const courses: Course[] = [ iconFooter: javascript, secondaryIcon: javascriptBlack, startDate: TO_BE_DETERMINED, - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_RU], + scheduleUrl: COURSE_SCHEDULE_LINKS.JS_RU, registrationEndDate: TO_BE_DETERMINED, language: 'ru', mode: 'online', @@ -94,7 +94,7 @@ export const courses: Course[] = [ iconFooter: react, secondaryIcon: react, startDate: TO_BE_DETERMINED, - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.REACT], + scheduleUrl: COURSE_SCHEDULE_LINKS.REACT, registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -117,7 +117,7 @@ export const courses: Course[] = [ iconFooter: angular, secondaryIcon: angular, startDate: TO_BE_DETERMINED, - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.ANGULAR], + scheduleUrl: COURSE_SCHEDULE_LINKS.ANGULAR, registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -140,7 +140,7 @@ export const courses: Course[] = [ iconFooter: nodejs, secondaryIcon: nodejs, startDate: TO_BE_DETERMINED, - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.NODE], + scheduleUrl: COURSE_SCHEDULE_LINKS.NODE, registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -163,7 +163,7 @@ export const courses: Course[] = [ iconFooter: awsWhite, secondaryIcon: awsBlack, startDate: TO_BE_DETERMINED, - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_FUNDAMENTALS], + scheduleUrl: COURSE_SCHEDULE_LINKS.AWS_FUNDAMENTALS, registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -187,7 +187,7 @@ export const courses: Course[] = [ secondaryIcon: awsBlack, iconFooter: awsWhite, startDate: TO_BE_DETERMINED, - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_CLOUD_DEVELOPER], + scheduleUrl: COURSE_SCHEDULE_LINKS.AWS_CLOUD_DEVELOPER, registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', @@ -210,7 +210,7 @@ export const courses: Course[] = [ secondaryIcon: awsBlack, iconFooter: awsWhite, startDate: TO_BE_DETERMINED, - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_DEVOPS], + scheduleUrl: COURSE_SCHEDULE_LINKS.AWS_DEVOPS, registrationEndDate: TO_BE_DETERMINED, language: 'en', mode: 'online', diff --git a/src/shared/helpers/get-schedule-and-documentation-links.tsx b/dev-data/schedule-and-documentation.data.tsx similarity index 56% rename from src/shared/helpers/get-schedule-and-documentation-links.tsx rename to dev-data/schedule-and-documentation.data.tsx index be41b79fa..35f7fb1e0 100644 --- a/src/shared/helpers/get-schedule-and-documentation-links.tsx +++ b/dev-data/schedule-and-documentation.data.tsx @@ -1,9 +1,18 @@ +import { ReactElement } from 'react'; + import { COURSE_TITLES } from '@/../dev-data/courseTitles.data'; import { COURSE_SCHEDULE_LINKS, DOCUMENTATION_LINKS } from '@/shared/constants'; import { LinkCustom } from '@/shared/ui/link-custom'; import { Paragraph } from '@/shared/ui/paragraph'; -export const scheduleDocumentationEN = (courseName: keyof typeof COURSE_SCHEDULE_LINKS) => ( +type CourseKeys = keyof typeof COURSE_TITLES; +type CourseNames = typeof COURSE_TITLES[CourseKeys]; + +type ScheduleDocumentationMapType = { + [key in CourseNames]: ReactElement; +}; + +const scheduleDocumentationEN: (courseName: CourseKeys) => ReactElement = (courseName) => ( The course {' '} @@ -27,10 +36,10 @@ export const scheduleDocumentationEN = (courseName: keyof typeof COURSE_SCHEDULE ); -export const scheduleDocumentationJS_PRESCHOOL_RU = () => ( +const JS_PRESCHOOL_RU: ReactElement = ( @@ -51,12 +60,12 @@ export const scheduleDocumentationJS_PRESCHOOL_RU = () => ( ); -export const scheduleDocumentationJS_RU = () => ( +const JS_RU: ReactElement = ( Рассписания {' '} @@ -66,7 +75,7 @@ export const scheduleDocumentationJS_RU = () => ( и {' '} @@ -86,3 +95,15 @@ export const scheduleDocumentationJS_RU = () => ( школы. ); + +export const scheduleDocumentationMap: ScheduleDocumentationMapType = { + [COURSE_TITLES.JS_RU]: JS_RU, + [COURSE_TITLES.JS_EN]: scheduleDocumentationEN('JS_EN'), + [COURSE_TITLES.JS_PRESCHOOL_RU]: JS_PRESCHOOL_RU, + [COURSE_TITLES.REACT]: scheduleDocumentationEN('REACT'), + [COURSE_TITLES.ANGULAR]: scheduleDocumentationEN('ANGULAR'), + [COURSE_TITLES.NODE]: scheduleDocumentationEN('NODE'), + [COURSE_TITLES.AWS_FUNDAMENTALS]: scheduleDocumentationEN('AWS_FUNDAMENTALS'), + [COURSE_TITLES.AWS_CLOUD_DEVELOPER]: scheduleDocumentationEN('AWS_CLOUD_DEVELOPER'), + [COURSE_TITLES.AWS_DEVOPS]: scheduleDocumentationEN('AWS_DEVOPS'), +}; diff --git a/dev-data/training-program.data.tsx b/dev-data/training-program.data.tsx index 3d0c25814..958158bd9 100644 --- a/dev-data/training-program.data.tsx +++ b/dev-data/training-program.data.tsx @@ -8,6 +8,7 @@ import { COURSE_TITLES, CourseNamesKeys, } from './courseTitles.data'; +import { scheduleDocumentationMap } from './schedule-and-documentation.data'; import awsPractitionerBadge from '@/shared/assets/aws-cloud-pract-badge.webp'; import angularImg from '@/shared/assets/rs-slope-angular.webp'; import awsDevImg from '@/shared/assets/rs-slope-aws-dev.webp'; @@ -16,11 +17,6 @@ import jsImg from '@/shared/assets/rs-slope-js.webp'; import nodejsImg from '@/shared/assets/rs-slope-nodejs.webp'; import reactEnImg from '@/shared/assets/rs-slope-react-en.webp'; import { REGISTRATION_WILL_OPEN_SOON, REGISTRATION_WILL_OPEN_SOON_RU } from '@/shared/constants'; -import { - scheduleDocumentationEN, - scheduleDocumentationJS_PRESCHOOL_RU, - scheduleDocumentationJS_RU, -} from '@/shared/helpers/get-schedule-and-documentation-links'; import { LinkCustom } from '@/shared/ui/link-custom'; import { List } from '@/shared/ui/list'; import { Paragraph } from '@/shared/ui/paragraph'; @@ -65,7 +61,7 @@ export const contentMap: ContentMap = { 'Implement backend-for-frontend using API Gateway', ]} />, - scheduleDocumentationEN(COURSE_TITLES.AWS_CLOUD_DEVELOPER), + scheduleDocumentationMap[COURSE_TITLES.AWS_CLOUD_DEVELOPER], ], image: awsDevImg, }, @@ -87,7 +83,7 @@ export const contentMap: ContentMap = { During the course, you will have access to online sessions led by AWS User Groups and RS School Mentors, where you can ask questions, discuss the materials, and get feedback. , - scheduleDocumentationEN(COURSE_TITLES.AWS_FUNDAMENTALS), + scheduleDocumentationMap[COURSE_TITLES.AWS_FUNDAMENTALS], ], image: awsFundamentalsImg, }, @@ -116,7 +112,7 @@ export const contentMap: ContentMap = { 'Nest.js', ]} />, - scheduleDocumentationEN(COURSE_TITLES.NODE), + scheduleDocumentationMap[COURSE_TITLES.NODE], ], image: nodejsImg, }, @@ -139,7 +135,7 @@ export const contentMap: ContentMap = { . Theoretical materials are provided as recorded lectures from previous courses. , - scheduleDocumentationEN(COURSE_TITLES.ANGULAR), + scheduleDocumentationMap[COURSE_TITLES.ANGULAR], ], image: angularImg, }, @@ -164,7 +160,7 @@ export const contentMap: ContentMap = { {` that practical tasks’ deadlines are not suggestions, and should be respected.`} , - scheduleDocumentationEN(COURSE_TITLES.JS_EN), + scheduleDocumentationMap[COURSE_TITLES.JS_EN], ], image: jsImg, }, @@ -190,7 +186,7 @@ export const contentMap: ContentMap = { {`, что сроки выполнения практических заданий не являются рекомендацией и должны быть соблюдены.`} , - scheduleDocumentationJS_RU(), + scheduleDocumentationMap[COURSE_TITLES.JS_RU], ], image: jsImg, }, @@ -240,7 +236,7 @@ export const contentMap: ContentMap = { type="unmarked" /> , - scheduleDocumentationJS_PRESCHOOL_RU(), + scheduleDocumentationMap[COURSE_TITLES.JS_PRESCHOOL_RU], ], image: jsImg, }, @@ -262,7 +258,7 @@ export const contentMap: ContentMap = { 'Understanding of RESTful services', ]} />, - scheduleDocumentationEN(COURSE_TITLES.REACT), + scheduleDocumentationMap[COURSE_TITLES.REACT], ], image: reactEnImg, }, @@ -310,7 +306,7 @@ export const contentMap: ContentMap = { 'Community-based education: the community will help you explore emerging technologies and best practices, ensuring you are equipped with the knowledge that the current market seeks', ]} />, - scheduleDocumentationEN(COURSE_TITLES.AWS_DEVOPS), + scheduleDocumentationMap[COURSE_TITLES.AWS_DEVOPS], ], image: awsDevImg, }, diff --git a/src/shared/__tests__/constants.ts b/src/shared/__tests__/constants.ts index 36e2a06b0..fe35cbc28 100644 --- a/src/shared/__tests__/constants.ts +++ b/src/shared/__tests__/constants.ts @@ -32,7 +32,7 @@ export const mockedCourses: Course[] = [ subTitle: 'Pre-school RU', descriptionUrl: COURSE_LINKS.JS_PRESCHOOL_RU, startDate: 'Jun 24, 2024', - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_PRESCHOOL_RU], + scheduleUrl: COURSE_SCHEDULE_LINKS.JS_PRESCHOOL_RU, registrationEndDate: 'Jun 24, 2024', language: 'ru', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.JS_PRESCHOOL_RU}`, @@ -56,7 +56,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.JS_EN, startDate: 'Oct, 2024', - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_EN], + scheduleUrl: COURSE_SCHEDULE_LINKS.JS_EN, registrationEndDate: 'Jun 24, 2025', language: 'en', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.JS}`, @@ -80,7 +80,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.JS_RU, startDate: 'Oct, 2024', - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.JS_RU], + scheduleUrl: COURSE_SCHEDULE_LINKS.JS_RU, registrationEndDate: 'Jun 24, 2025', language: 'ru', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.JS_RU}`, @@ -104,7 +104,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.REACT, startDate: 'Jul 1, 2024', - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.REACT], + scheduleUrl: COURSE_SCHEDULE_LINKS.REACT, registrationEndDate: 'Jun 24, 2024', language: 'en', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.REACT}`, @@ -127,7 +127,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.ANGULAR, startDate: 'Jul 1, 2024', - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.ANGULAR], + scheduleUrl: COURSE_SCHEDULE_LINKS.ANGULAR, registrationEndDate: 'Jun 24, 2025', language: 'en', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.ANGULAR}`, @@ -150,7 +150,7 @@ export const mockedCourses: Course[] = [ subTitle: null, descriptionUrl: COURSE_LINKS.AWS_FUNDAMENTALS, startDate: 'Jul 1, 2024', - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_FUNDAMENTALS], + scheduleUrl: COURSE_SCHEDULE_LINKS.AWS_FUNDAMENTALS, registrationEndDate: 'Jun 24, 2025', language: 'en', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.AWS_FUNDAMENTALS}`, @@ -177,7 +177,7 @@ export const mockedCourses: Course[] = [ iconFooter: MOCKED_IMAGE_PATH, secondaryIcon: MOCKED_IMAGE_PATH, startDate: 'Jul 1, 2024', - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_CLOUD_DEVELOPER], + scheduleUrl: COURSE_SCHEDULE_LINKS.AWS_CLOUD_DEVELOPER, registrationEndDate: 'Jun 24, 2025', language: 'en', mode: 'online', @@ -200,7 +200,7 @@ export const mockedCourses: Course[] = [ iconFooter: MOCKED_IMAGE_PATH, secondaryIcon: MOCKED_IMAGE_PATH, startDate: 'Jul 1, 2024', - scheduleUrl: COURSE_SCHEDULE_LINKS[COURSE_TITLES.AWS_DEVOPS], + scheduleUrl: COURSE_SCHEDULE_LINKS.AWS_DEVOPS, registrationEndDate: 'Jun 24, 2025', language: 'en', mode: 'online', diff --git a/src/shared/constants.ts b/src/shared/constants.ts index be026baeb..fbea30fbf 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -1,5 +1,3 @@ -import { COURSE_TITLES } from 'data'; - export const RS_INTRO_URL = 'https://www.youtube.com/embed/n4unZLVpnaU'; export const RS_FOUNDATION_YEAR = '2013'; export const RS_EMAIL = 'rolling.scopes@gmail.com'; @@ -38,18 +36,18 @@ export const COURSE_LINKS = { export const KEY_CODES = { ESCAPE: 'Escape' } as const; export const COURSE_SCHEDULE_LINKS = { - [COURSE_TITLES.JS_PRESCHOOL_RU]: 'https://github.com/rolling-scopes-school/tasks/tree/master/stage0', - [COURSE_TITLES.JS_EN]: 'https://github.com/rolling-scopes-school/js-fe-course-en', - [COURSE_TITLES.JS_RU]: [ + JS_PRESCHOOL_RU: 'https://github.com/rolling-scopes-school/tasks/tree/master/stage0', + JS_EN: 'https://github.com/rolling-scopes-school/js-fe-course-en', + JS_RU: [ 'https://github.com/rolling-scopes-school/tasks/tree/master/stage1', 'https://github.com/rolling-scopes-school/tasks/tree/master/stage2', ], - [COURSE_TITLES.REACT]: 'https://github.com/rolling-scopes-school/tasks/blob/master/react/README.md', - [COURSE_TITLES.ANGULAR]: 'https://github.com/rolling-scopes-school/tasks/tree/master/angular', - [COURSE_TITLES.NODE]: 'https://github.com/rolling-scopes-school/tasks/tree/master/node', - [COURSE_TITLES.AWS_FUNDAMENTALS]: 'https://github.com/rolling-scopes-school/aws/tree/main/aws-fundamentals', - [COURSE_TITLES.AWS_CLOUD_DEVELOPER]: 'https://github.com/rolling-scopes-school/aws/tree/main/aws-developer', - [COURSE_TITLES.AWS_DEVOPS]: 'https://github.com/rolling-scopes-school/tasks/tree/master/devops', + REACT: 'https://github.com/rolling-scopes-school/tasks/blob/master/react/README.md', + ANGULAR: 'https://github.com/rolling-scopes-school/tasks/tree/master/angular', + NODE: 'https://github.com/rolling-scopes-school/tasks/tree/master/node', + AWS_FUNDAMENTALS: 'https://github.com/rolling-scopes-school/aws/tree/main/aws-fundamentals', + AWS_CLOUD_DEVELOPER: 'https://github.com/rolling-scopes-school/aws/tree/main/aws-developer', + AWS_DEVOPS: 'https://github.com/rolling-scopes-school/tasks/tree/master/devops', }; export const DOCUMENTATION_LINKS = { From 06d859ad5a6270898674b6bde3a37f5c17b733a6 Mon Sep 17 00:00:00 2001 From: Yulia Demir Date: Sun, 4 May 2025 06:52:03 +0300 Subject: [PATCH 10/12] refactor: 484 - changed link to the github --- dev-data/about-course.data.tsx | 8 ++------ dev-data/schedule-and-documentation.data.tsx | 1 + .../ui/mentorship-courses/mentorship-courses.test.tsx | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dev-data/about-course.data.tsx b/dev-data/about-course.data.tsx index 81dabbcfa..3144977b7 100644 --- a/dev-data/about-course.data.tsx +++ b/dev-data/about-course.data.tsx @@ -5,11 +5,7 @@ import noteIcon from '@/shared/assets/icons/note-icon.webp'; import paperIcon from '@/shared/assets/icons/paper-icon.webp'; import personIcon from '@/shared/assets/icons/person-icon.webp'; import planetIcon from '@/shared/assets/icons/planet.webp'; -import { - DOCUMENTATION_LINKS, - REGISTRATION_WILL_OPEN_SOON, - REGISTRATION_WILL_OPEN_SOON_RU, -} from '@/shared/constants'; +import { REGISTRATION_WILL_OPEN_SOON, REGISTRATION_WILL_OPEN_SOON_RU } from '@/shared/constants'; import { LinkCustom } from '@/shared/ui/link-custom'; import { List } from '@/shared/ui/list'; import { Paragraph } from '@/shared/ui/paragraph'; @@ -58,7 +54,7 @@ const infoMaterialsEn = ( {' '} )} - + GitHub . diff --git a/dev-data/schedule-and-documentation.data.tsx b/dev-data/schedule-and-documentation.data.tsx index 35f7fb1e0..e4697f61a 100644 --- a/dev-data/schedule-and-documentation.data.tsx +++ b/dev-data/schedule-and-documentation.data.tsx @@ -23,6 +23,7 @@ const scheduleDocumentationEN: (courseName: CourseKeys) => ReactElement = (cours > shcedule + {' '} and school {' '} Date: Sun, 11 May 2025 20:49:46 +0300 Subject: [PATCH 11/12] refactor: 484 - add const for github link --- dev-data/about-course.data.tsx | 3 ++- src/shared/constants.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dev-data/about-course.data.tsx b/dev-data/about-course.data.tsx index 5be9d5458..ca56274fa 100644 --- a/dev-data/about-course.data.tsx +++ b/dev-data/about-course.data.tsx @@ -5,6 +5,7 @@ import paperIcon from '@/shared/assets/icons/paper-icon.webp'; import personIcon from '@/shared/assets/icons/person-icon.webp'; import planetIcon from '@/shared/assets/icons/planet.webp'; import { + GITHUB_LINK, REGISTRATION_WILL_OPEN_SOON, REGISTRATION_WILL_OPEN_SOON_RU, ROUTES, @@ -57,7 +58,7 @@ const infoMaterialsEn = ( {' '} )} - + GitHub . diff --git a/src/shared/constants.ts b/src/shared/constants.ts index cc031ec2a..830e21b49 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -59,6 +59,7 @@ export const COURSE_SCHEDULE_LINKS = { AWS_DEVOPS: 'https://github.com/rolling-scopes-school/tasks/tree/master/devops', }; +export const GITHUB_LINK = 'https://github.com/rolling-scopes-school/'; export const DOCUMENTATION_LINKS = { 'RU': 'https://rs.school/docs/ru', 'EN': 'https://docs.rs.school', From 9bb72e2d3fc71bb76a60c997287dc3f005582e8e Mon Sep 17 00:00:00 2001 From: YulikK Date: Thu, 15 May 2025 22:00:12 +0200 Subject: [PATCH 12/12] refactor: 484 - move schedule and documentation links to a reusable function --- dev-data/index.ts | 1 + dev-data/schedule-and-documentation.data.tsx | 148 ++++++------------ dev-data/training-program.data.tsx | 10 -- src/shared/__tests__/constants.ts | 4 +- src/shared/constants.ts | 20 +-- .../training-program/ui/training-program.tsx | 6 +- 6 files changed, 56 insertions(+), 133 deletions(-) diff --git a/dev-data/index.ts b/dev-data/index.ts index 48f2d4cb8..47e0ba20e 100644 --- a/dev-data/index.ts +++ b/dev-data/index.ts @@ -59,6 +59,7 @@ export { preschoolFaqData } from './faq.data'; export { principleCards } from './principle-cards.data'; export { requirementsData } from './requirements.data'; export { rsInNumbers } from './rs-in-numbers.data'; +export { scheduleDocumentationLinks } from './schedule-and-documentation.data'; export { sliderPhotos } from './slider-photos.data'; export { studyPath } from './study-path.data'; export { videoTitleLocalized } from './about-video.data'; diff --git a/dev-data/schedule-and-documentation.data.tsx b/dev-data/schedule-and-documentation.data.tsx index 2ecdd05a2..8207aabc3 100644 --- a/dev-data/schedule-and-documentation.data.tsx +++ b/dev-data/schedule-and-documentation.data.tsx @@ -1,111 +1,57 @@ import { ReactElement } from 'react'; -import { COURSE_TITLES } from '@/../dev-data/course-titles.data'; -import { COURSE_SCHEDULE_LINKS, DOCUMENTATION_LINKS } from '@/shared/constants'; +import { DOCUMENTATION_LINKS } from '@/shared/constants'; +import { Language } from '@/shared/types'; import { LinkCustom } from '@/shared/ui/link-custom'; import { Paragraph } from '@/shared/ui/paragraph'; -type CourseKeys = keyof typeof COURSE_TITLES; -type CourseNames = typeof COURSE_TITLES[CourseKeys]; - -type ScheduleDocumentationMapType = { - [key in CourseNames]: ReactElement; +interface ScheduleText { + schedule: string; + documentation: string; + and: string; + link: string; +} +const TEXT: Record = { + ru: { + schedule: 'Расписание курса доступно - ', + documentation: ', а документацию школы можно найти - ', + link: 'здесь', + and: 'и', + }, + en: { + schedule: 'The course schedule is available - ', + documentation: ', and the school documentation can be found - ', + link: 'here', + and: 'and', + }, }; -const scheduleDocumentationEN: (courseName: CourseKeys) => ReactElement = (courseName) => ( - - The course - {' '} - - shcedule - - {' '} - and school - {' '} - - documentation - - . - -); - -const JS_PRESCHOOL_RU: ReactElement = ( - - - Рассписание - - {' '} - курса и - {' '} - - документация - - {' '} - школы. - -); +export const scheduleDocumentationLinks = ( + language: Language, scheduleUrl: string[] | null, +): ReactElement => { + const text = TEXT[language]; + const docLink = DOCUMENTATION_LINKS[language]; -const JS_RU: ReactElement = ( - - Рассписания - {' '} - - первого - - {' '} - и - {' '} - - второго - - {' '} - этапа курса и - {' '} - - документация - - {' '} - школы. - -); + const renderScheduleLinks = () => { + return scheduleUrl?.map((link, index) => ( + <> + + {`${text.link}`} + + {index < scheduleUrl.length - 1 && ` ${text.and} `} + + )); + }; -export const scheduleDocumentationMap: ScheduleDocumentationMapType = { - [COURSE_TITLES.JS_RU]: JS_RU, - [COURSE_TITLES.JS_EN]: scheduleDocumentationEN('JS_EN'), - [COURSE_TITLES.JS_PRESCHOOL_RU]: JS_PRESCHOOL_RU, - [COURSE_TITLES.REACT]: scheduleDocumentationEN('REACT'), - [COURSE_TITLES.ANGULAR]: scheduleDocumentationEN('ANGULAR'), - [COURSE_TITLES.NODE]: scheduleDocumentationEN('NODE'), - [COURSE_TITLES.AWS_FUNDAMENTALS]: scheduleDocumentationEN('AWS_FUNDAMENTALS'), - [COURSE_TITLES.AWS_CLOUD_DEVELOPER]: scheduleDocumentationEN('AWS_CLOUD_DEVELOPER'), - [COURSE_TITLES.AWS_DEVOPS]: scheduleDocumentationEN('AWS_DEVOPS'), - [COURSE_TITLES.AWS_AI]: scheduleDocumentationEN('AWS_AI'), + return ( + + {text.schedule} + {' '} + {renderScheduleLinks()} + {text.documentation} + + {text.link} + + + ); }; diff --git a/dev-data/training-program.data.tsx b/dev-data/training-program.data.tsx index 4e4724329..51e291772 100644 --- a/dev-data/training-program.data.tsx +++ b/dev-data/training-program.data.tsx @@ -8,7 +8,6 @@ import { COURSE_TITLES, CourseNamesKeys, } from './course-titles.data'; -import { scheduleDocumentationMap } from './schedule-and-documentation.data'; import awsPractitionerBadge from '@/shared/assets/aws-cloud-pract-badge.webp'; import angularImg from '@/shared/assets/rs-slope-angular.webp'; import awsDevImg from '@/shared/assets/rs-slope-aws-dev.webp'; @@ -61,7 +60,6 @@ export const contentMap: ContentMap = { 'Implement backend-for-frontend using API Gateway', ]} />, - scheduleDocumentationMap[COURSE_TITLES.AWS_CLOUD_DEVELOPER], ], image: awsDevImg, }, @@ -83,7 +81,6 @@ export const contentMap: ContentMap = { During the course, you will have access to online sessions led by AWS User Groups and RS School Mentors, where you can ask questions, discuss the materials, and get feedback. , - scheduleDocumentationMap[COURSE_TITLES.AWS_FUNDAMENTALS], ], image: awsFundamentalsImg, }, @@ -112,7 +109,6 @@ export const contentMap: ContentMap = { 'Nest.js', ]} />, - scheduleDocumentationMap[COURSE_TITLES.NODE], ], image: nodejsImg, }, @@ -135,7 +131,6 @@ export const contentMap: ContentMap = { . Theoretical materials are provided as recorded lectures from previous courses. , - scheduleDocumentationMap[COURSE_TITLES.ANGULAR], ], image: angularImg, }, @@ -160,7 +155,6 @@ export const contentMap: ContentMap = { {` that practical tasks’ deadlines are not suggestions, and should be respected.`} , - scheduleDocumentationMap[COURSE_TITLES.JS_EN], ], image: jsImg, }, @@ -186,7 +180,6 @@ export const contentMap: ContentMap = { {`, что сроки выполнения практических заданий не являются рекомендацией и должны быть соблюдены.`} , - scheduleDocumentationMap[COURSE_TITLES.JS_RU], ], image: jsImg, }, @@ -229,7 +222,6 @@ export const contentMap: ContentMap = { type="unmarked" /> , - scheduleDocumentationMap[COURSE_TITLES.JS_PRESCHOOL_RU], ], image: jsImg, }, @@ -251,7 +243,6 @@ export const contentMap: ContentMap = { 'Understanding of RESTful services', ]} />, - scheduleDocumentationMap[COURSE_TITLES.REACT], ], image: reactEnImg, }, @@ -299,7 +290,6 @@ export const contentMap: ContentMap = { 'Community-based education: the community will help you explore emerging technologies and best practices, ensuring you are equipped with the knowledge that the current market seeks', ]} />, - scheduleDocumentationMap[COURSE_TITLES.AWS_DEVOPS], ], image: awsDevImg, }, diff --git a/src/shared/__tests__/constants.ts b/src/shared/__tests__/constants.ts index 64e1fe828..285f0e0c2 100644 --- a/src/shared/__tests__/constants.ts +++ b/src/shared/__tests__/constants.ts @@ -5,7 +5,7 @@ import { Course } from '@/entities/course'; import { MentorFeedback } from '@/entities/mentor'; import type { Trainer } from '@/entities/trainer'; import nodejsImg1 from '@/shared/assets/mentors/m-shylau.webp'; -import { COURSE_LINKS, COURSE_SCHEDULE_LINKS, ROUTES } from '@/shared/constants'; +import { COURSE_LINKS, ROUTES } from '@/shared/constants'; import { FaqDataItem, FaqDataItemWithLink } from '@/widgets/faq/types'; import { COURSE_TITLES } from 'data'; @@ -79,7 +79,7 @@ export const mockedCourses: Course[] = [ subTitle: undefined, descriptionUrl: COURSE_LINKS.JS_RU, startDate: 'Oct, 2024', - scheduleUrl: COURSE_SCHEDULE_LINKS.JS_RU, + scheduleUrl: ['link'], registrationEndDate: 'Jun 24, 2025', language: 'ru', detailsUrl: `/${ROUTES.COURSES}/${ROUTES.JS_RU}`, diff --git a/src/shared/constants.ts b/src/shared/constants.ts index a12837fea..0cf099f43 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -45,26 +45,10 @@ export const COURSE_LINKS = { export const KEY_CODES = { ESCAPE: 'Escape' } as const; -export const COURSE_SCHEDULE_LINKS = { - JS_PRESCHOOL_RU: 'https://github.com/rolling-scopes-school/tasks/tree/master/stage0', - JS_EN: 'https://github.com/rolling-scopes-school/js-fe-course-en', - JS_RU: [ - 'https://github.com/rolling-scopes-school/tasks/tree/master/stage1', - 'https://github.com/rolling-scopes-school/tasks/tree/master/stage2', - ], - REACT: 'https://github.com/rolling-scopes-school/tasks/blob/master/react/README.md', - ANGULAR: 'https://github.com/rolling-scopes-school/tasks/tree/master/angular', - NODE: 'https://github.com/rolling-scopes-school/tasks/tree/master/node', - AWS_FUNDAMENTALS: 'https://github.com/rolling-scopes-school/aws/tree/main/aws-fundamentals', - AWS_CLOUD_DEVELOPER: 'https://github.com/rolling-scopes-school/aws/tree/main/aws-developer', - AWS_DEVOPS: 'https://github.com/rolling-scopes-school/tasks/tree/master/devops', - AWS_AI: 'https://github.com/rolling-scopes-school/tasks/tree/master/devops', -}; - export const GITHUB_LINK = 'https://github.com/rolling-scopes-school/'; export const DOCUMENTATION_LINKS = { - 'RU': 'https://rs.school/docs/ru', - 'EN': 'https://docs.rs.school', + ru: 'https://rs.school/docs/ru', + en: 'https://docs.rs.school', }; export const HTTP_METHOD = { diff --git a/src/widgets/training-program/ui/training-program.tsx b/src/widgets/training-program/ui/training-program.tsx index ace9eba67..d1130cf12 100644 --- a/src/widgets/training-program/ui/training-program.tsx +++ b/src/widgets/training-program/ui/training-program.tsx @@ -6,7 +6,7 @@ import { isTrainingProgramType } from '@/shared/helpers/is-training-program'; import { selectCourse } from '@/shared/hooks/use-course-by-title/utils/select-course'; import { LinkCustom } from '@/shared/ui/link-custom'; import { WidgetTitle } from '@/shared/ui/widget-title'; -import { CourseNamesKeys, contentMap, trainingProgramLink } from 'data'; +import { CourseNamesKeys, contentMap, scheduleDocumentationLinks, trainingProgramLink } from 'data'; import styles from './training-program.module.scss'; @@ -19,7 +19,7 @@ type TrainingProgramProps = { export const TrainingProgram = async ({ courseName, specify = '' }: TrainingProgramProps) => { const course = await selectCourse(courseName); - const { language } = course; + const { language, scheduleUrl } = course; const programName = specify ? `${courseName} ${specify}` : courseName; const contentName = isTrainingProgramType(programName) ? programName : courseName; const isCourseWithBadge = courseName.includes('badge'); @@ -38,6 +38,8 @@ export const TrainingProgram = async ({ courseName, specify = '' }: TrainingProg {content.map((component, index) => cloneElement(component, { key: index }))} + {scheduleDocumentationLinks(language, scheduleUrl)} + {course && ( {registrationLinkText}