[Custom Branding] Update text (#151631)

## Summary

This PR updates text for Custom Branding.
<img width="1505" alt="Screenshot 2023-02-20 at 16 22 10"
src="https://user-images.githubusercontent.com/1937956/220145333-68aedb04-5c57-4dca-aa1f-037a245100ba.png">



### Checklist

Delete any items that are not applicable to this PR.

- [X] 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)
- [X]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
~- [ ] [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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
This commit is contained in:
Maja Grubic 2023-03-10 09:45:06 +01:00 committed by GitHub
parent 1ad0bfd16a
commit c69bb77235
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 10 deletions

View file

@ -488,7 +488,7 @@ The plugin exposes the static DefaultEditorController class to consume.
|{kib-repo}blob/{branch}/x-pack/plugins/custom_branding/README.md[customBranding]
|This is a plugin to configure custom branding.
This plugin is currently under active development; do not use.
Plugin server-side only. Plugin has three main functions:
|<<dashboard-enhanced-plugin>>

View file

@ -1,10 +1,21 @@
# customBranding
## !! UNDER DEVELOPMENT !!
This is a plugin to configure custom branding.
This plugin is currently under active development; do not use.
Plugin server-side only. Plugin has three main functions:
1. To check license (custom branding is available for enterprise licenses and above)
2. To register itself with a custom branding service
3. To register UI settings
Properties that can be configured through custom branding are:
1. Custom logo (replaces the default `Elastic` logo in the chrome header and on the login page)
2. Customized text (replaces the `elastic` logo in the the chrome header)
3. Page title
4. Favicons - PNG and SVG
---
## Development
For detailed architectural overview, see image: ![architecture_diagram](./architecture_diagram.png)
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment.

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

View file

@ -96,7 +96,6 @@ export class CustomBrandingPlugin implements Plugin {
const key = settingsKeys[i];
const fullKey = `xpackCustomBranding:${key}`;
const value = await uiSettingsClient.get(fullKey);
this.logger.info(`Fetching custom branding key ${fullKey} with value ${value}`);
if (value) {
branding[key] = value;
}

View file

@ -15,7 +15,7 @@ export const UI_SETTINGS_CUSTOMIZED_LOGO = 'xpackCustomBranding:customizedLogo';
export const UI_SETTINGS_PAGE_TITLE = 'xpackCustomBranding:pageTitle';
export const UI_SETTINGS_FAVICON_PNG = 'xpackCustomBranding:faviconPNG';
export const UI_SETTINGS_FAVICON_SVG = 'xpackCustomBranding:faviconSVG';
export const PLUGIN_ID = 'Custom Branding';
export const PLUGIN_ID = 'Custom branding';
const kbToBase64Length = (kb: number) => Math.floor((kb * 1024 * 8) / 6);
const maxLogoSizeInBase64 = kbToBase64Length(200);
@ -59,15 +59,16 @@ const subscriptionLink = `
})}
</a>
`;
export function registerUiSettings(core: CoreSetup<object, unknown>) {
core.uiSettings.registerGlobal({
[UI_SETTINGS_CUSTOM_LOGO]: {
name: i18n.translate('xpack.customBranding.customLogoLabel', {
defaultMessage: 'Logo icon',
defaultMessage: 'Custom logo',
}),
value: null,
description: i18n.translate('xpack.customBranding.customLogoDescription', {
defaultMessage: `Replaces the Elastic logo. Logos look best when they are no larger than 128 x 128 pixels and have a transparent background. {subscriptionLink}`,
defaultMessage: `Replaces the Elastic logo. Logos look best when they are no larger than 128 x 128 pixels and have a transparent background. {subscriptionLink}`,
values: { subscriptionLink },
}),
sensitive: true,
@ -83,7 +84,7 @@ export function registerUiSettings(core: CoreSetup<object, unknown>) {
}),
value: null,
description: i18n.translate('xpack.customBranding.customizedLogoDescription', {
defaultMessage: `Replaces the Elastic text. Images look best when they are no larger than 200 x 84 pixels and have a transparent background. {subscriptionLink}`,
defaultMessage: `Replaces the text next to the logo. Images look best when they are no larger than 200 x 84 pixels and have a transparent background. {subscriptionLink}`,
values: { subscriptionLink },
}),
sensitive: true,
@ -115,7 +116,7 @@ export function registerUiSettings(core: CoreSetup<object, unknown>) {
}),
value: null,
description: i18n.translate('xpack.customBranding.faviconSVGDescription', {
defaultMessage: `A link to an icon that will appear on browser tabs. Recommended size is 16 x 16 pixels. {subscriptionLink}`,
defaultMessage: `The URL of an image that will appear on browser tabs. Recommended size is 16 x 16 pixels. {subscriptionLink}`,
values: { subscriptionLink },
}),
sensitive: true,
@ -131,7 +132,7 @@ export function registerUiSettings(core: CoreSetup<object, unknown>) {
}),
value: null,
description: i18n.translate('xpack.customBranding.faviconPNGDescription', {
defaultMessage: `An icon for use in browsers that dont support svg. {subscriptionLink}`,
defaultMessage: `The URL of an image for use in browsers that dont support SVG. {subscriptionLink}`,
values: { subscriptionLink },
}),
sensitive: true,