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.device.* #531

Open
9 tasks
flovogt opened this issue Feb 11, 2025 · 1 comment
Open
9 tasks

Missing autofix for methods related to jQuery.device.* #531

flovogt opened this issue Feb 11, 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 11, 2025

Missing autofix for methods related to jQuery.device.*

Methods related to jQuery.device.* are deprecated. Therefore an autofix should be offered by UI5 linter.

Deprecated APIs:

  • jQuery.device.is.landscape
  • jQuery.device.is.portrait
  • jQuery.device.is.desktop
  • jQuery.device.is.phone
  • jQuery.device.is.tablet
  • jQuery.device.is.android_phone
  • jQuery.device.is.android_tablet
  • jQuery.device.is.iphone
  • jQuery.device.is.ipad

Deprecated Usage

var isLandscape = jQuery.device.is.landscape;
var isPortait = jQuery.device.is.portrait;
var isDesktop = jQuery.device.is.desktop;
var isPhone = jQuery.device.is.phone;
var isTablet = jQuery.device.is.tablet;
var isAndroidPhone = jQuery.device.is.android_phone;
var isAndroidTablet = jQuery.device.is.android_tablet;
var isIPhone = jQuery.device.is.iphone;
var isIPad = jQuery.device.is.ipad;

Recommended Usage

sap.ui.define([
  "sap/ui/Device"
], (Device) => {
  var isLandscape = Device.orientation.landscape;
  var isPortait = Device.orientation.portrait;
  var isDesktop = Device.system.desktop;
  var isPhone = Device.system.phone;
  var isTablet = Device.system.tablet;
  var isAndroidPhone = Device.os.android && Device.system.phone;
  var isAndroidTablet = Device.os.android && Device.system.tablet;
  var isIPhone = Device.os.ios && Device.system.phone;
  var isIPad = Device.os.ios && Device.system.ipad;
});
@flovogt flovogt added autofix An issue related to the autofix capabilities enhancement New feature or request labels Feb 11, 2025
@flovogt
Copy link
Member Author

flovogt commented Feb 11, 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