From b8d54e60287ed62d4a64730ceacf447346c2aef0 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Mon, 29 Aug 2022 13:46:23 +0300 Subject: [PATCH 01/61] TCA-366 - Certificate view is flickering when trackType isn't DEV --- .../certificate-view/CertificateView.tsx | 8 ++++++-- .../certificate-bg-pattern/CertificateBgPattern.tsx | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src-ts/tools/learn/course-certificate/certificate-view/CertificateView.tsx b/src-ts/tools/learn/course-certificate/certificate-view/CertificateView.tsx index 465c19982..ead6c3bab 100644 --- a/src-ts/tools/learn/course-certificate/certificate-view/CertificateView.tsx +++ b/src-ts/tools/learn/course-certificate/certificate-view/CertificateView.tsx @@ -66,7 +66,11 @@ const CertificateView: FC = (props: CertificateViewProps) const { certification: certificate, ready: certificateReady, - }: AllCertificationsProviderData = useAllCertifications(props.provider, course?.certificationId) + }: AllCertificationsProviderData = useAllCertifications( + props.provider, + course?.certificationId, + {enabled: !!course?.certificationId} + ) const ready: boolean = useMemo(() => ( completedCertificateReady && courseReady && certificateReady @@ -142,7 +146,7 @@ const CertificateView: FC = (props: CertificateViewProps) <> - {readyAndCompletedCertification && ( + {ready && readyAndCompletedCertification && (
{!props.hideActions && ( diff --git a/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx b/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx index f1d2196b7..596ef86e9 100644 --- a/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx +++ b/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx @@ -1,10 +1,11 @@ import classNames from 'classnames' import { FC } from 'react' +import { LearnCertificateTrackType } from '../../../../learn-lib' import styles from './CertificateBgPattern.module.scss' interface CertificateBgPatternProps { - type: 'QA'|'DEV'|'DATASCIENCE'|'DESIGN' + type: LearnCertificateTrackType } const CertificateBgPattern: FC = (props: CertificateBgPatternProps) => { From a2e92aa3b904b2ceff75edcdb89b6ba9f4c558df Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Mon, 29 Aug 2022 14:15:01 +0300 Subject: [PATCH 02/61] lint fixes --- .../certificate/certificate-bg-pattern/CertificateBgPattern.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx b/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx index 596ef86e9..82fdb7c1a 100644 --- a/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx +++ b/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx @@ -2,6 +2,7 @@ import classNames from 'classnames' import { FC } from 'react' import { LearnCertificateTrackType } from '../../../../learn-lib' + import styles from './CertificateBgPattern.module.scss' interface CertificateBgPatternProps { From cd4ef32e42bd55cda8e00562f26982a98e893d6d Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Tue, 30 Aug 2022 10:59:46 +0300 Subject: [PATCH 03/61] TCA-367 - FCC page: check if url params are valid, if not redirect to first module/lesson --- .../tools/learn/free-code-camp/FreeCodeCamp.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx index b335e8a77..bb083fc8f 100644 --- a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx +++ b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx @@ -80,6 +80,22 @@ const FreeCodeCamp: FC<{}> = () => { lessonParam, ) + if (courseDataReady && courseData) { + const moduleParamData = courseData.modules.find(m => m.key === moduleParam) ?? courseData.modules[0]; + const lessonParamExists = moduleParamData?.lessons.find(l => l.dashedName === lessonParam); + + if (!lessonParamExists) { + const lessonPath: string = getLessonPathFromModule( + providerParam, + certificationParam, + moduleParamData.key, + moduleParamData.lessons[0].dashedName, + ) + + navigate(lessonPath) + } + } + const ready: boolean = profileReady && courseDataReady && lessonReady && (!isLoggedIn || progressReady) const certification: string = lesson?.course.certification ?? '' From 8edfcaf8590609feb887508fdd70b70f20c1e231 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Tue, 30 Aug 2022 11:20:28 +0300 Subject: [PATCH 04/61] lint fixes --- .../learn/free-code-camp/FreeCodeCamp.tsx | 42 ++++++++++++------- .../functions/learn-xhr.functions.ts | 2 +- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx index bb083fc8f..a986e6e98 100644 --- a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx +++ b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx @@ -80,22 +80,6 @@ const FreeCodeCamp: FC<{}> = () => { lessonParam, ) - if (courseDataReady && courseData) { - const moduleParamData = courseData.modules.find(m => m.key === moduleParam) ?? courseData.modules[0]; - const lessonParamExists = moduleParamData?.lessons.find(l => l.dashedName === lessonParam); - - if (!lessonParamExists) { - const lessonPath: string = getLessonPathFromModule( - providerParam, - certificationParam, - moduleParamData.key, - moduleParamData.lessons[0].dashedName, - ) - - navigate(lessonPath) - } - } - const ready: boolean = profileReady && courseDataReady && lessonReady && (!isLoggedIn || progressReady) const certification: string = lesson?.course.certification ?? '' @@ -301,6 +285,32 @@ const FreeCodeCamp: FC<{}> = () => { setCertificateProgress, ]) + useEffect(() => { + if (courseDataReady && courseData) { + const moduleParamData: LearnModule = courseData.modules.find(m => m.key === moduleParam) ?? courseData.modules[0] + const lessonParamExists: boolean = !!moduleParamData?.lessons.find(l => l.dashedName === lessonParam) + + if (!lessonParamExists) { + const lessonPath: string = getLessonPathFromModule( + providerParam, + certificationParam, + moduleParamData.key, + moduleParamData.lessons[0].dashedName, + ) + + navigate(lessonPath) + } + } + }, [ + certificationParam, + courseData, + courseDataReady, + lessonParam, + moduleParam, + navigate, + providerParam, + ]) + useEffect(() => { const certificationPath: string = routeParams.certification ?? '' const modulePath: string = routeParams.module ?? '' diff --git a/src-ts/tools/learn/learn-lib/functions/learn-xhr.functions.ts b/src-ts/tools/learn/learn-lib/functions/learn-xhr.functions.ts index 1c1a409c0..fd3430aee 100644 --- a/src-ts/tools/learn/learn-lib/functions/learn-xhr.functions.ts +++ b/src-ts/tools/learn/learn-lib/functions/learn-xhr.functions.ts @@ -1,4 +1,4 @@ -import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios' +import { AxiosInstance, AxiosRequestConfig } from 'axios' import { xhrCreateInstance, xhrGetAsync, xhrPostAsync, xhrPutAsync } from '../../../../lib' From f944b9a72d95730e213275193b032f3da320c687 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Tue, 30 Aug 2022 11:51:04 +0300 Subject: [PATCH 05/61] TCA-376 - refetch course progress data when user opens sidebar nav --- .../learn/free-code-camp/FreeCodeCamp.tsx | 6 ++- .../collapsible-pane/CollapsiblePane.tsx | 8 ++- ...tification-progress-provider-data.model.ts | 1 + .../user-certification-progress.provider.tsx | 51 +++++++++++-------- 4 files changed, 43 insertions(+), 23 deletions(-) diff --git a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx index b335e8a77..3051c38e8 100644 --- a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx +++ b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx @@ -62,6 +62,7 @@ const FreeCodeCamp: FC<{}> = () => { certificationProgress: certificateProgress, setCertificateProgress, ready: progressReady, + refetch: refetchProgress, }: UserCertificationProgressProviderData = useUserCertificationProgress( profile?.userId, routeParams.provider, @@ -336,7 +337,10 @@ const FreeCodeCamp: FC<{}> = () => { {lesson && (
- + isOpen && refetchProgress()} + >
{courseData?.title} diff --git a/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx b/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx index 3742fecb0..e73399a51 100644 --- a/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx +++ b/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx @@ -1,4 +1,5 @@ import classNames from 'classnames' +import { noop } from 'lodash' import { Dispatch, FC, ReactNode, SetStateAction, useCallback, useState } from 'react' import { IconSolid } from '../../../../lib' @@ -7,16 +8,19 @@ import styles from './CollapsiblePane.module.scss' interface CollapsiblePaneProps { children: ReactNode + onToggle?: (isOpen: boolean) => void position?: 'to-left'|'to-right' title: string } const CollapsiblePane: FC = (props: CollapsiblePaneProps) => { + const {onToggle = noop}: CollapsiblePaneProps = props const [isOpen, setIsOpen]: [boolean, Dispatch>] = useState(false) const toggle: () => void = useCallback(() => { - setIsOpen(open => !open) - }, []) + setIsOpen(!isOpen) + onToggle(!isOpen) + }, [isOpen, onToggle]) return (
void, setCertificateProgress: (progess: LearnUserCertificationProgress) => void, } diff --git a/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certification-progress.provider.tsx b/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certification-progress.provider.tsx index 2b0991b04..8a951e979 100644 --- a/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certification-progress.provider.tsx +++ b/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certification-progress.provider.tsx @@ -1,49 +1,60 @@ -import { Dispatch, SetStateAction, useEffect, useState } from 'react' +import { Dispatch, MutableRefObject, SetStateAction, useCallback, useEffect, useRef, useState } from 'react' import { UserCertificationProgressProviderData } from './user-certification-progress-provider-data.model' import { LearnUserCertificationProgress, userCertificationProgressGetAsync } from './user-certifications-functions' export function useUserCertificationProgress(userId?: number, provider?: string, certification?: string): UserCertificationProgressProviderData { + const callCounter: MutableRefObject = useRef(0) function setCertificateProgress(progress: LearnUserCertificationProgress): void { setState((prevState) => ({ ...prevState, certificationProgress: progress })) + callCounter.current++ } + const fetchProgress: () => void = useCallback(() => { + if (!userId) { + return + } + + const currentCallCounter: number = ++callCounter.current + + userCertificationProgressGetAsync(userId, provider, certification) + .then((myCertifications) => { + // if another call to fetchProgress or to setCertificateProgress + // was made before we got the api response + // return, and do not update state + if (callCounter.current !== currentCallCounter) { + return + } + + setState((prevState) => ({ + ...prevState, + certificationProgress: myCertifications.find(c => c.certification === certification), + loading: false, + ready: true, + })) + }) + }, [certification, provider, userId]) + const [state, setState]: [UserCertificationProgressProviderData, Dispatch>] = useState({ certificationProgress: undefined, loading: false, ready: false, + refetch: fetchProgress, setCertificateProgress, }) useEffect(() => { - setState((prevState) => ({ ...prevState, loading: true, })) - if (!userId) { - return - } - - userCertificationProgressGetAsync(userId, provider, certification) - .then((myCertifications) => { - setState((prevState) => ({ - ...prevState, - certificationProgress: myCertifications.find(c => c.certification === certification), - loading: false, - ready: true, - })) - }) - }, [ - certification, - provider, - userId, - ]) + fetchProgress() + }, [certification, fetchProgress]) return state } From 5bdbe6b498e33ebcc54467d48df04d355fa02849 Mon Sep 17 00:00:00 2001 From: billsedison Date: Wed, 31 Aug 2022 10:11:00 +0800 Subject: [PATCH 06/61] Final fix: Landing page thrive update, Getting Started Guide update --- .../MarkdownDoc/MarkdownDoc.module.scss | 2 +- .../MarkdownDoc/TableOfContents.tsx | 25 +- .../getting-started/GettingStartedGuide.md | 266 +++++++++--------- .../articles.config.ts | 23 +- .../carousel-content.config.ts | 76 ++--- 5 files changed, 200 insertions(+), 192 deletions(-) diff --git a/src-ts/tools/dev-center/dev-center-lib/MarkdownDoc/MarkdownDoc.module.scss b/src-ts/tools/dev-center/dev-center-lib/MarkdownDoc/MarkdownDoc.module.scss index e8e157f78..e3ddad865 100644 --- a/src-ts/tools/dev-center/dev-center-lib/MarkdownDoc/MarkdownDoc.module.scss +++ b/src-ts/tools/dev-center/dev-center-lib/MarkdownDoc/MarkdownDoc.module.scss @@ -16,7 +16,7 @@ @include font-weight-normal; font-size: 14px; line-height: 18px; - color: $purple-120; + color: $silver-2; word-break: break-word; } diff --git a/src-ts/tools/dev-center/dev-center-lib/MarkdownDoc/TableOfContents.tsx b/src-ts/tools/dev-center/dev-center-lib/MarkdownDoc/TableOfContents.tsx index 28d1adcb9..20a674635 100644 --- a/src-ts/tools/dev-center/dev-center-lib/MarkdownDoc/TableOfContents.tsx +++ b/src-ts/tools/dev-center/dev-center-lib/MarkdownDoc/TableOfContents.tsx @@ -14,9 +14,11 @@ export const TableOfContents: React.FC = (props) => { ] = React.useState(-1) const { toc }: { toc: TOC } = props const items: TOC = React.useMemo(() => { - return toc.filter((item) => (item.level === 2 || item.level === 3)) + return toc.filter((item) => item.level === 2 || item.level === 3) }, [toc]) + const navRef: React.RefObject = React.createRef() + const findActiveIndex: () => void = React.useCallback(() => { for (let i: number = 0; i < items.length; i++) { const h: HTMLElement | null = document.getElementById( @@ -29,27 +31,40 @@ export const TableOfContents: React.FC = (props) => { document.documentElement.clientHeight / 2 ) { setActiveIndex(i) + const liNodes: NodeListOf | undefined = + navRef.current?.querySelectorAll('li') + if (navRef.current && liNodes) { + navRef.current.scrollTop = + liNodes[i].offsetTop > + document.documentElement.clientHeight - 100 + ? liNodes[liNodes.length - 1].offsetTop + : 0 + } } } - }, [items]) + }, [items, navRef]) useOnScroll({ onScroll: findActiveIndex }) return ( -
- {!myInProgressCertifications.length && ( - - {allMyLearningsLink} - - )} + + {allMyLearningsLink} +
Date: Thu, 1 Sep 2022 10:46:43 +0800 Subject: [PATCH 13/61] integrate cy dashboard --- .circleci/config.yml | 3 --- .gitignore | 2 ++ cypress.config.ts | 7 ++++--- cypress/e2e/home/home.spec.ts | 4 ++++ package.json | 3 ++- yarn.lock | 20 ++++++++++++++++++++ 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd0d77bc6..42d07afff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -155,9 +155,6 @@ jobs: - checkout - restore_cache: key: test-node-modules-{{ checksum "yarn.lock" }} - - run: - name: Config Git - command: git config --global url."https://git@".insteadOf git:// - run: name: Install Dependencies command: yarn install diff --git a/.gitignore b/.gitignore index 63c983693..00cac0197 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ # testing /coverage .nyc_output +/cypress/screenshots +/cypress/videos # production /build diff --git a/cypress.config.ts b/cypress.config.ts index e622ea360..64e42e01a 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,9 +1,10 @@ import { defineConfig } from 'cypress' export default defineConfig({ + projectId: "yfm67z", fixturesFolder: false, - video: false, - screenshotOnRunFailure: false, + video: true, + screenshotOnRunFailure: true, defaultCommandTimeout: 10000, e2e: { baseUrl: 'http://localhost:3000', @@ -15,5 +16,5 @@ export default defineConfig({ require('@cypress/code-coverage/task')(on, config) return config; }, - }, + } }) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index 8d1f98c25..960cda452 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -5,4 +5,8 @@ describe('Landing Page', () => { it('loads landing page should be successfully', () => { cy.get('[data-id="root"]').should('be.visible') }) + + it('loads landing page should fail', () => { + cy.get('[data-id="root"]').should('not.be.visible') + }) }) diff --git a/package.json b/package.json index bf9628928..5f619c046 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "eslint:fix": "eslint 'src/**/*.{js,jsx}' --fix", "test": "react-scripts test --watchAll", "test:no-watch": "react-scripts test --watchAll=false --passWithNoTests", - "cy:run": "cypress run", + "cy:run": "dotenv -- cypress run --record --key f290b5f1-3586-45a6-ba5f-aa33b68e4868", "cy:ci": "start-server-and-test 'serve -s build -n -p 3000' http://localhost:3000 'cy:run'", "report:coverage": "nyc report --reporter=html", "report:coverage:text": "nyc report --reporter=text" @@ -104,6 +104,7 @@ "config": "^3.3.6", "cross-env": "^7.0.2", "cypress": "^10.6.0", + "dotenv-cli": "^6.0.0", "eslint": "^8.18.0", "eslint-config-prettier": "^6.7.0", "eslint-config-react-app": "^7.0.1", diff --git a/yarn.lock b/yarn.lock index 301fcda10..66b5c757f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6071,16 +6071,36 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" +dotenv-cli@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/dotenv-cli/-/dotenv-cli-6.0.0.tgz#8a30cbc59d0a8aaa166b2fee0a9a55e23a1223ab" + integrity sha512-qXlCOi3UMDhCWFKe0yq5sg3X+pJAz+RQDiFN38AMSbUrnY3uZshSfDJUAge951OS7J9gwLZGfsBlWRSOYz/TRg== + dependencies: + cross-spawn "^7.0.3" + dotenv "^16.0.0" + dotenv-expand "^8.0.1" + minimist "^1.2.5" + dotenv-expand@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0" integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA== +dotenv-expand@^8.0.1: + version "8.0.3" + resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-8.0.3.tgz#29016757455bcc748469c83a19b36aaf2b83dd6e" + integrity sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg== + dotenv@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== +dotenv@^16.0.0: + version "16.0.2" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.2.tgz#0b0f8652c016a3858ef795024508cddc4bffc5bf" + integrity sha512-JvpYKUmzQhYoIFgK2MOnF3bciIZoItIIoryihy0rIA+H4Jy0FmgyKYAHCTN98P5ybGSJcIFbh6QKeJdtZd1qhA== + duplexer@^0.1.1, duplexer@^0.1.2, duplexer@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" From dc8b73bf124e0bc8dd2c93530818ec3bca1bdf91 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 1 Sep 2022 14:35:23 +0800 Subject: [PATCH 14/61] refine ci --- .circleci/config.yml | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 42d07afff..f01198fe7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,7 @@ install_build_dependency: &install_build_dependency apt update apt install jq -y apt install python3-pip -y + apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb pip3 install awscli --upgrade install_dependency: &install_dependency @@ -36,6 +37,7 @@ save_cache_settings: &save_cache_settings key: connect-node-modules-{{ checksum "yarn.lock" }} paths: - node_modules + - /root/.cache/Cypress running_yarn_tslint: &running_yarn_tslint name: Running Yarn tslint @@ -48,7 +50,9 @@ running_yarn_build: &running_yarn_build command: | source buildenvvar yarn install + yarn cypress install yarn build + yarn cy:ci workspace_persist: &workspace_persist root: . @@ -147,32 +151,6 @@ jobs: APPNAME: "platform-ui-mvp" steps: *deploy_steps - # Test job for the cases when we don not need deployment. - e2e-test: - docker: - - image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge - steps: - - checkout - - restore_cache: - key: test-node-modules-{{ checksum "yarn.lock" }} - - run: - name: Install Dependencies - command: yarn install - no_output_timeout: 20m - - run: - name: Install Cypress Binary - command: yarn cypress install - - run: - name: Build the application - command: yarn build - no_output_timeout: 20m - - save_cache: - key: test-node-modules-{{ checksum "yarn.lock" }} - paths: - - node_modules - - /root/.cache/Cypress - - run: yarn cy:ci - workflows: version: 2 build: @@ -198,9 +176,6 @@ workflows: ignore: - master - - e2e-test: - context : org-global - - build-prod: context : org-global filters: @@ -212,7 +187,6 @@ workflows: context : org-global requires: - build-dev - - e2e-test filters: branches: only: From f1fcdc86dd0454fd79dc063afc93eff544271330 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 1 Sep 2022 14:44:49 +0800 Subject: [PATCH 15/61] refine command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f01198fe7..9ab068ee1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ install_build_dependency: &install_build_dependency apt update apt install jq -y apt install python3-pip -y - apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb + apt install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y pip3 install awscli --upgrade install_dependency: &install_dependency From a90128b1a2b8dba19c43c185e93561f7a2036fab Mon Sep 17 00:00:00 2001 From: Brooke Date: Thu, 1 Sep 2022 08:43:42 -0700 Subject: [PATCH 16/61] TCA-386 #comment This commit fixes the condition that compares undefined updated at values #time 15m --- .../welcome/progress-block/progress-action/ProgressAction.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ts/tools/learn/welcome/progress-block/progress-action/ProgressAction.tsx b/src-ts/tools/learn/welcome/progress-block/progress-action/ProgressAction.tsx index 162e59099..3eb8997ec 100644 --- a/src-ts/tools/learn/welcome/progress-block/progress-action/ProgressAction.tsx +++ b/src-ts/tools/learn/welcome/progress-block/progress-action/ProgressAction.tsx @@ -46,7 +46,7 @@ const ProgressAction: FC = (props: ProgressActionProps) => ), [allCertifications]) // we only want to display the last course that was acted upon - const mostRecentIsCompleted: boolean = myInProgressCertifications?.[0]?.updatedAt < myCompletedCertifications?.[0]?.updatedAt + const mostRecentIsCompleted: boolean = myCompletedCertifications?.[0]?.updatedAt > (myInProgressCertifications?.[0]?.updatedAt || 0) function renderInProgress(): JSX.Element { From 19249261588575dc982c5f8ee5cb20d9db19fcdb Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 2 Sep 2022 10:55:55 +0800 Subject: [PATCH 17/61] report integration --- .circleci/config.yml | 8 ++ .gitignore | 1 + cypress.config.ts | 1 - package.json | 4 +- yarn.lock | 313 +++++++++++++++++++++++++++++++++++++++---- 5 files changed, 296 insertions(+), 31 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9ab068ee1..79394a923 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,6 +83,14 @@ build_steps: &build_steps - run: *install_deploysuite - run: *build_configuration_fetch - run: *running_yarn_build + - store_test_results: + path: test-results.xml + - store_artifacts: + path: test-results.xml + - store_artifacts: + path: cypress/videos + - store_artifacts: + path: cypress/screenshots - persist_to_workspace: *workspace_persist deploy_steps: &deploy_steps diff --git a/.gitignore b/.gitignore index 00cac0197..4ac1f11aa 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ .nyc_output /cypress/screenshots /cypress/videos +test-results.xml # production /build diff --git a/cypress.config.ts b/cypress.config.ts index 64e42e01a..82fbc1a8f 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,7 +1,6 @@ import { defineConfig } from 'cypress' export default defineConfig({ - projectId: "yfm67z", fixturesFolder: false, video: true, screenshotOnRunFailure: true, diff --git a/package.json b/package.json index 5f619c046..657094294 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "eslint:fix": "eslint 'src/**/*.{js,jsx}' --fix", "test": "react-scripts test --watchAll", "test:no-watch": "react-scripts test --watchAll=false --passWithNoTests", - "cy:run": "dotenv -- cypress run --record --key f290b5f1-3586-45a6-ba5f-aa33b68e4868", + "cy:run": "cypress run --reporter junit", "cy:ci": "start-server-and-test 'serve -s build -n -p 3000' http://localhost:3000 'cy:run'", "report:coverage": "nyc report --reporter=html", "report:coverage:text": "nyc report --reporter=text" @@ -94,6 +94,7 @@ "@types/segment-analytics": "^0.0.34", "@types/systemjs": "^6.1.0", "@types/uuid": "^8.3.4", + "@wdio/junit-reporter": "^7.24.0", "autoprefixer": "^9.8.6", "babel-eslint": "^11.0.0-beta.2", "babel-jest": "^24.9.0", @@ -104,7 +105,6 @@ "config": "^3.3.6", "cross-env": "^7.0.2", "cypress": "^10.6.0", - "dotenv-cli": "^6.0.0", "eslint": "^8.18.0", "eslint-config-prettier": "^6.7.0", "eslint-config-react-app": "^7.0.1", diff --git a/yarn.lock b/yarn.lock index 66b5c757f..32d30477e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2057,6 +2057,11 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.28.tgz#15aa0b416f82c268b1573ab653e4413c965fe794" integrity sha512-dgJd3HLOkLmz4Bw50eZx/zJwtBq65nms3N9VBYu5LTjJ883oBFkTyXRlCB/ZGGwqYpJJHA5zW2Ibhl5ngITfow== +"@sindresorhus/is@^4.0.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" + integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== + "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -2196,6 +2201,13 @@ "@svgr/plugin-svgo" "^5.5.0" loader-utils "^2.0.0" +"@szmarczak/http-timer@^4.0.5": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" + integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== + dependencies: + defer-to-connect "^2.0.0" + "@testing-library/dom@^8.0.0": version "8.17.1" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.17.1.tgz#2d7af4ff6dad8d837630fecd08835aee08320ad7" @@ -2311,6 +2323,16 @@ dependencies: "@types/node" "*" +"@types/cacheable-request@^6.0.1": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.2.tgz#c324da0197de0a98a2312156536ae262429ff6b9" + integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "*" + "@types/node" "*" + "@types/responselike" "*" + "@types/connect-history-api-fallback@^1.3.5": version "1.3.5" resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz#d1f7a8a09d0ed5a57aee5ae9c18ab9b803205dae" @@ -2326,6 +2348,11 @@ dependencies: "@types/node" "*" +"@types/diff@^5.0.0": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@types/diff/-/diff-5.0.2.tgz#dd565e0086ccf8bc6522c6ebafd8a3125c91c12b" + integrity sha512-uw8eYMIReOwstQ0QKF0sICefSy8cNO/v7gOTiIy9SbwuHyEecJUm7qlgueOO5S1udZ5I/irVydHVwMchgzbKTg== + "@types/dompurify@^2.3.3": version "2.3.3" resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-2.3.3.tgz#c24c92f698f77ed9cc9d9fa7888f90cf2bfaa23f" @@ -2426,6 +2453,11 @@ resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35" integrity sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg== +"@types/http-cache-semantics@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" + integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== + "@types/http-proxy@^1.17.8": version "1.17.9" resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.9.tgz#7f0e7931343761efde1e2bf48c40f02f3f75705a" @@ -2476,16 +2508,33 @@ jest-matcher-utils "^27.0.0" pretty-format "^27.0.0" +"@types/json-buffer@~3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/json-buffer/-/json-buffer-3.0.0.tgz#85c1ff0f0948fc159810d4b5be35bf8c20875f64" + integrity sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ== + "@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== +"@types/json-stringify-safe@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@types/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz#df34d054419d39323a3730966bacba02ac5e474e" + integrity sha512-UUA1sH0RSRROdInuDOA1yoRzbi5xVFD1RHCoOvNRPTNwR8zBkJ/84PZ6NhKVDtKp0FTeIccJCdQz1X2aJPr4uw== + "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== +"@types/keyv@*": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" + integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== + dependencies: + "@types/node" "*" + "@types/lodash@^4.14.182": version "4.14.184" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.184.tgz#23f96cd2a21a28e106dc24d825d4aa966de7a9fe" @@ -2516,6 +2565,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.26.tgz#239e19f8b4ea1a9eb710528061c1d733dc561996" integrity sha512-0b+utRBSYj8L7XAp0d+DX7lI4cSmowNaaTkk6/1SKzbKkG+doLuPusB9EOvzLJ8ahJSk03bTLIL6cWaEd4dBKA== +"@types/node@^18.0.0": + version "18.7.14" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.14.tgz#0fe081752a3333392d00586d815485a17c2cf3c9" + integrity sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA== + "@types/node@^18.7.13": version "18.7.13" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.13.tgz#23e6c5168333480d454243378b69e861ab5c011a" @@ -2526,6 +2580,11 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== +"@types/object-inspect@^1.8.0": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@types/object-inspect/-/object-inspect-1.8.1.tgz#7c08197ad05cc0e513f529b1f3919cc99f720e1f" + integrity sha512-0JTdf3CGV0oWzE6Wa40Ayv2e2GhpP3pEJMcrlM74vBSJPuuNkVwfDnl0SZxyFCXETcB4oKA/MpTVfuYSMOelBg== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -2644,6 +2703,13 @@ dependencies: "@types/node" "*" +"@types/responselike@*", "@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + "@types/retry@0.12.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" @@ -2706,6 +2772,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== +"@types/supports-color@^8.1.0": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@types/supports-color/-/supports-color-8.1.1.tgz#1b44b1b096479273adf7f93c75fc4ecc40a61ee4" + integrity sha512-dPWnWsf+kzIG140B8z2w3fr5D03TLWbOAFQl45xUpI3vcizeXriNR5VYkWZ+WTMsUHqZ9Xlt3hrxGNANFyNQfw== + "@types/systemjs@^6.1.0": version "6.1.1" resolved "https://registry.yarnpkg.com/@types/systemjs/-/systemjs-6.1.1.tgz#eae17f2a080e867d01a2dd614f524ab227cf5a41" @@ -2723,6 +2794,11 @@ dependencies: "@types/jest" "*" +"@types/tmp@^0.2.0": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.3.tgz#908bfb113419fd6a42273674c00994d40902c165" + integrity sha512-dDZH/tXzwjutnuk4UacGgFRwV+JSLaXL1ikvidfJprkb7L9Nx1njcRHHmi3Dsvt7pgqqTEeucQuOrWHPFgzVHA== + "@types/trusted-types@*", "@types/trusted-types@^2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756" @@ -2745,6 +2821,11 @@ resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw== +"@types/validator@^13.1.3": + version "13.7.6" + resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.7.6.tgz#631f1acd15cbac9cb0a114da7e87575f1c95b46a" + integrity sha512-uBsnWETsUagQ0n6G2wcXNIufpTNJir0zqzG4p62fhnwzs48d/iuOWEEo0d3iUxN7D+9R/8CSvWGKS+KmaD0mWA== + "@types/webpack-sources@*": version "3.2.0" resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-3.2.0.tgz#16d759ba096c289034b26553d2df1bf45248d38b" @@ -2900,6 +2981,52 @@ "@typescript-eslint/types" "5.34.0" eslint-visitor-keys "^3.3.0" +"@wdio/dot-reporter@^7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@wdio/dot-reporter/-/dot-reporter-7.24.0.tgz#4c0fe12537d38067bd015e3c3252356189d2a15a" + integrity sha512-GeeXpudVogN0wrM+1Jp6RhIKEL5/noeQljNDJr7/1Fq0KzpTNrToAzMo5OmPKqIymn+RXqI9L1lBnXWl70HoFA== + dependencies: + "@wdio/reporter" "7.24.0" + "@wdio/types" "7.24.0" + chalk "^4.0.0" + +"@wdio/junit-reporter@^7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@wdio/junit-reporter/-/junit-reporter-7.24.0.tgz#84b5027e10def7b856016d7cf3171db459e02c2d" + integrity sha512-x7R2Au30P9zscGuIlBCMfuO4wttEIGQHKc6EY12I518D46vfUKnq7iS9tqcFi7VtVMbG4irYcaDDAuSMZRyCaw== + dependencies: + "@types/json-stringify-safe" "^5.0.0" + "@types/validator" "^13.1.3" + "@wdio/reporter" "7.24.0" + "@wdio/types" "7.24.0" + json-stringify-safe "^5.0.1" + junit-report-builder "^3.0.0" + validator "^13.0.0" + +"@wdio/reporter@7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@wdio/reporter/-/reporter-7.24.0.tgz#36e26d86d57418472af7466bdaa16dc4535f3d1d" + integrity sha512-iZUQpF3zHmBH+4GWZYqf9/yDxmufSGmfIn0GkZHhiymv+pIN8y8zTNlZ5OH6t0h+ICdeoAOxlBEUBMy4eVRhHQ== + dependencies: + "@types/diff" "^5.0.0" + "@types/node" "^18.0.0" + "@types/object-inspect" "^1.8.0" + "@types/supports-color" "^8.1.0" + "@types/tmp" "^0.2.0" + "@wdio/types" "7.24.0" + diff "^5.0.0" + fs-extra "^10.0.0" + object-inspect "^1.10.3" + supports-color "8.1.1" + +"@wdio/types@7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@wdio/types/-/types-7.24.0.tgz#ded79460f8a2a4892232e2707fb8d0ce3694bfd5" + integrity sha512-wJZ+1lIHFz5aWXSO+k91wX8tfZdpyX4YYoker5xfC4zvM7ypyK81dZyiE5whS+QFL3VTCPP8dXNjwX5f5h+YEw== + dependencies: + "@types/node" "^18.0.0" + got "^11.8.1" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" @@ -4469,6 +4596,24 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cacheable-lookup@^5.0.3: + version "5.0.4" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" + integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== + +cacheable-request@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" + integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^6.0.1" + responselike "^2.0.0" + cachedir@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" @@ -4824,6 +4969,13 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +clone-response@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" + integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== + dependencies: + mimic-response "^1.0.0" + clsx@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" @@ -4966,6 +5118,14 @@ compose-function@3.0.3: dependencies: arity-n "^1.0.4" +compress-brotli@^1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/compress-brotli/-/compress-brotli-1.3.8.tgz#0c0a60c97a989145314ec381e84e26682e7b38db" + integrity sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ== + dependencies: + "@types/json-buffer" "~3.0.0" + json-buffer "~3.0.1" + compressible@~2.0.16: version "2.0.18" resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" @@ -5656,6 +5816,11 @@ date-fns@^2.0.1: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.2.tgz#0d4b3d0f3dff0f920820a070920f0d9662c51931" integrity sha512-0VNbwmWJDS/G3ySwFSJA3ayhbURMTJLtwM2DTxf9CWondCnh6DTNlO9JgRSq6ibf4eD0lfMJNBxUdEAHHix+bA== +date-format@4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.3.tgz#f63de5dc08dc02efd8ef32bf2a6918e486f35873" + integrity sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ== + dayjs@1.10.7: version "1.10.7" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468" @@ -5709,6 +5874,13 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -5768,6 +5940,11 @@ default-require-extensions@^3.0.0: dependencies: strip-bom "^4.0.0" +defer-to-connect@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" @@ -5906,6 +6083,11 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +diff@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" + integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -6071,36 +6253,16 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" -dotenv-cli@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/dotenv-cli/-/dotenv-cli-6.0.0.tgz#8a30cbc59d0a8aaa166b2fee0a9a55e23a1223ab" - integrity sha512-qXlCOi3UMDhCWFKe0yq5sg3X+pJAz+RQDiFN38AMSbUrnY3uZshSfDJUAge951OS7J9gwLZGfsBlWRSOYz/TRg== - dependencies: - cross-spawn "^7.0.3" - dotenv "^16.0.0" - dotenv-expand "^8.0.1" - minimist "^1.2.5" - dotenv-expand@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0" integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA== -dotenv-expand@^8.0.1: - version "8.0.3" - resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-8.0.3.tgz#29016757455bcc748469c83a19b36aaf2b83dd6e" - integrity sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg== - dotenv@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== -dotenv@^16.0.0: - version "16.0.2" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.2.tgz#0b0f8652c016a3858ef795024508cddc4bffc5bf" - integrity sha512-JvpYKUmzQhYoIFgK2MOnF3bciIZoItIIoryihy0rIA+H4Jy0FmgyKYAHCTN98P5ybGSJcIFbh6QKeJdtZd1qhA== - duplexer@^0.1.1, duplexer@^0.1.2, duplexer@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" @@ -7685,6 +7847,23 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" +got@^11.8.1: + version "11.8.5" + resolved "https://registry.yarnpkg.com/got/-/got-11.8.5.tgz#ce77d045136de56e8f024bebb82ea349bc730046" + integrity sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ== + dependencies: + "@sindresorhus/is" "^4.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.2" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.2" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" + graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -8006,6 +8185,11 @@ htmlparser2@^6.1.0: domutils "^2.5.2" entities "^2.0.0" +http-cache-semantics@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + http-deceiver@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" @@ -8094,6 +8278,14 @@ http-signature@~1.3.6: jsprim "^2.0.2" sshpk "^1.14.1" +http2-wrapper@^1.0.0-beta.5.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" + integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" @@ -9876,6 +10068,11 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== +json-buffer@3.0.1, json-buffer@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -9970,6 +10167,24 @@ jsprim@^2.0.2: array-includes "^3.1.5" object.assign "^4.1.3" +junit-report-builder@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/junit-report-builder/-/junit-report-builder-3.0.1.tgz#8501ad56c62b801334d8903860750f699a967150" + integrity sha512-B8AZ2q24iGwPM3j/ZHc9nD0BY1rKhcnWCA1UvT8mhHfR8Vo/HTtg3ojMyo55BgctqQGZG7H8z0+g+mEUc32jgg== + dependencies: + date-format "4.0.3" + lodash "^4.17.21" + make-dir "^3.1.0" + xmlbuilder "^15.1.1" + +keyv@^4.0.0: + version "4.4.1" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.4.1.tgz#5d97bae8dfbb6788ebc9330daf5eb6582e2d3d1c" + integrity sha512-PzByhNxfBLnSBW2MZi1DF+W5+qB/7BMpOokewqIvqS8GFtP7xHm2oeGU72Y1fhtfOv/FiEnI4+nyViYDmUChnw== + dependencies: + compress-brotli "^1.3.8" + json-buffer "3.0.1" + killable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" @@ -10338,6 +10553,11 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -10559,6 +10779,16 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + min-indent@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" @@ -10982,7 +11212,7 @@ object-hash@^3.0.0: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== -object-inspect@^1.12.0, object-inspect@^1.12.2, object-inspect@^1.9.0: +object-inspect@^1.10.3, object-inspect@^1.12.0, object-inspect@^1.12.2, object-inspect@^1.9.0: version "1.12.2" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== @@ -11162,6 +11392,11 @@ ospath@^1.2.2: resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b" integrity sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA== +p-cancelable@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" + integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== + p-each-series@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" @@ -13199,6 +13434,11 @@ resize-observer-polyfill@1.5.0: resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.0.tgz#660ff1d9712a2382baa2cad450a4716209f9ca69" integrity sha512-M2AelyJDVR/oLnToJLtuDJRBBWUGUvvGigj1411hXhAdyFWqMaqHp7TixW3FpiLuVaikIcR1QL+zqoJoZlOgpg== +resolve-alpn@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" + integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== + resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" @@ -13296,6 +13536,13 @@ resolve@^2.0.0-next.3: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +responselike@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" + integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== + dependencies: + lowercase-keys "^2.0.0" + restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -14399,6 +14646,13 @@ stylis@4.0.13: resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.0.13.tgz#f5db332e376d13cc84ecfe5dace9a2a51d954c91" integrity sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag== +supports-color@8.1.1, supports-color@^8.0.0, supports-color@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -14432,13 +14686,6 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^8.0.0, supports-color@^8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - supports-hyperlinks@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" @@ -15292,6 +15539,11 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +validator@^13.0.0: + version "13.7.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857" + integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw== + vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -16018,6 +16270,11 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== +xmlbuilder@^15.1.1: + version "15.1.1" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz#9dcdce49eea66d8d10b42cae94a79c3c8d0c2ec5" + integrity sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg== + xmlchars@^2.1.1, xmlchars@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" From 3e97d80069c79cef376e4bf63e7e181e034166ff Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 2 Sep 2022 11:07:33 +0800 Subject: [PATCH 18/61] success tests --- cypress/e2e/home/home.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index 960cda452..43c584180 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -6,7 +6,7 @@ describe('Landing Page', () => { cy.get('[data-id="root"]').should('be.visible') }) - it('loads landing page should fail', () => { + it.skip('loads landing page should fail', () => { cy.get('[data-id="root"]').should('not.be.visible') }) }) From 37d0a32183dea45ca3a29a54fb7333ab1b27a9c8 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 2 Sep 2022 11:18:53 +0800 Subject: [PATCH 19/61] integrate test report --- .circleci/config.yml | 4 ++-- .gitignore | 2 +- cypress.config.ts | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 79394a923..ccbd83edc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -84,9 +84,9 @@ build_steps: &build_steps - run: *build_configuration_fetch - run: *running_yarn_build - store_test_results: - path: test-results.xml + path: cypress/test-report - store_artifacts: - path: test-results.xml + path: cypress/test-report - store_artifacts: path: cypress/videos - store_artifacts: diff --git a/.gitignore b/.gitignore index 4ac1f11aa..6d23f4087 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ .nyc_output /cypress/screenshots /cypress/videos -test-results.xml +/cypress/test-report # production /build diff --git a/cypress.config.ts b/cypress.config.ts index 82fbc1a8f..b0b0280a4 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -15,5 +15,10 @@ export default defineConfig({ require('@cypress/code-coverage/task')(on, config) return config; }, + }, + reporter: 'junit', + reporterOptions: { + mochaFile: 'cypress/test-report/test-result-[hash].xml', + toConsole: false } }) From 0840b7c3cdb0156990b00d3425fbb0e5ffcd581e Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 2 Sep 2022 11:28:26 +0800 Subject: [PATCH 20/61] test with failure case --- cypress/e2e/home/home.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index 43c584180..960cda452 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -6,7 +6,7 @@ describe('Landing Page', () => { cy.get('[data-id="root"]').should('be.visible') }) - it.skip('loads landing page should fail', () => { + it('loads landing page should fail', () => { cy.get('[data-id="root"]').should('not.be.visible') }) }) From 7aff7c10912fb41081e350123a0860f8b21474c3 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 2 Sep 2022 19:29:13 +0800 Subject: [PATCH 21/61] skip failed e2e test cases --- cypress/e2e/home/home.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index 960cda452..43c584180 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -6,7 +6,7 @@ describe('Landing Page', () => { cy.get('[data-id="root"]').should('be.visible') }) - it('loads landing page should fail', () => { + it.skip('loads landing page should fail', () => { cy.get('[data-id="root"]').should('not.be.visible') }) }) From e4f43054d450c3cd1b9859520e6c6d87052225b1 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 2 Sep 2022 19:30:55 +0800 Subject: [PATCH 22/61] finalize yarn.lock file --- yarn.lock | 9 --------- 1 file changed, 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index 32d30477e..161261927 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2981,15 +2981,6 @@ "@typescript-eslint/types" "5.34.0" eslint-visitor-keys "^3.3.0" -"@wdio/dot-reporter@^7.24.0": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@wdio/dot-reporter/-/dot-reporter-7.24.0.tgz#4c0fe12537d38067bd015e3c3252356189d2a15a" - integrity sha512-GeeXpudVogN0wrM+1Jp6RhIKEL5/noeQljNDJr7/1Fq0KzpTNrToAzMo5OmPKqIymn+RXqI9L1lBnXWl70HoFA== - dependencies: - "@wdio/reporter" "7.24.0" - "@wdio/types" "7.24.0" - chalk "^4.0.0" - "@wdio/junit-reporter@^7.24.0": version "7.24.0" resolved "https://registry.yarnpkg.com/@wdio/junit-reporter/-/junit-reporter-7.24.0.tgz#84b5027e10def7b856016d7cf3171db459e02c2d" From a1abe2f47f1a7784c54e5970be5ce99639ef0c5e Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Sep 2022 10:40:57 +0800 Subject: [PATCH 23/61] try workflow --- .github/workflows/config.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/config.yml diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml new file mode 100644 index 000000000..03f8261bf --- /dev/null +++ b/.github/workflows/config.yml @@ -0,0 +1,24 @@ +name: Node CI + +on: [push] + +jobs: + build_and_test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: 16.14.0 + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: | + apt update + apt install jq python3-pip libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y + pip3 install awscli --upgrade + yarn install + yarn cypress install + yarn build + yarn cy:ci From d7eb09e47bf18d69cabfb1058e89ca7a45515c6b Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Sep 2022 10:42:29 +0800 Subject: [PATCH 24/61] correct action --- .github/workflows/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 03f8261bf..4660cf9ea 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: 16.14.0 + node-version: [16.14.0] steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} From 844928f6f65496213ca1fa723e7fac1d54bf54e3 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Sep 2022 10:43:33 +0800 Subject: [PATCH 25/61] add sudo in lib installation --- .github/workflows/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 4660cf9ea..304517a45 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -15,9 +15,9 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: | - apt update - apt install jq python3-pip libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y - pip3 install awscli --upgrade + sudo apt update + sudo apt install jq python3-pip libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y + sudo pip3 install awscli --upgrade yarn install yarn cypress install yarn build From c5efbb5b9c6d5e7a21e1ce5fb3fe91d2af89fec8 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Sep 2022 10:48:18 +0800 Subject: [PATCH 26/61] store testing result --- .github/workflows/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 304517a45..fceb805b2 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -22,3 +22,11 @@ jobs: yarn cypress install yarn build yarn cy:ci + - name: Storing test artifcats + uses: actions/upload-artifcat@v3 + with: + name: store-testing-result + path: | + cypress/test-report + cypress/videos + cypress/screenshots From 648375b4c87257cc4e4fb800e7e3397bec099b18 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Sep 2022 10:51:07 +0800 Subject: [PATCH 27/61] correct command --- .github/workflows/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index fceb805b2..0752a9eab 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -22,8 +22,8 @@ jobs: yarn cypress install yarn build yarn cy:ci - - name: Storing test artifcats - uses: actions/upload-artifcat@v3 + - name: Storing test artifacts + uses: actions/upload-artifact@v3 with: name: store-testing-result path: | From a77f304d3f54cf655ca19adc697b44ee8060cd76 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Sep 2022 12:02:47 +0800 Subject: [PATCH 28/61] check failed test case --- cypress/e2e/home/home.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index 43c584180..960cda452 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -6,7 +6,7 @@ describe('Landing Page', () => { cy.get('[data-id="root"]').should('be.visible') }) - it.skip('loads landing page should fail', () => { + it('loads landing page should fail', () => { cy.get('[data-id="root"]').should('not.be.visible') }) }) From 893415437e35d8cd504cd8bc32266b07d2a0ef7c Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Sep 2022 12:09:53 +0800 Subject: [PATCH 29/61] continue on error --- .github/workflows/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 0752a9eab..f57c663af 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -24,6 +24,7 @@ jobs: yarn cy:ci - name: Storing test artifacts uses: actions/upload-artifact@v3 + continue-on-error: true with: name: store-testing-result path: | From 629c9338c485ee91548d55901325895095fe5573 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Sep 2022 12:18:35 +0800 Subject: [PATCH 30/61] enable cache operation --- .github/workflows/config.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index f57c663af..e5134ffae 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -18,13 +18,29 @@ jobs: sudo apt update sudo apt install jq python3-pip libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y sudo pip3 install awscli --upgrade + - name: Cache data + id: cache-data + uses: actions/cache@v2 + with: + path: | + node_modules + ~/.cache/Cypress + key: ${{ runner.os }}-build-${{ hashFiles('**/yarn-lock.json') }} + restore-keys: | + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Install Dependencies + if: steps.cache-data.outputs.cache-hit != 'true' + run: | yarn install - yarn cypress install + yarn cypress + - name: Build the codebase and Run E2E Tests + continue-on-error: true + run: | yarn build yarn cy:ci - name: Storing test artifacts uses: actions/upload-artifact@v3 - continue-on-error: true with: name: store-testing-result path: | From f757bf27be6f9dd151d1c5c39dfc766cd261d1f8 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Sep 2022 12:21:25 +0800 Subject: [PATCH 31/61] yarn cache id update --- .github/workflows/config.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index e5134ffae..31c58dd78 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -19,18 +19,17 @@ jobs: sudo apt install jq python3-pip libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y sudo pip3 install awscli --upgrade - name: Cache data - id: cache-data + id: yarn-cache uses: actions/cache@v2 with: path: | node_modules ~/.cache/Cypress - key: ${{ runner.os }}-build-${{ hashFiles('**/yarn-lock.json') }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ runner.os }}-yarn- - name: Install Dependencies - if: steps.cache-data.outputs.cache-hit != 'true' + if: steps.yarn-cache.outputs.cache-hit != 'true' run: | yarn install yarn cypress From 550330f4da07a6aa7515937557f5a69b72fc624c Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Wed, 7 Sep 2022 18:25:37 +0300 Subject: [PATCH 32/61] TCA-400 - update behavior for fcc sidebar (course outline navigation) --- .../CertificateBgPattern.module.scss | 4 +- .../free-code-camp/FreeCodeCamp.module.scss | 29 ----------- .../learn/free-code-camp/FreeCodeCamp.tsx | 28 ++++------- .../fcc-sidebar/FccSidebar.module.scss | 31 ++++++++++++ .../free-code-camp/fcc-sidebar/FccSidebar.tsx | 48 +++++++++++++++++++ .../learn/free-code-camp/fcc-sidebar/index.ts | 1 + .../collapsible-pane/CollapsiblePane.tsx | 38 ++++++++++++++- .../course-outline/CourseOutline.tsx | 2 + .../collapsible-item/CollapsibleItem.tsx | 2 + 9 files changed, 130 insertions(+), 53 deletions(-) create mode 100644 src-ts/tools/learn/free-code-camp/fcc-sidebar/FccSidebar.module.scss create mode 100644 src-ts/tools/learn/free-code-camp/fcc-sidebar/FccSidebar.tsx create mode 100644 src-ts/tools/learn/free-code-camp/fcc-sidebar/index.ts diff --git a/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.module.scss b/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.module.scss index 2075827eb..78fdf28b0 100644 --- a/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.module.scss +++ b/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.module.scss @@ -31,7 +31,7 @@ > div { position: absolute; top: 0; - left: 0; + left: -1px; width: 100%; height: 100%; z-index: 1; @@ -42,7 +42,7 @@ } &:global(.wave-bg) { - background: url('./wave-bg.png') -1px 0 repeat-y; + background: url('./wave-bg.png') 0 0 repeat-y; background-size: 400px 116px; } } diff --git a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.module.scss b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.module.scss index abf59cf76..4be0344b3 100644 --- a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.module.scss +++ b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.module.scss @@ -48,32 +48,3 @@ } } } - -.course-outline-pane { - position: absolute; - left: 0; - top: 0; - bottom: 0; - - @include ltemd { - position: relative; - top: auto; - left: auto; - bottom: auto; - flex: 0 0 auto; - } -} - -.course-outline-wrap { - width: 406px; - - @include ltemd { - width: 100%; - } -} - -.course-outline-title { - @extend .body-main-bold; - flex: 0 0 auto; - margin-bottom: $space-xl; -} \ No newline at end of file diff --git a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx index 7552abd1f..9f123afc7 100644 --- a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx +++ b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx @@ -19,8 +19,6 @@ import { ProfileContextData, } from '../../../lib' import { - CollapsiblePane, - CourseOutline, CoursesProviderData, LearnLesson, LearnModule, @@ -39,6 +37,7 @@ import { import { getCertificationCompletedPath, getCoursePath, getLessonPathFromModule } from '../learn.routes' import { FccFrame } from './fcc-frame' +import { FccSidebar } from './fcc-sidebar' import styles from './FreeCodeCamp.module.scss' import { TitleNav } from './title-nav' @@ -362,24 +361,13 @@ const FreeCodeCamp: FC<{}> = () => { {lesson && (
-
- isOpen && refetchProgress()} - > -
-
- {courseData?.title} -
- -
-
-
+
void +} + +const FccSidebar: FC = (props: FccSidebarProps) => { + const [isOpen, setIsOpen] = useState(false); + + const handleToggle = (isOutlineOpen: boolean) => { + setIsOpen(isOutlineOpen) + if (isOutlineOpen) { + props.refetchProgress() + } + } + + return ( +
+ +
+
+ {props.courseData?.title} +
+ setIsOpen(false)} + /> +
+
+
+ ) +} + +export default FccSidebar diff --git a/src-ts/tools/learn/free-code-camp/fcc-sidebar/index.ts b/src-ts/tools/learn/free-code-camp/fcc-sidebar/index.ts new file mode 100644 index 000000000..5f95796fc --- /dev/null +++ b/src-ts/tools/learn/free-code-camp/fcc-sidebar/index.ts @@ -0,0 +1 @@ +export { default as FccSidebar } from './FccSidebar' diff --git a/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx b/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx index e73399a51..ad7fe658c 100644 --- a/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx +++ b/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx @@ -1,6 +1,16 @@ +import { + Dispatch, + FC, + ReactNode, + SetStateAction, + MutableRefObject, + useCallback, + useEffect, + useState, + useRef, +} from 'react' import classNames from 'classnames' import { noop } from 'lodash' -import { Dispatch, FC, ReactNode, SetStateAction, useCallback, useState } from 'react' import { IconSolid } from '../../../../lib' @@ -11,19 +21,43 @@ interface CollapsiblePaneProps { onToggle?: (isOpen: boolean) => void position?: 'to-left'|'to-right' title: string + isOpen?: boolean } const CollapsiblePane: FC = (props: CollapsiblePaneProps) => { const {onToggle = noop}: CollapsiblePaneProps = props const [isOpen, setIsOpen]: [boolean, Dispatch>] = useState(false) + const elRef: MutableRefObject = useRef() + const toggle: () => void = useCallback(() => { setIsOpen(!isOpen) onToggle(!isOpen) }, [isOpen, onToggle]) + const close = useCallback(() => { + setIsOpen(false) + onToggle(false) + }, [onToggle]) + + useEffect(() => { + setIsOpen(!!props.isOpen) + }, [props.isOpen]) + + useEffect(() => { + const handleClickOutside = (ev: MouseEvent) => { + if (elRef.current && !elRef.current.contains(ev.target)) { + close() + } + } + if (isOpen) { + document.addEventListener('click', handleClickOutside) + } + return () => document.removeEventListener('click', handleClickOutside) + }, [close]) + return ( -
void } const CourseOutline: FC = (props: CourseOutlineProps) => { @@ -52,6 +53,7 @@ const CourseOutline: FC = (props: CourseOutlineProps) => { progress={props.progress?.modules} shortDescription={module.meta.introCopy} title={module.meta.name} + onItemClick={props.onItemNavigate} /> ))}
diff --git a/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx b/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx index 2d91608c2..82904367d 100644 --- a/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx +++ b/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx @@ -25,6 +25,7 @@ interface CollapsibleItemProps { progress?: LearnUserCertificationProgress['modules'] shortDescription: Array title: string + onItemClick: (item: any) => void } const CollapsibleItem: FC = (props: CollapsibleItemProps) => { @@ -72,6 +73,7 @@ const CollapsibleItem: FC = (props: CollapsibleItemProps)
  • props.onItemClick(item)} > {props.path ? ( From 97d9287bbe7cac9318ac0f6083b0df9c0d6e4711 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Wed, 7 Sep 2022 18:47:02 +0300 Subject: [PATCH 33/61] lint --- .../free-code-camp/fcc-sidebar/FccSidebar.tsx | 7 ++++--- .../collapsible-pane/CollapsiblePane.tsx | 16 ++++++++-------- .../learn-lib/course-outline/CourseOutline.tsx | 2 +- .../collapsible-item/CollapsibleItem.tsx | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src-ts/tools/learn/free-code-camp/fcc-sidebar/FccSidebar.tsx b/src-ts/tools/learn/free-code-camp/fcc-sidebar/FccSidebar.tsx index 6d53097b4..c298575f2 100644 --- a/src-ts/tools/learn/free-code-camp/fcc-sidebar/FccSidebar.tsx +++ b/src-ts/tools/learn/free-code-camp/fcc-sidebar/FccSidebar.tsx @@ -1,4 +1,5 @@ import { FC, useState } from 'react' + import { CollapsiblePane, CourseOutline, LearnCourse, LearnUserCertificationProgress } from '../../learn-lib' import styles from './FccSidebar.module.scss' @@ -12,15 +13,15 @@ interface FccSidebarProps { } const FccSidebar: FC = (props: FccSidebarProps) => { - const [isOpen, setIsOpen] = useState(false); + const [isOpen, setIsOpen]: [boolean, Dispatch>] = useState(false) - const handleToggle = (isOutlineOpen: boolean) => { + const handleToggle: (isOutlineOpen: boolean) => void = (isOutlineOpen: boolean) => { setIsOpen(isOutlineOpen) if (isOutlineOpen) { props.refetchProgress() } } - + return (
    void position?: 'to-left'|'to-right' title: string - isOpen?: boolean } const CollapsiblePane: FC = (props: CollapsiblePaneProps) => { @@ -35,7 +35,7 @@ const CollapsiblePane: FC = (props: CollapsiblePaneProps) onToggle(!isOpen) }, [isOpen, onToggle]) - const close = useCallback(() => { + const close: () => void = useCallback(() => { setIsOpen(false) onToggle(false) }, [onToggle]) @@ -45,7 +45,7 @@ const CollapsiblePane: FC = (props: CollapsiblePaneProps) }, [props.isOpen]) useEffect(() => { - const handleClickOutside = (ev: MouseEvent) => { + const handleClickOutside: (ev: MouseEvent) => void = (ev: MouseEvent) => { if (elRef.current && !elRef.current.contains(ev.target)) { close() } @@ -54,7 +54,7 @@ const CollapsiblePane: FC = (props: CollapsiblePaneProps) document.addEventListener('click', handleClickOutside) } return () => document.removeEventListener('click', handleClickOutside) - }, [close]) + }, [close, isOpen]) return (
    void progress?: LearnUserCertificationProgress ready?: boolean - onItemNavigate: (item: LearnLesson) => void } const CourseOutline: FC = (props: CourseOutlineProps) => { diff --git a/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx b/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx index 82904367d..cac0bd7fc 100644 --- a/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx +++ b/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx @@ -21,11 +21,11 @@ interface CollapsibleItemProps { items: Array lessonsCount: number moduleKey: string + onItemClick: (item: any) => void path?: (item: any) => string progress?: LearnUserCertificationProgress['modules'] shortDescription: Array title: string - onItemClick: (item: any) => void } const CollapsibleItem: FC = (props: CollapsibleItemProps) => { From 5cf3d8f68627b6e972f8c5aac175521c93ecece8 Mon Sep 17 00:00:00 2001 From: Brooke Date: Wed, 7 Sep 2022 11:47:19 -0700 Subject: [PATCH 34/61] TCA-404 #comment This commit tweaks for formatting of the cypress config file for linting. It also adds cypress types and a declaration for proper linting. #time 30m --- cypress.config.ts | 41 ++++++++++++++++-------------- package.json | 7 ++--- src-ts/declarations.d.ts | 2 ++ yarn.lock | 55 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 22 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index b0b0280a4..9c399bd54 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,24 +1,27 @@ +// tslint:disable-next-line: no-submodule-imports This is the way cypress does it +import task from '@cypress/code-coverage/task' import { defineConfig } from 'cypress' export default defineConfig({ - fixturesFolder: false, - video: true, - screenshotOnRunFailure: true, - defaultCommandTimeout: 10000, - e2e: { - baseUrl: 'http://localhost:3000', - specPattern: "cypress/e2e/**/*.spec.{js,jsx,ts,tsx}", - supportFile: "cypress/support/e2e.ts", - viewportHeight: 1000, - viewportWidth: 1280, - setupNodeEvents(on, config) { - require('@cypress/code-coverage/task')(on, config) - return config; + defaultCommandTimeout: 10000, + e2e: { + // baseUrl: 'https://local.topcoder-dev.com', + baseUrl: 'http://localhost:3000', + setupNodeEvents(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions): Cypress.PluginConfigOptions { + task(on, config) + return config + }, + specPattern: 'cypress/e2e/**/*.spec.{js,jsx,ts,tsx}', + supportFile: 'cypress/support/e2e.ts', + viewportHeight: 1000, + viewportWidth: 1280, }, - }, - reporter: 'junit', - reporterOptions: { - mochaFile: 'cypress/test-report/test-result-[hash].xml', - toConsole: false - } + fixturesFolder: false, + reporter: 'junit', + reporterOptions: { + mochaFile: 'cypress/test-report/test-result-[hash].xml', + toConsole: false, + }, + screenshotOnRunFailure: true, + video: true, }) diff --git a/package.json b/package.json index 657094294..d17a1b4b5 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,6 @@ "dependencies": { "@datadog/browser-logs": "^4.7.1", "@heroicons/react": "^1.0.6", - "@types/dompurify": "^2.3.3", - "@types/highlightjs": "^9.12.2", - "@types/marked": "4.0.3", "apexcharts": "^3.35.3", "axios": "^0.26.1", "browser-cookies": "^1.2.0", @@ -82,8 +79,12 @@ "@testing-library/react": "^12.0.0", "@testing-library/user-event": "^13.2.1", "@types/axios": "^0.14.0", + "@types/cypress": "^1.1.3", + "@types/dompurify": "^2.3.3", + "@types/highlightjs": "^9.12.2", "@types/jest": "^27.0.1", "@types/lodash": "^4.14.182", + "@types/marked": "4.0.3", "@types/node": "^18.7.13", "@types/reach__router": "^1.3.10", "@types/react": "^18.0.5", diff --git a/src-ts/declarations.d.ts b/src-ts/declarations.d.ts index bd7a8df0c..84ecabc9c 100644 --- a/src-ts/declarations.d.ts +++ b/src-ts/declarations.d.ts @@ -1,3 +1,5 @@ +declare module '@cypress/code-coverage/task' + declare module '*.html' { const htmlFile: string export = htmlFile diff --git a/yarn.lock b/yarn.lock index 161261927..7f848882a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2348,6 +2348,13 @@ dependencies: "@types/node" "*" +"@types/cypress@^1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@types/cypress/-/cypress-1.1.3.tgz#0a700c040d53e9e12b5af98e41d4a88c39f39b6a" + integrity sha512-OXe0Gw8LeCflkG1oPgFpyrYWJmEKqYncBsD/J0r17r0ETx/TnIGDNLwXt/pFYSYuYTpzcq1q3g62M9DrfsBL4g== + dependencies: + cypress "*" + "@types/diff@^5.0.0": version "5.0.2" resolved "https://registry.yarnpkg.com/@types/diff/-/diff-5.0.2.tgz#dd565e0086ccf8bc6522c6ebafd8a3125c91c12b" @@ -5716,6 +5723,54 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A== +cypress@*: + version "10.7.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.7.0.tgz#2d37f8b9751c6de33ee48639cb7e67a2ce593231" + integrity sha512-gTFvjrUoBnqPPOu9Vl5SBHuFlzx/Wxg/ZXIz2H4lzoOLFelKeF7mbwYUOzgzgF0oieU2WhJAestQdkgwJMMTvQ== + dependencies: + "@cypress/request" "^2.88.10" + "@cypress/xvfb" "^1.2.4" + "@types/node" "^14.14.31" + "@types/sinonjs__fake-timers" "8.1.1" + "@types/sizzle" "^2.3.2" + arch "^2.2.0" + blob-util "^2.0.2" + bluebird "^3.7.2" + buffer "^5.6.0" + cachedir "^2.3.0" + chalk "^4.1.0" + check-more-types "^2.24.0" + cli-cursor "^3.1.0" + cli-table3 "~0.6.1" + commander "^5.1.0" + common-tags "^1.8.0" + dayjs "^1.10.4" + debug "^4.3.2" + enquirer "^2.3.6" + eventemitter2 "^6.4.3" + execa "4.1.0" + executable "^4.1.1" + extract-zip "2.0.1" + figures "^3.2.0" + fs-extra "^9.1.0" + getos "^3.2.1" + is-ci "^3.0.0" + is-installed-globally "~0.4.0" + lazy-ass "^1.6.0" + listr2 "^3.8.3" + lodash "^4.17.21" + log-symbols "^4.0.0" + minimist "^1.2.6" + ospath "^1.2.2" + pretty-bytes "^5.6.0" + proxy-from-env "1.0.0" + request-progress "^3.0.0" + semver "^7.3.2" + supports-color "^8.1.1" + tmp "~0.2.1" + untildify "^4.0.0" + yauzl "^2.10.0" + cypress@^10.6.0: version "10.6.0" resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.6.0.tgz#13f46867febf2c3715874ed5dce9c2e946b175fe" From 11fb137c871a83f56f5e6f5fe5544dc9a2e64727 Mon Sep 17 00:00:00 2001 From: Brooke Date: Wed, 7 Sep 2022 11:58:37 -0700 Subject: [PATCH 35/61] TCA-404 #comment This commit does a little bit more clean-up #time 10m --- cypress.config.ts | 17 +++++++++++------ .../authentication.functions.test.ts | 6 ------ .../user-functions/user.functions.test.ts | 8 -------- 3 files changed, 11 insertions(+), 20 deletions(-) delete mode 100644 src-ts/lib/functions/authentication-functions/authentication.functions.test.ts delete mode 100644 src-ts/lib/functions/user-functions/user.functions.test.ts diff --git a/cypress.config.ts b/cypress.config.ts index 9c399bd54..7a33104af 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -5,12 +5,9 @@ import { defineConfig } from 'cypress' export default defineConfig({ defaultCommandTimeout: 10000, e2e: { - // baseUrl: 'https://local.topcoder-dev.com', - baseUrl: 'http://localhost:3000', - setupNodeEvents(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions): Cypress.PluginConfigOptions { - task(on, config) - return config - }, + baseUrl: 'https://local.topcoder-dev.com', + // baseUrl: 'http://localhost:3000', + setupNodeEvents: setUpNodeEvents, specPattern: 'cypress/e2e/**/*.spec.{js,jsx,ts,tsx}', supportFile: 'cypress/support/e2e.ts', viewportHeight: 1000, @@ -25,3 +22,11 @@ export default defineConfig({ screenshotOnRunFailure: true, video: true, }) + +function setUpNodeEvents( + on: Cypress.PluginEvents, + config: Cypress.PluginConfigOptions +): Cypress.PluginConfigOptions { + task(on, config) + return config +} diff --git a/src-ts/lib/functions/authentication-functions/authentication.functions.test.ts b/src-ts/lib/functions/authentication-functions/authentication.functions.test.ts deleted file mode 100644 index 8d3b4e806..000000000 --- a/src-ts/lib/functions/authentication-functions/authentication.functions.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import '@testing-library/jest-dom' - -describe('Authentication Functions', () => { - - test('authentication', () => { }) -}) diff --git a/src-ts/lib/functions/user-functions/user.functions.test.ts b/src-ts/lib/functions/user-functions/user.functions.test.ts deleted file mode 100644 index c77886f77..000000000 --- a/src-ts/lib/functions/user-functions/user.functions.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import '@testing-library/jest-dom' - -describe('Profile Functions', () => { - - test('TODO', () => { - - }) -}) From f95d26fcffeed6c8eb7fb2067b354a323f685d5a Mon Sep 17 00:00:00 2001 From: Brooke Date: Wed, 7 Sep 2022 12:21:20 -0700 Subject: [PATCH 36/61] TCA-404 #comment This comment removes extraneous code that was in the v6 branch but which we don't want to merge to dev #time 10m --- .github/workflows/config.yml | 48 ----------------------------------- cypress/e2e/home/home.spec.ts | 2 +- 2 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 .github/workflows/config.yml diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml deleted file mode 100644 index 31c58dd78..000000000 --- a/.github/workflows/config.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Node CI - -on: [push] - -jobs: - build_and_test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.14.0] - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - run: | - sudo apt update - sudo apt install jq python3-pip libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y - sudo pip3 install awscli --upgrade - - name: Cache data - id: yarn-cache - uses: actions/cache@v2 - with: - path: | - node_modules - ~/.cache/Cypress - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install Dependencies - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: | - yarn install - yarn cypress - - name: Build the codebase and Run E2E Tests - continue-on-error: true - run: | - yarn build - yarn cy:ci - - name: Storing test artifacts - uses: actions/upload-artifact@v3 - with: - name: store-testing-result - path: | - cypress/test-report - cypress/videos - cypress/screenshots diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index 960cda452..43c584180 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -6,7 +6,7 @@ describe('Landing Page', () => { cy.get('[data-id="root"]').should('be.visible') }) - it('loads landing page should fail', () => { + it.skip('loads landing page should fail', () => { cy.get('[data-id="root"]').should('not.be.visible') }) }) From 33952f5f146981c9b18936845f50f591d704570b Mon Sep 17 00:00:00 2001 From: Brooke Date: Wed, 7 Sep 2022 12:35:26 -0700 Subject: [PATCH 37/61] TCA-404 #comment This commit fixes the base url in source control #time 5m --- src-ts/tools/learn/learn-config/learn.bsouza.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ts/tools/learn/learn-config/learn.bsouza.config.ts b/src-ts/tools/learn/learn-config/learn.bsouza.config.ts index ab591ccaa..a337ba971 100644 --- a/src-ts/tools/learn/learn-config/learn.bsouza.config.ts +++ b/src-ts/tools/learn/learn-config/learn.bsouza.config.ts @@ -4,6 +4,6 @@ import { LearnConfigDev } from './learn.dev.config' export const LearnConfigBsouza: LearnConfigModel = { ...LearnConfigDev, - // API: LearnConfigDefault.API, + API: LearnConfigDefault.API, CLIENT: LearnConfigDefault.CLIENT, } From b835cfe15ec8cedf0b643c129ad232afaa111f06 Mon Sep 17 00:00:00 2001 From: Brooke Date: Wed, 7 Sep 2022 12:35:45 -0700 Subject: [PATCH 38/61] TCA-404 fix base url --- cypress.config.ts | 4 ++-- src-ts/tools/learn/learn-config/learn.bsouza.config.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index 7a33104af..97651723a 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -5,8 +5,8 @@ import { defineConfig } from 'cypress' export default defineConfig({ defaultCommandTimeout: 10000, e2e: { - baseUrl: 'https://local.topcoder-dev.com', - // baseUrl: 'http://localhost:3000', + // baseUrl: 'https://local.topcoder-dev.com', + baseUrl: 'http://localhost:3000', setupNodeEvents: setUpNodeEvents, specPattern: 'cypress/e2e/**/*.spec.{js,jsx,ts,tsx}', supportFile: 'cypress/support/e2e.ts', diff --git a/src-ts/tools/learn/learn-config/learn.bsouza.config.ts b/src-ts/tools/learn/learn-config/learn.bsouza.config.ts index a337ba971..58b0b8dd1 100644 --- a/src-ts/tools/learn/learn-config/learn.bsouza.config.ts +++ b/src-ts/tools/learn/learn-config/learn.bsouza.config.ts @@ -4,6 +4,6 @@ import { LearnConfigDev } from './learn.dev.config' export const LearnConfigBsouza: LearnConfigModel = { ...LearnConfigDev, - API: LearnConfigDefault.API, - CLIENT: LearnConfigDefault.CLIENT, + // API: LearnConfigDefault.API, + // CLIENT: LearnConfigDefault.CLIENT, } From ea43c8a4bdb1fe28844b13dad55823f8ca084639 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Wed, 7 Sep 2022 22:55:54 +0300 Subject: [PATCH 39/61] TCA-400 - use the clickoutside hook --- .../learn-lib/collapsible-pane/CollapsiblePane.tsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx b/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx index 44788aa3b..dadf18d74 100644 --- a/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx +++ b/src-ts/tools/learn/learn-lib/collapsible-pane/CollapsiblePane.tsx @@ -12,7 +12,7 @@ import { useState, } from 'react' -import { IconSolid } from '../../../../lib' +import { IconSolid, useClickOutside } from '../../../../lib' import styles from './CollapsiblePane.module.scss' @@ -44,17 +44,7 @@ const CollapsiblePane: FC = (props: CollapsiblePaneProps) setIsOpen(!!props.isOpen) }, [props.isOpen]) - useEffect(() => { - const handleClickOutside: (ev: MouseEvent) => void = (ev: MouseEvent) => { - if (elRef.current && !elRef.current.contains(ev.target)) { - close() - } - } - if (isOpen) { - document.addEventListener('click', handleClickOutside) - } - return () => document.removeEventListener('click', handleClickOutside) - }, [close, isOpen]) + useClickOutside(elRef.current, close, isOpen) return (
    Date: Wed, 7 Sep 2022 14:36:36 -0700 Subject: [PATCH 40/61] TCA-336 #comment This commit forces a dev deployment to see if it's a permissions issue #time 10m --- cypress.config.ts | 1 + src-ts/tools/learn/learn-config/learn.bsouza.config.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress.config.ts b/cypress.config.ts index 97651723a..fc55f43d8 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -23,6 +23,7 @@ export default defineConfig({ video: true, }) +// adds the config to node setup events function setUpNodeEvents( on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions diff --git a/src-ts/tools/learn/learn-config/learn.bsouza.config.ts b/src-ts/tools/learn/learn-config/learn.bsouza.config.ts index 58b0b8dd1..ab591ccaa 100644 --- a/src-ts/tools/learn/learn-config/learn.bsouza.config.ts +++ b/src-ts/tools/learn/learn-config/learn.bsouza.config.ts @@ -5,5 +5,5 @@ import { LearnConfigDev } from './learn.dev.config' export const LearnConfigBsouza: LearnConfigModel = { ...LearnConfigDev, // API: LearnConfigDefault.API, - // CLIENT: LearnConfigDefault.CLIENT, + CLIENT: LearnConfigDefault.CLIENT, } From 1e2fdcc4ecc3778ad2fcd534716c7a2a694bd82e Mon Sep 17 00:00:00 2001 From: Brooke Date: Thu, 8 Sep 2022 09:13:24 -0700 Subject: [PATCH 41/61] TCA-400 #comment This commit temporarily skips the cypress test bc the test needs to be debugged #time 5m --- cypress/e2e/home/home.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index 43c584180..a1b877a9b 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -2,7 +2,8 @@ describe('Landing Page', () => { beforeEach(() => cy.visit('/')) - it('loads landing page should be successfully', () => { + // TCA-336 temporarily skip this bc the site isn't loading + it.skip('loads landing page should be successfully', () => { cy.get('[data-id="root"]').should('be.visible') }) From 9823c1a61473bd5eb19ea55beb76b797181bc2f3 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 10:39:21 +0800 Subject: [PATCH 42/61] refine e2e --- .circleci/config.yml | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ccbd83edc..cbab2e9be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,13 +8,16 @@ deploy_defaults: &deploy_defaults docker: - image: cimg/python:3.10.2 +test_defaults: &test_defaults + docker: + - image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge + install_build_dependency: &install_build_dependency name: Installation of build and deployment dependencies. command: | apt update apt install jq -y apt install python3-pip -y - apt install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y pip3 install awscli --upgrade install_dependency: &install_dependency @@ -37,7 +40,6 @@ save_cache_settings: &save_cache_settings key: connect-node-modules-{{ checksum "yarn.lock" }} paths: - node_modules - - /root/.cache/Cypress running_yarn_tslint: &running_yarn_tslint name: Running Yarn tslint @@ -47,6 +49,13 @@ running_yarn_tslint: &running_yarn_tslint running_yarn_build: &running_yarn_build name: Running Yarn Build + command: | + source buildenvvar + yarn install + yarn build + +running_yarn_test: &running_yarn_test + name: Running Yarn Test Build command: | source buildenvvar yarn install @@ -83,6 +92,20 @@ build_steps: &build_steps - run: *install_deploysuite - run: *build_configuration_fetch - run: *running_yarn_build + - persist_to_workspace: *workspace_persist + +test_steps: &test_steps + # Initialization. + - checkout + - setup_remote_docker + - restore_cache: + key: test-node-modules-{{ checksum "yarn.lock" }} + - save_cache: + key: test-node-modules-{{ checksum "yarn.lock" }} + paths: + - node_modules + - /root/.cache/Cypress + - run: *running_yarn_test - store_test_results: path: cypress/test-report - store_artifacts: @@ -91,7 +114,6 @@ build_steps: &build_steps path: cypress/videos - store_artifacts: path: cypress/screenshots - - persist_to_workspace: *workspace_persist deploy_steps: &deploy_steps - checkout @@ -139,6 +161,14 @@ jobs: LOGICAL_ENV: "prod" APPNAME: "platform-ui-mvp" steps: *build_steps + + test-dev: + <<: *test_defaults + environment: + DEPLOY_ENV: "DEV" + LOGICAL_ENV: "dev" + APPNAME: "platform-ui-mvp" + steps: *test_steps # Just tests commited code. deployDev: @@ -208,3 +238,9 @@ workflows: branches: only: - master + + - test-dev: + filters: + branches: + ignore: + - develop \ No newline at end of file From d77db70c7d2d90820b65cbf5e6b1f5a0848f3303 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 11:03:13 +0800 Subject: [PATCH 43/61] include env var --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cbab2e9be..7eef21350 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,8 @@ test_steps: &test_steps paths: - node_modules - /root/.cache/Cypress + - run: *install_deploysuite + - run: *build_configuration_fetch - run: *running_yarn_test - store_test_results: path: cypress/test-report From db39b001de72af7e8ebe6cb60fc971ea5c486b0c Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 11:05:33 +0800 Subject: [PATCH 44/61] env prepare --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7eef21350..0c3b92bfd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,7 @@ test_steps: &test_steps paths: - node_modules - /root/.cache/Cypress + - run: *install_build_dependency - run: *install_deploysuite - run: *build_configuration_fetch - run: *running_yarn_test From 2175923bb47a51e89aabd7d8a66ff6ffea6b5574 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 11:09:41 +0800 Subject: [PATCH 45/61] remove test env --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c3b92bfd..1d4499df3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,6 @@ running_yarn_build: &running_yarn_build running_yarn_test: &running_yarn_test name: Running Yarn Test Build command: | - source buildenvvar yarn install yarn cypress install yarn build @@ -105,9 +104,6 @@ test_steps: &test_steps paths: - node_modules - /root/.cache/Cypress - - run: *install_build_dependency - - run: *install_deploysuite - - run: *build_configuration_fetch - run: *running_yarn_test - store_test_results: path: cypress/test-report From 33eac904a50a97c0cde730e3a64eb4f719d84581 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 15:34:47 +0800 Subject: [PATCH 46/61] merge dev --- cypress/e2e/home/home.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index a1b877a9b..09e9bfc94 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -3,11 +3,11 @@ describe('Landing Page', () => { beforeEach(() => cy.visit('/')) // TCA-336 temporarily skip this bc the site isn't loading - it.skip('loads landing page should be successfully', () => { + it('loads landing page should be successfully', () => { cy.get('[data-id="root"]').should('be.visible') }) - it.skip('loads landing page should fail', () => { + it('loads landing page should fail', () => { cy.get('[data-id="root"]').should('not.be.visible') }) }) From 6ecf7f3926b985092997755190cccf94fc15d716 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 15:35:54 +0800 Subject: [PATCH 47/61] try fail and deploy --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d4499df3..26afa921e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -228,6 +228,7 @@ workflows: branches: only: - dev + - circle-ci-setup-v7 - deployProd: context : org-global From 10ce989b1e4d7652e0cf8496dd5a1ebafc7e02df Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 15:41:45 +0800 Subject: [PATCH 48/61] reset --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 26afa921e..1d4499df3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -228,7 +228,6 @@ workflows: branches: only: - dev - - circle-ci-setup-v7 - deployProd: context : org-global From 83446a1a552b535fc35f5c2561dfabebe3b7ab36 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 21:51:42 +0800 Subject: [PATCH 49/61] execute test --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d4499df3..58f6e8ae9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -239,7 +239,4 @@ workflows: - master - test-dev: - filters: - branches: - ignore: - - develop \ No newline at end of file + context : org-global \ No newline at end of file From f6ce5cba2c316ca991a66d997a2bc00bbac19d11 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 22:16:47 +0800 Subject: [PATCH 50/61] switch the command seqneuce --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 58f6e8ae9..1c16fe79b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,12 +99,12 @@ test_steps: &test_steps - setup_remote_docker - restore_cache: key: test-node-modules-{{ checksum "yarn.lock" }} - - save_cache: - key: test-node-modules-{{ checksum "yarn.lock" }} - paths: - - node_modules - - /root/.cache/Cypress - run: *running_yarn_test + - save_cache: + key: test-node-modules-{{ checksum "yarn.lock" }} + paths: + - node_modules + - /root/.cache/Cypress - store_test_results: path: cypress/test-report - store_artifacts: From efe4e018107a70e7c665a68bdf15224d23e027d7 Mon Sep 17 00:00:00 2001 From: Brooke Date: Fri, 9 Sep 2022 08:16:47 -0700 Subject: [PATCH 51/61] TCA-408 clean up for dev #time 10m --- cypress/e2e/home/home.spec.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index 09e9bfc94..43c584180 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -2,12 +2,11 @@ describe('Landing Page', () => { beforeEach(() => cy.visit('/')) - // TCA-336 temporarily skip this bc the site isn't loading it('loads landing page should be successfully', () => { cy.get('[data-id="root"]').should('be.visible') }) - it('loads landing page should fail', () => { + it.skip('loads landing page should fail', () => { cy.get('[data-id="root"]').should('not.be.visible') }) }) From 5847caca1091485c66127fdbbdd592d54f4a5db1 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Thu, 15 Sep 2022 15:48:12 +0300 Subject: [PATCH 52/61] TCA-440: call certification completion based on assessment completion --- src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx | 2 +- .../tools/learn/learn-lib/course-outline/CourseOutline.tsx | 1 + .../course-outline/collapsible-item/CollapsibleItem.tsx | 5 ++--- .../learn-lib/lesson-provider/learn-module-meta.model.ts | 2 +- .../learn-user-certification-progress.model.ts | 2 ++ 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx index 9f123afc7..43b519f83 100644 --- a/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx +++ b/src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx @@ -259,7 +259,7 @@ const FreeCodeCamp: FC<{}> = () => { useEffect(() => { if ( certificateProgress && - certificateProgress.courseProgressPercentage === 100 && + certificateProgress.certificationProgressPercentage === 100 && certificateProgress.status === UserCertificationProgressStatus.inProgress ) { userCertificationProgressUpdateAsync( diff --git a/src-ts/tools/learn/learn-lib/course-outline/CourseOutline.tsx b/src-ts/tools/learn/learn-lib/course-outline/CourseOutline.tsx index e381863d1..65dd085cc 100644 --- a/src-ts/tools/learn/learn-lib/course-outline/CourseOutline.tsx +++ b/src-ts/tools/learn/learn-lib/course-outline/CourseOutline.tsx @@ -54,6 +54,7 @@ const CourseOutline: FC = (props: CourseOutlineProps) => { shortDescription={module.meta.introCopy} title={module.meta.name} onItemClick={props.onItemNavigate} + isAssessment={module.meta.isAssessment} /> ))}
    diff --git a/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx b/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx index cac0bd7fc..a58f53646 100644 --- a/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx +++ b/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx @@ -19,6 +19,7 @@ interface CollapsibleItemProps { duration: LearnModule['meta']['estimatedCompletionTime'] itemId?: (item: any) => string items: Array + isAssessment: boolean lessonsCount: number moduleKey: string onItemClick: (item: any) => void @@ -31,8 +32,6 @@ interface CollapsibleItemProps { const CollapsibleItem: FC = (props: CollapsibleItemProps) => { const [isOpen, setIsOpen]: [boolean, Dispatch>] = useState(false) - const isAssessment: boolean = props.lessonsCount === 1 - const toggle: () => void = useCallback(() => { setIsOpen(open => !open) }, []) @@ -89,7 +88,7 @@ const CollapsibleItem: FC = (props: CollapsibleItemProps)
    - {isAssessment && ( + {props.isAssessment && (
    assessment
    diff --git a/src-ts/tools/learn/learn-lib/lesson-provider/learn-module-meta.model.ts b/src-ts/tools/learn/learn-lib/lesson-provider/learn-module-meta.model.ts index 1c8d08b1f..bb2a59385 100644 --- a/src-ts/tools/learn/learn-lib/lesson-provider/learn-module-meta.model.ts +++ b/src-ts/tools/learn/learn-lib/lesson-provider/learn-module-meta.model.ts @@ -5,6 +5,6 @@ export interface LearnModuleMeta { value: number } introCopy: Array - lessonCount: number + isAssessment: boolean name: string } diff --git a/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certifications-functions/learn-user-certification-progress.model.ts b/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certifications-functions/learn-user-certification-progress.model.ts index 88100541b..e08ac81f5 100644 --- a/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certifications-functions/learn-user-certification-progress.model.ts +++ b/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certifications-functions/learn-user-certification-progress.model.ts @@ -7,6 +7,8 @@ export interface LearnUserCertificationProgress extends LearnModelBase { academicHonestyPolicyAcceptedAt?: number, certification: string certificationId: string + certificationProgressPercentage: number + certType: 'certification'; completedDate?: string courseId: string courseKey: string From 0ea5539d8de839dfb5c6566a58e1e2249b4e268e Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Thu, 15 Sep 2022 15:54:45 +0300 Subject: [PATCH 53/61] lint fix --- .../course-outline/collapsible-item/CollapsibleItem.tsx | 2 +- .../learn-user-certification-progress.model.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx b/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx index a58f53646..5380318c8 100644 --- a/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx +++ b/src-ts/tools/learn/learn-lib/course-outline/collapsible-item/CollapsibleItem.tsx @@ -17,9 +17,9 @@ interface CollapsibleListItem { interface CollapsibleItemProps { active?: string duration: LearnModule['meta']['estimatedCompletionTime'] + isAssessment: boolean itemId?: (item: any) => string items: Array - isAssessment: boolean lessonsCount: number moduleKey: string onItemClick: (item: any) => void diff --git a/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certifications-functions/learn-user-certification-progress.model.ts b/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certifications-functions/learn-user-certification-progress.model.ts index e08ac81f5..2d9dc6f78 100644 --- a/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certifications-functions/learn-user-certification-progress.model.ts +++ b/src-ts/tools/learn/learn-lib/user-certifications-provider/user-certifications-functions/learn-user-certification-progress.model.ts @@ -8,7 +8,7 @@ export interface LearnUserCertificationProgress extends LearnModelBase { certification: string certificationId: string certificationProgressPercentage: number - certType: 'certification'; + certType: 'certification' completedDate?: string courseId: string courseKey: string From 51c92071f418055ff760ea1e3543095349c6e1ff Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Thu, 15 Sep 2022 18:10:52 +0300 Subject: [PATCH 54/61] TCA-444 - Learn Landing Header content --- .../learn-lib/wave-hero/WaveHero.module.scss | 8 +++---- .../learn/learn-lib/wave-hero/WaveHero.tsx | 2 +- .../learn/welcome/WelcomePage.module.scss | 15 ++++++++---- src-ts/tools/learn/welcome/WelcomePage.tsx | 8 ++++++- src-ts/tools/learn/welcome/tca-full-logo.svg | 24 +++++++++++++++++++ 5 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 src-ts/tools/learn/welcome/tca-full-logo.svg diff --git a/src-ts/tools/learn/learn-lib/wave-hero/WaveHero.module.scss b/src-ts/tools/learn/learn-lib/wave-hero/WaveHero.module.scss index 996cb752a..7fb19c5aa 100755 --- a/src-ts/tools/learn/learn-lib/wave-hero/WaveHero.module.scss +++ b/src-ts/tools/learn/learn-lib/wave-hero/WaveHero.module.scss @@ -19,7 +19,7 @@ } } } - + &-inner { padding: calc($space-xxxxl + $space-sm) 0 $space-lg; @include contentWidth; @@ -47,13 +47,13 @@ flex-direction: column; } } - + &-card-col { flex: 0 0 auto; } - + &-text { @extend .body-medium-normal; - margin-top: $space-xxl; + margin-top: $space-sm; } } diff --git a/src-ts/tools/learn/learn-lib/wave-hero/WaveHero.tsx b/src-ts/tools/learn/learn-lib/wave-hero/WaveHero.tsx index a78e17b7b..907111c88 100755 --- a/src-ts/tools/learn/learn-lib/wave-hero/WaveHero.tsx +++ b/src-ts/tools/learn/learn-lib/wave-hero/WaveHero.tsx @@ -7,7 +7,7 @@ interface WaveHeroProps { children?: ReactNode text: string theme?: 'light' - title: string + title: ReactNode } const WaveHero: FC = (props: WaveHeroProps) => { diff --git a/src-ts/tools/learn/welcome/WelcomePage.module.scss b/src-ts/tools/learn/welcome/WelcomePage.module.scss index c00834ead..c44175908 100644 --- a/src-ts/tools/learn/welcome/WelcomePage.module.scss +++ b/src-ts/tools/learn/welcome/WelcomePage.module.scss @@ -1,10 +1,15 @@ @import '../../../lib/styles/includes'; .hero-wrap { + svg:global(.tca-logo) { + margin-bottom: $space-xxl; + max-width: calc(100% - 70px); + } + :global(.hero-card-col) { width: 43.5%; max-width: 600px; - + @include ltemd { width: 100%; max-width: none; @@ -15,7 +20,7 @@ .courses-section { padding: $space-xxxxl 0; position: relative; - + @include ltemd { padding-top: $space-xxl; } @@ -38,12 +43,12 @@ @include ltelg { grid-template-columns: repeat(2, 1fr); } - + @media (max-width: 576px) { grid-template-columns: repeat(1, 1fr); } - + @include ltemd { margin-top: $space-xxl; } -} \ No newline at end of file +} diff --git a/src-ts/tools/learn/welcome/WelcomePage.tsx b/src-ts/tools/learn/welcome/WelcomePage.tsx index 12008470f..e437e9a43 100644 --- a/src-ts/tools/learn/welcome/WelcomePage.tsx +++ b/src-ts/tools/learn/welcome/WelcomePage.tsx @@ -14,6 +14,7 @@ import { import { CoursesCard } from './courses-card' import { ProgressBlock } from './progress-block' import styles from './WelcomePage.module.scss' +import { ReactComponent as TcAcademyFullLogoSvg } from './tca-full-logo.svg' const WelcomePage: FC<{}> = () => { @@ -30,7 +31,12 @@ const WelcomePage: FC<{}> = () => {
    + + Welcome! + + )} text={` The Topcoder Academy will provide you with learning opportunities in the form of guided learning paths. diff --git a/src-ts/tools/learn/welcome/tca-full-logo.svg b/src-ts/tools/learn/welcome/tca-full-logo.svg new file mode 100644 index 000000000..9deee693b --- /dev/null +++ b/src-ts/tools/learn/welcome/tca-full-logo.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + From cfeb2d4c250a26e5b1fd194d5399864746fd55a0 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Thu, 15 Sep 2022 18:16:28 +0300 Subject: [PATCH 55/61] lint fixes --- src-ts/tools/learn/welcome/WelcomePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ts/tools/learn/welcome/WelcomePage.tsx b/src-ts/tools/learn/welcome/WelcomePage.tsx index e437e9a43..303472002 100644 --- a/src-ts/tools/learn/welcome/WelcomePage.tsx +++ b/src-ts/tools/learn/welcome/WelcomePage.tsx @@ -13,8 +13,8 @@ import { import { CoursesCard } from './courses-card' import { ProgressBlock } from './progress-block' -import styles from './WelcomePage.module.scss' import { ReactComponent as TcAcademyFullLogoSvg } from './tca-full-logo.svg' +import styles from './WelcomePage.module.scss' const WelcomePage: FC<{}> = () => { From cde8c845e9288f49a9608d9c79960aedc9554198 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Fri, 16 Sep 2022 15:50:24 +0300 Subject: [PATCH 56/61] TCA-440 - add slider on homepage with user's latest progress --- .../in-progress/InProgress.module.scss | 8 +- .../progress-block/ProgressBlock.module.scss | 6 +- .../cards-slider/CardsSlider.module.scss | 63 +++++++++++ .../cards-slider/CardsSlider.tsx | 49 +++++++++ .../progress-block/cards-slider/index.ts | 1 + .../progress-action/ProgressAction.tsx | 103 ++++++++---------- 6 files changed, 166 insertions(+), 64 deletions(-) create mode 100644 src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.module.scss create mode 100644 src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.tsx create mode 100644 src-ts/tools/learn/welcome/progress-block/cards-slider/index.ts diff --git a/src-ts/tools/learn/learn-lib/my-course-card/in-progress/InProgress.module.scss b/src-ts/tools/learn/learn-lib/my-course-card/in-progress/InProgress.module.scss index 1b525b6fd..152d7f6fb 100644 --- a/src-ts/tools/learn/learn-lib/my-course-card/in-progress/InProgress.module.scss +++ b/src-ts/tools/learn/learn-lib/my-course-card/in-progress/InProgress.module.scss @@ -8,10 +8,6 @@ display: flex; - &.large { - padding: $space-xxxxl; - } - @include ltelg { &, &.large { padding: $space-lg; @@ -119,8 +115,8 @@ .started-date { font-weight: bold; - + @include ltemd { order: -1; } -} \ No newline at end of file +} diff --git a/src-ts/tools/learn/welcome/progress-block/ProgressBlock.module.scss b/src-ts/tools/learn/welcome/progress-block/ProgressBlock.module.scss index 167346070..354f50713 100644 --- a/src-ts/tools/learn/welcome/progress-block/ProgressBlock.module.scss +++ b/src-ts/tools/learn/welcome/progress-block/ProgressBlock.module.scss @@ -4,14 +4,14 @@ .wrap { background: $black-5; border-radius: $space-sm; - padding: $space-xxl; + padding: $space-xxl $space-xxl $space-lg; color: $black-100; display: flex; flex-direction: column; - gap: $space-lg; + gap: $space-xxl; width: 100%; - + @include ltemd { padding: $space-lg; } diff --git a/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.module.scss b/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.module.scss new file mode 100644 index 000000000..f54fe4bcb --- /dev/null +++ b/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.module.scss @@ -0,0 +1,63 @@ +@import '../../../../../lib/styles/includes'; + +.slides-wrap { + display: block; + position: relative; + z-index: 1; + overflow: hidden; +} + +.slide { + position: absolute; + top: 0; + left: 0; + width: 100%; + + opacity: 0; + visibility: hidden; + transition: 0.2s ease; + &:global(:not(.active)) { + pointer-events: none; + } + + + &:global(.is-prev) { + transform: translateX(-100%); + } + + &:global(.is-next) { + transform: translateX(100%); + } + + &:global(.active) { + position: relative; + opacity: 1; + transform: translateX(0); + visibility: visible; + } +} + +.nav-wrap { + display: flex; + align-items: center; + justify-content: center; + margin-top: $space-xxl; + + gap: calc($space-xs + $border-xs); +} + +.nav-dot { + display: block; + width: $space-md; + height: $space-md; + background: $black-40; + border-radius: 50%; + cursor: pointer; + + &:global(.active) { + width: calc($space-lg + $border); + height: calc($space-lg + $border); + border: $border solid $turq-100; + background: $tc-white; + } +} diff --git a/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.tsx b/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.tsx new file mode 100644 index 000000000..e41f99aab --- /dev/null +++ b/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.tsx @@ -0,0 +1,49 @@ +import classNames from 'classnames' +import { fill } from 'lodash' +import { Children, Dispatch, FC, ReactNode, SetStateAction, useState } from 'react' + +import styles from './CardsSlider.module.scss' + +interface CardsSliderProps { + children: Array +} + +const CardsSlider: FC = (props: CardsSliderProps) => { + const [activeSlide, setActiveSlide]: [number, Dispatch>] = useState(2) + + const wrapSlides: (children: Array) => Array = (children: Array) => { + return Children.map(children, (child, index) => ( +
    index && 'is-prev', + activeSlide < index && 'is-next', + ) + } + > + {child} +
    + )) as Array + } + + return ( +
    +
    + {wrapSlides(props.children)} +
    +
    + {fill(Array(props.children.length), '').map((_, i) => ( + setActiveSlide(i)} + /> + ))} +
    +
    + ) +} + +export default CardsSlider diff --git a/src-ts/tools/learn/welcome/progress-block/cards-slider/index.ts b/src-ts/tools/learn/welcome/progress-block/cards-slider/index.ts new file mode 100644 index 000000000..f2113ef20 --- /dev/null +++ b/src-ts/tools/learn/welcome/progress-block/cards-slider/index.ts @@ -0,0 +1 @@ +export { default as CardsSlider } from './CardsSlider' diff --git a/src-ts/tools/learn/welcome/progress-block/progress-action/ProgressAction.tsx b/src-ts/tools/learn/welcome/progress-block/progress-action/ProgressAction.tsx index 3eb8997ec..9de579e3b 100644 --- a/src-ts/tools/learn/welcome/progress-block/progress-action/ProgressAction.tsx +++ b/src-ts/tools/learn/welcome/progress-block/progress-action/ProgressAction.tsx @@ -1,15 +1,18 @@ +import { orderBy } from 'lodash' import { FC, ReactNode, useMemo } from 'react' import { Button } from '../../../../../lib' import { LearnCertification, - LearningHat, + LearnUserCertificationProgress, MyCourseCompletedCard, MyCourseInProgressCard, UserCertificationCompleted, UserCertificationInProgress, + UserCertificationProgressStatus, } from '../../../learn-lib' import { LEARN_PATHS } from '../../../learn.routes' +import { CardsSlider } from '../cards-slider' import styles from './ProgressAction.module.scss' @@ -19,6 +22,12 @@ interface ProgressActionProps { userInProgressCertifications: ReadonlyArray } +function isCompleted(cert: LearnUserCertificationProgress): boolean { + return cert.status === UserCertificationProgressStatus.completed +} + +const USER_PROGRESS_MAX_SLIDES_COUNT: number = 8 + const ProgressAction: FC = (props: ProgressActionProps) => { const { @@ -45,72 +54,56 @@ const ProgressAction: FC = (props: ProgressActionProps) => }, {} as unknown as { [key: string]: LearnCertification }) ), [allCertifications]) - // we only want to display the last course that was acted upon - const mostRecentIsCompleted: boolean = myCompletedCertifications?.[0]?.updatedAt > (myInProgressCertifications?.[0]?.updatedAt || 0) - - function renderInProgress(): JSX.Element { - - // if the most recently acted upon course is completed and not in progress, - // or there are no courses in progress, don't show this block - if (mostRecentIsCompleted || !myInProgressCertifications.length) { - return <> - } - - const courseToDisplay: UserCertificationInProgress = myInProgressCertifications[0] + const recentlyUpdatedCertifications: Array = orderBy([ + ...myCompletedCertifications, + ...myInProgressCertifications, + ], 'updatedAt', 'desc').slice(0, USER_PROGRESS_MAX_SLIDES_COUNT) + function renderInProgress(courseToDisplay: UserCertificationInProgress): JSX.Element { return ( - <> -
    -

    In progress

    - - {allMyLearningsLink} - -
    - - + ) } - function renderCompleted(): JSX.Element { + function renderCompleted(certToDisplay: UserCertificationCompleted): JSX.Element { + return ( + + ) + } - // if the most recently acted upon course is in progress rather than completed, - // or there are no completed courses, don't show this block - if (!mostRecentIsCompleted || !myCompletedCertifications.length) { - return <> + function renderCertificateCards(): Array { + if (!recentlyUpdatedCertifications.length) { + return [] } - const certToDisplay: UserCertificationCompleted = myCompletedCertifications[0] - - return ( - <> -
    -
    - -

    Congratulations!

    -
    - - {allMyLearningsLink} - -
    - - - ) + return recentlyUpdatedCertifications.map((cert) => ( + isCompleted(cert) + ? renderCompleted(cert as UserCertificationCompleted) + : renderInProgress(cert as UserCertificationInProgress) + )) } return ( <> - {renderInProgress()} - {renderCompleted()} +
    +

    My progress

    + + {allMyLearningsLink} + +
    + + {renderCertificateCards()} + {allMyLearningsLink} From dbeb9ad6f5e8bd3e04bbbed17366b4c2bb305034 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Fri, 16 Sep 2022 16:31:05 +0300 Subject: [PATCH 57/61] update default active slider --- .../learn/welcome/progress-block/cards-slider/CardsSlider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.tsx b/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.tsx index e41f99aab..d8b4f8f29 100644 --- a/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.tsx +++ b/src-ts/tools/learn/welcome/progress-block/cards-slider/CardsSlider.tsx @@ -9,7 +9,7 @@ interface CardsSliderProps { } const CardsSlider: FC = (props: CardsSliderProps) => { - const [activeSlide, setActiveSlide]: [number, Dispatch>] = useState(2) + const [activeSlide, setActiveSlide]: [number, Dispatch>] = useState(0) const wrapSlides: (children: Array) => Array = (children: Array) => { return Children.map(children, (child, index) => ( From f4d55e54cad820df95f34230400da7da49bfcc72 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Fri, 16 Sep 2022 16:54:40 +0300 Subject: [PATCH 58/61] TCA-428 - add "completion suggestions" on course landing page --- .../CourseDetailsPage.module.scss | 6 ++++- .../course-details/CourseDetailsPage.tsx | 22 +++++++++++++++++++ .../courses-functions/learn-course.model.ts | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src-ts/tools/learn/course-details/CourseDetailsPage.module.scss b/src-ts/tools/learn/course-details/CourseDetailsPage.module.scss index 96aa7ad71..605a7afe9 100644 --- a/src-ts/tools/learn/course-details/CourseDetailsPage.module.scss +++ b/src-ts/tools/learn/course-details/CourseDetailsPage.module.scss @@ -47,10 +47,14 @@ @extend .body-main; margin-top: $space-xxl; } - + p { margin: $space-sm 0; } + + :global(.details.mtop) { + margin-top: $space-xxl; + } } .coming-soon { diff --git a/src-ts/tools/learn/course-details/CourseDetailsPage.tsx b/src-ts/tools/learn/course-details/CourseDetailsPage.tsx index 756bbdfb1..856829c6c 100644 --- a/src-ts/tools/learn/course-details/CourseDetailsPage.tsx +++ b/src-ts/tools/learn/course-details/CourseDetailsPage.tsx @@ -99,6 +99,27 @@ const CourseDetailsPage: FC<{}> = () => { ) } + function getCompletionSuggestion(): ReactNode { + if (!course) { + return + } + + return progress?.status === UserCertificationProgressStatus.completed ? ( + <> + ) : ( + !!course.completionSuggestions?.length && ( + <> +

    Suggestions for completing this course

    + +

    ') }} + >
    + + ) + ) + } + function getFooter(): ReactNode { if (!resourceProvider) { return @@ -141,6 +162,7 @@ const CourseDetailsPage: FC<{}> = () => {
    {getDescription()} + {getCompletionSuggestion()}
    diff --git a/src-ts/tools/learn/learn-lib/courses-provider/courses-functions/learn-course.model.ts b/src-ts/tools/learn/learn-lib/courses-provider/courses-functions/learn-course.model.ts index 34a4e2442..b9c7010a4 100644 --- a/src-ts/tools/learn/learn-lib/courses-provider/courses-functions/learn-course.model.ts +++ b/src-ts/tools/learn/learn-lib/courses-provider/courses-functions/learn-course.model.ts @@ -4,6 +4,7 @@ import { LearnModule } from '../../lesson-provider' export interface LearnCourse extends LearnModelBase { certification: string certificationId: string + completionSuggestions: Array estimatedCompletionTime: { units: string value: number From 03cd149d8e006314cfc5bab1e7ab4e463e490701 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 20 Sep 2022 18:46:15 +0300 Subject: [PATCH 59/61] dedicated checkbox input init --- .../ContactSupportForm.tsx | 3 ++ .../contact-support-form.config.ts | 6 +++ src-ts/lib/form/form-groups/FormGroups.tsx | 12 ++++- .../lib/form/form-groups/form-input/index.ts | 1 + .../input-checkbox/InputCheckbox.module.scss | 32 +++++++++++ .../input-checkbox/InputCheckbox.tsx | 53 +++++++++++++++++++ .../form-input/input-checkbox/index.ts | 1 + src-ts/lib/form/form-input.model.ts | 1 + 8 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.module.scss create mode 100644 src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.tsx create mode 100644 src-ts/lib/form/form-groups/form-input/input-checkbox/index.ts diff --git a/src-ts/lib/contact-support-form/ContactSupportForm.tsx b/src-ts/lib/contact-support-form/ContactSupportForm.tsx index 0580bf918..2f6383ce2 100644 --- a/src-ts/lib/contact-support-form/ContactSupportForm.tsx +++ b/src-ts/lib/contact-support-form/ContactSupportForm.tsx @@ -19,6 +19,9 @@ const ContactSupportForm: FC = (props: ContactSupportFo const { profile }: ProfileContextData = useContext(profileContext) function generateRequest(inputs: ReadonlyArray): ContactSupportRequest { + const activeEl: any = formGetInputModel(inputs, 'active') + console.log('generateRequest', activeEl) + const firstName: string = formGetInputModel(inputs, ContactSupportFormField.first).value as string const lastName: string = formGetInputModel(inputs, ContactSupportFormField.last).value as string const email: string = formGetInputModel(inputs, ContactSupportFormField.email).value as string diff --git a/src-ts/lib/contact-support-form/contact-support-form.config.ts b/src-ts/lib/contact-support-form/contact-support-form.config.ts index c41d6dff9..6d76f4ccf 100644 --- a/src-ts/lib/contact-support-form/contact-support-form.config.ts +++ b/src-ts/lib/contact-support-form/contact-support-form.config.ts @@ -22,6 +22,12 @@ export const contactSupportFormDef: FormDefinition = { groups: [ { inputs: [ + { + checked: true, + label: 'Activate', + name: 'active', + type: 'checkbox', + }, { label: 'First Name', name: ContactSupportFormField.first, diff --git a/src-ts/lib/form/form-groups/FormGroups.tsx b/src-ts/lib/form/form-groups/FormGroups.tsx index 2562d0146..e3ef42a0f 100644 --- a/src-ts/lib/form/form-groups/FormGroups.tsx +++ b/src-ts/lib/form/form-groups/FormGroups.tsx @@ -6,7 +6,7 @@ import { FormInputModel } from '../form-input.model' import { FormCardSet } from './form-card-set' import FormGroupItem from './form-group-item/FormGroupItem' -import { InputRating, InputText, InputTextarea } from './form-input' +import { InputCheckbox, InputRating, InputText, InputTextarea } from './form-input' import { FormInputRow } from './form-input-row' import { InputTextTypes } from './form-input/input-text/InputText' import FormRadio from './form-radio' @@ -44,7 +44,6 @@ const FormGroups: (props: FormGroupsProps) => JSX.Element = (props: FormGroupsPr /> ) break - case 'textarea': inputElement = ( JSX.Element = (props: FormGroupsPr ) break case 'checkbox': + inputElement = ( + + ) + break case 'radio': inputElement = ( ) => void + readonly tabIndex: number + readonly type: InputCheckboxTypes +} + +const InputCheckbox: FC = (props: InputCheckboxProps) => { + + const [checked, setChecked]: [boolean, Dispatch>] = useState(props.checked || false) + + return ( + + { + setChecked(!checked) + props.onChange(event) + }} + name={props.name} + tabIndex={props.tabIndex} + type={'checkbox'} + checked={checked} + /> + + ) +} + +export default InputCheckbox diff --git a/src-ts/lib/form/form-groups/form-input/input-checkbox/index.ts b/src-ts/lib/form/form-groups/form-input/input-checkbox/index.ts new file mode 100644 index 000000000..fcf5b192b --- /dev/null +++ b/src-ts/lib/form/form-groups/form-input/input-checkbox/index.ts @@ -0,0 +1 @@ +export { default as InputCheckbox } from './InputCheckbox' diff --git a/src-ts/lib/form/form-input.model.ts b/src-ts/lib/form/form-input.model.ts index a27489902..29503e2aa 100644 --- a/src-ts/lib/form/form-input.model.ts +++ b/src-ts/lib/form/form-input.model.ts @@ -20,6 +20,7 @@ export interface FormCard { export interface FormInputModel { readonly autocomplete?: FormInputAutocompleteOption readonly cards?: ReadonlyArray + checked?: boolean readonly className?: string readonly dependentFields?: Array dirty?: boolean From 460cd292ec75947eaa3b0efdc9bfc3de3a6e6e7e Mon Sep 17 00:00:00 2001 From: Brooke Date: Tue, 20 Sep 2022 10:30:11 -0700 Subject: [PATCH 60/61] GAME-108 #comment This commit adapts the InputText component to support checkboxes #time 1h --- .../lib/form/form-functions/form.functions.ts | 8 ++- src-ts/lib/form/form-groups/FormGroups.tsx | 34 ++++++++---- .../lib/form/form-groups/form-input/index.ts | 1 - .../input-checkbox/InputCheckbox.module.scss | 32 ----------- .../input-checkbox/InputCheckbox.tsx | 53 ------------------- .../form-input/input-checkbox/index.ts | 1 - .../input-text/InputText.module.scss | 29 ++++++++-- .../form-input/input-text/InputText.tsx | 9 +++- src-ts/lib/form/form-input.model.ts | 2 +- 9 files changed, 64 insertions(+), 105 deletions(-) delete mode 100644 src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.module.scss delete mode 100644 src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.tsx delete mode 100644 src-ts/lib/form/form-groups/form-input/input-checkbox/index.ts diff --git a/src-ts/lib/form/form-functions/form.functions.ts b/src-ts/lib/form/form-functions/form.functions.ts index 5f5e72246..f6ca85586 100644 --- a/src-ts/lib/form/form-functions/form.functions.ts +++ b/src-ts/lib/form/form-functions/form.functions.ts @@ -121,7 +121,13 @@ function handleFieldEvent(input: HTMLInputElement | HTMLTextAreaElement, inpu inputDef.touched = true // set the def value - inputDef.value = input.value + if (input.type === 'checkbox') { + const checkbox: HTMLInputElement = input as HTMLInputElement + inputDef.value = checkbox.checked + inputDef.checked = checkbox.checked + } else { + inputDef.value = input.value + } // now let's validate the field const formElements: HTMLFormControlsCollection = (input.form as HTMLFormElement).elements diff --git a/src-ts/lib/form/form-groups/FormGroups.tsx b/src-ts/lib/form/form-groups/FormGroups.tsx index e3ef42a0f..141bcb4f5 100644 --- a/src-ts/lib/form/form-groups/FormGroups.tsx +++ b/src-ts/lib/form/form-groups/FormGroups.tsx @@ -6,7 +6,7 @@ import { FormInputModel } from '../form-input.model' import { FormCardSet } from './form-card-set' import FormGroupItem from './form-group-item/FormGroupItem' -import { InputCheckbox, InputRating, InputText, InputTextarea } from './form-input' +import { InputRating, InputText, InputTextarea } from './form-input' import { FormInputRow } from './form-input-row' import { InputTextTypes } from './form-input/input-text/InputText' import FormRadio from './form-radio' @@ -23,12 +23,13 @@ const FormGroups: (props: FormGroupsProps) => JSX.Element = (props: FormGroupsPr const { formDef, onBlur, onChange }: FormGroupsProps = props - const getTabIndex: (input: FormInputModel, index: number) => number = (input, index) => { + function getTabIndex(input: FormInputModel, index: number): number { const tabIndex: number = input.notTabbable ? -1 : index + 1 + (formDef.tabIndexStart || 0) return tabIndex } - const renderInputField: (input: FormInputModel, index: number) => JSX.Element | undefined = (input, index) => { + function renderInputField(input: FormInputModel, index: number): JSX.Element | undefined { + const tabIndex: number = getTabIndex(input, index) let inputElement: JSX.Element @@ -40,7 +41,7 @@ const FormGroups: (props: FormGroupsProps) => JSX.Element = (props: FormGroupsPr {...input} onChange={onChange} tabIndex={tabIndex} - value={input.value} + value={input.value as number | undefined} /> ) break @@ -51,17 +52,19 @@ const FormGroups: (props: FormGroupsProps) => JSX.Element = (props: FormGroupsPr onBlur={onBlur} onChange={onChange} tabIndex={tabIndex} - value={input.value} + value={input.value as string | undefined} /> ) break case 'checkbox': inputElement = ( - ) break @@ -91,7 +94,7 @@ const FormGroups: (props: FormGroupsProps) => JSX.Element = (props: FormGroupsPr onChange={onChange} tabIndex={tabIndex} type={input.type as InputTextTypes || 'text'} - value={input.value} + value={input.value as string | undefined} /> ) break @@ -108,9 +111,18 @@ const FormGroups: (props: FormGroupsProps) => JSX.Element = (props: FormGroupsPr ) } - const formGroups: Array = formDef?.groups?.map((element: FormGroup, index: number) => { - return - }) || [] + const formGroups: Array = formDef?.groups + ?.map((element: FormGroup, index: number) => { + return ( + + ) + }) + || [] return (
    diff --git a/src-ts/lib/form/form-groups/form-input/index.ts b/src-ts/lib/form/form-groups/form-input/index.ts index 17c210364..3f5dfa642 100644 --- a/src-ts/lib/form/form-groups/form-input/index.ts +++ b/src-ts/lib/form/form-groups/form-input/index.ts @@ -1,4 +1,3 @@ -export * from './input-checkbox' export * from './form-input-autcomplete-option.enum' export * from './input-rating' export * from './input-text' diff --git a/src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.module.scss b/src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.module.scss deleted file mode 100644 index 001cb128b..000000000 --- a/src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.module.scss +++ /dev/null @@ -1,32 +0,0 @@ -@use '../../../../styles/typography'; -@import '../../../../styles/includes'; - -.form-input-checkbox { - @extend .body-small; - color: $black-60; - box-sizing: border-box; - border: 0; - width: 100%; - padding: 0; - margin: 0; - height: auto; - border-radius: 0; - - &:focus { - box-shadow: none; - border: none; - outline: none; - color: $black-100; - } - - &:disabled { - background-color: $black-10; - } - - &.checkbox { - & { - width: 20px; - height: 20px; - } - } -} diff --git a/src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.tsx b/src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.tsx deleted file mode 100644 index a296a0d07..000000000 --- a/src-ts/lib/form/form-groups/form-input/input-checkbox/InputCheckbox.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import cn from 'classnames' -import { ChangeEvent, Dispatch, FC, FocusEvent, SetStateAction, useState } from 'react' - -import { InputWrapper } from '../input-wrapper' - -import styles from './InputCheckbox.module.scss' - -export type InputCheckboxTypes = 'checkbox' | 'password' | 'text' - -interface InputCheckboxProps { - readonly checked?: boolean - readonly className?: string - readonly dirty?: boolean - readonly disabled?: boolean - readonly error?: string - readonly hideInlineErrors?: boolean - readonly hint?: string - readonly label?: string | JSX.Element - readonly name: string - readonly onChange: (event: ChangeEvent) => void - readonly tabIndex: number - readonly type: InputCheckboxTypes -} - -const InputCheckbox: FC = (props: InputCheckboxProps) => { - - const [checked, setChecked]: [boolean, Dispatch>] = useState(props.checked || false) - - return ( - - { - setChecked(!checked) - props.onChange(event) - }} - name={props.name} - tabIndex={props.tabIndex} - type={'checkbox'} - checked={checked} - /> - - ) -} - -export default InputCheckbox diff --git a/src-ts/lib/form/form-groups/form-input/input-checkbox/index.ts b/src-ts/lib/form/form-groups/form-input/input-checkbox/index.ts deleted file mode 100644 index fcf5b192b..000000000 --- a/src-ts/lib/form/form-groups/form-input/input-checkbox/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as InputCheckbox } from './InputCheckbox' diff --git a/src-ts/lib/form/form-groups/form-input/input-text/InputText.module.scss b/src-ts/lib/form/form-groups/form-input/input-text/InputText.module.scss index 7b47d447d..ac7f33476 100644 --- a/src-ts/lib/form/form-groups/form-input/input-text/InputText.module.scss +++ b/src-ts/lib/form/form-groups/form-input/input-text/InputText.module.scss @@ -30,9 +30,32 @@ } &.checkbox { - & { - width: 20px; - height: 20px; + @extend .body-small; + color: $black-60; + box-sizing: border-box; + border: 0; + width: 100%; + padding: 0; + margin: 0; + height: auto; + border-radius: 0; + + &:focus { + box-shadow: none; + border: none; + outline: none; + color: $black-100; + } + + &:disabled { + background-color: $black-10; + } + + &.checkbox { + & { + width: 20px; + height: 20px; + } } } } diff --git a/src-ts/lib/form/form-groups/form-input/input-text/InputText.tsx b/src-ts/lib/form/form-groups/form-input/input-text/InputText.tsx index 21e94e307..34bbea969 100644 --- a/src-ts/lib/form/form-groups/form-input/input-text/InputText.tsx +++ b/src-ts/lib/form/form-groups/form-input/input-text/InputText.tsx @@ -10,6 +10,7 @@ export type InputTextTypes = 'checkbox' | 'password' | 'text' interface InputTextProps { readonly autocomplete?: FormInputAutocompleteOption + readonly checked?: boolean readonly className?: string readonly dirty?: boolean readonly disabled?: boolean @@ -24,11 +25,15 @@ interface InputTextProps { readonly spellCheck?: boolean readonly tabIndex: number readonly type: InputTextTypes - readonly value?: string | number + readonly value?: string | number | boolean } const InputText: FC = (props: InputTextProps) => { + const defaultValue: string | number | undefined = props.type === 'checkbox' && !!props.checked + ? 'on' + : props.value as string | number | undefined + return ( = (props: InputTextProps) => { - value?: string + value?: string | boolean } From e8b5069174820e7c0b8fff75563a8ceceefc7cd1 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Wed, 21 Sep 2022 10:06:47 +0300 Subject: [PATCH 61/61] fix checkbox init and clean up --- src-ts/lib/contact-support-form/ContactSupportForm.tsx | 3 --- .../contact-support-form.config.ts | 6 ------ src-ts/lib/form/form-functions/form.functions.ts | 10 +++++++--- .../form-groups/form-input/input-text/InputText.tsx | 1 + 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src-ts/lib/contact-support-form/ContactSupportForm.tsx b/src-ts/lib/contact-support-form/ContactSupportForm.tsx index 2f6383ce2..0580bf918 100644 --- a/src-ts/lib/contact-support-form/ContactSupportForm.tsx +++ b/src-ts/lib/contact-support-form/ContactSupportForm.tsx @@ -19,9 +19,6 @@ const ContactSupportForm: FC = (props: ContactSupportFo const { profile }: ProfileContextData = useContext(profileContext) function generateRequest(inputs: ReadonlyArray): ContactSupportRequest { - const activeEl: any = formGetInputModel(inputs, 'active') - console.log('generateRequest', activeEl) - const firstName: string = formGetInputModel(inputs, ContactSupportFormField.first).value as string const lastName: string = formGetInputModel(inputs, ContactSupportFormField.last).value as string const email: string = formGetInputModel(inputs, ContactSupportFormField.email).value as string diff --git a/src-ts/lib/contact-support-form/contact-support-form.config.ts b/src-ts/lib/contact-support-form/contact-support-form.config.ts index 6d76f4ccf..c41d6dff9 100644 --- a/src-ts/lib/contact-support-form/contact-support-form.config.ts +++ b/src-ts/lib/contact-support-form/contact-support-form.config.ts @@ -22,12 +22,6 @@ export const contactSupportFormDef: FormDefinition = { groups: [ { inputs: [ - { - checked: true, - label: 'Activate', - name: 'active', - type: 'checkbox', - }, { label: 'First Name', name: ContactSupportFormField.first, diff --git a/src-ts/lib/form/form-functions/form.functions.ts b/src-ts/lib/form/form-functions/form.functions.ts index f6ca85586..b2ec0c417 100644 --- a/src-ts/lib/form/form-functions/form.functions.ts +++ b/src-ts/lib/form/form-functions/form.functions.ts @@ -33,9 +33,13 @@ export function initializeValues(inputs: Array, formValues?: inputs .filter(input => !input.dirty && !input.touched) .forEach(input => { - input.value = !!(formValues as any)?.hasOwnProperty(input.name) - ? (formValues as any)[input.name] - : undefined + if (input.type === 'checkbox') { + input.value = input.checked || false + } else { + input.value = !!(formValues as any)?.hasOwnProperty(input.name) + ? (formValues as any)[input.name] + : undefined + } }) } diff --git a/src-ts/lib/form/form-groups/form-input/input-text/InputText.tsx b/src-ts/lib/form/form-groups/form-input/input-text/InputText.tsx index 34bbea969..de7cd32e6 100644 --- a/src-ts/lib/form/form-groups/form-input/input-text/InputText.tsx +++ b/src-ts/lib/form/form-groups/form-input/input-text/InputText.tsx @@ -44,6 +44,7 @@ const InputText: FC = (props: InputTextProps) => { >