From d8f3c7441efae4c0e8b4d5abe7f6c057864c932b Mon Sep 17 00:00:00 2001
From: Chris Deery <3932645+cdeery@users.noreply.github.com>
Date: Tue, 19 Oct 2021 10:37:22 -0400
Subject: [PATCH] feat: [AA-906] UI for WeeklyLearningGoals (#664)
* feat: [AA-906] UI for WeeklyLearningGoals
Add component to OutlineTab for selecting Weekly Learning Goals
Move start button to before course outline, and put in card with Call to action.
Unit tests
Implement temporary a11y feedback
add react-responsive as a dependency
Everything except for the start/resume button move is behind a waffle flag: course_goals.number_of_days_goals
---
package-lock.json | 13 +++
package.json | 1 +
.../AccountActivationAlert.jsx | 27 ++---
src/alerts/logistration-alert/messages.js | 11 ++
.../__factories__/outlineTabData.factory.js | 3 +
.../data/__snapshots__/redux.test.js.snap | 3 +
src/course-home/data/api.js | 11 +-
src/course-home/data/index.js | 3 +-
src/course-home/data/redux.test.js | 2 +-
src/course-home/data/thunks.js | 11 +-
src/course-home/outline-tab/OutlineTab.jsx | 46 ++++----
.../outline-tab/OutlineTab.test.jsx | 110 +++++++++++++++++-
src/course-home/outline-tab/messages.js | 77 ++++++++++--
...lCard.jsx => DeprecatedCourseGoalCard.jsx} | 10 +-
.../outline-tab/widgets/FlagButton.jsx | 32 +++++
.../outline-tab/widgets/FlagButton.scss | 25 ++++
.../widgets/LearningGoalButton.jsx | 83 +++++++++++++
.../widgets/StartOrResumeCourseCard.jsx | 65 +++++++++++
.../widgets/UpdateGoalSelector.jsx | 4 +-
.../widgets/WeeklyLearningGoalCard.jsx | 109 +++++++++++++++++
.../outline-tab/widgets/flag_gray.svg | 18 +++
.../outline-tab/widgets/flag_outline.svg | 3 +
src/index.scss | 1 +
23 files changed, 603 insertions(+), 65 deletions(-)
create mode 100644 src/alerts/logistration-alert/messages.js
rename src/course-home/outline-tab/widgets/{CourseGoalCard.jsx => DeprecatedCourseGoalCard.jsx} (90%)
create mode 100644 src/course-home/outline-tab/widgets/FlagButton.jsx
create mode 100644 src/course-home/outline-tab/widgets/FlagButton.scss
create mode 100644 src/course-home/outline-tab/widgets/LearningGoalButton.jsx
create mode 100644 src/course-home/outline-tab/widgets/StartOrResumeCourseCard.jsx
create mode 100644 src/course-home/outline-tab/widgets/WeeklyLearningGoalCard.jsx
create mode 100644 src/course-home/outline-tab/widgets/flag_gray.svg
create mode 100644 src/course-home/outline-tab/widgets/flag_outline.svg
diff --git a/package-lock.json b/package-lock.json
index b52de281..e9e6558b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3802,6 +3802,19 @@
"react-transition-group": "^4.0.0",
"tabbable": "^4.0.0",
"uncontrollable": "7.2.1"
+ },
+ "dependencies": {
+ "react-responsive": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/react-responsive/-/react-responsive-8.2.0.tgz",
+ "integrity": "sha512-iagCqVrw4QSjhxKp3I/YK6+ODkWY6G+YPElvdYKiUUbywwh9Ds0M7r26Fj2/7dWFFbOpcGnJE6uE7aMck8j5Qg==",
+ "requires": {
+ "hyphenate-style-name": "^1.0.0",
+ "matchmediaquery": "^0.3.0",
+ "prop-types": "^15.6.1",
+ "shallow-equal": "^1.1.0"
+ }
+ }
}
},
"@formatjs/ecma402-abstract": {
diff --git a/package.json b/package.json
index 83392d24..b031836e 100644
--- a/package.json
+++ b/package.json
@@ -54,6 +54,7 @@
"react-dom": "17.0.2",
"react-helmet": "6.1.0",
"react-redux": "7.2.5",
+ "react-responsive": "8.2.0",
"react-router": "5.2.1",
"react-router-dom": "5.3.0",
"react-share": "4.4.0",
diff --git a/src/alerts/logistration-alert/AccountActivationAlert.jsx b/src/alerts/logistration-alert/AccountActivationAlert.jsx
index bbb9f565..dcdd06d7 100644
--- a/src/alerts/logistration-alert/AccountActivationAlert.jsx
+++ b/src/alerts/logistration-alert/AccountActivationAlert.jsx
@@ -9,10 +9,13 @@ import {
Icon,
} from '@edx/paragon';
import { Check, ArrowForward } from '@edx/paragon/icons';
-import { FormattedMessage, injectIntl } from '@edx/frontend-platform/i18n';
+import { FormattedMessage, injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { sendActivationEmail } from '../../courseware/data';
+import messages from './messages';
-function AccountActivationAlert() {
+function AccountActivationAlert({
+ intl,
+}) {
const [showModal, setShowModal] = useState(false);
const [showSpinner, setShowSpinner] = useState(false);
const [showCheck, setShowCheck] = useState(false);
@@ -29,22 +32,12 @@ function AccountActivationAlert() {
if (showAccountActivationAlert !== undefined) {
Cookies.remove('show-account-activation-popup', { path: '/', domain: process.env.SESSION_COOKIE_DOMAIN });
// extra check to make sure cookie was removed before updating the state. Updating the state without removal
- // of cookie would make it infinit rendering
+ // of cookie would make it infinite rendering
if (Cookies.get('show-account-activation-popup') === undefined) {
setShowModal(true);
}
}
- const title = (
-
-
-
- );
-
const button = (