Ensure timefilter updates correctly (#20677)

This commit is contained in:
Søren Louv-Jansen 2018-07-11 21:35:45 +02:00 committed by GitHub
parent 047e003e91
commit 32505afd3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 12 deletions

View file

@ -126,7 +126,6 @@
"moment-timezone": "^0.5.14",
"ngreact": "^0.5.1",
"nodemailer": "^4.6.4",
"object-hash": "1.2.0",
"path-match": "1.2.4",
"pdfmake": "0.1.33",
"pivotal-ui": "13.0.1",

View file

@ -50,19 +50,19 @@ export function initTimepicker(history, dispatch) {
history.listen(() => {
updateRefreshRate(dispatch);
globalState.fetch();
dispatch(updateTimePickerAction());
globalState.fetch(); // ensure global state is updated when url changes
});
// ensure that timepicker updates when global state changes
registerTimefilterWithGlobalState(globalState);
timefilter.enableTimeRangeSelector();
timefilter.enableAutoRefreshSelector();
dispatch(updateTimePickerAction());
updateRefreshRate(dispatch);
$scope.$listen(timefilter, 'timeUpdate', () =>
dispatch(updateTimePickerAction())
);
registerTimefilterWithGlobalState(globalState);
Promise.all([waitForAngularReady]).then(resolve);
});
});

View file

@ -5446,10 +5446,6 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"
object-hash@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.2.0.tgz#e96af0e96981996a1d47f88ead8f74f1ebc4422b"
object-inspect@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-0.4.0.tgz#f5157c116c1455b243b06ee97703392c5ad89fec"