-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[uiApp] replace uiApp.injectVars with server.injectUiAppVars() (#17485)
* [uiApp] replace uiApp.injectVars with server.injectUiAppVars() * [server/injectUiAppVars] cleanup styling * [server/injectUiAppVars] add test to verify injectUiAppVars merging * [server/injectUiAppVars] describe what type of id we expect * [uiExportTypes/uiApp] add removal error to proper location * [uiApps/tests] avoid snapshots for undefined/{} values
- Loading branch information
Showing
11 changed files
with
244 additions
and
96 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
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,92 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`UiAppsMixin creates kbnServer.uiApps from uiExports 1`] = ` | ||
Array [ | ||
StubUiApp { | ||
"_hidden": true, | ||
"_id": "foo", | ||
}, | ||
StubUiApp { | ||
"_hidden": false, | ||
"_id": "bar", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`UiAppsMixin decorates server with methods 1`] = ` | ||
Array [ | ||
Array [ | ||
"server", | ||
"getAllUiApps", | ||
[Function], | ||
], | ||
Array [ | ||
"server", | ||
"getUiAppById", | ||
[Function], | ||
], | ||
Array [ | ||
"server", | ||
"getHiddenUiAppById", | ||
[Function], | ||
], | ||
Array [ | ||
"server", | ||
"injectUiAppVars", | ||
[Function], | ||
], | ||
Array [ | ||
"server", | ||
"getInjectedUiAppVars", | ||
[Function], | ||
], | ||
] | ||
`; | ||
|
||
exports[`UiAppsMixin server.getAllUiApps() returns hidden and non-hidden apps 1`] = ` | ||
Array [ | ||
StubUiApp { | ||
"_hidden": true, | ||
"_id": "foo", | ||
}, | ||
StubUiApp { | ||
"_hidden": false, | ||
"_id": "bar", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`UiAppsMixin server.getHiddenUiAppById() returns hidden apps when requested, undefined for non-hidden and unknown apps 1`] = ` | ||
StubUiApp { | ||
"_hidden": true, | ||
"_id": "foo", | ||
} | ||
`; | ||
|
||
exports[`UiAppsMixin server.getUiAppById() returns non-hidden apps when requested, undefined for non-hidden and unknown apps 1`] = ` | ||
StubUiApp { | ||
"_hidden": false, | ||
"_id": "bar", | ||
} | ||
`; | ||
|
||
exports[`UiAppsMixin server.injectUiAppVars()/server.getInjectedUiAppVars() merges injected vars provided by multiple providers in the order they are registered: foo 1`] = ` | ||
Object { | ||
"bar": false, | ||
"baz": 1, | ||
"box": true, | ||
"foo": true, | ||
} | ||
`; | ||
|
||
exports[`UiAppsMixin server.injectUiAppVars()/server.getInjectedUiAppVars() stored injectVars provider and returns provider result when requested: bar 1`] = ` | ||
Object { | ||
"thisIsFoo": false, | ||
} | ||
`; | ||
|
||
exports[`UiAppsMixin server.injectUiAppVars()/server.getInjectedUiAppVars() stored injectVars provider and returns provider result when requested: foo 1`] = ` | ||
Object { | ||
"thisIsFoo": true, | ||
} | ||
`; |
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
Oops, something went wrong.