-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:elastic/kibana into deprecations/…
…docs
- Loading branch information
Showing
150 changed files
with
2,352 additions
and
1,424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") | ||
|
||
PKG_BASE_NAME = "kbn-spec-to-console" | ||
PKG_REQUIRE_NAME = "@kbn/spec-to-console" | ||
|
||
SOURCE_FILES = glob( | ||
[ | ||
"bin/**/*", | ||
"lib/**/*", | ||
"index.js" | ||
], | ||
exclude = [ | ||
"**/*.test.*", | ||
"**/__fixtures__/**", | ||
], | ||
) | ||
|
||
SRCS = SOURCE_FILES | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = SRCS, | ||
) | ||
|
||
NPM_MODULE_EXTRA_FILES = [ | ||
"package.json", | ||
"README.md", | ||
] | ||
|
||
DEPS = [] | ||
|
||
js_library( | ||
name = PKG_BASE_NAME, | ||
srcs = NPM_MODULE_EXTRA_FILES + [ | ||
":srcs", | ||
], | ||
deps = DEPS, | ||
package_name = PKG_REQUIRE_NAME, | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
pkg_npm( | ||
name = "npm_module", | ||
deps = [ | ||
":%s" % PKG_BASE_NAME, | ||
] | ||
) | ||
|
||
filegroup( | ||
name = "build", | ||
srcs = [ | ||
":npm_module", | ||
], | ||
visibility = ["//visibility:public"], | ||
) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
src/core/public/core_app/errors/public_base_url.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { docLinksServiceMock } from '../../doc_links/doc_links_service.mock'; | ||
import { httpServiceMock } from '../../http/http_service.mock'; | ||
import { notificationServiceMock } from '../../notifications/notifications_service.mock'; | ||
|
||
import { setupPublicBaseUrlConfigWarning } from './public_base_url'; | ||
|
||
describe('publicBaseUrl warning', () => { | ||
const docLinks = docLinksServiceMock.createStartContract(); | ||
const notifications = notificationServiceMock.createStartContract(); | ||
|
||
beforeEach(() => { | ||
jest.resetAllMocks(); | ||
}); | ||
|
||
it('does not show any toast on localhost', () => { | ||
const http = httpServiceMock.createStartContract(); | ||
|
||
setupPublicBaseUrlConfigWarning({ | ||
docLinks, | ||
notifications, | ||
http, | ||
location: { | ||
hostname: 'localhost', | ||
} as Location, | ||
}); | ||
|
||
expect(notifications.toasts.addWarning).not.toHaveBeenCalled(); | ||
}); | ||
|
||
it('does not show any toast on 127.0.0.1', () => { | ||
const http = httpServiceMock.createStartContract(); | ||
|
||
setupPublicBaseUrlConfigWarning({ | ||
docLinks, | ||
notifications, | ||
http, | ||
location: { | ||
hostname: '127.0.0.1', | ||
} as Location, | ||
}); | ||
|
||
expect(notifications.toasts.addWarning).not.toHaveBeenCalled(); | ||
}); | ||
|
||
it('does not show toast if configured correctly', () => { | ||
const http = httpServiceMock.createStartContract({ publicBaseUrl: 'http://myhost.com' }); | ||
|
||
setupPublicBaseUrlConfigWarning({ | ||
docLinks, | ||
notifications, | ||
http, | ||
location: { | ||
hostname: 'myhost.com', | ||
toString() { | ||
return 'http://myhost.com/'; | ||
}, | ||
} as Location, | ||
}); | ||
|
||
expect(notifications.toasts.addWarning).not.toHaveBeenCalled(); | ||
}); | ||
|
||
describe('config missing toast', () => { | ||
it('adds toast if publicBaseUrl is missing', () => { | ||
const http = httpServiceMock.createStartContract({ publicBaseUrl: undefined }); | ||
|
||
setupPublicBaseUrlConfigWarning({ | ||
docLinks, | ||
notifications, | ||
http, | ||
location: { | ||
hostname: 'myhost.com', | ||
toString() { | ||
return 'http://myhost.com/'; | ||
}, | ||
} as Location, | ||
}); | ||
|
||
expect(notifications.toasts.addWarning).toHaveBeenCalledWith({ | ||
title: 'Configuration missing', | ||
text: expect.any(Function), | ||
}); | ||
}); | ||
|
||
it('does not add toast if storage key set', () => { | ||
const http = httpServiceMock.createStartContract({ publicBaseUrl: undefined }); | ||
|
||
setupPublicBaseUrlConfigWarning({ | ||
docLinks, | ||
notifications, | ||
http, | ||
location: { | ||
hostname: 'myhost.com', | ||
toString() { | ||
return 'http://myhost.com/'; | ||
}, | ||
} as Location, | ||
storage: { | ||
getItem: (id: string) => 'true', | ||
} as Storage, | ||
}); | ||
|
||
expect(notifications.toasts.addWarning).not.toHaveBeenCalled(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.