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

SAA-459: Remove use of Jquery code, and upgrade peer dependency of Jquery from moj-frontend #167

Merged
merged 2 commits into from
Mar 13, 2023

Conversation

smcveigh941
Copy link
Contributor

@smcveigh941 smcveigh941 commented Mar 12, 2023

  • Remove jQuery-UI
  • Remove jQuery code. jQuery still required as peer dependency of moj-frontend
  • Bumped dependency versions

var valueA = this.getCellValue(tdA)
var valueB = this.getCellValue(tdB)
var valueA = this.getCellValue($(tdA))
var valueB = this.getCellValue($(tdB))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function from moj-library requires this parameter to be a Jquery object. sigh

@@ -113,16 +113,15 @@
"govuk-frontend": "^4.5.0",
"helmet": "^6.0.0",
"http-errors": "^2.0.0",
"jquery": "^3.6.3",
"jquery-ui-dist": "^1.13.2",
"jquery": "^3.6.4",
Copy link
Contributor Author

@smcveigh941 smcveigh941 Mar 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jQuery library to be removed in the future. However is still required for now since the MoJ library components require it. Considering raising with frontend team about removing the need for jQuery, though it would require a major version change of that library.

Bumping the version for now to suppress vulnerabilities.

Note issue: ministryofjustice/moj-frontend#134

Copy link
Contributor

@matt-crowson-moj matt-crowson-moj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -4,17 +4,17 @@ ActivitiesFrontend.ListFilter = function (container) {
new MOJFrontend.FilterToggleButton({
startHidden: true,
toggleButton: {
container: $('.moj-action-bar__filter'),
container: document.getElementsByClassName('.moj-action-bar__filter'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove the dot at the start of the class name, or you could use query selector,

document.querySelectorAll('.moj-action-bar__filter')

@smcveigh941 smcveigh941 merged commit 34d711d into main Mar 13, 2023
@smcveigh941 smcveigh941 deleted the dev/SAA-459-remove-jquery branch March 13, 2023 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants