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

Missing autofix for methods related to jQuery.sap.* (DOM Utils) #542

Open
10 tasks
flovogt opened this issue Feb 14, 2025 · 1 comment
Open
10 tasks

Missing autofix for methods related to jQuery.sap.* (DOM Utils) #542

flovogt opened this issue Feb 14, 2025 · 1 comment
Labels
autofix An issue related to the autofix capabilities enhancement New feature or request

Comments

@flovogt
Copy link
Member

flovogt commented Feb 14, 2025

Missing autofix for methods related to jQuery.sap.* (DOM Utils)

Methods related to jQuery.sap.*(DOM Utils) are deprecated. Therefore an autofix should be offered by UI5 linter.

Deprecated APIs:

  • jQuery.sap.containsOrEquals
  • jQuery.sap.denormalizeScrollBeginRTL
  • jQuery.sap.denormalizeScrollLeftRTL
  • jQuery.sap.ownerWindow
  • jQuery.sap.scrollbarSize
  • jQuery.sap.includeScript
  • jQuery.sap.includeStylesheet
  • jQuery.sap.replaceDOM
  • jQuery.sap.pxToRem
  • jQuery.sap.remToPx

Deprecated Usage

var isBChildOfAOrEqualA = jQuery.sap.containsOrEquals(document.getElementById("controlA"), document.getElementById("controlB"));
var iScrollBegin = jQuery.sap.denormalizeScrollBeginRTL(100);
var iScrollLeft = jQuery.sap.denormalizeScrollLeftRTL(101, document.getElementById("controlA"));
var ownerWindow = jQuery.sap.ownerWindow(document.getElementById("controlA"));
var size = jQuery.sap.scrollbarSize("myclassA", true);
jQuery.sap.includeScript("myapp/fancy/awesome.js", "fancyAwesomeScript");
jQuery.sap.includeStylesheet("myapp/fancy/style.css", "fancyStyleSheet");
var isPatched = jQuery.sap.replaceDOM(document.getElementById("controlA"), document.getElementById("controlB"));
var rem = jQuery.sap.pxToRem("16px");
var px = jQuery.sap.remToPx("1rem");

Recommended Usage

sap.ui.define([
   "sap/ui/dom/containsOrEquals",
   "sap/ui/dom/denormalizeScrollBeginRTL",
   "sap/ui/dom/denormalizeScrollLeftRTL",
   "sap/ui/dom/getOwnerWindow",
   "sap/ui/dom/getScrollbarSize",
   "sap/ui/dom/includeScript",
   "sap/ui/dom/includeStylesheet",
   "sap/ui/dom/patch",
   "sap/ui/dom/units/Rem"
  ], (containsOrEquals, denormalizeScrollBeginRTL, denormalizeScrollLeftRTL, getOwnerWindow, 
getScrollbarSize, includeScript, includeStylesheet, patch, Rem) => {
  var isBChildOfAOrEqualA = containsOrEquals(document.getElementById("controlA"), document.getElementById("controlB"));
  var iScrollBegin = denormalizeScrollBeginRTL(100);
  var iScrollLeft = denormalizeScrollLeftRTL(101, document.getElementById("controlA"));
  var ownerWindow = getOwnerWindow(document.getElementById("controlA"));
  var size = getScrollbarSize("myclassA", true);
  includeScript("myapp/fancy/awesome.js", "fancyAwesomeScript");
  includeStylesheet("myapp/fancy/style.css", "fancyStyleSheet");
  var isPatched = patch(document.getElementById("controlA"), document.getElementById("controlB"));
  var rem = Rem.fromPx("16px");
  var px = Rem.toPx("1rem");
});

Note: "sap/ui/dom/patch" is removed with openui5#84ae02e87

@flovogt flovogt added autofix An issue related to the autofix capabilities enhancement New feature or request labels Feb 14, 2025
@flovogt
Copy link
Member Author

flovogt commented Feb 14, 2025

Will be implemented in CPOUI5FOUNDATION-990.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autofix An issue related to the autofix capabilities enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant