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

ROU-11183: Include OnOrientationChange logic on MenuReady/MenuDestroy #993

Merged
merged 6 commits into from
Sep 25, 2024

Conversation

gnbm
Copy link
Collaborator

@gnbm gnbm commented Sep 23, 2024

What was happening

  • The app templates were released with some javascript nodes calling OutSystems UI framework APIs that the Developer doesn't know and that were only present in tablets and for older apps there's some manual work to be done.
  • Since we now have MenuReady and MenuDestroy client actions, we should enclose this logic to avoid having JS nodes spread over the templates.

What was done

  • Included the Orientation Change logic on Menu OnReady (this method now receives a callback) and OnDestroy
  • Deprecated AddMenuOnOrientationChange and RemoveMenuOnOrientationChange
  • Fixed some typos on the Menu.ts file
  • Added the comments and @deprecate symbol to all methods within osui.ts file and added a new namespace to fallback the deprecated methods
  • Fixed an issue raised by Snyk on the function _getUserAgent

Test Steps

  • Test 1 - Old Apps - Tablet:

    • Go to a Tablet app
    • Switch between portrait and landscape
    • Check that the handler is triggered and the console.warn(...) on the developer tools console and the listener added
  • Test 2 - Old Apps - Phone/Desktop:

    • Go to a Phone app
    • Switch between portrait and landscape
    • Check that no handler is triggered, no message is logged on the developer tools console and no listener is added
    • Repeated the same steps for a Desktop app
  • Test 3 - New Apps - Tablet:

    • Go to a Tablet app
    • Switch between portrait and landscape
    • Check that the handler is triggered, no message is logged on the developer tools console and the listener is added
  • Test 4 - New Apps - Phone/Desktop:

    • Go to a Phone app
    • Switch between portrait and landscape
    • Check that no handler is triggered, no message is logged on the developer tools console and no listener is added
    • Repeated the same steps for a Desktop app

Screenshots

Checklist

  • tested locally
  • documented the code
  • clean all warnings and errors of eslint
  • requires changes in OutSystems
  • requires new sample page in OutSystems

@gnbm gnbm added the enhancement New feature or request label Sep 23, 2024
Copy link

sonarcloud bot commented Sep 23, 2024

@gnbm gnbm marked this pull request as ready for review September 24, 2024 10:37
@gnbm gnbm requested a review from a team as a code owner September 24, 2024 10:37
joselrio
joselrio previously approved these changes Sep 24, 2024
src/scripts/OutSystems/OSUI/Utils/Menu.ts Outdated Show resolved Hide resolved
@gnbm gnbm requested a review from joselrio September 24, 2024 11:06
@gnbm gnbm merged commit baaa6da into dev Sep 25, 2024
8 checks passed
@gnbm gnbm deleted the ROU-11183 branch September 25, 2024 10:01
@gnbm gnbm restored the ROU-11183 branch September 25, 2024 11:27
@gnbm gnbm deleted the ROU-11183 branch September 25, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants