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

Upgrade frontend-build to v14 #1052

Merged
merged 23 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ab269ec
fix: warnings about Duplicate message id
pomegranited May 30, 2024
2bf0d6f
fix: paragon's Hyperlink no longer accepts a 'content' attribute
pomegranited May 31, 2024
961a8a2
test: ensure all act() calls are async
pomegranited May 31, 2024
af50999
test: Removed "async" from "describe"
pomegranited May 31, 2024
fb7391e
fix: DiscussionsSettings tests
pomegranited May 31, 2024
3c48d81
fix: typo in data-testid
pomegranited May 31, 2024
79def95
test: Use useLocation to test route changes
yusuf-musleh May 31, 2024
7434cd0
test: cleanup
pomegranited May 29, 2024
3bbb63c
Merge pull request #36 from open-craft/yusuf-musleh/fix-routes-in-tests
pomegranited May 31, 2024
b75584d
Merge remote-tracking branch 'opencraft/jill/fix-test-warnings' into …
pomegranited May 31, 2024
c9f16d4
temp: updates frontend-lib-content-components and frontend-component-…
pomegranited May 28, 2024
1a30585
chore: fix lint:fix and lint errors
pomegranited May 29, 2024
48cda53
test: fix failing tests after upgrade
pomegranited May 31, 2024
0a801c1
test: fix failing tests after upgrade
pomegranited Jun 4, 2024
65a6807
Merge branch 'master' into jill/frontend-build-14
pomegranited Jun 4, 2024
3f53e96
test: fix tests failing after upgrade
pomegranited Jun 5, 2024
e0542a3
fix: address PR review
pomegranited Jun 13, 2024
2541806
Merge branch 'master' into jill/frontend-build-14
pomegranited Jun 13, 2024
4738cbc
fix: css error "target selector was not found"
pomegranited Jun 13, 2024
0e5c2fb
Merge branch 'master' into jill/frontend-build-14
pomegranited Jun 13, 2024
21924cb
chore: upgrades dependency [email protected]
pomegranited Jun 13, 2024
9c16156
chore: bumps @edx/frontend-component-ai-translations to ^2.1.0
pomegranited Jun 20, 2024
0197c1d
Merge branch 'master' into jill/frontend-build-14
pomegranited Jun 20, 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
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = createConfig(
}],
'template-curly-spacing': 'off',
'react-hooks/exhaustive-deps': 'off',
indent: ['error', 2],
'no-restricted-exports': 'off',
},
settings: {
Expand Down
1 change: 1 addition & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"scss/at-rule-no-unknown": true,
"scss/at-import-partial-extension": null,
"scss/comment-no-empty": null,
"import-notation": "string",
"property-no-unknown": [true, {
"ignoreProperties": ["xs", "sm", "md", "lg", "xl", "xxl"]
}],
Expand Down
6,953 changes: 2,646 additions & 4,307 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"i18n_extract": "fedx-scripts formatjs extract",
"stylelint": "stylelint \"plugins/**/*.scss\" \"src/**/*.scss\" \"scss/**/*.scss\" --config .stylelintrc.json",
"lint": "npm run stylelint && fedx-scripts eslint --ext .js --ext .jsx .",
"lint:fix": "npm run stylelint && fedx-scripts eslint --ext .js --ext .jsx . --fix",
"lint:fix": "npm run stylelint -- --fix && fedx-scripts eslint --fix --ext .js --ext .jsx .",
"snapshot": "TZ=UTC fedx-scripts jest --updateSnapshot",
"start": "fedx-scripts webpack-dev-server --progress",
"start:with-theme": "paragon install-theme && npm start && npm install",
Expand All @@ -40,13 +40,13 @@
"@dnd-kit/modifiers": "^7.0.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/frontend-component-ai-translations": "^2.0.0",
"@edx/frontend-component-footer": "^13.0.2",
"@edx/frontend-component-header": "^5.1.0",
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.3",
"@edx/frontend-component-ai-translations": "github:open-craft/frontend-component-ai-translations#jill/frontend-platform-v8",
"@edx/frontend-component-footer": "^14.0.3",
"@edx/frontend-component-header": "^5.3.3",
"@edx/frontend-enterprise-hotjar": "^2.0.0",
"@edx/frontend-lib-content-components": "^2.1.10",
"@edx/frontend-platform": "7.0.1",
"@edx/frontend-lib-content-components": "github:open-craft/frontend-lib-content-components#jill/bilalqamar95/jest-v29-upgrade",
"@edx/frontend-platform": "8.0.3",
"@edx/openedx-atlas": "^0.6.0",
"@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-brands-svg-icons": "5.15.4",
Expand All @@ -64,19 +64,19 @@
"@openedx-plugins/course-app-teams": "file:plugins/course-apps/teams",
"@openedx-plugins/course-app-wiki": "file:plugins/course-apps/wiki",
"@openedx-plugins/course-app-xpert_unit_summary": "file:plugins/course-apps/xpert_unit_summary",
"@openedx/frontend-plugin-framework": "^1.1.0",
"@openedx/paragon": "^22.2.1",
"@openedx/frontend-plugin-framework": "^1.2.1",
"@openedx/paragon": "^22.5.1",
"@reduxjs/toolkit": "1.9.7",
"@tanstack/react-query": "4.36.1",
"classnames": "2.2.6",
"core-js": "3.8.1",
"classnames": "2.5.1",
"core-js": "3.37.1",
"email-validator": "2.0.4",
"file-saver": "^2.0.5",
"formik": "2.2.6",
"formik": "2.4.6",
"jszip": "^3.10.1",
"lodash": "4.17.21",
"meilisearch": "^0.38.0",
"moment": "2.29.4",
"moment": "2.30.1",
"prop-types": "^15.8.1",
"react": "17.0.2",
"react-datepicker": "^4.13.0",
Expand All @@ -85,10 +85,10 @@
"react-helmet": "^6.1.0",
"react-redux": "7.2.9",
"react-responsive": "9.0.2",
"react-router": "6.16.0",
"react-router-dom": "6.16.0",
"react-router": "6.23.1",
"react-router-dom": "6.23.1",
"react-select": "5.8.0",
"react-textarea-autosize": "^8.4.1",
"react-textarea-autosize": "^8.5.3",
"react-transition-group": "4.4.5",
"redux": "4.0.5",
"regenerator-runtime": "0.13.7",
Expand All @@ -98,11 +98,11 @@
},
"devDependencies": {
"@edx/browserslist-config": "1.2.0",
"@edx/react-unit-test-utils": "2.0.0",
"@edx/react-unit-test-utils": "2.1.1",
"@edx/reactifex": "^1.0.3",
"@edx/stylelint-config-edx": "2.3.0",
"@edx/stylelint-config-edx": "2.3.3",
"@edx/typescript-config": "^1.0.1",
"@openedx/frontend-build": "13.1.0",
"@openedx/frontend-build": "^14.0.3",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "12.1.5",
"@testing-library/react-hooks": "^8.0.1",
Expand All @@ -117,7 +117,7 @@
"jest-expect-message": "^1.1.3",
"react-test-renderer": "17.0.2",
"reactifex": "1.1.1",
"ts-loader": "^9.5.0"
"ts-loader": "^9.5.1"
},
"peerDependencies": {
"decode-uri-component": ">=0.2.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`ORASettings should render 1`] = `
appId="ora_settings"
hideAppToggle={true}
initialValues={
Object {
{
"enableFlexiblePeerGrade": "abitrary value",
}
}
Expand All @@ -19,19 +19,25 @@ exports[`ORASettings should render 1`] = `
<div
className="pt-3"
>
<withDeprecatedProps(Hyperlink)
<ForwardRef
className="text-primary-500 small"
destination="https://learnmore.test"
externalLinkAlternativeText="in a new tab"
externalLinkTitle="Opens in a new tab"
isInline={false}
onClick={[Function]}
rel="noreferrer noopener"
showLaunchIcon={true}
target="_blank"
variant="default"
>
Learn more about open response assessment settings
</withDeprecatedProps(Hyperlink)>
</ForwardRef>
</div>
</div>
}
validationSchema={
Object {
{
"enableFlexiblePeerGrade": "Yub.boolean",
}
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/course-apps/proctoring/Settings.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ describe('ProctoredExamSettings', () => {
await act(async () => {
fireEvent.change(selectEscalationEmailElement, { target: { value: 'foo.bar' } });
});
const selectButton = screen.getByTestId('submissionButton');
const proctoringForm = screen.getByTestId('proctoringForm');
await act(async () => {
fireEvent.click(selectButton);
fireEvent.submit(proctoringForm);
});

// verify alert content and focus management
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ const ResetUnitsButton = ({

const getResetButtonState = () => {
switch (resetStatusRequestStatus) {
case RequestStatus.PENDING:
return 'pending';
case RequestStatus.SUCCESSFUL:
return 'finish';
default:
return 'default';
case RequestStatus.PENDING:
return 'pending';
case RequestStatus.SUCCESSFUL:
return 'finish';
default:
return 'default';
}
};

Expand Down Expand Up @@ -246,7 +246,7 @@ const SettingsModal = ({
success = success && await onSettingsSave(values);
}
setSaveError(!success);
!success && alertRef?.current.scrollIntoView(); // eslint-disable-line no-unused-expressions
!success && alertRef?.current.scrollIntoView(); // eslint-disable-line @typescript-eslint/no-unused-expressions
};

const handleFormikSubmit = ({ handleSubmit, errors }) => async (event) => {
Expand Down
2 changes: 1 addition & 1 deletion src/accessibility-page/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineMessages } from '@edx/frontend-platform/i18n';

const messages = defineMessages({
pageTitle: {
id: 'course-authoring.import.page.title',
id: 'course-authoring.accessibility.page.title',
defaultMessage: 'Studio Accessibility Policy| {siteName}',
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/content-tags-drawer/ContentTagsCollapsibleHelper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ const useContentTagsCollapsibleHelper = (
traversal[tag].lineage = tagLineage;
}

// eslint-disable-next-line no-unused-expressions
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
isExplicit ? add(value.join(',')) : remove(value.join(','));
traversal = traversal[tag].children;
});
Expand Down
2 changes: 1 addition & 1 deletion src/content-tags-drawer/ContentTagsDrawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
min-width: max(500px, 33vw);
}

@media only screen and (max-width: 500px) {
@media only screen and (width <= 500px) {
.pgn__sheet-component:has(#content-tags-drawer) {
min-width: 100vw;
}
Expand Down
2 changes: 1 addition & 1 deletion src/content-tags-drawer/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const messages = defineMessages({
defaultMessage: 'Add a tag',
},
collapsibleNoTagsAddedText: {
id: 'course-authoring.content-tags-drawer.content-tags-collapsible.custom-menu.placeholder-text',
id: 'course-authoring.content-tags-drawer.content-tags-collapsible.custom-menu.no-tags-added-text',
defaultMessage: 'No tags added yet.',
},
collapsibleAddStagedTagsButtonText: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ const ChecklistItemComment = ({
<ul className="assignment-list">
{gradedAssignmentsOutsideDateRange.map(assignment => (
<li className="assignment-list-item" key={assignment.id}>
<Hyperlink
content={assignment.displayName}
destination={`${outlineUrl}#${assignment.id}`}
/>
<Hyperlink destination={`${outlineUrl}#${assignment.id}`}>
{assignment.displayName}
</Hyperlink>
</li>
))}
</ul>
Expand Down
48 changes: 24 additions & 24 deletions src/course-checklist/ChecklistSection/utils/getValidatedValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ import * as healthValidators from './courseChecklistValidators';

const getValidatedValue = (data, id) => {
switch (id) {
case 'welcomeMessage':
return healthValidators.hasWelcomeMessage(data.updates);
case 'gradingPolicy':
return healthValidators.hasGradingPolicy(data.grades);
case 'certificate':
return healthValidators.hasCertificate(data.certificates);
case 'courseDates':
return healthValidators.hasDates(data.dates);
case 'assignmentDeadlines':
return healthValidators.hasAssignmentDeadlines(data.assignments, data.dates);
case 'videoDuration':
return healthValidators.hasShortVideoDuration(data.videos);
case 'mobileFriendlyVideo':
return healthValidators.hasMobileFriendlyVideos(data.videos);
case 'diverseSequences':
return healthValidators.hasDiverseSequences(data.subsections);
case 'weeklyHighlights':
return healthValidators.hasWeeklyHighlights(data.sections);
case 'unitDepth':
return healthValidators.hasShortUnitDepth(data.units);
case 'proctoringEmail':
return healthValidators.hasProctoringEscalationEmail(data.proctoring);
default:
throw new Error(`Unknown validator ${id}.`);
case 'welcomeMessage':
return healthValidators.hasWelcomeMessage(data.updates);
case 'gradingPolicy':
return healthValidators.hasGradingPolicy(data.grades);
case 'certificate':
return healthValidators.hasCertificate(data.certificates);
case 'courseDates':
return healthValidators.hasDates(data.dates);
case 'assignmentDeadlines':
return healthValidators.hasAssignmentDeadlines(data.assignments, data.dates);
case 'videoDuration':
return healthValidators.hasShortVideoDuration(data.videos);
case 'mobileFriendlyVideo':
return healthValidators.hasMobileFriendlyVideos(data.videos);
case 'diverseSequences':
return healthValidators.hasDiverseSequences(data.subsections);
case 'weeklyHighlights':
return healthValidators.hasWeeklyHighlights(data.sections);
case 'unitDepth':
return healthValidators.hasShortUnitDepth(data.units);
case 'proctoringEmail':
return healthValidators.hasProctoringEscalationEmail(data.proctoring);
default:
throw new Error(`Unknown validator ${id}.`);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/course-outline/card-header/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const messages = defineMessages({
defaultMessage: 'Delete',
},
menuCopy: {
id: 'course-authoring.course-outline.card.menu.delete',
id: 'course-authoring.course-outline.card.menu.copy',
defaultMessage: 'Copy to clipboard',
},
menuProctoringLinkText: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import initializeStore from '../../store';
import EnableHighlightsModal from './EnableHighlightsModal';
import messages from './messages';

// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let axiosMock;
let store;
const mockPathname = '/foo-bar';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ import {
import { IntlProvider } from '@edx/frontend-platform/i18n';
import { useSelector } from 'react-redux';
import { initializeMockApp } from '@edx/frontend-platform';
import MockAdapter from 'axios-mock-adapter';
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
import { AppProvider } from '@edx/frontend-platform/react';

import initializeStore from '../../store';
import HighlightsModal from './HighlightsModal';
import messages from './messages';

// eslint-disable-next-line no-unused-vars
let axiosMock;
let store;
const mockPathname = '/foo-bar';

Expand Down Expand Up @@ -68,7 +64,6 @@ describe('<HighlightsModal />', () => {
});

store = initializeStore();
axiosMock = new MockAdapter(getAuthenticatedHttpClient());
useSelector.mockReturnValue(currentItemMock);
});

Expand Down
Loading