mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Merge pull request #410 from rashidkpc/fix/index-pattern-flicker
Fix index pattern create flicker
This commit is contained in:
commit
6e32b9d21a
2 changed files with 11 additions and 10 deletions
|
@ -91,7 +91,7 @@
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<div class="form-group" ng-if="index.isTimeBased">
|
||||
<div class="form-group" ng-if="index.isTimeBased && !index.fetchFieldsError">
|
||||
<label>
|
||||
Time-field name
|
||||
|
||||
|
@ -108,16 +108,14 @@
|
|||
ng-model="index.timeField"
|
||||
class="form-control">
|
||||
</select>
|
||||
<select ng-if="index.fetchFieldsError" class="form-control" disabled >
|
||||
<option>{{index.fetchFieldsError}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button
|
||||
ng-disabled="form.$invalid || index.fetchFieldsError"
|
||||
ng-class="index.fetchFieldsError ? 'btn-default' : 'btn-success'"
|
||||
type="submit"
|
||||
class="btn btn-success">
|
||||
{{index.fetchFieldsError ? "No indices found" : "Create" }}
|
||||
class="btn">
|
||||
{{index.fetchFieldsError || "Create" }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -76,7 +76,7 @@ define(function (require) {
|
|||
};
|
||||
|
||||
$scope.refreshFieldList = _.debounce(function () {
|
||||
index.dateFields = index.timeField = index.fetchFieldsError = index.listUsed = null;
|
||||
index.dateFields = index.timeField = index.listUsed = null;
|
||||
var useIndexList = index.isTimeBased && index.nameIsPattern;
|
||||
|
||||
// we don't have enough info to continue
|
||||
|
@ -118,9 +118,12 @@ define(function (require) {
|
|||
});
|
||||
})
|
||||
.then(function (fields) {
|
||||
index.dateFields = fields.filter(function (field) {
|
||||
return field.type === 'date';
|
||||
});
|
||||
if (fields.length > 0) {
|
||||
index.fetchFieldsError = null;
|
||||
index.dateFields = fields.filter(function (field) {
|
||||
return field.type === 'date';
|
||||
});
|
||||
}
|
||||
}, notify.fatal);
|
||||
}, 50, { leading: true, trailing: false });
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue