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-4709: Fixing cluster problems with back-button, other improvements #158

Merged
merged 14 commits into from
Feb 14, 2024

Conversation

rugoncalves
Copy link
Contributor

This PR is in the continuation of previous PR, which introduced some issues, now solved. Additionally more fixes were added.

What was happening

  • When the back button is used, and the previous page has a list records with markers, the markers are first build then destroyed then built again... And when Addresses are passed, what happened was that the FinishBuild was ran after the dispose, causing a glitch in the number of markers per cluster.
  • There was a console warning from google: Google Maps JavaScript API has been loaded directly without loading=async. This can result in suboptimal performance. For best-practice loading patterns please see https://goo.gle/js-api-loading
  • I previous PR, the choice of map center was changed, leading to the marker being always chosen.

What was done

  • Added the protected attribute _destroyed to the AbstractMarker class. This attribute will be set to true when the Marker is disposed, so that if the when the build() is occurring and the address needs to be converted into coordinates, if the Marker is destroyed meanwhile, upon resolving the address promise, no other code is executed.
  • Added the attribute loading=async in the URL of Google Maps:
    • Changed the way the callbacks are being invoked, by using a Promise;
    • This caused the warning mentioned above to disappear;
  • Added the attribute v=X.xx that defines the version of Google Maps to be loaded:
    • Current version being loaded 3.55 will be made stale (or stable) by mid-February 2024;
    • This will enable the Maps to have a stable and controlled version;
  • If the map center, is the same as the default, then the map will ignore it. Otherwise, the isAutofit config will be checked, and if false, then the current center will not be changed.
  • Small TS fixes
  • Small comments changes

Checklist

  • tested locally
  • documented the code
  • clean all warnings and errors of eslint
  • requires changes in OutSystems (if so, provide a module with changes)
  • requires new sample page in OutSystems (if so, provide a module with changes)

When the back button is used, and the previous page has a list records with markers, the markers are first build then destroyed then built again... And when Addresses are passed, what happened was that the FinishBuild was ran after the dispose, causing a glitch in the number of markers per cluster.
@rugoncalves rugoncalves requested a review from a team as a code owner February 9, 2024 17:11
@outsystemsbot outsystemsbot bot added the cla:yes label Feb 9, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 New Critical Issues (required ≤ 0)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@rugoncalves rugoncalves merged commit b22d850 into dev Feb 14, 2024
4 of 9 checks passed
@rugoncalves rugoncalves deleted the ROU-4709-v2 branch February 14, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants