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

[Lens] library annotation groups #152623

Merged
merged 112 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
13d509b
refactor layer actions to be more flexible
drewdaemon Feb 24, 2023
22fa4b5
merge martas work
drewdaemon Feb 28, 2023
f32c013
saving annotation group to library
drewdaemon Feb 28, 2023
d398395
unit test save action
drewdaemon Mar 1, 2023
89b38a7
extract annotation group references for persistence
drewdaemon Mar 1, 2023
a47d143
library annotation groups removed from lens saved object and loaded a…
drewdaemon Mar 2, 2023
e47c17b
report data views used by annotation groups
drewdaemon Mar 2, 2023
ad14b60
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Mar 2, 2023
968cb74
support by-ref annotation groups in embeddable
drewdaemon Mar 2, 2023
c27a6a3
improve saved object reference names and schema
drewdaemon Mar 2, 2023
568b89c
reverting a few name changes
drewdaemon Mar 2, 2023
10bb53d
show saved title in layer panel header
drewdaemon Mar 3, 2023
3a87ab7
save annotations in modal instead of flyout
drewdaemon Mar 7, 2023
26aff6f
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Mar 7, 2023
dd6ef59
functional test: saving an annotation group
drewdaemon Mar 8, 2023
b47030c
better abstractions in the save action modal setup
drewdaemon Mar 8, 2023
b6c7c02
updating and copying existing annotation group
drewdaemon Mar 8, 2023
45c6ca2
improve object type message
drewdaemon Mar 9, 2023
eb4ba12
simplifying annotation layer actions logic
drewdaemon Mar 9, 2023
685645d
introduce linked by-value annotation layers
drewdaemon Mar 9, 2023
b10e5a7
more accurate typings
drewdaemon Mar 10, 2023
ec2f544
leave functional testing note
drewdaemon Mar 10, 2023
32af469
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Mar 10, 2023
899f6ee
refactor components to use SavedObjectsFinder
drewdaemon Mar 10, 2023
c1964ad
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Mar 20, 2023
8c4abb8
add missing type refs
drewdaemon Mar 20, 2023
d18c833
add existing annotation groups from library
drewdaemon Mar 20, 2023
f149af6
add append annotation layer unit tests
drewdaemon Mar 21, 2023
8f0cb7c
functional test for add from library
drewdaemon Mar 21, 2023
9c37ce4
unlink action
drewdaemon Mar 21, 2023
15d8ec7
revert action
drewdaemon Mar 22, 2023
130777a
fix extra annotation group bug
drewdaemon Mar 22, 2023
2d3fda8
fix some type errors
drewdaemon Mar 22, 2023
d02132d
remove annotation layers if library group has been deleted
drewdaemon Mar 23, 2023
c2f1b78
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Mar 23, 2023
ae5486c
Add missing group functional test
drewdaemon Mar 23, 2023
0abb991
warn users only when they're discarding annotation changes
drewdaemon Mar 24, 2023
1e80420
support saving and loading groups with ad-hoc data views
drewdaemon Mar 29, 2023
7778006
add ad-hoc data view to lens when annotation group added
drewdaemon Mar 29, 2023
ffd9a1d
fix some types
drewdaemon Mar 29, 2023
0a16665
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Apr 3, 2023
6148054
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Apr 17, 2023
f2ce71a
restore table list to main state
drewdaemon Apr 19, 2023
a084c44
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Apr 19, 2023
b5e0638
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Apr 25, 2023
f59f517
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon Apr 27, 2023
baf870a
Merge branch '141054/library-annotation-groups' of github.com:drewdae…
drewdaemon May 15, 2023
5e66b99
remove superfluous hide parameter
drewdaemon May 15, 2023
6770eab
remove simpleView parameter from everywhere outside expression genera…
drewdaemon May 15, 2023
5450241
Merge branch 'main' into 141054/library-annotation-groups
kibanamachine May 15, 2023
ecb1a2f
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 15, 2023
ca19a55
put annotation groups in the analytics index
drewdaemon May 15, 2023
63b95ea
Merge branch '141054/library-annotation-groups' of github.com:drewdae…
drewdaemon May 15, 2023
1cb7fb3
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine May 15, 2023
cded3e9
Merge branch '141054/library-annotation-groups' of github.com:drewdae…
drewdaemon May 16, 2023
8a28c3d
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 16, 2023
78f89d1
fix linting problem
drewdaemon May 16, 2023
3cad5f6
fix config panel test
drewdaemon May 16, 2023
e73de35
Merge branch '141054/library-annotation-groups' of github.com:drewdae…
drewdaemon May 16, 2023
d8bade5
limit
drewdaemon May 16, 2023
4cec332
update integration test snapshot
drewdaemon May 16, 2023
8be8e92
remove event annotation saved object type
drewdaemon May 16, 2023
831e519
update snapshot
drewdaemon May 16, 2023
c0f7b67
clean up flyout
drewdaemon May 18, 2023
c78559e
logical improvement
drewdaemon May 18, 2023
59e9823
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 18, 2023
2097012
removing unnecessary initialize parameter
drewdaemon May 22, 2023
33e95c3
Merge branch '141054/library-annotation-groups' of github.com:drewdae…
drewdaemon May 22, 2023
d21c380
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon May 22, 2023
b379a9f
clean up some comments and improve some imports
drewdaemon May 22, 2023
5321a62
remove ignore global filters action
drewdaemon May 22, 2023
8d436eb
a couple of small logical changes
drewdaemon May 22, 2023
0b52e1d
change icon
drewdaemon May 22, 2023
729b593
use changeIndexPattern action to load new ad-hoc data view
drewdaemon May 23, 2023
3b493c6
always ensure index pattern is loaded before adding library annotatio…
drewdaemon May 23, 2023
302d329
save index pattern references for linked layers
drewdaemon May 23, 2023
5f9f3b4
use flag icon for saved objects management
drewdaemon May 23, 2023
dc1ed29
fix dirty state bug, clean up addLayer
drewdaemon May 24, 2023
7e9a62b
fix extra dimension bug
drewdaemon May 25, 2023
07083cb
remove unused translations
drewdaemon May 25, 2023
889cc7a
Merge branch 'main' of github.com:elastic/kibana into 141054/library-…
drewdaemon May 25, 2023
0cb229c
dont assume index-pattern reference when by-ref annotation layer
drewdaemon May 25, 2023
38955ff
a little extra error handling protection
drewdaemon May 25, 2023
3d621ab
don't show search interface when no library groups
drewdaemon May 25, 2023
39e38c8
disable, don't hide, revert changes action
drewdaemon May 25, 2023
10d1fea
add body to the revert confirmation toast
drewdaemon May 25, 2023
2d825ed
Change confirmation modal widths
drewdaemon May 25, 2023
230e6db
unsaved changes indicator
drewdaemon May 25, 2023
8947971
Update x-pack/plugins/lens/public/visualizations/xy/add_layer.tsx
drewdaemon May 25, 2023
246cd01
Update x-pack/plugins/lens/public/visualizations/xy/annotations/actio…
drewdaemon May 25, 2023
37a77a4
impose ordering on layer actions
drewdaemon May 25, 2023
00c7370
show save action outside context menu
drewdaemon May 25, 2023
d7d9517
Merge branch '141054/library-annotation-groups' of github.com:drewdae…
drewdaemon May 25, 2023
04f92d6
update snapshot
drewdaemon May 25, 2023
8744114
update snapshot
drewdaemon May 26, 2023
3dc6ced
some code style feedback
drewdaemon May 26, 2023
766a3d7
Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/s…
drewdaemon May 26, 2023
23566c9
Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/s…
drewdaemon May 26, 2023
7fb46cf
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine May 26, 2023
2823824
fix action ordering
drewdaemon May 26, 2023
d278eb0
Merge branch '141054/library-annotation-groups' of github.com:drewdae…
drewdaemon May 26, 2023
63d9b3a
fix library annotation loading
drewdaemon May 26, 2023
9df5131
update size and format of save modal
drewdaemon May 26, 2023
60f1956
hold off on validation until submit has been attempted
drewdaemon May 26, 2023
5e7814a
change save modal copy
drewdaemon May 26, 2023
f8cdd41
marking optional fields optional
drewdaemon May 26, 2023
3a3b53d
Merge branch 'main' into 141054/library-annotation-groups
stratoula May 29, 2023
e223128
Fix CI
stratoula May 29, 2023
91c2db4
new annotation from empty annotation library
drewdaemon May 30, 2023
9b23bef
Merge branch '141054/library-annotation-groups' of github.com:drewdae…
drewdaemon May 30, 2023
7e53a71
make unsaved changes indicator accessible
drewdaemon May 31, 2023
5f3be56
Merge branch 'main' into 141054/library-annotation-groups
kibanamachine May 31, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@
* Side Public License, v 1.
*/

import { deepFreeze } from '@kbn/std';
import type { PublicMethodsOf } from '@kbn/utility-types';
import type {
CapabilitiesStart,
CapabilitiesService,
} from '@kbn/core-capabilities-browser-internal';

const createStartContractMock = (): jest.Mocked<CapabilitiesStart> => ({
capabilities: deepFreeze({
capabilities: {
catalogue: {},
management: {},
navLinks: {},
}),
},
});

const createMock = (): jest.Mocked<PublicMethodsOf<CapabilitiesService>> => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"**/*.tsx",
],
"kbn_references": [
"@kbn/std",
"@kbn/utility-types",
"@kbn/core-capabilities-browser-internal"
],
Expand Down
11 changes: 11 additions & 0 deletions packages/kbn-check-mappings-update-cli/current_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,17 @@
}
}
},
"event-annotation-group": {
"dynamic": false,
"properties": {
"title": {
"type": "text"
},
"description": {
"type": "text"
}
}
},
"visualization": {
"dynamic": false,
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pageLoadAssetSize:
embeddableEnhanced: 22107
enterpriseSearch: 35741
esUiShared: 326654
eventAnnotation: 20500
eventAnnotation: 22000
exploratoryView: 74673
expressionError: 22127
expressionGauge: 25000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"enterprise_search_telemetry": "9ac912e1417fc8681e0cd383775382117c9e3d3d",
"epm-packages": "2449bb565f987eff70b1b39578bb17e90c404c6e",
"epm-packages-assets": "7a3e58efd9a14191d0d1a00b8aaed30a145fd0b1",
"event-annotation-group": "715ba867d8c68f3c9438052210ea1c30a9362582",
"event_loop_delays_daily": "01b967e8e043801357503de09199dfa3853bab88",
"exception-list": "4aebc4e61fb5d608cae48eaeb0977e8db21c61a4",
"exception-list-agnostic": "6d3262d58eee28ac381ec9654f93126a58be6f5d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ describe('split .kibana index into multiple system indices', () => {
"enterprise_search_telemetry",
"epm-packages",
"epm-packages-assets",
"event-annotation-group",
"event_loop_delays_daily",
"exception-list",
"exception-list-agnostic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const previouslyRegisteredTypes = [
'csp-rule-template',
'csp_rule',
'dashboard',
'event-annotation-group',
'endpoint:user-artifact',
'endpoint:user-artifact-manifest',
'enterprise_search_telemetry',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
import { ChartsPluginStart } from '@kbn/charts-plugin/public';
import { CoreSetup, CoreStart, IUiSettingsClient } from '@kbn/core/public';
import { EventAnnotationPluginSetup } from '@kbn/event-annotation-plugin/public';
import type { EventAnnotationPluginStart } from '@kbn/event-annotation-plugin/public';
import { UsageCollectionStart } from '@kbn/usage-collection-plugin/public';
import { ExpressionXyPluginSetup, ExpressionXyPluginStart, SetupDeps } from './types';
import {
Expand All @@ -37,7 +37,7 @@ export interface XYPluginStartDependencies {
data: DataPublicPluginStart;
fieldFormats: FieldFormatsStart;
charts: ChartsPluginStart;
eventAnnotation: EventAnnotationPluginSetup;
eventAnnotation: EventAnnotationPluginStart;
usageCollection?: UsageCollectionStart;
}

Expand Down

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 @@ -9,7 +9,7 @@
import { i18n } from '@kbn/i18n';
import React, { Fragment } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiFormRow, EuiTextArea, EuiSwitch } from '@elastic/eui';
import { EuiFormRow, EuiSwitch } from '@elastic/eui';
import { SavedObjectSaveModal } from '@kbn/saved-objects-plugin/public';

import type { DashboardSaveOptions } from '../../../types';
Expand Down Expand Up @@ -39,14 +39,12 @@ interface Props {
}

interface State {
description: string;
tags: string[];
timeRestore: boolean;
}

export class DashboardSaveModal extends React.Component<Props, State> {
state: State = {
description: this.props.description,
timeRestore: this.props.timeRestore,
tags: this.props.tags ?? [],
};
Expand All @@ -57,18 +55,20 @@ export class DashboardSaveModal extends React.Component<Props, State> {

saveDashboard = ({
newTitle,
newDescription,
newCopyOnSave,
isTitleDuplicateConfirmed,
onTitleDuplicate,
}: {
newTitle: string;
newDescription: string;
newCopyOnSave: boolean;
isTitleDuplicateConfirmed: boolean;
onTitleDuplicate: () => void;
}) => {
this.props.onSave({
newTitle,
newDescription: this.state.description,
newDescription,
newCopyOnSave,
newTimeRestore: this.state.timeRestore,
isTitleDuplicateConfirmed,
Expand All @@ -77,12 +77,6 @@ export class DashboardSaveModal extends React.Component<Props, State> {
});
};

onDescriptionChange = (event: any) => {
this.setState({
description: event.target.value,
});
};

onTimeRestoreChange = (event: any) => {
this.setState({
timeRestore: event.target.checked,
Expand All @@ -102,26 +96,12 @@ export class DashboardSaveModal extends React.Component<Props, State> {
tags,
});
}}
markOptional
/>
) : undefined;

return (
<Fragment>
<EuiFormRow
label={
<FormattedMessage
id="dashboard.topNav.saveModal.descriptionFormRowLabel"
defaultMessage="Description"
/>
}
>
<EuiTextArea
data-test-subj="dashboardDescription"
value={this.state.description}
onChange={this.onDescriptionChange}
/>
</EuiFormRow>

{tagSelector}

<EuiFormRow
Expand Down Expand Up @@ -154,13 +134,14 @@ export class DashboardSaveModal extends React.Component<Props, State> {
onSave={this.saveDashboard}
onClose={this.props.onClose}
title={this.props.title}
description={this.props.description}
showDescription
showCopyOnSave={this.props.showCopyOnSave}
initialCopyOnSave={this.props.showCopyOnSave}
objectType={i18n.translate('dashboard.topNav.saveModal.objectType', {
defaultMessage: 'dashboard',
})}
options={this.renderDashboardSaveOptions()}
showDescription={false}
/>
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/event_annotation/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ export const AvailableAnnotationIcons = {
TAG: 'tag',
TRIANGLE: 'triangle',
} as const;

export const EVENT_ANNOTATION_GROUP_TYPE = 'event-annotation-group';
3 changes: 3 additions & 0 deletions src/plugins/event_annotation/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ export type {
QueryPointEventAnnotationConfig,
AvailableAnnotationIcon,
EventAnnotationOutput,
EventAnnotationGroupAttributes,
} from './types';

export { EVENT_ANNOTATION_GROUP_TYPE } from './constants';
17 changes: 15 additions & 2 deletions src/plugins/event_annotation/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { KibanaQueryOutput } from '@kbn/data-plugin/common';
import { DataViewSpec, KibanaQueryOutput } from '@kbn/data-plugin/common';
import { DatatableColumn } from '@kbn/expressions-plugin/common';
import { $Values } from '@kbn/utility-types';
import { AvailableAnnotationIcons } from './constants';
Expand Down Expand Up @@ -82,10 +82,23 @@ export type EventAnnotationConfig =
| RangeEventAnnotationConfig
| QueryPointEventAnnotationConfig;

export interface EventAnnotationGroupAttributes {
title: string;
description: string;
tags: string[];
ignoreGlobalFilters: boolean;
annotations: EventAnnotationConfig[];
dataViewSpec?: DataViewSpec;
}

export interface EventAnnotationGroupConfig {
annotations: EventAnnotationConfig[];
indexPatternId: string;
ignoreGlobalFilters?: boolean;
ignoreGlobalFilters: boolean;
title: string;
description: string;
tags: string[];
dataViewSpec?: DataViewSpec;
}

export type EventAnnotationArgs =
Expand Down
7 changes: 6 additions & 1 deletion src/plugins/event_annotation/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
"browser": true,
"requiredPlugins": [
"expressions",
"data"
"savedObjectsManagement",
"data",
],
"requiredBundles": [
"savedObjectsFinder",
"dataViews"
],
"extraPublicDirs": [
"common"
Expand Down
Loading