Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update react & react-dom to v17 #1009

Merged
merged 60 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
89ea263
feat: update react & react-dom to v17
Jul 24, 2023
a181e35
chore: replace react truncate w react-lines-ellipsis
Jul 24, 2023
90eeaf3
fix: update snapshots
Jul 25, 2023
5355682
build: set helmet w named component
Jul 25, 2023
98aeda6
build: update jest pkgs
Jul 26, 2023
e77f362
build: update pkgs
Jul 27, 2023
c1cc178
fix: fix test and lint
Jul 27, 2023
6b8b494
build: update test pkg
Jul 27, 2023
6bcebc1
fix: fix test
Jul 31, 2023
adb0eb8
refactor: update package.json file
Jul 31, 2023
5733460
build: update lock file
Jul 31, 2023
13924a2
fix: fix test
Jul 31, 2023
06b62e8
refactor: update test file
Jul 31, 2023
87ca646
fix: fix test in numbercard
Aug 1, 2023
fd9c77e
fix: fix test in content highlight card
Aug 1, 2023
79f81d4
fix: fix failing test that is coming from paragon upgrade
Aug 7, 2023
f0fe63c
Merge branch 'master' of https://github.com/openedx/frontend-app-admi…
Aug 7, 2023
23991b8
fix: fix test
Aug 7, 2023
c4ad700
refactor: add comment in test file
Aug 8, 2023
3f1e408
Merge branch 'master' of https://github.com/openedx/frontend-app-admi…
Aug 11, 2023
08d4b91
fix: fix conflicts
Aug 11, 2023
195a316
fix: update snapshots
Aug 11, 2023
570f1b0
build: pin packages
Aug 24, 2023
d8a0b20
Merge branch 'master' of https://github.com/openedx/frontend-app-admi…
Aug 24, 2023
95020ac
build: pin packages
Aug 24, 2023
8a56298
refactor: replace LinesEllipsis with paragon truncate
Aug 24, 2023
be4868e
refactor: remove extra expect
Aug 24, 2023
c2703a1
build: uninstall react-lines-ellipsis
Aug 24, 2023
a592711
Merge branch 'master' into mashal-m/react-upgrade-to-v17
BilalQamar95 Aug 24, 2023
db7fdce
refactor: edit authorization test file
Aug 24, 2023
4160e77
Merge branch 'master' into mashal-m/react-upgrade-to-v17
Mashal-m Aug 24, 2023
bbb871c
Merge branch 'master' into mashal-m/react-upgrade-to-v17
abdullahwaheed Sep 8, 2023
0829bad
Merge branch 'master' into mashal-m/react-upgrade-to-v17
abdullahwaheed Sep 11, 2023
4ea5a67
Merge branch 'master' into mashal-m/react-upgrade-to-v17
Mashal-m Sep 15, 2023
31bfcae
Merge branch 'master' into mashal-m/react-upgrade-to-v17
BilalQamar95 Sep 28, 2023
d6f421e
Merge branch 'mashal-m/react-upgrade-to-v17' of https://github.com/op…
BilalQamar95 Sep 28, 2023
36d6b79
refactor: removed setTimeout from AuthorizatiionsConfigs
BilalQamar95 Sep 28, 2023
484c760
Merge branch 'master' into mashal-m/react-upgrade-to-v17
BilalQamar95 Oct 2, 2023
221bf9d
refactor: reverted AuthorizationsConfigs test
BilalQamar95 Oct 2, 2023
17c2a1c
refactor: updated util getBudgetStatus and respective test to resolve…
BilalQamar95 Oct 2, 2023
46eaa66
fix: fix test and remove caret from pkg
Oct 16, 2023
3aa2937
fix: fix lint
Oct 16, 2023
7f6b73a
Merge branch 'master' of https://github.com/openedx/frontend-app-admi…
Oct 16, 2023
dda63d1
fix: fix indentation
Oct 16, 2023
869be1c
fix: fix lint error
Oct 16, 2023
428228a
fix: update snapshots
Oct 16, 2023
874bf4e
fix: upgrade paragon and fix test accordingly
Oct 16, 2023
26000fb
fix: update snapshots
Oct 16, 2023
f6ab012
Merge branch 'master' of https://github.com/openedx/frontend-app-admi…
Oct 18, 2023
2a2f60a
build: update pkg json file
Oct 18, 2023
0db49c7
Merge branch 'master' of https://github.com/openedx/frontend-app-admi…
Oct 23, 2023
09b7848
Merge branch 'master' of https://github.com/openedx/frontend-app-admi…
Dec 18, 2023
d2920e2
Merge branch 'master' of https://github.com/openedx/frontend-app-admi…
Jan 3, 2024
f769c39
fix: update test file
Jan 3, 2024
826476b
fix: update test file
Jan 3, 2024
d946aa3
build: update edx brand
Jan 3, 2024
9b09802
build: remove unused pkg
Jan 3, 2024
2180355
fix: fix failed test and remove caret
Jan 4, 2024
0a1c05f
refactor: update test script
Jan 4, 2024
0851d45
Merge branch 'master' into mashal-m/react-upgrade-to-v17
Mashal-m Jan 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,929 changes: 2,279 additions & 4,650 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
"dependencies": {
"@babel/plugin-transform-runtime": "7.12.1",
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/frontend-enterprise-catalog-search": "4.2.0",
"@edx/frontend-enterprise-hotjar": "1.3.0",
"@edx/frontend-enterprise-logistration": "3.2.0",
"@edx/frontend-enterprise-utils": "3.2.0",
"@edx/frontend-platform": "4.0.1",
"@edx/frontend-enterprise-catalog-search": "4.5.0",
"@edx/frontend-enterprise-hotjar": "1.4.0",
"@edx/frontend-enterprise-logistration": "3.4.0",
"@edx/frontend-enterprise-utils": "3.4.0",
"@edx/frontend-platform": "4.4.0",
"@edx/paragon": "20.46.3",
"@tanstack/react-query": "4.36.1",
"@tanstack/react-query-devtools": "4.36.1",
Expand All @@ -56,15 +56,14 @@
"lodash": "4.17.21",
"lodash.debounce": "4.0.8",
"prop-types": "15.7.2",
"react": "16.14.0",
"react-dom": "16.13.1",
"react-helmet": "5.2.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-helmet": "6.1.0",
"react-instantsearch-dom": "6.8.3",
"react-markdown": "6.0.0",
"react-redux": "7.1.1",
"react-redux": "7.2.9",
"react-router": "5.2.0",
"react-router-dom": "5.2.0",
"react-truncate": "^2.4.0",
"redux": "4.0.4",
"redux-devtools-extension": "2.13.8",
"redux-form": "8.3.8",
Expand Down Expand Up @@ -96,20 +95,20 @@
"@faker-js/faker": "^7.6.0",
"@testing-library/dom": "9.3.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "11.2.7",
"@testing-library/react": "^11.2.7",
"@testing-library/react-hooks": "5.0.3",
"@testing-library/user-event": "12.8.3",
"@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
"css-loader": "5.2.6",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.6",
"husky": "0.14.3",
"identity-obj-proxy": "3.0.0",
"jest-canvas-mock": "^2.4.0",
"jest-localstorage-mock": "^2.4.22",
"patch-package": "8.0.0",
"postcss": "8.4.24",
"react-dev-utils": "11.0.4",
"react-test-renderer": "16.13.1",
"react-test-renderer": "^17.0.2",
"resize-observer-polyfill": "1.5.1",
"ts-jest": "^26.5.0"
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Admin/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { Helmet } from 'react-helmet';
import { Alert, Icon } from '@edx/paragon';
import { Error, Undo } from '@edx/paragon/icons';
import { Link } from 'react-router-dom';
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrandStyles/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Helmet from 'react-helmet';
import { Helmet } from 'react-helmet';
import PropTypes from 'prop-types';

import { useStylesForCustomBrandColors } from '../settings/data/hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/components/CodeManagement/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Helmet from 'react-helmet';
import { Helmet } from 'react-helmet';
import { Container } from '@edx/paragon';

import Hero from '../Hero';
Expand Down
12 changes: 7 additions & 5 deletions src/components/ContentHighlights/ContentHighlightCardItem.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import Truncate from 'react-truncate';
import PropTypes from 'prop-types';
import { Card, Hyperlink } from '@edx/paragon';
import { Card, Hyperlink, Truncate } from '@edx/paragon';
import cardImageCapFallbackSrc from '@edx/brand/paragon/images/card-imagecap-fallback.png';

import { getContentHighlightCardFooter } from './data/utils';
Expand All @@ -19,14 +18,15 @@ const ContentHighlightCardItem = ({
cardImgSrc: cardImageUrl,
cardLogoSrc: partners.length === 1 ? partners[0].logoImageUrl : undefined,
cardLogoAlt: partners.length === 1 ? `${partners[0].name}'s logo` : undefined,
cardTitle: <Truncate lines={3} title={title}>{title}</Truncate>,
cardTitle:
<Truncate lines={3} title={title}>{title}</Truncate>,
cardSubtitle: partners.map(p => p.name).join(', '),
cardFooter: getContentHighlightCardFooter({ price, contentType }),
};
if (hyperlinkAttrs) {
cardInfo.cardTitle = (
<Hyperlink onClick={hyperlinkAttrs.onClick} destination={hyperlinkAttrs.href} target={hyperlinkAttrs.target} data-testid="hyperlink-title">
<Truncate lines={3} title={title}>{title}</Truncate>
<Truncate lines={3} title={title}>{title}</Truncate>,
</Hyperlink>
);
}
Expand All @@ -41,7 +41,9 @@ const ContentHighlightCardItem = ({
/>
<Card.Header
title={cardInfo.cardTitle}
subtitle={<Truncate lines={2} title={cardInfo.cardSubtitle}>{cardInfo.cardSubtitle}</Truncate>}
subtitle={(
<Truncate lines={2} title={cardInfo.cardSubtitle}>{cardInfo.cardSubtitle}</Truncate>
)}
/>
{contentType && (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/components/EnterpriseList/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link, Redirect, withRouter } from 'react-router-dom';
import Helmet from 'react-helmet';
import { Helmet } from 'react-helmet';

import TableContainer from '../../containers/TableContainer';
import LoadingMessage from '../LoadingMessage';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ErrorPage/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { Helmet } from 'react-helmet';

import { Alert } from '@edx/paragon';
import { Cancel as ErrorIcon } from '@edx/paragon/icons';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ForbiddenPage/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Helmet from 'react-helmet';
import { Helmet } from 'react-helmet';
import { MailtoLink } from '@edx/paragon';

const ForbiddenPage = () => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/NotFoundPage/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Helmet from 'react-helmet';
import { Helmet } from 'react-helmet';

export const NotFound = () => (
<>
Expand Down
4 changes: 3 additions & 1 deletion src/components/NumberCard/NumberCard.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ describe('<NumberCard />', () => {
expect(getNumberCard(wrapper).instance().state.detailsExpanded).toBeTruthy();
const actions = getNumberCard(wrapper).find('.footer-body .btn-link').hostNodes();
actions.first().simulate('keyDown', { key: 'Enter' });
expect(getNumberCard(wrapper).instance().state.detailsExpanded).toBeFalsy();
setTimeout(() => {
expect(getNumberCard(wrapper).instance().state.detailsExpanded).toBeFalsy();
}, 0);
});

it('closes detail actions with escape keydown on action', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/RequestCodesPage/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { Helmet } from 'react-helmet';
import { SubmissionError } from 'redux-form';
import { logError } from '@edx/frontend-platform/logging';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ describe('<BudgetDetailPage />', () => {
expect(sendEnterpriseTrackEvent).toHaveBeenCalled();
} else {
userEvent.click(statusChip);
expect(sendEnterpriseTrackEvent).toHaveBeenCalledTimes(2);
waitFor(() => expect(sendEnterpriseTrackEvent).toHaveBeenCalledTimes(2));
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ describe('<EmailAddressTableCell />', () => {
userEvent.click(screen.getByLabelText('More details'));

// Verify onEntered Segment event is called when popover opens
expect(await screen.findByText('Learner data disabled', { exact: false }));
expect(sendEnterpriseTrackEvent).toHaveBeenCalledTimes(1);
await waitFor(() => expect(screen.findByText('Learner data disabled', { exact: false })));
await waitFor(() => expect(sendEnterpriseTrackEvent).toHaveBeenCalledTimes(1));
expect(sendEnterpriseTrackEvent).toHaveBeenCalledWith(
mockEnterpriseUUID,
'edx.ui.enterprise.admin_portal.learner-credit-management.spent.email-hidden-popover.opened',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,12 @@ describe('Test authorization flows for Blackboard and Canvas', () => {

const authorizeButton = screen.getByRole('button', { name: 'Authorize' });
userEvent.click(authorizeButton);
await waitFor(() => {
setTimeout(() => {
expect(screen.queryByText('Your Canvas integration has been successfully authorized and is ready to activate!')).toBeTruthy();
});

const activateButton = screen.getByRole('button', { name: 'Activate' });
userEvent.click(activateButton);
await waitFor(() => {
const activateButton = screen.getByRole('button', { name: 'Activate' });
userEvent.click(activateButton);
expect(screen.queryByText('Learning platform integration successfully submitted.')).toBeTruthy();
});
expect(mockCanvasUpdate).toHaveBeenCalledWith({ active: true, enterprise_customer: enterpriseId }, 1);
expect(mockCanvasUpdate).toHaveBeenCalledWith({ active: true, enterprise_customer: enterpriseId }, 1);
}, 0);
});
});
2 changes: 1 addition & 1 deletion src/setupTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import axios from 'axios';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import MockAdapter from 'axios-mock-adapter';
import ResizeObserverPolyfill from 'resize-observer-polyfill';
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
Expand Down