Skip to content

Commit 5ffab67

Browse files
authored
feat: replaced packages @edx/paragon & @edx/frontend-build to use openedx namespace (#1192)
* feat: replaced packages @edx/paragon & @edx/frontend-build to use openedx namespace * refactor: updated snapshots for failing tests * refactor: resolved failing tests * refactor: removed patch-package * refactor: updated budgetDetailPage test * refactor: added ariaLabelledby prop to SelectableBox * refactor: re-installed patch-package * refactor: updated paragon imports to openedx * feat: bump paragon version, update snapshot * refactor: updated LMS selector page SelectableBox.Set arialabel * refactor: updated LMSSelectorPage p tag id * feat: updated frontend-build to v14 & ts-jest to v29 along with respective packages * fix: updated snapshots for failing tests * fix: fixed failing tests * refactor: pinned paragon version
1 parent 9f442ff commit 5ffab67

File tree

345 files changed

+9838
-9249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+9838
-9249
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
2-
const { getBaseConfig } = require('@edx/frontend-build');
2+
const { getBaseConfig } = require('@openedx/frontend-build');
33

44
const config = getBaseConfig('eslint');
55
/* Custom config manipulations */

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ module.exports = {
9696
*/
9797
localModules: [
9898
{ moduleName: '@edx/brand', dir: '../brand-edx.org' },
99-
{ moduleName: '@edx/paragon/scss/core', dir: '../paragon', dist: 'scss/core' },
100-
{ moduleName: '@edx/paragon', dir: '../paragon', dist: 'dist' },
99+
{ moduleName: '@openedx/paragon/scss/core', dir: '../paragon', dist: 'scss/core' },
100+
{ moduleName: '@openedx/paragon', dir: '../paragon', dist: 'dist' },
101101
],
102102
};
103103
```

docs/decisions/0007-patch-package.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Accepted (November 2023)
99
Context
1010
*******
1111

12-
The ``frontend-app-admin-portal`` repository is currently blocked on upgrading to the latest version of ``@edx/paragon`` until the React, React Router, ``@edx/frontend-platform``, etc. packages are upgraded first. Given this, we cannot rely on upstream fixes to ``@edx/paragon`` for bugs or security issues.
12+
The ``frontend-app-admin-portal`` repository is currently blocked on upgrading to the latest version of ``@openedx/paragon`` until the React, React Router, ``@edx/frontend-platform``, etc. packages are upgraded first. Given this, we cannot rely on upstream fixes to ``@openedx/paragon`` for bugs or security issues.
1313

1414
There is at least one opportunity identified where there is a bug within Paragon's ``DataTable`` component, where the "Select all X" label's count is inaccurate when one or more rows are selected, with or without filters applied, using the ``DataTable.ControlledSelect*`` sub-components. A separate bug issue was filed upstream to the Paragon repository, but given ``frontend-app-admin-portal`` is blocked on a Paragon upgrade, we can turn to ``patch-package`` to temporarily fix the issue locally within this repository itself.
1515

@@ -18,25 +18,25 @@ There is at least one opportunity identified where there is a bug within Paragon
1818

1919
``patch-package`` is an NPM package that allows one to modify third-party dependencies' code within ``node_modules``, and persist the patch so it's applied for other developers and within CI (i.e., anytime ``npm install`` is executed).
2020

21-
By creating a temporary, committed patch file for ``@edx/paragon``, we can resolve the aforementioned "Select all X" label's inaccurate count without needing an upstream fix or upgrading to the latest version of ``@edx/paragon``.
21+
By creating a temporary, committed patch file for ``@openedx/paragon``, we can resolve the aforementioned "Select all X" label's inaccurate count without needing an upstream fix or upgrading to the latest version of ``@openedx/paragon``.
2222

2323
Decisions
2424
*********
2525

2626
We will use ``patch-package`` to temporarily create a patch of Paragon's ``DataTable`` component to shows the correct number in the "Select all X" label count until we can upgrade to the latest version of Paragon containing a fix for this issue.
2727

28-
We will keep the ``patch-package`` devDependency installed and running in the ``postinstall`` NPM script. However, we should only reach for ``patch-package`` when necessary, and should not use it as a crutch for not upgrading to the latest version of a dependency or making a contribution to the upstream third-party dependency (e.g., ``@edx/paragon``).
28+
We will keep the ``patch-package`` devDependency installed and running in the ``postinstall`` NPM script. However, we should only reach for ``patch-package`` when necessary, and should not use it as a crutch for not upgrading to the latest version of a dependency or making a contribution to the upstream third-party dependency (e.g., ``@openedx/paragon``).
2929

3030
Consequences
3131
************
3232

33-
* The generated patch file is versioned to the currently installed version of the patched dependency. If the installed version of the patched dependency changes, the patch file's version may need to be updated as well by ensuring the local package changes still function as expected and then generating the patch file (i.e., ``npx patch-package @edx/paragon``).
33+
* The generated patch file is versioned to the currently installed version of the patched dependency. If the installed version of the patched dependency changes, the patch file's version may need to be updated as well by ensuring the local package changes still function as expected and then generating the patch file (i.e., ``npx patch-package @openedx/paragon``).
3434
* Because code changes made in a generated patch are applied after ``npm install``, the changes in the patch should apply to unit and integration tests within this repository (i.e., the patch changes should be testable).
3535

3636

3737
Alternatives Considered
3838
***********************
3939

40-
* Implement a fix upstream in ``@edx/paragon`` and then upgrade to the latest versions of React, React Router, ``@edx/frontend-platform``, etc. in order to unblock the upgrade to the latest Paragon version. This was rejected because it would take focus off of the critical path of feature release with an impending deadline.
40+
* Implement a fix upstream in ``@openedx/paragon`` and then upgrade to the latest versions of React, React Router, ``@edx/frontend-platform``, etc. in order to unblock the upgrade to the latest Paragon version. This was rejected because it would take focus off of the critical path of feature release with an impending deadline.
4141
* Replicate a large portion of the Paragon code (i.e., ``SelectionStatusComponent``) into ``frontend-app-admin-portal`` to temporarily remove the "Select all X" label from the ``DataTable``. This was rejected because the "Select all X" functionality is intended to be there to make it easier to work with bulk actions on the table. Without "Select all X" functionality, users would need to manually paginate and select through each individual page which is not a good user experience.
4242
* Do nothing. This was rejected as the state of the world without a fix leaves a known bug fix that causes usability issues and user confusion.

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
2-
const { createConfig } = require('@edx/frontend-build');
2+
const { createConfig } = require('@openedx/frontend-build');
33

44
module.exports = createConfig('jest', {
55
setupFiles: [

0 commit comments

Comments
 (0)