-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:openedx/frontend-app-admin-portal…
… into Ali-Abbas/react-router-upgrade
- Loading branch information
Showing
385 changed files
with
45,632 additions
and
37,720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# App Specific | ||
|
||
# Note: The Algolia APP_ID and SEARCH_API_KEY are secret and must be configured via `.env.private`. | ||
ALGOLIA_APP_ID="" | ||
ALGOLIA_SEARCH_API_KEY="" | ||
|
||
BASE_URL="https://localhost.stage.edx.org:1991" | ||
LICENSE_MANAGER_BASE_URL="https://license-manager.stage.edx.org" | ||
ENTERPRISE_ACCESS_BASE_URL="https://enterprise-access.stage.edx.org" | ||
ENTERPRISE_CATALOG_BASE_URL="https://enterprise-catalog.stage.edx.org" | ||
ENTERPRISE_SUBSIDY_BASE_URL="https://enterprise-subsidy.stage.edx.org" | ||
DISCOVERY_BASE_URL="https://discovery.stage.edx.org" | ||
PLOTLY_SERVER_URL="https://enterprise-dash.edx.org/admin-analytics/" | ||
SEGMENT_KEY="" | ||
NEW_RELIC_AGENT_ID="" | ||
NEW_RELIC_APP_ID="" | ||
ALGOLIA_INDEX_NAME="enterprise_catalog_new" | ||
FEATURE_PROGRAM_TITLES_FACET='true' | ||
FEATURE_LANGUAGE_FACET='true' | ||
FEATURE_CODE_MANAGEMENT='true' | ||
FEATURE_REPORTING_CONFIGURATIONS='true' | ||
FEATURE_ANALYTICS='true' | ||
FEATURE_SUPPORT='true' | ||
FEATURE_SAML_CONFIGURATION='' | ||
FEATURE_CODE_VISIBILITY='true' | ||
FEATURE_EXTERNAL_LMS_CONFIGURATION='' | ||
FEATURE_BULK_ENROLLMENT='true' | ||
FEATURE_FILE_ATTACHMENT='true' | ||
FEATURE_SETTINGS_PAGE='true' | ||
FEATURE_SETTINGS_PAGE_LMS_TAB='true' | ||
FEATURE_SETTINGS_PAGE_APPEARANCE_TAB='true' | ||
FEATURE_LEARNER_CREDIT_MANAGEMENT='true' | ||
FEATURE_CONTENT_HIGHLIGHTS='true' | ||
FEATURE_AUTH0_SELF_SERVICE_INTEGRATION='false' | ||
HOTJAR_DEBUG='' | ||
HOTJAR_APP_ID='' | ||
FEATURE_SSO_SETTINGS_TAB='true' | ||
FEATURE_API_CREDENTIALS_TAB='true' | ||
FEATURE_PENDING_ENROLLMENT_ACTIONS='false' | ||
# maintenance alert | ||
IS_MAINTENANCE_ALERT_ENABLED='' | ||
MAINTENANCE_ALERT_MESSAGE='edX is currently in a brief maintenance window. Functionality involving course enrollments is unavailable at this time, including enrollment and assignment. Please check back shortly to continue the learning journey.' | ||
MAINTENANCE_ALERT_START_TIMESTAMP='' | ||
|
||
# Common | ||
|
||
LMS_BASE_URL="https://courses.stage.edx.org" | ||
STUDIO_BASE_URL="https://studio.stage.edx.org" | ||
DATA_API_BASE_URL="https://analyticsapi.stage.edx.org" | ||
ECOMMERCE_BASE_URL="https://ecommerce.stage.edx.org" | ||
DISCOVERY_API_BASE_URL="https://discovery.stage.edx.org" | ||
PUBLISHER_BASE_URL="https://publisher.stage.edx.org/" | ||
CREDENTIALS_BASE_URL="https://credentials.stage.edx.org" | ||
ENTERPRISE_CATALOG_API_BASE_URL="https://enterprise-catalog.stage.edx.org" | ||
INSIGHTS_BASE_URL="https://stage-insights.edx.org" | ||
LEARNING_BASE_URL="https://learning.stage.edx.org" | ||
LOGIN_URL="https://courses.stage.edx.org/login" | ||
LOGOUT_URL="https://courses.stage.edx.org/logout" | ||
MARKETING_SITE_BASE_URL="https://stage.edx.org" | ||
ORDER_HISTORY_URL="https://orders.stage.edx.org/orders" | ||
ENTERPRISE_MARKETING_URL="https://business.edx.org" | ||
REGISTRAR_API_BASE_URL="https://registrar.stage.edx.org/api" | ||
OPTIMIZELY_PROJECT_ID="1706490390" | ||
ENTERPRISE_LEARNER_PORTAL_HOSTNAME="enterprise.stage.edx.org" | ||
ENTERPRISE_LEARNER_PORTAL_URL="https://enterprise.stage.edx.org" | ||
DEMOGRAPHICS_BASE_URL="https://demographics.stage.edx.org" | ||
EXAMS_BASE_URL="https://edx-exams.stage.edx.org" | ||
ACCOUNT_SETTINGS_URL="https://account.stage.edx.org" | ||
ACCOUNT_PROFILE_URL="https://profile.stage.edx.org" | ||
SUPPORT_URL="https://support.edx.org" | ||
ENTERPRISE_SUPPORT_URL="https://business-support.edx.org/hc/en-us" | ||
ENTERPRISE_SUPPORT_PROGRAM_OPTIMIZATION_URL="https://business.edx.org/hubfs/Onboarding%20and%20Engagement/Onboarding%20Assets/Admin%20Resources/Program%20Optimization.pdf?hsLang=en" | ||
ENTERPRISE_SUPPORT_LEARNER_CREDIT_URL='http://stage.edx.org' | ||
CONTACT_URL="https://courses.stage.edx.org/support/contact_us" | ||
OPEN_SOURCE_URL="https://open.edx.org" | ||
TERMS_OF_SERVICE_URL="https://stage.edx.org/edx-terms-service" | ||
PRIVACY_POLICY_URL="https://stage.edx.org/edx-privacy-policy" | ||
SPANISH_PRIVACY_POLICY_URL="https://stage.edx.org/es/edx-privacy-policy" | ||
SEARCH_CATALOG_URL="https://stage.edx.org/search" | ||
FACEBOOK_URL="https://www.facebook.com/edX" | ||
TWITTER_URL="https://twitter.com/edXOnline" | ||
YOU_TUBE_URL="https://www.youtube.com/user/edxonline" | ||
LINKED_IN_URL="https://www.linkedin.com/school/edx/" | ||
GOOGLE_PLUS_URL="https://plus.google.com/+edXOnline" | ||
REDDIT_URL="https://www.reddit.com/r/edx" | ||
APPLE_APP_STORE_URL="https://itunes.apple.com/us/app/edx/id945480667?mt=8" | ||
GOOGLE_PLAY_URL="https://play.google.com/store/apps/details?id=org.edx.mobile" | ||
ENTERPRISE_SUPPORT_REVOKE_LICENSE_URL="https://business-support.edx.org/hc/en-us/articles/4409008473495" | ||
LANGUAGE_PREFERENCE_COOKIE_NAME="stage-edx-language-preference" | ||
NEW_RELIC_ACCOUNT_ID="" | ||
NEW_RELIC_LICENSE_KEY="" | ||
NEW_RELIC_TRUST_KEY="" | ||
ACCESS_TOKEN_COOKIE_NAME="stage-edx-jwt-cookie-header-payload" | ||
USER_INFO_COOKIE_NAME="stage-edx-user-info" | ||
REFRESH_ACCESS_TOKEN_ENDPOINT="https://courses.stage.edx.org/login_refresh" | ||
CSRF_TOKEN_API_PATH="/csrf/api/v1/token" | ||
SITE_NAME="edX" | ||
FAVICON_URL="https://edx-cdn.org/v3/stage/favicon.ico" | ||
LOGO_TRADEMARK_URL="https://edx-cdn.org/v3/stage/logo-trademark.svg" | ||
LOGO_TRADEMARK_URL_PNG="https://edx-cdn.org/v3/stage/logo-trademark.png" | ||
LOGO_TRADEMARK_URL_SVG="https://edx-cdn.org/v3/stage/logo-trademark.svg" | ||
LOGO_URL="https://edx-cdn.org/v3/stage/logo.svg" | ||
LOGO_URL_PNG="https://edx-cdn.org/v3/stage/logo.png" | ||
LOGO_URL_SVG="https://edx-cdn.org/v3/stage/logo.svg" | ||
LOGO_WHITE_URL="https://edx-cdn.org/v3/stage/logo-white.svg" | ||
LOGO_WHITE_URL_PNG="https://edx-cdn.org/v3/stage/logo-white.png" | ||
LOGO_WHITE_URL_SVG="https://edx-cdn.org/v3/stage/logo-white.svg" | ||
LOGO_POWERED_BY_OPEN_EDX_URL="https://edx-cdn.org/v3/stage/open-edx-tag.png" | ||
LOGO_POWERED_BY_OPEN_EDX_URL_PNG="https://edx-cdn.org/v3/stage/open-edx-tag.png" | ||
LOGO_POWERED_BY_OPEN_EDX_URL_SVG="https://edx-cdn.org/v3/stage/open-edx-tag.svg" | ||
HOTJAR_VERSION=6 | ||
SESSION_COOKIE_DOMAIN=".stage.edx.org" | ||
|
||
# Cookie Policy Banner | ||
COOKIE_POLICY_BANNER_VIEWED_NAME="edx-cookie-policy-viewed" | ||
MARKETING_SITE_NAME="edx.org" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ dist/ | |
|
||
# emacs | ||
*~ | ||
.projectile | ||
|
||
# edx | ||
.env.private | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
16 | ||
18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,11 @@ | |
![Build Status](https://github.com/openedx/frontend-app-admin-portal/actions/workflows/ci.yml/badge.svg) | ||
![Codecov](https://codecov.io/gh/edx/frontend-app-admin-portal/branch/master/graph/badge.svg) | ||
|
||
## Overview | ||
# Purpose | ||
frontend-app-admin-portal is a frontend that provides branded learning experiences as well as a dashboard for enterprise learning administrators. | ||
|
||
# Getting Started | ||
|
||
## Setting up a dev environment | ||
|
||
### The Short Story | ||
|
@@ -101,3 +103,81 @@ module.exports = { | |
``` | ||
|
||
NB: In order for webpack to properly resolve scss imports locally, you must use a `~` before the import, like so: `@import "~@edx/brand/paragon/fonts";` | ||
|
||
### Running tests | ||
|
||
You can run all tests as follows: | ||
``` | ||
nvm use | ||
npm install | ||
npm run test | ||
``` | ||
|
||
Additionally, you can run a single test file with | ||
``` | ||
npm run test -- ProvisioningFormSubmissionButton.test.jsx | ||
``` | ||
|
||
or run a given test function by appending a `.only` to the test function (or appending `.skip` to do the inverse). | ||
For example: `test.only('your test function', () => {...})`. | ||
|
||
You can use watch mode with tests as follows: | ||
``` | ||
npm run test:watch BudgetDetailPage.test.jsx | ||
# or to skip coverage reporting | ||
npm run test:watch-no-cov BudgetDetailpage.test.jsx | ||
``` | ||
Note the watcher has its own set of commands to help run test functions that match a regex (`t my regex`), etc. | ||
Use the `w` command to get a list of valid watch commands. | ||
|
||
## 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-admin-portal/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 | ||
|
||
## 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/ | ||
|
||
## License | ||
|
||
The code in this repository is licensed under the AGPLv3 unless otherwise | ||
noted. | ||
|
||
Please see `LICENSE <LICENSE>`_ for details. | ||
|
||
## Reporting Security Issues | ||
|
||
Please do not report security issues in public. Please email [email protected]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
5. Replacing Moment.js library with Day.js | ||
============================================================ | ||
|
||
Status | ||
****** | ||
|
||
In progress | ||
|
||
Context | ||
******* | ||
|
||
Moment.js is a widely used time and date library, but the creators have decided to make it a legacy project that no | ||
longer fixes bugs or adds new features. Because of this, and because of the large size that the Moment.js package takes up | ||
(4.23 MB according to npm and the minified size is 6.3KB), we are choosing to replace all instances of Moment.js | ||
in our enterprise repositories. | ||
|
||
Decisions | ||
********* | ||
|
||
In its stead, we are choosing to replace this library with the Day.js project. This is one of the projects that were | ||
explicitly recommended from the Moment.js team as a recommended alternative. Out of the box, it supports basic usage, | ||
and additional plugins have been identified based on a look through our current usages of Moment.js in our codebase. | ||
The plugins that we will need to add are Duration, UTC, and Timezone, with more possibilities available for future use. | ||
|
||
Day.js also has almost identical functions to Moment, and was definitely created with this in mind. So most files will | ||
just need to replace the package name and nothing else | ||
|
||
``moment(date).format('MMMM D, YYYY') -> dayjs(date).format('MMMM D, YYYY')`` | ||
|
||
Consequences | ||
************ | ||
|
||
By choosing Day.js over another, larger library like date-fns, we sacrifice more of the out of the box functionality | ||
that comes from having a bigger library. Also, day.js does not support tree-shaking like the date-fns library does. | ||
However, by only installing needed plugins and starting from a much smaller package size, Day.js will considerably | ||
decrease the JS bundle size while still maintaining the core functionality. | ||
|
||
Alternatives Considered | ||
*********************** | ||
|
||
date-fns | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Date-fns has a 162.1 kB bundle size compared to 6.4 kB of day.js bundle. Since the majority of the functionality | ||
we are using with these libraries is basic, and the intended goal is to ultimately decrease the bundle size, | ||
opting for the more lightweight library was the preferred path forward. |
Oops, something went wrong.