-
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.
Changing the inheritance chain so it's resolved at merge time
- Loading branch information
1 parent
2d6eda1
commit 7ff55bf
Showing
12 changed files
with
134 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,4 +88,4 @@ <h2>Searching</h2> | |
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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
49 changes: 49 additions & 0 deletions
49
src/kibana/components/courier/data_source/_root_search_source.js
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,49 @@ | ||
define(function (require) { | ||
return function RootSearchSource(Private, $rootScope, config, Promise, indexPatterns, timefilter) { | ||
var prom; // promise that must be resolved before the source is acurrate (updated by loadDefaultPattern) | ||
var appSource; | ||
var SearchSource = Private(require('components/courier/data_source/search_source')); | ||
|
||
var get = function () { | ||
return prom || loadDefaultPattern(); | ||
}; | ||
|
||
var set = function (source) { | ||
source.inherits(globalSource); | ||
appSource = source; | ||
}; | ||
|
||
var loadDefaultPattern = function () { | ||
var defId = config.get('defaultIndex'); | ||
|
||
return prom = Promise.cast(defId && indexPatterns.get(defId)).then(function (pattern) { | ||
globalSource.set('index', pattern); | ||
return appSource; | ||
}); | ||
}; | ||
|
||
var globalSource = new SearchSource(); | ||
globalSource.inherits(false); | ||
set(new SearchSource()); | ||
|
||
globalSource.filter(function (globalSource) { | ||
// dynamic time filter will be called in the _flatten phase of things | ||
return timefilter.get(globalSource.get('index')); | ||
}); | ||
|
||
$rootScope.$on('change:config.defaultIndex', loadDefaultPattern); | ||
$rootScope.$on('init:config', loadDefaultPattern); | ||
|
||
function onRouteChangeStart() { | ||
appSource = new SearchSource(); | ||
} | ||
|
||
$rootScope.$on('$routeChangeStart', onRouteChangeStart); | ||
$rootScope.$on('$routeUpdate', onRouteChangeStart); | ||
|
||
return { | ||
get: get, | ||
set: set | ||
}; | ||
}; | ||
}); |
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