-
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.
Browse files
Browse the repository at this point in the history
* move find logic to SavedObjectFinder component since savedObjectClient is no longer coupled to angular * implement flyout open saved searches * remove old open stuff * add jest test for OpenSearchPanel and simplify panel title * fix functional tests * fix _lab_mode functional test
- Loading branch information
Showing
15 changed files
with
297 additions
and
92 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
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
7 changes: 0 additions & 7 deletions
7
src/core_plugins/kibana/public/discover/partials/load_search.html
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
src/core_plugins/kibana/public/discover/top_nav/__snapshots__/open_search_panel.test.js.snap
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,44 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`render 1`] = ` | ||
<EuiFlyout | ||
closeButtonAriaLabel="Closes this dialog" | ||
data-test-subj="loadSearchForm" | ||
hideCloseButton={false} | ||
maxWidth={false} | ||
onClose={[Function]} | ||
ownFocus={true} | ||
size="m" | ||
> | ||
<EuiFlyoutBody> | ||
<EuiTitle | ||
size="s" | ||
> | ||
<h1> | ||
Open Search | ||
</h1> | ||
</EuiTitle> | ||
<EuiSpacer | ||
size="m" | ||
/> | ||
<SavedObjectFinder | ||
callToActionButton={ | ||
<EuiButton | ||
color="primary" | ||
fill={false} | ||
href="#/management/kibana/objects?_a=(tab:search)" | ||
iconSide="left" | ||
onClick={[Function]} | ||
type="button" | ||
> | ||
Manage searches | ||
</EuiButton> | ||
} | ||
makeUrl={[Function]} | ||
noItemsMessage="No matching searches found." | ||
onChoose={[Function]} | ||
savedObjectType="search" | ||
/> | ||
</EuiFlyoutBody> | ||
</EuiFlyout> | ||
`; |
80 changes: 80 additions & 0 deletions
80
src/core_plugins/kibana/public/discover/top_nav/open_search_panel.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,80 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { SavedObjectFinder } from 'ui/saved_objects/components/saved_object_finder'; | ||
import rison from 'rison-node'; | ||
|
||
import { | ||
EuiSpacer, | ||
EuiFlyout, | ||
EuiFlyoutBody, | ||
EuiTitle, | ||
EuiButton, | ||
} from '@elastic/eui'; | ||
|
||
const SEARCH_OBJECT_TYPE = 'search'; | ||
|
||
export class OpenSearchPanel extends React.Component { | ||
|
||
renderMangageSearchesButton() { | ||
return ( | ||
<EuiButton | ||
onClick={this.props.onClose} | ||
href={`#/management/kibana/objects?_a=${rison.encode({ tab: SEARCH_OBJECT_TYPE })}`} | ||
> | ||
Manage searches | ||
</EuiButton> | ||
); | ||
} | ||
|
||
render() { | ||
return ( | ||
<EuiFlyout | ||
ownFocus | ||
onClose={this.props.onClose} | ||
data-test-subj="loadSearchForm" | ||
> | ||
<EuiFlyoutBody> | ||
|
||
<EuiTitle size="s"> | ||
<h1>Open Search</h1> | ||
</EuiTitle> | ||
|
||
<EuiSpacer size="m" /> | ||
|
||
<SavedObjectFinder | ||
noItemsMessage="No matching searches found." | ||
savedObjectType={SEARCH_OBJECT_TYPE} | ||
makeUrl={this.props.makeUrl} | ||
onChoose={this.props.onClose} | ||
callToActionButton={this.renderMangageSearchesButton()} | ||
/> | ||
|
||
</EuiFlyoutBody> | ||
</EuiFlyout> | ||
); | ||
} | ||
} | ||
|
||
OpenSearchPanel.propTypes = { | ||
onClose: PropTypes.func.isRequired, | ||
makeUrl: PropTypes.func.isRequired, | ||
}; |
33 changes: 33 additions & 0 deletions
33
src/core_plugins/kibana/public/discover/top_nav/open_search_panel.test.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,33 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import { | ||
OpenSearchPanel, | ||
} from './open_search_panel'; | ||
|
||
test('render', () => { | ||
const component = shallow(<OpenSearchPanel | ||
onClose={() => {}} | ||
makeUrl={() => {}} | ||
/>); | ||
expect(component).toMatchSnapshot(); | ||
}); |
Oops, something went wrong.