Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved kbnGlobalTimepicker into old kbn_top_nav (both do be deprecated) #40603

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
e5f6f9c
kbn top nav in discover
Jun 19, 2019
d5d7e38
New top nav in dashboard and vis editor
Jun 19, 2019
3b97926
change kbn top nav directive
Jun 19, 2019
1ea5b7b
Stop using template feature of kbn top nav
Jun 26, 2019
8a7ba6b
Combined css
Jun 27, 2019
c4b84bf
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jun 27, 2019
2e90a18
Merge branch 'newplatform/kbn-top-nav/graph' into newplatform/kbn-top…
Jun 27, 2019
344b055
console top nav
Jun 27, 2019
3c5878b
Removed unnecessary use of kbn-top-nav in dev tools app (wrapping tabs)
Jun 27, 2019
d01d882
Merge branch 'newplatform/kbn-top-nav/devtools-2' into newplatform/kb…
Jun 27, 2019
366b03a
Changed console menu to new directive
Jun 27, 2019
5b0a63d
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jun 30, 2019
9599e15
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 1, 2019
4766510
CSS adjustments + functional implementation of top nav menu item
Jul 1, 2019
b23d0c3
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 1, 2019
929ed9c
Fixed DevTools top nav toggle
Jul 2, 2019
6adc512
Optional show-border
Jul 2, 2019
0f24457
timelion menu works
Jul 2, 2019
f6906b7
Improve filter sorting logic to be more stable
Jul 3, 2019
c5d3a14
Merge branch 'bug/filter-manager/sorting-logic-failure' into newplatf…
Jul 3, 2019
20a9922
Support showing filter bar as part of top nav
Jul 3, 2019
daf6f98
Use search bar in top nav in discover and maps
Jul 3, 2019
c580fe7
tmp revert
Jul 4, 2019
78ea450
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 4, 2019
b3711e6
Align search bar settings accross apps
Jul 4, 2019
3117fce
Reverted change in ML, removed unused css
Jul 4, 2019
3cfa5c7
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 4, 2019
e749bd4
Added data test subj to top nav menu items
Jul 4, 2019
fa5332d
Watch config by value
Jul 4, 2019
833d49f
Some directive magic to make sure that disabledButtons functions are …
Jul 5, 2019
8fee73a
Fix missing controls from new top nav in some visualizations
Jul 7, 2019
cc5dbff
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 7, 2019
d368c94
showAutoRefreshOnly in input controls visualization
Jul 7, 2019
000eeb2
Fixed inspector disabled test
Jul 7, 2019
efe00bf
Fix dashboard action links
Jul 7, 2019
97496c6
snapshots
Jul 7, 2019
d52e581
Fixed maps filter bar
Jul 7, 2019
8c06d39
Remvoed comment
Jul 7, 2019
afd9933
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 8, 2019
5f71b4e
Update Query Bar defaults
Jul 8, 2019
86dbbbc
Top nav menu item tests
Jul 8, 2019
e6260ea
Moved storage instantiation to angular directive
Jul 8, 2019
ddcdda0
SearchBar jest tests
Jul 8, 2019
9a68d7a
Query bar additional tests
Jul 8, 2019
c2bc4d3
Top nav menu tests
Jul 8, 2019
144d8bb
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 8, 2019
247a4f7
Pass store into top nav menu correctly
Jul 9, 2019
e5fb6d8
watch store by reference
Jul 9, 2019
1856e8f
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 9, 2019
7786fa9
Added not null assertion
Jul 9, 2019
bcb6674
Make index patterns optional (for timepicker only setup)
Jul 9, 2019
60f1643
QueryBar tests again
Jul 9, 2019
d7b9941
Search bar tests
Jul 9, 2019
362d322
Top nav tests
Jul 9, 2019
01b359c
Top nav menu tests
Jul 9, 2019
541c813
removed unnecessary ui/new_platform mock
Jul 9, 2019
d7fe175
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 10, 2019
caad37f
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 11, 2019
5cac8c9
Moved discover result count away from top nav
Jul 11, 2019
3316b4a
Moved and improved top nav menu css
Jul 11, 2019
4d64d66
remove unused translations
Jul 11, 2019
0401c7f
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 14, 2019
df1f06d
Move timepicker (to be deprecated) into old kbn_top_nav
Jul 9, 2019
eaf21a7
Deleted search-bar and query-bar directives!
Jul 11, 2019
cef0742
moved search bar to kibana_react (it's a generic react component, not…
Jul 11, 2019
938c5c0
translations
Jul 11, 2019
83ff3c3
Moved superDatePicker directive to kbn_top_nav (to be deprecated)
Jul 11, 2019
d5e07ab
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 15, 2019
ff59ab8
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 17, 2019
209797d
Code review part 1
Jul 17, 2019
37d7a98
Code review part 2 - clean up top nav menu item run interface
Jul 17, 2019
8729b57
Give top nav items better keys
Jul 17, 2019
d6f904f
Simplified top nav construction logic in editor
Jul 17, 2019
d6b1112
Merge branch 'newplatform/kbn-top-nav/new-directive' into newplatform…
Jul 17, 2019
c2ed904
Fixed mock of search bar in top nav test
Jul 17, 2019
c6f6ca5
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 17, 2019
8881518
Merge remote-tracking branch 'upstream/master' into newplatform/kbn-t…
Jul 17, 2019
0f41c0c
Merge branch 'newplatform/kbn-top-nav/new-directive' into newplatform…
Jul 18, 2019
d127cfd
Moved filter trigger button rendering to helper function
Jul 18, 2019
541a779
Remove responsiveness from top nav items
Jul 18, 2019
a6ba593
vertical align for cases where showSearchBarInline is true
Jul 18, 2019
f5ea79d
Export TopNavMenuData type
Jul 18, 2019
045efb0
Removed unused name attribute in top nav. Use app-name instead.
Jul 18, 2019
b8ff540
Merge branch 'newplatform/kbn-top-nav/new-directive' into newplatform…
Jul 18, 2019
3232156
Copy KEY => ID in angular directive
Jul 18, 2019
a5390cb
Merge branch 'newplatform/kbn-top-nav/new-directive' into newplatform…
Jul 18, 2019
f7f43dc
i18n fix
Jul 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"paths": {
"common.ui": "src/legacy/ui",
"data": "src/legacy/core_plugins/data",
"kibana_react": "src/legacy/core_plugins/kibana_react",
"server": "src/legacy/server",
"console": "src/legacy/core_plugins/console",
"core": "src/core",
Expand Down
5 changes: 4 additions & 1 deletion src/legacy/core_plugins/console/public/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<kbn-top-nav name="console" config="topNavMenu"></kbn-top-nav>
<kbn-top-nav-v2
app-name="'console'"
config="topNavMenu"
></kbn-top-nav-v2>
<kbn-dev-tools-app data-test-subj="console">
<sense-history ng-show="showHistory" is-shown="showHistory" close="closeHistory()" history-dirty="lastRequestTimestamp"></sense-history>
<div class="conApp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ import { showHelpPanel } from './help_show_panel';
export function getTopNavConfig($scope: IScope, toggleHistory: () => {}) {
return [
{
key: 'history',
id: 'history',
label: i18n.translate('console.topNav.historyTabLabel', {
defaultMessage: 'History',
}),
description: i18n.translate('console.topNav.historyTabDescription', {
defaultMessage: 'History',
}),
run: () => {
toggleHistory();
$scope.$evalAsync(toggleHistory);
},
testId: 'consoleHistoryButton',
},
{
key: 'settings',
id: 'settings',
label: i18n.translate('console.topNav.settingsTabLabel', {
defaultMessage: 'Settings',
}),
Expand All @@ -54,7 +54,7 @@ export function getTopNavConfig($scope: IScope, toggleHistory: () => {}) {
testId: 'consoleSettingsButton',
},
{
key: 'help',
id: 'help',
label: i18n.translate('console.topNav.helpTabLabel', {
defaultMessage: 'Help',
}),
Expand Down
2 changes: 2 additions & 0 deletions src/legacy/core_plugins/data/public/filter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
*/

export { FilterService, FilterSetup } from './filter_service';

export { FilterBar } from './filter_bar';
9 changes: 2 additions & 7 deletions src/legacy/core_plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
// @ts-ignore
import { renderersRegistry } from 'plugins/interpreter/registries';
import { ExpressionsService, ExpressionsSetup } from './expressions';
import { SearchService, SearchSetup } from './search';
import { QueryService, QuerySetup } from './query';
import { FilterService, FilterSetup } from './filter';
import { IndexPatternsService, IndexPatternsSetup } from './index_patterns';
Expand All @@ -34,14 +33,12 @@ export class DataPlugin {
private readonly expressions: ExpressionsService;
private readonly filter: FilterService;
private readonly indexPatterns: IndexPatternsService;
private readonly search: SearchService;
private readonly query: QueryService;

constructor() {
this.indexPatterns = new IndexPatternsService();
this.filter = new FilterService();
this.query = new QueryService();
this.search = new SearchService();
this.expressions = new ExpressionsService();
}

Expand All @@ -61,7 +58,6 @@ export class DataPlugin {
filter: this.filter.setup({
indexPatterns: indexPatternsService.indexPatterns,
}),
search: this.search.setup(),
query: this.query.setup(),
};
}
Expand All @@ -70,7 +66,6 @@ export class DataPlugin {
this.expressions.stop();
this.indexPatterns.stop();
this.filter.stop();
this.search.stop();
this.query.stop();
}
}
Expand All @@ -80,7 +75,6 @@ export interface DataSetup {
expressions: ExpressionsSetup;
indexPatterns: IndexPatternsSetup;
filter: FilterSetup;
search: SearchSetup;
query: QuerySetup;
}

Expand All @@ -89,7 +83,8 @@ export { ExpressionRenderer, ExpressionRendererProps, ExpressionRunner } from '.

/** @public types */
export { IndexPattern, StaticIndexPattern, StaticIndexPatternField, Field } from './index_patterns';
export { Query } from './query';
export { Query, QueryBar } from './query';
export { FilterBar } from './filter';
export { FilterManager, FilterStateManager, uniqFilters } from './filter/filter_manager';

/** @public static code */
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/data/public/query/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export { QueryService, QuerySetup, Query } from './query_service';
export * from './query_service';

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const mockIndexPattern = {
};

describe('QueryBar', () => {
const QUERY_INPUT_SELECTOR = 'InjectIntl(QueryBarInputUI)';
const TIMEPICKER_SELECTOR = 'EuiSuperDatePicker';
beforeEach(() => {
jest.clearAllMocks();
});
Expand Down Expand Up @@ -102,4 +104,104 @@ describe('QueryBar', () => {

expect(mockPersistedLogFactory.mock.calls[0][0]).toBe('typeahead:discover-kuery');
});

it('Should render only timepicker when no options provided', () => {
const component = shallowWithIntl(
<QueryBar.WrappedComponent
onSubmit={noop}
appName={'discover'}
store={createMockStorage()}
intl={null as any}
/>
);

expect(component.find(QUERY_INPUT_SELECTOR).length).toBe(0);
expect(component.find(TIMEPICKER_SELECTOR).length).toBe(1);
});

it('Should disable timepicker when asked', () => {
const component = shallowWithIntl(
<QueryBar.WrappedComponent
onSubmit={noop}
appName={'discover'}
store={createMockStorage()}
intl={null as any}
showDatePicker={false}
/>
);

expect(component.find(QUERY_INPUT_SELECTOR).length).toBe(0);
expect(component.find(TIMEPICKER_SELECTOR).length).toBe(0);
});

it('Should render timepicker with options', () => {
const component = shallowWithIntl(
<QueryBar.WrappedComponent
onSubmit={noop}
appName={'discover'}
screenTitle={'Another Screen'}
store={createMockStorage()}
intl={null as any}
showDatePicker={true}
dateRangeFrom={'now-7d'}
dateRangeTo={'now'}
/>
);

expect(component.find(QUERY_INPUT_SELECTOR).length).toBe(0);
expect(component.find(TIMEPICKER_SELECTOR).length).toBe(1);
});

it('Should render only query input bar', () => {
const component = shallowWithIntl(
<QueryBar.WrappedComponent
query={kqlQuery}
onSubmit={noop}
appName={'discover'}
screenTitle={'Another Screen'}
indexPatterns={[mockIndexPattern]}
store={createMockStorage()}
intl={null as any}
showDatePicker={false}
/>
);

expect(component.find(QUERY_INPUT_SELECTOR).length).toBe(1);
expect(component.find(TIMEPICKER_SELECTOR).length).toBe(0);
});

it('Should NOT render query input bar if disabled', () => {
const component = shallowWithIntl(
<QueryBar.WrappedComponent
query={kqlQuery}
onSubmit={noop}
appName={'discover'}
screenTitle={'Another Screen'}
indexPatterns={[mockIndexPattern]}
store={createMockStorage()}
intl={null as any}
showQueryInput={false}
showDatePicker={false}
/>
);

expect(component.find(QUERY_INPUT_SELECTOR).length).toBe(0);
expect(component.find(TIMEPICKER_SELECTOR).length).toBe(0);
});

it('Should NOT render query input bar if missing options', () => {
const component = shallowWithIntl(
<QueryBar.WrappedComponent
onSubmit={noop}
appName={'discover'}
screenTitle={'Another Screen'}
store={createMockStorage()}
intl={null as any}
showDatePicker={false}
/>
);

expect(component.find(QUERY_INPUT_SELECTOR).length).toBe(0);
expect(component.find(TIMEPICKER_SELECTOR).length).toBe(0);
});
});
Loading