From c53c3f021764fde3348883fd858b4419f9e25664 Mon Sep 17 00:00:00 2001 From: Justin Hynes Date: Fri, 3 Feb 2023 14:34:19 -0500 Subject: [PATCH] feat: add Skills Builder Header component, refactor to use ModalDialog [APER-2258] This PR adds the SkillsBuilderHeader component to the profile MFE. There was also some additional refactoring work required to display the header in the modal. The FullscreenModal component is not flexible enough to allow custom header designs to be displayed (only text). We have to pivot to using the `ModalDialog` family of components instead. --- package-lock.json | 102 ++++++++++++++++++ package.json | 1 + src/index.scss | 3 + src/skills-builder/images/edX-logo.svg | 3 + src/skills-builder/images/headerImage.png | Bin 0 -> 13433 bytes .../SkillsBuilderHeader.jsx | 25 +++++ .../skills-builder-header/index.js | 2 + .../skills-builder-header/messages.js | 16 +++ .../skillsBuilderHeader.scss | 8 ++ .../SkillsBuilderModal.jsx | 60 ++++++----- .../skillsBuilderModal.scss | 9 ++ .../test/SkillsBuilder.test.jsx | 10 +- 12 files changed, 210 insertions(+), 29 deletions(-) create mode 100644 src/skills-builder/images/edX-logo.svg create mode 100644 src/skills-builder/images/headerImage.png create mode 100644 src/skills-builder/skills-builder-header/SkillsBuilderHeader.jsx create mode 100644 src/skills-builder/skills-builder-header/index.js create mode 100644 src/skills-builder/skills-builder-header/messages.js create mode 100644 src/skills-builder/skills-builder-header/skillsBuilderHeader.scss create mode 100644 src/skills-builder/skills-builder-modal/skillsBuilderModal.scss diff --git a/package-lock.json b/package-lock.json index df0dbaad2..7ae9689bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,6 +47,7 @@ "@edx/browserslist-config": "^1.1.1", "@edx/frontend-build": "12.4.19", "@edx/reactifex": "2.1.1", + "@testing-library/react": "11.2.7", "codecov": "3.8.3", "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.7", @@ -4156,6 +4157,42 @@ "url": "https://github.com/sponsors/gregberge" } }, + "node_modules/@testing-library/dom": { + "version": "7.31.2", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-7.31.2.tgz", + "integrity": "sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^4.2.0", + "aria-query": "^4.2.2", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.6", + "lz-string": "^1.4.4", + "pretty-format": "^26.6.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@testing-library/react": { + "version": "11.2.7", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-11.2.7.tgz", + "integrity": "sha512-tzRNp7pzd5QmbtXNG/mhdcl7Awfu/Iz1RaVHY75zTdOkmHCuzMhRL83gWHSgOAcjS3CCbyfwUHMZgRJb4kAfpA==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.12.5", + "@testing-library/dom": "^7.28.1" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, "node_modules/@tootallnate/once": { "version": "1.1.2", "dev": true, @@ -4197,6 +4234,12 @@ "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, + "node_modules/@types/aria-query": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.2.tgz", + "integrity": "sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==", + "dev": true + }, "node_modules/@types/babel__core": { "version": "7.20.0", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", @@ -7529,6 +7572,12 @@ "node": ">=6.0.0" } }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true + }, "node_modules/dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -12690,6 +12739,15 @@ "node": ">=10" } }, + "node_modules/lz-string": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", + "integrity": "sha512-0ckx7ZHRPqb0oUm8zNr+90mtf9DQB60H1wMCjBtfi62Kl3a7JbHob6gA2bC+xRvZoOL+1hzUK8jeuEIQE8svEQ==", + "dev": true, + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/mailto-link": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mailto-link/-/mailto-link-2.0.0.tgz", @@ -22845,6 +22903,32 @@ "@svgr/plugin-svgo": "^6.2.0" } }, + "@testing-library/dom": { + "version": "7.31.2", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-7.31.2.tgz", + "integrity": "sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^4.2.0", + "aria-query": "^4.2.2", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.6", + "lz-string": "^1.4.4", + "pretty-format": "^26.6.2" + } + }, + "@testing-library/react": { + "version": "11.2.7", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-11.2.7.tgz", + "integrity": "sha512-tzRNp7pzd5QmbtXNG/mhdcl7Awfu/Iz1RaVHY75zTdOkmHCuzMhRL83gWHSgOAcjS3CCbyfwUHMZgRJb4kAfpA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.5", + "@testing-library/dom": "^7.28.1" + } + }, "@tootallnate/once": { "version": "1.1.2", "dev": true @@ -22879,6 +22963,12 @@ "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, + "@types/aria-query": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.2.tgz", + "integrity": "sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==", + "dev": true + }, "@types/babel__core": { "version": "7.20.0", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", @@ -25465,6 +25555,12 @@ "esutils": "^2.0.2" } }, + "dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true + }, "dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -29304,6 +29400,12 @@ "yallist": "^4.0.0" } }, + "lz-string": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", + "integrity": "sha512-0ckx7ZHRPqb0oUm8zNr+90mtf9DQB60H1wMCjBtfi62Kl3a7JbHob6gA2bC+xRvZoOL+1hzUK8jeuEIQE8svEQ==", + "dev": true + }, "mailto-link": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mailto-link/-/mailto-link-2.0.0.tgz", diff --git a/package.json b/package.json index f02879998..24ff26ec5 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "@edx/browserslist-config": "^1.1.1", "@edx/frontend-build": "12.4.19", "@edx/reactifex": "2.1.1", + "@testing-library/react": "11.2.7", "codecov": "3.8.3", "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.7", diff --git a/src/index.scss b/src/index.scss index 173e0ecb9..7b80a2bf6 100755 --- a/src/index.scss +++ b/src/index.scss @@ -6,3 +6,6 @@ @import "~@edx/frontend-component-footer/dist/footer"; @import './profile/index'; + +@import './skills-builder/skills-builder-modal/skillsBuilderModal.scss'; +@import './skills-builder/skills-builder-header/skillsBuilderHeader.scss'; diff --git a/src/skills-builder/images/edX-logo.svg b/src/skills-builder/images/edX-logo.svg new file mode 100644 index 000000000..400cff1f5 --- /dev/null +++ b/src/skills-builder/images/edX-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/skills-builder/images/headerImage.png b/src/skills-builder/images/headerImage.png new file mode 100644 index 0000000000000000000000000000000000000000..9df8987cba7f9944b67a0993f29f6bd99b3b2cf7 GIT binary patch literal 13433 zcmY*gbyQUC*B!bMq#I%APJtJMp=3b1ySuwvx?5@K?rx5`HhX^<|F@A~`io3$>m zn04p!oadZ<_TJ|qMn&m84kkG!2n51`%1NsM-}iv4866e)`gy(K8wkWN0hNYm_~f4E z1$t22d_M0lo{iseC1lAo<7+D>#ctdAfdfU5`Yqgj$YQlZx!OV!C0J6bkA2dlKW`{? z=hS|9D|vV8pzMalqTsKPIqzZXMbVwy4VAY)i1mR;xb1$Bo9Cm((tV(hvI{caC_ zY9|N>USyr7DLudHj*e2BYV|2ZL_~hy?FC5^c+A=+Mp@>URB8PeKtt(1;L?Jt9m?ZPP#I z>rXF&w)O>(jihuT1w!(nuGw~BDf7tcLW_uj7RZGJg^Y_m1d|&ZBOGC?g9o(En^caV zq4rdO*47@f+R1jQ9*TA%C@Z=+Jg_8%Nc!RK+ZEAqB+jF<;9F~dGH6upyM9cxT-LXbhK~Gg?cZNm%t2mfh>H){DjvpJ3>Mt! zI>on1dbL^;J8rKTSs;kam~OT@AWsc{C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UzIn@sg5`5;NA+ zRK=f`ViSow&EiUB2wO*u*4jZl;7t5d}LZZ3pT^ZDt4P^TnF}l55GTnkqBdK zDd@HO$WVUq?3~_Ym&nd34}@`06i_ypP2SV4Y9U(wadZ2LE?_}bdq z7;k&{W4N>bJL^CK%MbRU!Z6#035q{y8$*Nrwq`(iQ7ld zc8UR4XKixDBKT4Us|ZkDWwm{gmsc3}as~|W?6=qhMJ)G{abb@Yg6k2ICLJ(t!t20#?RzA^sjJ|33Zw%cmKt<(TCUXR5t>R=} zfN?fLwV8;8Fd_ae0Q6nm-EV%2N}G5_*$7K$DbT}k5i>sHnX}`|(nHl~Yq7>4=wxB>$3>}wamBR?Zxl?a_^;d< zR&h?OE>B-ESuJ6hM^n;jGywOOC&>QlTUu&~ab>`ll~Po!tvbs6WFr7};Cz;s*&RCE zeyuAt*BHcvFG9e$907_iu}lz_gkbXaI2l3%1AD8MKS+OECV7p!es=YMrfCRulIpo> zeD?w68tYiY*3Hnf;XnQmv=)URi0YT$3B0}WJf-!DRjpG7rL-t4P_^V;HRlF7`H!m6 z@fQ{ bj$e?B*O8)(BQO5_V-W}{qa { + const { formatMessage } = useIntl(); + + return ( +
+ edx-logo +
+
+

+ {formatMessage(messages.skillsBuilderHeaderTitle)} +

+

+ {formatMessage(messages.skillsBuilderHeaderSubheading)} +

+
+
+ ); +}; + +export default SkillsBuilderHeader; diff --git a/src/skills-builder/skills-builder-header/index.js b/src/skills-builder/skills-builder-header/index.js new file mode 100644 index 000000000..00e6b020d --- /dev/null +++ b/src/skills-builder/skills-builder-header/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line import/prefer-default-export +export { default as SkillsBuilderHeader } from './SkillsBuilderHeader'; diff --git a/src/skills-builder/skills-builder-header/messages.js b/src/skills-builder/skills-builder-header/messages.js new file mode 100644 index 000000000..1c7fabfb4 --- /dev/null +++ b/src/skills-builder/skills-builder-header/messages.js @@ -0,0 +1,16 @@ +import { defineMessages } from '@edx/frontend-platform/i18n'; + +const messages = defineMessages({ + skillsBuilderHeaderTitle: { + id: 'skills.builder.header.title', + defaultMessage: 'Skills Builder', + description: 'Title for the Skills Builder feature', + }, + skillsBuilderHeaderSubheading: { + id: 'skills.builder.header.subheading', + defaultMessage: 'Let edX be your guide', + description: 'Subheading to the Skills Builder title in the header component', + }, +}); + +export default messages; diff --git a/src/skills-builder/skills-builder-header/skillsBuilderHeader.scss b/src/skills-builder/skills-builder-header/skillsBuilderHeader.scss new file mode 100644 index 000000000..1d47b42f9 --- /dev/null +++ b/src/skills-builder/skills-builder-header/skillsBuilderHeader.scss @@ -0,0 +1,8 @@ +.vertical-line { + border-left: 7px solid #D23228; + transform: rotate(13deg); +} + +.header-title { + color: #F0CC00; +} diff --git a/src/skills-builder/skills-builder-modal/SkillsBuilderModal.jsx b/src/skills-builder/skills-builder-modal/SkillsBuilderModal.jsx index 1019b944f..e6f0e298e 100644 --- a/src/skills-builder/skills-builder-modal/SkillsBuilderModal.jsx +++ b/src/skills-builder/skills-builder-modal/SkillsBuilderModal.jsx @@ -3,8 +3,8 @@ import { ActionRow, Button, Container, - FullscreenModal, Form, + ModalDialog, } from '@edx/paragon'; import { FormattedMessage } from '@edx/frontend-platform/i18n'; import { @@ -12,6 +12,9 @@ import { } from '../data/actions'; import messages from './messages'; import { SkillsBuilderContext } from '../skills-builder-context'; +import { SkillsBuilderHeader } from '../skills-builder-header'; + +import headerImage from '../images/headerImage.png'; const SkillsBuilderModal = () => { const onCloseHandle = () => { @@ -19,15 +22,42 @@ const SkillsBuilderModal = () => { }; const [state, dispatch] = useContext(SkillsBuilderContext); - const [learnerGoal, setLearnerGoal] = useState(''); return ( - + + + + + + + + + + +

Your current goal: {state.currentGoal}

+
+ + setLearnerGoal(e.target.value)} + /> + + +
+
+ - )} - > - -

Your current goal: {state.currentGoal}

-
- - setLearnerGoal(e.target.value)} - /> - - -
-
+ + ); }; diff --git a/src/skills-builder/skills-builder-modal/skillsBuilderModal.scss b/src/skills-builder/skills-builder-modal/skillsBuilderModal.scss new file mode 100644 index 000000000..f3cf538a1 --- /dev/null +++ b/src/skills-builder/skills-builder-modal/skillsBuilderModal.scss @@ -0,0 +1,9 @@ +.skills-builder-modal { + .pgn__modal-close-button{ + color: #ffffff !important; + } + + .pgn__modal-hero-bg { + background-color: #00262B; + } +} diff --git a/src/skills-builder/test/SkillsBuilder.test.jsx b/src/skills-builder/test/SkillsBuilder.test.jsx index ef2fda900..a99573722 100644 --- a/src/skills-builder/test/SkillsBuilder.test.jsx +++ b/src/skills-builder/test/SkillsBuilder.test.jsx @@ -1,7 +1,7 @@ import { IntlProvider } from '@edx/frontend-platform/i18n'; -import { mount } from 'enzyme'; import React from 'react'; import { SkillsBuilder } from '..'; +import { screen, render } from '@testing-library/react'; const SkillsBuilderWrapper = () => ( @@ -11,9 +11,9 @@ const SkillsBuilderWrapper = () => ( describe('skills-builder', () => { it('should render a Skills Builder modal', () => { - const component = ; - const wrapper = mount(component); - const modal = wrapper.find(SkillsBuilder); - expect(modal.find('h2').text()).toBe('Skills Builder'); + render( + + ); + expect(screen.getByText("Skills Builder")).toBeTruthy(); }); });