Skip to content

[Custom branding] Add custom logo to space selector#150284

Merged
majagrubic merged 3 commits intoelastic:mainfrom
majagrubic:custom-branding-space-selector
Feb 10, 2023
Merged

[Custom branding] Add custom logo to space selector#150284
majagrubic merged 3 commits intoelastic:mainfrom
majagrubic:custom-branding-space-selector

Conversation

@majagrubic
Copy link
Copy Markdown
Contributor

@majagrubic majagrubic commented Feb 6, 2023

Summary

As part of custom branding, we need to replace all occurrences of Elastic logo with the custom one, when it's set. This PR does that for space selector.

Resolves: #150272

Example of how it might look like:

Screenshot 2023-02-06 at 14 59 25

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@majagrubic majagrubic added v8.8.0 release_note:skip Skip the PR/issue when compiling release notes labels Feb 6, 2023
@majagrubic majagrubic marked this pull request as ready for review February 6, 2023 14:01
@majagrubic majagrubic requested a review from a team as a code owner February 6, 2023 14:01
@jeramysoucy
Copy link
Copy Markdown
Contributor

@majagrubic How do I set the logo? Is it part of the yml file, a UI setting I can find somewhere, or an API call?

@majagrubic
Copy link
Copy Markdown
Contributor Author

majagrubic commented Feb 8, 2023

It's still WIP:
#150080

If you hardcode a base64-encoded image from custom_branding plugin here:
https://github.com/elastic/kibana/blob/main/x-pack/plugins/custom_branding/server/plugin.ts#L103

as
branding.logo = <your_encoded_string> that should work

@jeramysoucy
Copy link
Copy Markdown
Contributor

If you hardcode a base64-encoded image from custom_branding plugin here: https://github.com/elastic/kibana/blob/main/x-pack/plugins/custom_branding/server/plugin.ts#L103

as branding.logo = <your_encoded_string> that should work

I was not able to get this to work. Is there an image format or size restriction? I just grabbed a simple 200x200 bitmap and converted it to a base64 encoded string. I added the set you suggested, but it doesn't render.
Screenshot 2023-02-08 at 11 54 52 AM

@majagrubic
Copy link
Copy Markdown
Contributor Author

majagrubic commented Feb 9, 2023

Well, it looks like something was picked up (otherwise the default Elastic logo would be rendered), but it wasn't properly decoded into image. I guess the image encoding is wrong?

@jeramysoucy
Copy link
Copy Markdown
Contributor

jeramysoucy commented Feb 9, 2023

EDIT: I figured out that the string requires the following prefix data:image;base64, before the raw encoded data. I didn't realize that. It's working as expected now. 👍

I guess the image encoding is wrong?

That was my guess too, but every tool I try yields the same exact string for each image I supply. What are you using to generate the image string?

Copy link
Copy Markdown
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

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

LGTM! FYI there is another open PR modifying the space selector but the merge should be pretty straightforward. Unrelated to this PR, I did also notice that the custom image on the loading screen is stretched disproportionately.

@majagrubic
Copy link
Copy Markdown
Contributor Author

majagrubic commented Feb 9, 2023

I was using this tool: https://www.base64-image.de/

I did also notice that the custom image on the loading screen is stretched disproportionately.

Thanks for the feedback, will have a look into that.

@majagrubic
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

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
spaces 174.0KB 174.4KB +453.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
spaces 20.4KB 20.4KB +49.0B

History

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

@majagrubic majagrubic merged commit 27f1126 into elastic:main Feb 10, 2023
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Feb 10, 2023
@majagrubic majagrubic deleted the custom-branding-space-selector branch February 10, 2023 08:27
jloleysens added a commit to jloleysens/kibana that referenced this pull request Feb 10, 2023
* main: (115 commits)
  [Custom branding] Add custom logo to space selector (elastic#150284)
  [api-docs] 2023-02-10 Daily api_docs build (elastic#150831)
  [ci] build next docs in PRs when relevant files change (elastic#149991)
  [codeowners] allow overrides to take higher precedence (elastic#150821)
  [docs] Remove kibDevDocsOpsPluginDiscovery (elastic#150788)
  [Fleet] Fix max 20 installed integrations returned from Fleet API (elastic#150780)
  [maps] fix Changing resolutions on Heat map layer throws error in console (elastic#150761)
  fixes Failing ES Promotion: X-Pack API Integration Tests x-pack/test/api_integration/apis/maps/get_grid_tile.js (elastic#150768)
  [Synthetics] adjust overview scrolling e2e (elastic#150774)
  [Security Solution] Fixes bulk close alerts from exception flyout type bug (elastic#150765)
  Upgrade EUI to v74.1.0 (elastic#150235)
  [skip ci] Fix labeling for Infrastructure UI (elastic#150571)
  [Enterprise Search] Move pipelines modal to flyout (elastic#150727)
  [Security Solution] fix flaky endpoint tests (elastic#150652)
  Fixes the space selector page layout  (elastic#150503)
  [Dashboard] [Navigation] Fix mount point bug (elastic#150507)
  [Infrastructure UI] Track host cloud provider on table entry click (elastic#150685)
  [Dashboard Usability] Moves scrollbar to panel section (elastic#145628)
  [Maps] fixes Kibana maps shows MVT borders if the geometry border style is greater than 1 (elastic#150497)
  [Cloud Posture][Dashboard] dashboard re-design enhancements (elastic#150394)
  ...
majagrubic pushed a commit that referenced this pull request Feb 10, 2023
## Summary

This PR updates the snapshot for `space_selector_test`, so the test can
pass normally. Discrepancy occurred after two PRs changing the
`space_selector` were merged around the same time.
#150284
#150503

__Fixes: https://github.com/elastic/kibana/issues/150834__

### Checklist

Delete any items that are not applicable to this PR.

~- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
~- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
~- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
~- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
~- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
~- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
~- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
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 release_note:skip Skip the PR/issue when compiling release notes v8.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Custom Branding] Replace logo in Space selector

4 participants