Skip to content

Commit

Permalink
finishing header->top replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Mar 29, 2021
1 parent 0570ea1 commit 2ac2bea
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/settings/banners-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can configure the `xpack.banners` settings in your `kibana.yml` file.
|===

| `xpack.banners.placement`
| Set to `header` to enable the header banner. Defaults to `disabled`.
| Set to `top` to enable the top banner. Defaults to `disabled`.

| `xpack.banners.textContent`
| The text to display inside the banner, either plain text or Markdown.
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/banners/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The options are

The placement of the banner. The allowed values are:
- `disabled` - The banner will be disabled
- `header` - The banner will be displayed in the header
- `top` - The banner will be displayed in the header

- `textContent`

Expand All @@ -31,7 +31,7 @@ The color for the banner's background. Must be a valid hex color
`kibana.yml`
```yaml
xpack.banners:
placement: 'header'
placement: 'top'
textContent: 'Production environment - Proceed with **special levels** of caution'
textColor: '#FF0000'
backgroundColor: '#CC2211'
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/banners/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface BannerInfoResponse {
banner: BannerConfiguration;
}

export type BannerPlacement = 'disabled' | 'header';
export type BannerPlacement = 'disabled' | 'top';

export interface BannerConfiguration {
placement: BannerPlacement;
Expand Down
8 changes: 4 additions & 4 deletions x-pack/plugins/banners/public/plugin.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ describe('BannersPlugin', () => {
});

describe('when banner is allowed', () => {
it('registers the header banner if `banner.placement` is `header`', async () => {
it('registers the header banner if `banner.placement` is `top`', async () => {
getBannerInfoMock.mockResolvedValue({
allowed: true,
banner: createBannerConfig({
placement: 'header',
placement: 'top',
}),
});

Expand All @@ -82,11 +82,11 @@ describe('BannersPlugin', () => {
});

describe('when banner is not allowed', () => {
it('does not register the header banner if `banner.placement` is `header`', async () => {
it('does not register the header banner if `banner.placement` is `top`', async () => {
getBannerInfoMock.mockResolvedValue({
allowed: false,
banner: createBannerConfig({
placement: 'header',
placement: 'top',
}),
});

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/banners/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class BannersPlugin implements Plugin<{}, {}, {}, {}> {
start({ chrome, uiSettings, http }: CoreStart) {
getBannerInfo(http).then(
({ allowed, banner }) => {
if (allowed && banner.placement === 'header') {
if (allowed && banner.placement === 'top') {
chrome.setHeaderBanner({
content: toMountPoint(<Banner bannerConfig={banner} />),
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/banners/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('BannersPlugin', () => {

beforeEach(() => {
bannerConfig = {
placement: 'header',
placement: 'top',
textContent: 'foo',
backgroundColor: '#000000',
textColor: '#FFFFFF',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/banners/server/ui_settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('registerSettings', () => {

it('uses the configuration values as defaults', () => {
const config = createConfig({
placement: 'header',
placement: 'top',
backgroundColor: '#FF00CC',
textColor: '#AAFFEE',
textContent: 'Some text',
Expand Down

0 comments on commit 2ac2bea

Please sign in to comment.