Skip to content

TCA-832 2.4 TCA Survey Release - 2022-12-14 -> master #446

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 25 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0bcf276
TCA-755 #comment This commit adds the basic sprig html snippet and fi…
brooketopcoder Dec 6, 2022
375a554
TCA-755 #comment This commit adds the Sprig SDK and creates a wrapper…
brooketopcoder Dec 6, 2022
a19ad96
TCA-755 #comment Update the trigger to run the first time any module …
brooketopcoder Dec 7, 2022
9fc1e01
Merge pull request #431 from topcoder-platform/TCA-755_implement-survey
testflyjets Dec 7, 2022
8c10a2c
TCA-790 #comment add delay if the cert is completed #time 2h
brooketopcoder Dec 7, 2022
3e0ee99
TCA-790 #comment This commit sets a timeout and uses the cert progres…
brooketopcoder Dec 7, 2022
7b4d8b9
TCA-652 #comment This commit sets all env to cache. #time 15m
brooketopcoder Dec 7, 2022
c30680a
Merge pull request #433 from topcoder-platform/TCA-652_enable-cache
brooketopcoder Dec 7, 2022
fe608e4
Use progress.status to check certification completion status
vas3a Dec 8, 2022
70d0116
user-certification-progress.ready - convert to boolean
vas3a Dec 8, 2022
96367c8
debounce lessonCompleted & lastLesson events from FCC
vas3a Dec 8, 2022
5436a5a
When user starts a new course, call swr.mutate with the new certifica…
vas3a Dec 8, 2022
db66c09
TCA-790 fix naming
brooketopcoder Dec 8, 2022
181918f
TCA-790 #comment This commit supports the fact that a certificate can…
brooketopcoder Dec 8, 2022
67defd5
TCA-790 comments
brooketopcoder Dec 9, 2022
c5e2a7c
Merge pull request #432 from topcoder-platform/TCA-790_assessments
brooketopcoder Dec 9, 2022
83f8a8d
Merge pull request #435 from topcoder-platform/TCA-796_fcc-last-lesso…
vas3a Dec 9, 2022
a5788de
TCA-663 Delay survey
brooketopcoder Dec 14, 2022
69effc0
TCA-790 assessments add delay
brooketopcoder Dec 14, 2022
289d146
Merge branch 'TCA-832_release' into TCA-790_assessments
brooketopcoder Dec 14, 2022
d9d4ad1
Merge pull request #445 from topcoder-platform/TCA-790_assessments
brooketopcoder Dec 14, 2022
3e915c3
TCA-832 temporarily deploy release branch to dev
brooketopcoder Dec 14, 2022
a712979
Merge branch 'TCA-832_release' of https://github.com/topcoder-platfor…
brooketopcoder Dec 14, 2022
37867d6
TCA-832 Fix branch to deploy to dev
brooketopcoder Dec 14, 2022
a3251b9
TCA-852 Revert dev deploy of feature branch
brooketopcoder Dec 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install_dependency: &install_dependency
install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
git clone --branch v1.4.12 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
git clone --branch v1.4.13 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
environment:
DEPLOY_ENV: "PROD"
LOGICAL_ENV: "prod"
ENABLE_CACHE: false
ENABLE_CACHE: true
APPNAME: "platform-ui-mvp"
steps: *deploy_steps

Expand Down Expand Up @@ -227,7 +227,9 @@ workflows:
filters:
branches:
only:
- dev
# - dev
# temp only deploy the release branch to dev
- TCA-832_release

- deployProd:
context : org-global
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"dependencies": {
"@datadog/browser-logs": "^4.21.2",
"@heroicons/react": "^1.0.6",
"@sprig-technologies/sprig-browser": "^2.20.1",
"@stripe/react-stripe-js": "1.13.0",
"@stripe/stripe-js": "1.41.0",
"apexcharts": "^3.36.0",
Expand Down
40 changes: 21 additions & 19 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
<html lang="en">

<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description"
content="Topcoder is home to the world’s largest community of designers, developers, and data scientists. Allowing you the freedom to start and execute faster." />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Barlow+Condensed:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Barlow+Condensed:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo_512x512.png" />
<link rel="stylesheet" href="%PUBLIC_URL%/global.css">
<!--
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description"
content="Topcoder is home to the world’s largest community of designers, developers, and data scientists. Allowing you the freedom to start and execute faster." />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="preload" as="style"
href="https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Barlow+Condensed:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" />
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Barlow+Condensed:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo_512x512.png" />
<link rel="stylesheet" href="%PUBLIC_URL%/global.css">
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -28,13 +30,13 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Topcoder Top Technology Talent On-Demand</title>
<title>Topcoder Top Technology Talent On-Demand</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root" data-id="root"></div>
<!--
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root" data-id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

Expand Down
6 changes: 3 additions & 3 deletions src-ts/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { routeContext, RouteContextData } from './lib'

const App: FC<{}> = () => {

const [ready, setReady]: [boolean, Dispatch<SetStateAction<boolean>>] = useState(false)
const [ready, setReady]: [boolean, Dispatch<SetStateAction<boolean>>] = useState<boolean>(false)
const { allRoutes, getRouteElement }: RouteContextData = useContext(routeContext)

const routeElements: Array<ReactElement> = allRoutes
Expand All @@ -19,9 +19,9 @@ const App: FC<{}> = () => {

useEffect(() => {
if (ready) {
document.getElementById('root')?.classList.add('app-ready');
document.getElementById('root')?.classList.add('app-ready')
}
}, [ready]);
}, [ready])

return (
<>
Expand Down
3 changes: 3 additions & 0 deletions src-ts/config/environments/environment.default.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export const EnvironmentConfigDefault: EnvironmentConfigModel = {
SERVICE: 'platform-ui',
},
REAUTH_OFFSET: 55,
SPRIG: {
ENVIRONMENT_ID: 'bUcousVQ0-yF',
},
// TODO: Move stripe creds to .env file
STRIPE: {
ADMIN_TOKEN:
Expand Down
3 changes: 3 additions & 0 deletions src-ts/config/environments/environment.prod.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const EnvironmentConfigProd: EnvironmentConfigModel = {
},
DISABLED_TOOLS: [],
ENV: 'prod',
SPRIG: {
ENVIRONMENT_ID: 'a-IZBZ6-r7bU',
},
// TODO: Move stripe creds to .env file
STRIPE: {
ADMIN_TOKEN:
Expand Down
1 change: 1 addition & 0 deletions src-ts/lib/functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export * from './error-functions'
export * from './file-functions'
export * from './logging-functions'
export * from './text-format-functions'
export * from './survey-functions'
export * from './user-functions'
export * from './xhr-functions'
1 change: 1 addition & 0 deletions src-ts/lib/functions/survey-functions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { triggerForUser as surveyTriggerForUser } from './survey.functions'
22 changes: 22 additions & 0 deletions src-ts/lib/functions/survey-functions/survey.functions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { sprig, SprigAPI } from '@sprig-technologies/sprig-browser'

import { EnvironmentConfig } from '../../../config'

const Sprig: SprigAPI = sprig.configure({
environmentId: EnvironmentConfig.SPRIG.ENVIRONMENT_ID,
})

export function triggerForUser(surveyName: string, userId?: number): void {

if (!userId) {
Sprig.track(surveyName)
return
}

Sprig.identifyAndTrack({
anonymousId: '',
eventName: surveyName,
metadata: undefined,
userId: `${userId}`,
})
}
3 changes: 3 additions & 0 deletions src-ts/lib/global-config.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export interface GlobalConfig {
SERVICE: string
}
REAUTH_OFFSET: number
SPRIG: {
ENVIRONMENT_ID: string
}
STRIPE: {
ADMIN_TOKEN: string
API_KEY: string
Expand Down
1 change: 1 addition & 0 deletions src-ts/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export {
logError,
logInfo,
logInitialize,
surveyTriggerForUser,
textFormatDateLocaleShortString,
textFormatGetSafeString,
textFormatMoneyLocaleString,
Expand Down
2 changes: 2 additions & 0 deletions src-ts/tools/learn/course-details/CourseDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const CourseDetailsPage: FC<{}> = () => {
const {
certificationProgress: progress,
ready: progressReady,
setCertificateProgress,
}: UserCertificationProgressProviderData = useGetUserCertificationProgress(
profile?.userId,
routeParams.provider,
Expand Down Expand Up @@ -214,6 +215,7 @@ const CourseDetailsPage: FC<{}> = () => {
progress={progress}
progressReady={progressReady}
profile={profile}
setCertificateProgress={setCertificateProgress}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ interface CourseCurriculumProps {
profile?: UserProfile
progress?: LearnUserCertificationProgress
progressReady?: boolean
setCertificateProgress: (d: LearnUserCertificationProgress) => void
}

const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProps) => {
Expand Down Expand Up @@ -108,7 +109,7 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp
}

if (!props.progress?.id) {
await userCertificationProgressStartAsync(
const progress: LearnUserCertificationProgress = await userCertificationProgressStartAsync(
props.profile.userId,
props.course.certificationId,
props.course.id,
Expand All @@ -117,6 +118,9 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp
module: props.course.modules[0].meta.dashedName,
},
)

// update progress with data returned from calling the start progress endpoint
props.setCertificateProgress(progress)
} else {
await userCertificationProgressUpdateAsync(
props.progress.id,
Expand Down
Loading