forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Timelion] Move the local menu to the header (elastic#80627)
* [Timelion] Move the local menu to the header * nice improvement * remove console msg * cleanup Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
59348cc
commit e2a48da
Showing
4 changed files
with
62 additions
and
29 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
58 changes: 58 additions & 0 deletions
58
src/plugins/timelion/public/components/timelion_top_nav_directive.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,58 @@ | ||
/* | ||
* 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'; | ||
|
||
export function initTimelionTopNavDirective(app, deps) { | ||
app.directive('timelionTopNav', function (reactDirective) { | ||
return reactDirective( | ||
(props) => { | ||
const { TopNavMenu } = deps.plugins.navigation.ui; | ||
return ( | ||
<deps.core.i18n.Context> | ||
<TopNavMenu | ||
appName="timelion" | ||
showTopNavMenu | ||
config={props.topNavMenu} | ||
setMenuMountPoint={deps.mountParams.setHeaderActionMenu} | ||
onQuerySubmit={props.onTimeUpdate} | ||
screenTitle="timelion" | ||
showDatePicker | ||
showFilterBar={false} | ||
showQueryInput={false} | ||
showSaveQuery={false} | ||
showSearchBar | ||
useDefaultBehaviors | ||
/> | ||
</deps.core.i18n.Context> | ||
); | ||
}, | ||
[ | ||
['topNavMenu', { watchDepth: 'reference' }], | ||
['onTimeUpdate', { watchDepth: 'reference' }], | ||
], | ||
{ | ||
restrict: 'E', | ||
scope: { | ||
topNavMenu: '=', | ||
onTimeUpdate: '=', | ||
}, | ||
} | ||
); | ||
}); | ||
} |
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