Skip to content

Commit e49e62d

Browse files
authored
Merge pull request #460 from topcoder-platform/TCA-710_TCA-716
TCA-710 and TCA-716 -> TCA-701
2 parents e8cbce6 + 4824a52 commit e49e62d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1171
-134
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,13 @@ The `yarn start` command serves the site using the cert and key in the /ssl dire
151151

152152
By overriding the app to use <b>port 443</b>, you can use the authorized URL and trust the root CA to avoid SSL errors in the browser.
153153

154-
>**NOTE:** Mac users will require running the app with elevated permissions in order to use a port lower than 500.
154+
>**NOTE:** Mac users will require running the app with elevated permissions in order to use a port lower than 500.
155+
156+
Easy way to overcome elevated permissions is to make use of:
157+
158+
```
159+
sudo setcap 'cap_net_bind_service=+ep' `which node`
160+
```
155161

156162
For easier development, it is recommended that you add this certificate to your trusted root authorities and as a trused cert in your browser. Google your browser and OS for more info on how to trust cert authorities.
157163

src-ts/lib/svgs/icon-level-1.svg

Lines changed: 5 additions & 0 deletions
Loading

src-ts/lib/svgs/icon-level-2.svg

Lines changed: 5 additions & 0 deletions
Loading

src-ts/lib/svgs/icon-level-3.svg

Lines changed: 5 additions & 0 deletions
Loading

src-ts/lib/svgs/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ import { ReactComponent as SocialShareTwitter } from './social-share-twitter.svg
1919
import { ReactComponent as SocialIconTwitter } from './social-tw-icon.svg'
2020
import { ReactComponent as SocialIconYoutube } from './social-yt-icon.svg'
2121
import { ReactComponent as TooltipArrowIcon } from './tooltip-arrow.svg'
22+
import { ReactComponent as TcAcademyLogoSvg } from './tc-academy-logo.svg'
23+
import { ReactComponent as TcLogoSvg } from './tc-logo.svg'
24+
import { ReactComponent as FccLogoSvg } from './vendor-fcc-logo.svg'
25+
import { ReactComponent as FccLogoBlackSvg } from './vendor-fcc-logo-black.svg'
26+
import { ReactComponent as IconLevel1 } from './icon-level-1.svg'
27+
import { ReactComponent as IconLevel2 } from './icon-level-2.svg'
28+
import { ReactComponent as IconLevel3 } from './icon-level-3.svg'
2229

2330
export {
2431
ActiveTabTipIcon,
@@ -40,5 +47,12 @@ export {
4047
GithubIcon,
4148
SaveForLaterIcon,
4249
IconCheck,
50+
TcAcademyLogoSvg,
51+
TcLogoSvg,
52+
FccLogoSvg,
53+
FccLogoBlackSvg,
54+
IconLevel1,
55+
IconLevel2,
56+
IconLevel3,
4357
}
4458
export * from './icon-wrapper'

src-ts/lib/svgs/vendor-fcc-logo-black.svg

Lines changed: 17 additions & 0 deletions
Loading

src-ts/tools/learn/course-certificate/certificate-view/certificate/Certificate.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import { LearnCertificateTrackType } from '../../../learn-lib'
66

77
import { CertificateBgPattern } from './certificate-bg-pattern'
88
import { CourseCard } from './course-card'
9-
import { ReactComponent as TcAcademyLogoSvg } from './tc-academy-logo.svg'
10-
import { ReactComponent as TcLogoSvg } from './tc-logo.svg'
11-
import { ReactComponent as FccLogoSvg } from './vendor-fcc-logo.svg'
9+
1210
import styles from './Certificate.module.scss'
11+
import { FccLogoSvg, TcAcademyLogoSvg, TcLogoSvg } from '../../../../../lib'
1312

1413
interface CertificateProps {
1514
completedDate?: string

src-ts/tools/learn/learn-lib/data-providers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ export * from './lesson-provider'
44
export * from './resource-provider-provider'
55
export * from './user-certifications-provider'
66
export * from './user-completed-certifications-provider'
7+
export * from './tca-certifications-provider'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * from './tca-certifications-provider-data.model'
2+
export * from './tca-certifications.provider'
3+
export * from './tca-certificate-status-type'
4+
export * from './tca-certificate-level-type'
5+
export * from './tca-certification.model'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type TCACertificationLearnLevel = 'Beginner' | 'Intermediate' | 'Expert' | 'All Levels'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type TCACertificationStatus = 'active' | 'inactive' | 'coming_soon' | 'deprecated'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { TCACertificationLearnLevel } from './tca-certificate-level-type'
2+
import { TCACertificationStatus } from './tca-certificate-status-type'
3+
4+
export interface TCACertification {
5+
id: number
6+
title: string
7+
description: string
8+
estimatedCompletionTime: number
9+
status: TCACertificationStatus
10+
sequentialCourses: boolean
11+
learnerLevel: TCACertificationLearnLevel
12+
certificationCategoryId: string
13+
stripeProductId?: string
14+
skills: string[]
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { TCACertification } from './tca-certification.model'
2+
3+
export interface TCACertificationsProviderData {
4+
certifications: Array<TCACertification>
5+
error: boolean
6+
loading: boolean
7+
ready: boolean
8+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* eslint-disable max-len */
2+
/* eslint-disable sort-keys */
3+
/* eslint-disable default-param-last */
4+
import useSWR, { SWRConfiguration, SWRResponse } from 'swr'
5+
6+
import { learnUrlGet } from '../../functions'
7+
import { useSwrCache } from '../../learn-swr'
8+
9+
import { TCACertificationsProviderData } from './tca-certifications-provider-data.model'
10+
import { TCACertification } from './tca-certification.model'
11+
12+
interface TCACertificationsAllProviderOptions {
13+
enabled?: boolean
14+
}
15+
16+
export function useGetAllTCACertifications(
17+
options?: TCACertificationsAllProviderOptions,
18+
): TCACertificationsProviderData {
19+
20+
const url: string = learnUrlGet(
21+
'topcoder-certifications',
22+
)
23+
const swrCacheConfig: SWRConfiguration = useSwrCache(url)
24+
25+
const { data, error }: SWRResponse = useSWR(url, {
26+
...swrCacheConfig,
27+
isPaused: () => options?.enabled === false,
28+
})
29+
30+
return {
31+
certifications: data ?? [],
32+
error: !!error,
33+
loading: !data,
34+
ready: !!data,
35+
}
36+
}
37+
38+
// TODO: remove when integrated with API
39+
export function useGetAllTCACertificationsMOCK(): TCACertificationsProviderData {
40+
const data: TCACertification[] = [{
41+
id: 1,
42+
title: 'Web Development Fundamentals',
43+
description: 'The Web Developer Fundamentals certification will teach you the basics of HTML, CSS, javascript, front end libraries and will also introduce you to backend development.',
44+
estimatedCompletionTime: 4,
45+
learnerLevel: 'Beginner',
46+
sequentialCourses: false,
47+
status: 'active',
48+
certificationCategoryId: '',
49+
skills: ['HTML', 'CSS', 'JavaScript', 'HTML', 'CSS', 'JavaScript', 'HTML', 'CSS', 'JavaScript', 'HTML', 'CSS', 'JavaScript', 'HTML', 'CSS', 'JavaScript'],
50+
},
51+
{
52+
id: 2,
53+
title: 'Data Science Fundamentals',
54+
description: 'The Data Science Fundamentals certification will teach you the basics of scientific computing, Data Analysis and machine learning while using Python. Additionally, you will learn about data visualization.',
55+
estimatedCompletionTime: 14,
56+
status: 'active',
57+
sequentialCourses: false,
58+
learnerLevel: 'Expert',
59+
certificationCategoryId: '',
60+
skills: ['Python', 'TensorFlow', 'JSON'],
61+
}]
62+
63+
const error = {}
64+
65+
return {
66+
certifications: data ?? [],
67+
error: !!error,
68+
loading: !data,
69+
ready: !!data,
70+
}
71+
}
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
import { ReactComponent as LearningHat } from './learning-hat.svg'
2+
import { ReactComponent as CertIcon } from './cert-icon.svg'
3+
import { ReactComponent as CourseIcon } from './course-icon.svg'
4+
import { ReactComponent as CrowdIcon } from './crowd-icon.svg'
25

3-
export { LearningHat }
6+
export {
7+
LearningHat,
8+
CertIcon,
9+
CourseIcon,
10+
CrowdIcon,
11+
}

src-ts/tools/learn/welcome/WelcomePage.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { FC } from 'react'
22
import classNames from 'classnames'
33

44
import { PageSubheaderPortalId } from '../../../config'
5-
import { ContentLayout, LoadingSpinner, Portal } from '../../../lib'
5+
import { ContentLayout, LoadingSpinner, PageDivider, Portal } from '../../../lib'
66
import {
77
AllCertificationsProviderData,
8+
TCACertificationsProviderData,
89
useGetAllCertifications,
10+
useGetAllTCACertificationsMOCK,
911
useGetUserCertifications,
1012
UserCertificationsProviderData,
1113
WaveHero,
@@ -14,6 +16,8 @@ import '../../../lib/styles/index.scss'
1416

1517
import { AvailableCoursesList } from './available-courses-list'
1618
import { ProgressBlock } from './progress-block'
19+
import { WhatTCACanDo } from './what-tca-cando'
20+
import { TCCertifications } from './tc-certifications'
1721
import { ReactComponent as TcAcademyFullLogoSvg } from './tca-full-logo.svg'
1822
import styles from './WelcomePage.module.scss'
1923

@@ -24,6 +28,9 @@ const WelcomePage: FC = () => {
2428

2529
const coursesReady: boolean = allCertsData.ready && userCertsData.ready
2630

31+
// TODO: this hook is mocked - remove mock when API is available...
32+
const allTCACertifications: TCACertificationsProviderData = useGetAllTCACertificationsMOCK()
33+
2734
return (
2835
<ContentLayout>
2936

@@ -42,9 +49,7 @@ const WelcomePage: FC = () => {
4249
The Topcoder Academy will provide you with learning opportunities
4350
in the form of guided learning paths.
4451
You will have the opportunity to learn new skills that will better
45-
prepare you to earn on the Topcoder platform.<br />
46-
<br />
47-
We look forward to learning with you!
52+
prepare you to earn on the Topcoder platform.
4853
`}
4954
theme='light'
5055
>
@@ -61,6 +66,14 @@ const WelcomePage: FC = () => {
6166
<div className={classNames(styles['courses-section'], 'full-height-frame')}>
6267
<LoadingSpinner hide={coursesReady} />
6368

69+
<WhatTCACanDo />
70+
71+
<PageDivider />
72+
73+
<TCCertifications certifications={allTCACertifications.certifications} />
74+
75+
<PageDivider />
76+
6477
{coursesReady && (
6578
<AvailableCoursesList
6679
certifications={allCertsData.certifications}

0 commit comments

Comments
 (0)