Compare commits

..

46 Commits

Author SHA1 Message Date
Bilal Qamar
091bc7738a refactor: updated frontend-platform & paragon version 2024-01-17 18:06:46 +05:00
Bilal Qamar
8930ebcb6a Merge branch master into bilalqamar95/react-upgrade-to-v17 2024-01-17 17:57:43 +05:00
Omar Al-Ithawi
6e4ae9d976 feat: add ATLAS_OPTIONS and lib-components and frontend-platform deps (#187) 2024-01-09 11:51:56 -05:00
mashal-m
1312f4a952 refactor: replace open/paragon with @edx/paragon 2023-12-21 14:25:43 +05:00
mashal-m
006b4d818a refactor: replace edx/paragon with @openedx/paragon 2023-12-20 14:15:06 +05:00
arbrandes
e863eef77d chore: update browserslist DB 2023-12-15 14:57:36 -03:00
arbrandes
ff900335a1 chore: update browserslist DB 2023-12-04 11:23:40 -03:00
arbrandes
c0dc0cbad6 chore: update browserslist DB 2023-11-28 11:42:45 -03:00
arbrandes
83aec7318e chore: update browserslist DB 2023-11-20 12:31:27 -03:00
Ihor Romaniuk
a037f5b340 fix: date format depends on locale date format (#175) 2023-11-16 07:05:57 -03:00
Omar Al-Ithawi
91402fbf12 feat!: remove broken transifex and use atlas exclusively | FC-0012 (#164)
* feat!: remove broken transifex and use atlas exclusively

* feat: install openedx-atlas
2023-11-15 15:10:50 -05:00
o.bugaenko
7a299eb064 fix: wrong id placement on the h1 tag 2023-11-14 16:13:56 -03:00
arbrandes
90e8eeeb50 chore: update browserslist DB 2023-11-14 13:04:20 -03:00
vladislavkeblysh
f25ce0b95d feat: fixed layout 2023-11-14 12:32:37 -03:00
Stanislav Lunyachek
98db1a4a35 fix: Missed favicon in Safari 2023-11-14 12:23:58 -03:00
Muhammad Abdullah Waheed
cf4b632c55 feat: babel-plugin-react-intl to babel-plugin-formatjs migration (#151)
* feat: babel-plugin-react-intl to babel-plugin-formatjs migration

* fix: upgraded frontend-build to fix security issue
2023-11-14 12:58:07 +05:00
Mashal Malik
0720b2feae refactor: add @openedx in renovate automate configuration (#150) 2023-11-01 12:38:32 -03:00
Bilal Qamar
8b2576f0c4 Merge branch master into bilalqamar95/react-upgrade-to-v17 2023-10-24 14:46:16 +05:00
Bilal Qamar
2b5aaadd87 Merge branch master into bilalqamar95/react-upgrade-to-v17 2023-10-24 14:42:30 +05:00
Bilal Qamar
0ef1456773 feat: bumped frontend-platform to v6 2023-10-24 14:32:13 +05:00
Jason Wesson
56e1781004 Merge pull request #145 from openedx/update-browserslist-db
Update browserslist DB
2023-10-23 13:07:18 -07:00
arbrandes
83eb21bb9a chore: update browserslist DB 2023-10-23 00:07:35 +00:00
Feanil Patel
18ddb35e1e chore: Update to the new version of brand-openedx in the new scope. (#165)
Part of https://github.com/openedx/axim-engineering/issues/23

This updates the `@edx/brand` alias to point to the `brand-openedx` package at
the `openedx` scope. This does not impact imports because this package is used
via an alias.
2023-10-20 17:26:49 -04:00
Syed Ali Abbas Zaidi
ae93b68d57 chore: bump frontend-platform (#158) 2023-10-12 18:41:58 +05:00
mashal-m
7ce2a61233 refactor: update lock file version 2023-09-22 10:49:43 -03:00
Awais Ansari
2de12997ce Merge pull request #122 from openedx/Ali-Abbas/react-router-upgrade
feat: upgrade react router to v6
2023-09-05 18:10:45 +05:00
Syed Ali Abbas Zaidi
f6c8cfa906 build: update header and footer 2023-08-21 17:22:24 +05:00
Syed Ali Abbas Zaidi
db181a7945 Merge branch 'master' of github.com:openedx/frontend-app-communications into Ali-Abbas/react-router-upgrade 2023-08-08 16:38:54 +05:00
arbrandes
840449f71b chore: update browserslist DB 2023-07-31 16:38:23 +01:00
Adolfo R. Brandes
01f1793414 chore: add catalog-info.yaml 2023-07-31 16:36:18 +01:00
Jhon Vente
ce45c8012d [DOCS] Readme updated according OEP-55 (#141)
* docs: readme updated with frontend-template-app readme ref
* fix: change main branch to master, spelling and getting help url
2023-07-07 08:49:27 -04:00
edX requirements bot
7224785682 chore: update browserslist DB (#142)
Co-authored-by: justinhynes <justinhynes@users.noreply.github.com>
2023-07-06 13:38:59 -04:00
Bilal Qamar
6d27b7082d feat: update react & react-dom to v17 (#131)
* feat: update react & react-dom to v17
* build: update paragon version
* refactor: updated edx packages
---------
Co-authored-by: mashal-m <mashal.malik@arbisoft.com>
2023-07-06 12:28:41 -04:00
edX requirements bot
c90bdb1ac7 chore: update browserslist DB (#132)
Co-authored-by: arbrandes <arbrandes@users.noreply.github.com>
2023-06-21 13:09:55 -04:00
Adolfo R. Brandes
090968e2f2 feat: Runtime config support, take 2
Adds a couple of missing features for proper runtime configuration:

1. Favicon runtime configuration support via react-helmet

2. Placeholder values for APP_ID and MFE_CONFIG_API_URL in the sample
   .env files
2023-06-14 15:33:43 +01:00
Tobias Macey
765857f380 fix: Disable URL rewriting when creating links
The default behavior of the TinyMCE editor is to rewrite links that share the same
domain as the component to be relative to that path. Relative URLs will never work in
email contents, so they _always_ need to be absolute URLs. This adds the configuration
settings for `relative_urls` and `remove_script_host` in TinyMCE to always be false,
enabling it to always use absolute URLs. See
[here](https://www.tiny.cloud/docs/configure/url-handling/) for reference.
2023-06-12 19:18:12 +01:00
edX requirements bot
0eec29a458 chore: update browserslist DB (#128)
Co-authored-by: arbrandes <arbrandes@users.noreply.github.com>
2023-06-05 15:06:12 -04:00
Mashal Malik
c2b4d04b5d Migrate off paragon modal deprecated component (#95)
* refactor: migrate off paragon modal deprecated component

* refactor: migrate off paragon modal deprecated component

* refactor: resource the close button string

* refactor: remove extra file

* refactor: add message in messages  file
2023-06-05 14:47:53 -04:00
Ghassan Maslamani
a198557e67 fix: getting course-id when public path is set (#127) 2023-06-01 14:30:35 -03:00
Muhammad Abdullah Waheed
4493eb71fa feat: automate browserlist DB update (#92) 2023-05-23 10:08:33 -03:00
Adolfo R. Brandes
559a1061b6 Merge pull request #125 from arbrandes/runtime-config 2023-05-23 08:54:59 -03:00
Adolfo R. Brandes
53fa594207 feat: Support runtime configuration
frontend-platform supports runtime configuration since 2.5.0 (see the PR
that introduced it[1], but it requires MFE cooperation.  This implements
just that: by avoiding making configuration values constant, it should
now be possible to change them after initialization.

Only a single change related to the `LMS_BASE_URL` setting was required.

[1] openedx/frontend-platform#335
2023-05-22 10:00:22 -03:00
Mashal Malik
0c34d86610 feat: upgrade to node v18 and related fixes (#123) 2023-05-17 14:19:00 -03:00
Syed Ali Abbas Zaidi
05d16cf231 Merge branch 'master' of github.com:openedx/frontend-app-communications into Ali-Abbas/react-router-upgrade 2023-05-16 16:13:15 +05:00
Omar Al-Ithawi
55a0ddb8d2 feat: use atlas in make pull_translations (#124)
Changes
-------
 - Bump frontend-platform to bring intl-imports.js script
 - Move all i18n imports into `src/i18n/index.js` so intl-imports.js can
   override it with latest translations
 - Add `atlas` into `make pull_translations` when `OPENEDX_ATLAS_PULL`
   environment variable is set.
 - Fixed lint rules for frontend-platform@4.1.0
 - Mock useTrackColorSchemeChoice to avoid test failures

Refs: [FC-0012 project](https://openedx.atlassian.net/l/cp/XGS0iCcQ) implementing Translation Infrastructure OEP-58.
2023-05-09 10:08:36 -04:00
Syed Ali Abbas Zaidi
81a5f89f36 feat: upgrade react router to v6 2023-03-21 14:26:08 +05:00
14 changed files with 6924 additions and 10051 deletions

View File

@@ -10,4 +10,4 @@ on:
jobs:
version-check:
uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master
uses: openedx/.github/.github/workflows/lockfile-check.yml@master

View File

@@ -0,0 +1,12 @@
name: Update Browserslist DB
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
update-browserslist:
uses: openedx/.github/.github/workflows/update-browserslist-db.yml@master
secrets:
requirements_bot_github_token: ${{ secrets.requirements_bot_github_token }}

View File

@@ -4,14 +4,14 @@ i18n = ./src/i18n
transifex_input = $(i18n)/transifex_input.json
# This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-react-intl
transifex_temp = ./temp/babel-plugin-formatjs
precommit:
npm run lint
npm audit
requirements:
npm install
npm ci
i18n.extract:
# Pulling display strings from .jsx files into .json files...
@@ -33,13 +33,15 @@ pull_translations:
rm -rf src/i18n/messages
mkdir src/i18n/messages
cd src/i18n/messages \
&& atlas pull \
&& atlas pull $(ATLAS_OPTIONS) \
translations/frontend-component-header/src/i18n/messages:frontend-component-header \
translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \
translations/paragon/src/i18n/messages:paragon \
translations/frontend-lib-content-components/src/i18n/messages:frontend-lib-content-components \
translations/frontend-platform/src/i18n/messages:frontend-platform \
translations/frontend-app-communications/src/i18n/messages:frontend-app-communications
$(intl_imports) frontend-component-header frontend-component-footer paragon frontend-app-communications
$(intl_imports) frontend-component-header frontend-component-footer paragon frontend-lib-content-components frontend-platform frontend-app-communications
# This target is used by Travis.
validate-no-uncommitted-package-lock-changes:

View File

@@ -1,45 +1,48 @@
|Codecov| |license|
.. |codecov| image:: https://codecov.io/gh/edx/frontend-app-learning/branch/master/graph/badge.svg?token=3z7XvuzTq3
:target: https://codecov.io/gh/edx/frontend-app-communications
.. |license| image:: https://img.shields.io/badge/license-AGPL-informational
:target: https://github.com/edx/frontend-app-account/blob/master/LICENSE
frontend-app-communications
==============================
#############################
Please tag **edx-aperture** on any PRs or issues. Thanks!
|license-badge| |status-badge| |ci-badge| |codecov-badge|
Introduction
------------
A tool used by course teams to communicate with thier learners. The interface for anything related to instructor to learner communications. Instructor bulk email, for example.
Purpose
*******
A tool used by course teams to communicate with their learners. The interface for anything related to instructor to learner communications. Instructor bulk email, for example.
Getting started
------------
For now, this repo is not intergrated with devstack. You'll be running the app locally and not through docker. This does make setup a little easier.
1. Clone the repo into your usual workspace
Cloning and Startup
===================
.. code-block::
1. Clone your new repo:
mkdir -p ~/workspace/
cd ~/workspace/
git clone https://github.com/edx/frontend-app-communications.git
``git clone https://github.com/edx/frontend-app-communications.git``
2. Install frontend dependencies
2. Use node v18.x.
.. code-block::
The current version of the micro-frontend build scripts support node 18.
Using other major versions of node *may* work, but this is unsupported. For
convenience, this repository includes an .nvmrc file to help in setting the
correct node version via `nvm <https://github.com/nvm-sh/nvm>`_.
npm i
3. Install npm dependencies:
3. Start the devserver. The app will be running at ``localhost:1984``, or whatever port you change it too.
``cd frontend-app-communications && npm install``
.. code-block::
4. Update the application port to use for local development:
Default port is 1984. If this does not work for you, update the line
`PORT=1984` to your port in all .env.* files
5. Start the devserver. The app will be running at ``localhost:1984``, or whatever port you change it too.
.. code-block::
npm start
npm start
Environment Variables/Setup Notes
---------------------------------
@@ -65,3 +68,96 @@ Tests use `jest` and `react-test-library`. To run all the tests for this repo:
.. code-block::
npm test
**Production Build**
The production build is created with ``npm run build``.
Internationalization
====================
Please see refer to the `frontend-platform i18n howto`_ for documentation on
internationalization.
.. _frontend-platform i18n howto: https://github.com/openedx/frontend-platform/blob/master/docs/how_tos/i18n.rst
Getting Help
************
If you're having trouble, we have discussion forums at
https://discuss.openedx.org where you can connect with others in the community.
Our real-time conversations are on Slack. You can request a `Slack
invitation`_, then join our `community Slack workspace`_. Because this is a
frontend repository, the best place to discuss it would be in the `#wg-frontend
channel`_.
For anything non-trivial, the best path is to open an issue in this repository
with as many details about the issue you are facing as you can provide.
https://github.com/openedx/frontend-app-communications/issues
For more information about these options, see the `Getting Help`_ page.
.. _Slack invitation: https://openedx.org/slack
.. _community Slack workspace: https://openedx.slack.com/
.. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6
.. _Getting Help: https://openedx.org/community/connect
License
*******
The code in this repository is licensed under the AGPLv3 unless otherwise
noted.
Please see `LICENSE <LICENSE>`_ for details.
Contributing
************
Contributions are very welcome. Please read `How To Contribute`_ for details.
.. _How To Contribute: https://openedx.org/r/how-to-contribute
This project is currently accepting all types of contributions, bug fixes,
security fixes, maintenance work, or new features. However, please make sure
to have a discussion about your new feature idea with the maintainers prior to
beginning development to maximize the chances of your change being accepted.
You can start a conversation by creating a new issue on this repo summarizing
your idea.
The Open edX Code of Conduct
****************************
All community members are expected to follow the `Open edX Code of Conduct`_.
.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
People
******
The assigned maintainers for this component and other project details may be
found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
file in this repo.
.. _Backstage: https://open-edx-backstage.herokuapp.com/catalog/default/component/frontend-app-communications
Reporting Security Issues
*************************
Please do not report security issues in public, and email security@openedx.org instead.
.. |license-badge| image:: https://img.shields.io/github/license/openedx/frontend-app-communications.svg
:target: https://github.com/openedx/frontend-app-communications/blob/master/LICENSE
:alt: License
.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
.. |ci-badge| image:: https://github.com/openedx/frontend-app-communications/actions/workflows/ci.yml/badge.svg
:target: https://github.com/openedx/frontend-app-communications/actions/workflows/ci.yml
:alt: Continuous Integration
.. |codecov-badge| image:: https://codecov.io/github/openedx/frontend-app-communications/coverage.svg?branch=master
:target: https://codecov.io/github/openedx/frontend-app-communications?branch=master
:alt: Codecov

18
catalog-info.yaml Normal file
View File

@@ -0,0 +1,18 @@
# This file records information about this repo. Its use is described in OEP-55:
# https://open-edx-proposals.readthedocs.io/en/latest/processes/oep-0055-proc-project-maintainers.html
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: "frontend-app-communications"
description: "A tool used by course teams to communicate with their learners."
links:
- url: "https://github.com/openedx/frontend-app-communications/blob/master/README.rst"
title: "README"
icon: "Article"
annotations:
openedx.org/arch-interest-groups: ""
spec:
owner: group:frontend-all
type: "service"
lifecycle: "production"

16656
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,7 @@
],
"scripts": {
"build": "fedx-scripts webpack",
"i18n_extract": "BABEL_ENV=i18n fedx-scripts babel src --quiet > /dev/null",
"i18n_extract": "fedx-scripts formatjs extract",
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx .",
"snapshot": "fedx-scripts jest --updateSnapshot",
@@ -33,12 +33,12 @@
"url": "https://github.com/edx/frontend-app-communications/issues"
},
"dependencies": {
"@edx/brand": "npm:@edx/brand-openedx@1.1.0",
"@edx/frontend-component-footer": "^12.0.0",
"@edx/frontend-component-header": "^4.0.0",
"@edx/frontend-platform": "^4.2.0",
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/frontend-component-footer": "12.5.0",
"@edx/frontend-component-header": "4.8.0",
"@edx/frontend-platform": "6.2.0",
"@edx/openedx-atlas": "^0.5.0",
"@edx/paragon": "^20.20.0",
"@edx/paragon": "21.5.6",
"@edx/tinymce-language-selector": "1.1.0",
"@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-brands-svg-icons": "5.15.4",
@@ -52,26 +52,26 @@
"jquery": "3.6.1",
"popper.js": "1.16.1",
"prop-types": "15.8.1",
"react": "16.14.0",
"react-dom": "16.14.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-helmet": "^6.1.0",
"react-redux": "7.2.9",
"react-router": "5.3.4",
"react-router-dom": "5.3.4",
"react-router": "6.15.0",
"react-router-dom": "6.15.0",
"redux": "4.2.0",
"regenerator-runtime": "0.13.11",
"tinymce": "5.10.7"
},
"devDependencies": {
"@edx/browserslist-config": "^1.2.0",
"@edx/frontend-build": "^12.7.0",
"@edx/frontend-build": "13.0.1",
"@edx/reactifex": "^2.1.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.5",
"axios-mock-adapter": "1.21.2",
"glob": "7.2.3",
"husky": "7.0.4",
"jest": "27.5.1",
"jest": "29.7.0",
"prettier": "2.8.1",
"rosie": "2.1.0"
}

View File

@@ -24,7 +24,7 @@
"automerge": true
},
{
"matchPackagePatterns": ["@edx"],
"matchPackagePatterns": ["@edx", "@openedx"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
}

View File

@@ -24,7 +24,7 @@ export default function BulkEmailTool() {
<Container size="md">
<BackToInstructor courseId={courseId} />
<div className="row pb-4.5">
<h1 className="text-primary-500" id="main-content">
<h1 className="text-primary-500">
<FormattedMessage
id="bulk.email.send.email.header"
defaultMessage="Send an email"

View File

@@ -1,6 +1,6 @@
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { Button, Modal } from '@edx/paragon';
import { ActionRow, Button, ModalDialog } from '@edx/paragon';
import { FormattedMessage, injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import messages from './messages';
import { BulkEmailContext } from '../bulk-email-context';
@@ -12,10 +12,13 @@ function ViewEmailModal({
const [, dispatch] = useContext(BulkEmailContext);
return (
<div>
<Modal
open={isOpen}
title=""
body={(
<ModalDialog
isOpen={isOpen}
onClose={() => setModalOpen(false)}
hasCloseButton
>
<ModalDialog.Body>
<div>
<div className="d-flex flex-row">
<p>{intl.formatMessage(messages.modalMessageSubject)}</p>
@@ -40,24 +43,30 @@ function ViewEmailModal({
<div dangerouslySetInnerHTML={{ __html: messageContent.email.html_message }} />
</div>
</div>
)}
onClose={() => setModalOpen(false)}
buttons={[
<Button
onClick={() => {
dispatch(
copyToEditor({
emailBody: messageContent.email.html_message,
emailSubject: messageContent.subject,
}),
);
setModalOpen(false);
}}
>
<FormattedMessage id="bulk.email.tool.copy.message.button" defaultMessage="Copy to editor" />
</Button>,
]}
/>
</ModalDialog.Body>
<ModalDialog.Footer>
<ActionRow>
<ModalDialog.CloseButton variant="link">
<FormattedMessage id="bulk.email.tool.close.modalDialog.button" defaultMessage="Close" />
</ModalDialog.CloseButton>
<Button
onClick={() => {
dispatch(
copyToEditor({
emailBody: messageContent.email.html_message,
emailSubject: messageContent.subject,
}),
);
setModalOpen(false);
}}
variant="primary"
>
<FormattedMessage id="bulk.email.tool.copy.message.button" defaultMessage="Copy to editor" />
</Button>
</ActionRow>
</ModalDialog.Footer>
</ModalDialog>
</div>
);
}

View File

@@ -34,6 +34,10 @@ const messages = defineMessages({
id: 'bulk.email.content.history.table.modal.messageBody',
defaultMessage: 'Message:',
},
modalCloseButton: {
id: 'bulk.email.tool.close.modalDialog.button',
defaultMessage: 'Close',
},
emailHistoryTableViewMessageInstructions: {
id: 'bulk.email.content.history.table.viewMessageInstructions',
defaultMessage: 'To read a sent email message, click the `View Message` button within the table.',

View File

@@ -59,18 +59,20 @@ export default function PageContainer(props) {
if (courseMetadata) {
return (
<CourseMetadataContext.Provider value={courseMetadata}>
<Header
className="learning-header"
courseOrg={courseMetadata.org}
courseNumber={courseMetadata.number}
courseTitle={courseMetadata.title}
/>
<div className="pb-3 container">
<main>
{children}
</main>
</div>
<Footer />
<>
<Header
className="learning-header"
courseOrg={courseMetadata.org}
courseNumber={courseMetadata.number}
courseTitle={courseMetadata.title}
/>
<div className="pb-3 container">
<main id="main-content">
{children}
</main>
</div>
<Footer />
</>
</CourseMetadataContext.Provider>
);
}

View File

@@ -8,7 +8,7 @@ import { AppProvider, AuthenticatedPageRoute, ErrorPage } from '@edx/frontend-pl
import ReactDOM from 'react-dom';
import { Helmet } from 'react-helmet';
import { Switch } from 'react-router-dom';
import { Routes, Route } from 'react-router-dom';
import messages from './i18n';
import './index.scss';
@@ -21,13 +21,18 @@ subscribe(APP_READY, () => {
<Helmet>
<link rel="shortcut icon" href={getConfig().FAVICON_URL} type="image/x-icon" />
</Helmet>
<Switch>
<AuthenticatedPageRoute path="/courses/:courseId/bulk_email">
<PageContainer>
<BulkEmailTool />
</PageContainer>
</AuthenticatedPageRoute>
</Switch>
<Routes>
<Route
path="/courses/:courseId/bulk_email"
element={(
<AuthenticatedPageRoute>
<PageContainer>
<BulkEmailTool />
</PageContainer>
</AuthenticatedPageRoute>
)}
/>
</Routes>
</AppProvider>,
document.getElementById('root'),
);

View File

@@ -14,6 +14,7 @@ jest.mock('@edx/frontend-platform/react/hooks', () => ({
...jest.requireActual('@edx/frontend-platform/react/hooks'),
useTrackColorSchemeChoice: jest.fn(),
}));
Object.defineProperty(window, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation((query) => ({