-
Notifications
You must be signed in to change notification settings - Fork 14
TCA-710 and TCA-716 -> TCA-701 #460
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cf95722
TCA-710 init code
kkartunov b04a363
TCA-710 courses list
kkartunov cf32329
TCA-710 courses filter UI above banner
kkartunov eb48997
TCA-716 correct custom icons
kkartunov 66a240e
adds progress bar to course cards
kkartunov 737a6b4
TCA Certifications on home page - init
kkartunov 37b4ea6
TCA-710 TCACert card updates
kkartunov 4824a52
code review updates
kkartunov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src-ts/tools/learn/learn-lib/data-providers/tca-certifications-provider/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './tca-certifications-provider-data.model' | ||
export * from './tca-certifications.provider' | ||
export * from './tca-certificate-status-type' | ||
export * from './tca-certificate-level-type' | ||
export * from './tca-certification.model' |
1 change: 1 addition & 0 deletions
1
.../learn/learn-lib/data-providers/tca-certifications-provider/tca-certificate-level-type.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type TCACertificationLearnLevel = 'Beginner' | 'Intermediate' | 'Expert' | 'All Levels' |
1 change: 1 addition & 0 deletions
1
...learn/learn-lib/data-providers/tca-certifications-provider/tca-certificate-status-type.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type TCACertificationStatus = 'active' | 'inactive' | 'coming_soon' | 'deprecated' |
15 changes: 15 additions & 0 deletions
15
...ols/learn/learn-lib/data-providers/tca-certifications-provider/tca-certification.model.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { TCACertificationLearnLevel } from './tca-certificate-level-type' | ||
import { TCACertificationStatus } from './tca-certificate-status-type' | ||
|
||
export interface TCACertification { | ||
id: number | ||
title: string | ||
description: string | ||
estimatedCompletionTime: number | ||
status: TCACertificationStatus | ||
sequentialCourses: boolean | ||
learnerLevel: TCACertificationLearnLevel | ||
certificationCategoryId: string | ||
stripeProductId?: string | ||
skills: string[] | ||
} |
8 changes: 8 additions & 0 deletions
8
...-lib/data-providers/tca-certifications-provider/tca-certifications-provider-data.model.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { TCACertification } from './tca-certification.model' | ||
|
||
export interface TCACertificationsProviderData { | ||
certifications: Array<TCACertification> | ||
error: boolean | ||
loading: boolean | ||
ready: boolean | ||
} |
71 changes: 71 additions & 0 deletions
71
...earn/learn-lib/data-providers/tca-certifications-provider/tca-certifications.provider.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* eslint-disable max-len */ | ||
/* eslint-disable sort-keys */ | ||
/* eslint-disable default-param-last */ | ||
import useSWR, { SWRConfiguration, SWRResponse } from 'swr' | ||
|
||
import { learnUrlGet } from '../../functions' | ||
import { useSwrCache } from '../../learn-swr' | ||
|
||
import { TCACertificationsProviderData } from './tca-certifications-provider-data.model' | ||
import { TCACertification } from './tca-certification.model' | ||
|
||
interface TCACertificationsAllProviderOptions { | ||
enabled?: boolean | ||
} | ||
|
||
export function useGetAllTCACertifications( | ||
options?: TCACertificationsAllProviderOptions, | ||
): TCACertificationsProviderData { | ||
|
||
const url: string = learnUrlGet( | ||
'topcoder-certifications', | ||
) | ||
const swrCacheConfig: SWRConfiguration = useSwrCache(url) | ||
|
||
const { data, error }: SWRResponse = useSWR(url, { | ||
...swrCacheConfig, | ||
isPaused: () => options?.enabled === false, | ||
}) | ||
|
||
return { | ||
certifications: data ?? [], | ||
error: !!error, | ||
loading: !data, | ||
ready: !!data, | ||
} | ||
} | ||
|
||
// TODO: remove when integrated with API | ||
export function useGetAllTCACertificationsMOCK(): TCACertificationsProviderData { | ||
const data: TCACertification[] = [{ | ||
id: 1, | ||
title: 'Web Development Fundamentals', | ||
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.', | ||
estimatedCompletionTime: 4, | ||
learnerLevel: 'Beginner', | ||
sequentialCourses: false, | ||
status: 'active', | ||
certificationCategoryId: '', | ||
skills: ['HTML', 'CSS', 'JavaScript', 'HTML', 'CSS', 'JavaScript', 'HTML', 'CSS', 'JavaScript', 'HTML', 'CSS', 'JavaScript', 'HTML', 'CSS', 'JavaScript'], | ||
}, | ||
{ | ||
id: 2, | ||
title: 'Data Science Fundamentals', | ||
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.', | ||
estimatedCompletionTime: 14, | ||
status: 'active', | ||
sequentialCourses: false, | ||
learnerLevel: 'Expert', | ||
certificationCategoryId: '', | ||
skills: ['Python', 'TensorFlow', 'JSON'], | ||
}] | ||
|
||
const error = {} | ||
|
||
return { | ||
certifications: data ?? [], | ||
error: !!error, | ||
loading: !data, | ||
ready: !!data, | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
import { ReactComponent as LearningHat } from './learning-hat.svg' | ||
import { ReactComponent as CertIcon } from './cert-icon.svg' | ||
import { ReactComponent as CourseIcon } from './course-icon.svg' | ||
import { ReactComponent as CrowdIcon } from './crowd-icon.svg' | ||
|
||
export { LearningHat } | ||
export { | ||
LearningHat, | ||
CertIcon, | ||
CourseIcon, | ||
CrowdIcon, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.