Skip to content

[maps] fix layers are not displayed in offline environment and map.includeElasticMapsService not set to false#152396

Merged
nreese merged 5 commits intoelastic:mainfrom
nreese:issue_152389
Mar 1, 2023
Merged

[maps] fix layers are not displayed in offline environment and map.includeElasticMapsService not set to false#152396
nreese merged 5 commits intoelastic:mainfrom
nreese:issue_152389

Conversation

@nreese
Copy link
Contributor

@nreese nreese commented Feb 28, 2023

Fixes #152389

PR adds check to ensure client has access to EMS before using EMS fonts. If the client does not have access to EMS fonts then a warning is logged and map falls back to open sans fonts served from Kibana server.

@kibana-ci
Copy link

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #54 / dashboard dashboard maps by value editing a map and adding to map library does not update the panel when only saving to library

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
maps 2.7MB 2.7MB +2.6KB
Unknown metric groups

ESLint disabled line counts

id before after diff
maps 39 40 +1
securitySolution 428 430 +2
total +3

Total ESLint disabled count

id before after diff
maps 67 68 +1
securitySolution 506 508 +2
total +3

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese added release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// backport:skip This PR does not require backporting Feature:Maps v8.8.0 labels Mar 1, 2023
@nreese nreese marked this pull request as ready for review March 1, 2023 01:45
@nreese nreese requested a review from a team as a code owner March 1, 2023 01:45
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

Copy link
Contributor

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

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

lgtm! just one nit.

thanks for the fix! code review and tested by blocking access to tiles.elastic.co/*

// eslint-disable-next-line no-console
console.warn(
`Unable to access fonts from Elastic Maps Service (EMS). Set kibana.yml 'map.includeElasticMapsService: false' to avoid unnecessary EMS requests.`
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. This warning will only be visible in the browser console of a client which might not be the best audience. Since we're suggesting changing kibana.yml, maybe we should instead log this warning in the kibana log where an administrator might see it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know if its possible to write kibana logs from the client?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh right. nevermind. also, after more consideration, I realize this is definitely more related to the client's environment as they might not have external internet access, but other clients accessing the kibana cluster may have access. so the warning would probably not be very useful for admins.

@nreese nreese merged commit 0c2e2c9 into elastic:main Mar 1, 2023
nreese added a commit that referenced this pull request Mar 9, 2023
…l/apps/dashboard/group2/dashboard_maps_by_value·ts (#152850)

Fixes #152476

flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1995

#152396 added an await to map
loading that waits for EMS fonts HEAD request. This introduced test
flakiness. This PR resolves the issue by re-working the solution from
#152476 to not block map loading
for EMS fonts HEAD request. Instead, glyphs URL is updated if EMS fonts
HEAD request fails after map has loaded.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
…cludeElasticMapsService not set to false (elastic#152396)

Fixes elastic#152389

PR adds check to ensure client has access to EMS before using EMS fonts.
If the client does not have access to EMS fonts then a warning is logged
and map falls back to open sans fonts served from Kibana server.
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
…l/apps/dashboard/group2/dashboard_maps_by_value·ts (elastic#152850)

Fixes elastic#152476

flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1995

elastic#152396 added an await to map
loading that waits for EMS fonts HEAD request. This introduced test
flakiness. This PR resolves the issue by re-working the solution from
elastic#152476 to not block map loading
for EMS fonts HEAD request. Instead, glyphs URL is updated if EMS fonts
HEAD request fails after map has loaded.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Maps release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v8.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[maps] layers are not displayed in offline environment and map.includeElasticMapsService not set to false

4 participants