mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Implements query bar portion of https://elastic.github.io/eui/#/layout/header. Filter bar will come in another PR. Fixes #14086 Re-implements our query bar component in React using some EUI components. Existing typeahead and suggestion styles were copied over 1:1 for now after talking with Dave about it. In this PR I focused on reaching feature parity with the existing query bar. Some additional work would be needed before we could move this into EUI as a generic component that could be consumed by other plugins. Still needs some new tests and I suspect some old tests will need to be updated, but other than that this PR is functionally complete and ready for reviews.
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
/*
|
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
* license agreements. See the NOTICE file distributed with
|
|
* this work for additional information regarding copyright
|
|
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
* the Apache License, Version 2.0 (the "License"); you may
|
|
* not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing,
|
|
* software distributed under the License is distributed on an
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
* KIND, either express or implied. See the License for the
|
|
* specific language governing permissions and limitations
|
|
* under the License.
|
|
*/
|
|
|
|
import { toUser } from './lib/to_user';
|
|
import { fromUser } from './lib/from_user';
|
|
|
|
import { uiModules } from '../modules';
|
|
uiModules
|
|
.get('kibana')
|
|
.directive('parseQuery', function () {
|
|
|
|
return {
|
|
restrict: 'A',
|
|
require: 'ngModel',
|
|
scope: {
|
|
'ngModel': '='
|
|
},
|
|
link: function ($scope, elem, attr, ngModel) {
|
|
const init = function () {
|
|
$scope.ngModel = fromUser($scope.ngModel);
|
|
};
|
|
|
|
ngModel.$parsers.push(fromUser);
|
|
ngModel.$formatters.push(toUser);
|
|
|
|
init();
|
|
}
|
|
};
|
|
});
|