-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spaces NP Migration - Moving server to the LegacyAPI model #45382
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3dcd3ef
moving to the legacy api model
legrego f58b05d
update onPostAuth error handling
legrego 115ea0c
cleaning up onRequest interceptor tests
legrego 1b619a6
updating UI Capabilities tests to expect redirection to new space sel…
legrego 4962e51
pass status code correctly
legrego 2e4f6f4
update snapshot...
legrego b4939e3
remove unused interface
legrego b2ed48f
removing ts-ignore
legrego 940742d
marking plugin fields readonly
legrego 1099e3f
removing unnecessary types
legrego 6d26d9f
improving type safety of wrapError
legrego ea16257
simplifying legacy config access
legrego 87d7ae7
moving interceptor tests into an integration_tests folder for better …
legrego 7ae92e2
Merge branch 'master' of github.com:elastic/kibana into np/spaces-leg…
legrego 3d8729b
remove hard-coded test credentials
legrego abe5cb2
Revert "moving interceptor tests into an integration_tests folder for…
legrego 4c30bfc
removing spaces enabled check from usage collector
legrego 81629bc
removing unnecessary types
legrego 0a8ba3f
moving legacy router into LegacyAPI
legrego 48b0091
improve handling when navigating to the root of a non-default space
legrego 42c617f
Merge branch 'master' of github.com:elastic/kibana into np/spaces-leg…
legrego 5770f84
Merge branch 'master' into np/spaces-legacy-api
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { KibanaConfig } from 'src/legacy/server/kbn_server'; | ||
import { get } from 'lodash'; | ||
import { CallAPIOptions } from 'src/core/server'; | ||
import { XPackMainPlugin } from '../../../xpack_main/xpack_main'; | ||
|
@@ -114,7 +113,7 @@ export interface UsageStats { | |
} | ||
|
||
interface CollectorDeps { | ||
config: KibanaConfig; | ||
kibanaIndex: string; | ||
usage: { collectorSet: any }; | ||
xpackMain: XPackMainPlugin; | ||
} | ||
|
@@ -131,19 +130,17 @@ export function getSpacesUsageCollector(deps: CollectorDeps) { | |
fetch: async (callCluster: CallCluster) => { | ||
const xpackInfo = deps.xpackMain.info; | ||
const available = xpackInfo && xpackInfo.isAvailable(); // some form of spaces is available for all valid licenses | ||
const enabled = deps.config.get('xpack.spaces.enabled'); | ||
const spacesAvailableAndEnabled = Boolean(available && enabled); | ||
|
||
const usageStats = await getSpacesUsage( | ||
callCluster, | ||
deps.config.get('kibana.index'), | ||
deps.kibanaIndex, | ||
deps.xpackMain, | ||
spacesAvailableAndEnabled | ||
available | ||
); | ||
|
||
return { | ||
available, | ||
enabled: spacesAvailableAndEnabled, // similar behavior as _xpack API in ES | ||
enabled: available, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not technically necessary to have both |
||
...usageStats, | ||
} as UsageStats; | ||
}, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
legacyConfig
moves toLegacyAPI.legacyConfig