mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
do not remove selection when clicking refreh fields
This commit is contained in:
parent
84a504ecf0
commit
afce3bede7
1 changed files with 21 additions and 1 deletions
|
@ -43,7 +43,14 @@ uiModules.get('apps/management')
|
|||
};
|
||||
|
||||
$scope.refreshFieldList = function () {
|
||||
fetchFieldList().then(updateFieldList);
|
||||
const timeField = index.timeField;
|
||||
fetchFieldList().then(function (results) {
|
||||
if (timeField) {
|
||||
updateFieldListAndSeed(results, timeField);
|
||||
} else {
|
||||
updateFieldList(results);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.createIndexPattern = function () {
|
||||
|
@ -247,6 +254,19 @@ uiModules.get('apps/management')
|
|||
}, notify.fatal);
|
||||
}
|
||||
|
||||
function updateFieldListAndSeed(results, seedField) {
|
||||
|
||||
updateFieldList(results);
|
||||
|
||||
if (!results.dateFields.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const matchingField = results.dateFields.find(field => field.name === seedField.name);
|
||||
index.timeField = matchingField ? matchingField : results.dateFields[0];
|
||||
|
||||
}
|
||||
|
||||
function updateFieldList(results) {
|
||||
index.fetchFieldsError = results.fetchFieldsError;
|
||||
index.dateFields = results.dateFields;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue