Skip to content

Commit cdb50c1

Browse files
committed
Fix i18n, package.json merge conflict, fix embeddable parenting.
1 parent 93344cb commit cdb50c1

File tree

10 files changed

+41
-65
lines changed

10 files changed

+41
-65
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@
9191
"yarn": "^1.21.1"
9292
},
9393
"dependencies": {
94-
"@babel/runtime": "^7.12.5",
9594
"@dnd-kit/core": "^3.1.1",
9695
"@dnd-kit/sortable": "^4.0.0",
9796
"@dnd-kit/utilities": "^2.0.0",
98-
"@elastic/apm-rum": "^5.8.0",
99-
"@elastic/apm-rum-react": "^1.2.11",
100-
"@elastic/charts": "33.2.2",
97+
"@babel/runtime": "^7.12.5",
98+
"@elastic/apm-rum": "^5.9.1",
99+
"@elastic/apm-rum-react": "^1.3.1",
100+
"@elastic/charts": "34.2.1",
101101
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
102102
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.20",
103103
"@elastic/ems-client": "7.15.0",

src/plugins/presentation_util/public/components/controls/__stories__/controls_service_stub.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const getControlsServiceStub = () => {
2222
);
2323

2424
// cast to unknown because the stub cannot use the embeddable start contract to transform the EmbeddableFactoryDefinition into an EmbeddableFactory
25-
const optionsListControlFactory = (optionsListFactoryStub as unknown) as InputControlFactory;
25+
const optionsListControlFactory = optionsListFactoryStub as unknown as InputControlFactory;
2626
optionsListControlFactory.getDefaultInput = () => ({});
2727
controlsServiceStub.registerInputControlType(optionsListControlFactory);
2828
return controlsServiceStub;

src/plugins/presentation_util/public/components/controls/control_group/component/control_group_component.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ export const ControlGroup = ({ controlGroupContainer, openFlyout }: ControlGroup
7070

7171
const [draggingId, setDraggingId] = useState<string | null>(null);
7272

73-
const draggingIndex = useMemo(() => (draggingId ? controlIds.indexOf(draggingId) : -1), [
74-
controlIds,
75-
draggingId,
76-
]);
73+
const draggingIndex = useMemo(
74+
() => (draggingId ? controlIds.indexOf(draggingId) : -1),
75+
[controlIds, draggingId]
76+
);
7777

7878
const sensors = useSensors(
7979
useSensor(PointerSensor),

src/plugins/presentation_util/public/components/controls/control_group/component/control_group_sortable_item.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,11 @@ export type SortableControlProps = ControlFrameProps & {
3434
*/
3535
export const SortableControl = (frameProps: SortableControlProps) => {
3636
const { embeddableId } = frameProps;
37-
const {
38-
over,
39-
listeners,
40-
isSorting,
41-
transform,
42-
transition,
43-
attributes,
44-
isDragging,
45-
setNodeRef,
46-
} = useSortable({
47-
id: embeddableId,
48-
animateLayoutChanges: () => true,
49-
});
37+
const { over, listeners, isSorting, transform, transition, attributes, isDragging, setNodeRef } =
38+
useSortable({
39+
id: embeddableId,
40+
animateLayoutChanges: () => true,
41+
});
5042

5143
frameProps.dragInfo = { ...frameProps.dragInfo, isOver: over?.id === embeddableId, isDragging };
5244

src/plugins/presentation_util/public/components/controls/control_group/control_group_strings.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
import { i18n } from '@kbn/i18n';
1010

1111
export const ControlGroupStrings = {
12+
getEmbeddableTitle: () =>
13+
i18n.translate('presentationUtil.inputControls.controlGroup.title', {
14+
defaultMessage: 'Control group',
15+
}),
1216
floatingActions: {
1317
getEditButtonTitle: () =>
1418
i18n.translate('presentationUtil.inputControls.controlGroup.floatingActions.edit', {

src/plugins/presentation_util/public/components/controls/control_group/embeddable/control_group_container_factory.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* Side Public License, v 1.
1515
*/
1616

17-
import { i18n } from '@kbn/i18n';
1817
import {
1918
Container,
2019
ContainerOutput,
@@ -27,15 +26,16 @@ import { ControlGroupInput } from '../../types';
2726
import { ControlGroupContainer } from './control_group_container';
2827
import { ControlsService } from '../../controls_service';
2928
import { PresentationOverlaysService } from '../../../../services/overlays';
29+
import { ControlGroupStrings } from '../control_group_strings';
3030

3131
export type DashboardContainerFactory = EmbeddableFactory<
3232
ControlGroupInput,
3333
ContainerOutput,
3434
ControlGroupContainer
3535
>;
3636
export class ControlGroupContainerFactory
37-
implements
38-
EmbeddableFactoryDefinition<ControlGroupInput, ContainerOutput, ControlGroupContainer> {
37+
implements EmbeddableFactoryDefinition<ControlGroupInput, ContainerOutput, ControlGroupContainer>
38+
{
3939
public readonly isContainerType = true;
4040
public readonly type = CONTROL_GROUP_TYPE;
4141
public readonly controlsService: ControlsService;
@@ -52,9 +52,7 @@ export class ControlGroupContainerFactory
5252
public isEditable = async () => false;
5353

5454
public readonly getDisplayName = () => {
55-
return i18n.translate('dashboard.factory.displayName', {
56-
defaultMessage: 'Dashboard',
57-
});
55+
return ControlGroupStrings.getEmbeddableTitle();
5856
};
5957

6058
public getDefaultInput(): Partial<ControlGroupInput> {

src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,10 @@ export const OptionsListEditor = ({
8181
})();
8282
}, [state.indexPattern, fetchFields]);
8383

84-
useEffect(() => setValidState(Boolean(state.field) && Boolean(state.indexPattern)), [
85-
state.field,
86-
setValidState,
87-
state.indexPattern,
88-
]);
84+
useEffect(
85+
() => setValidState(Boolean(state.field) && Boolean(state.indexPattern)),
86+
[state.field, setValidState, state.indexPattern]
87+
);
8988

9089
return (
9190
<>

src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { tap, debounceTime, map, distinctUntilChanged } from 'rxjs/operators';
1515

1616
import { esFilters } from '../../../../../../data/public';
1717
import { OptionsListStrings } from './options_list_strings';
18-
import { Embeddable } from '../../../../../../embeddable/public';
18+
import { Embeddable, IContainer } from '../../../../../../embeddable/public';
1919
import { InputControlInput, InputControlOutput } from '../../types';
2020
import { OptionsListComponent, OptionsListComponentState } from './options_list_component';
2121

@@ -88,9 +88,10 @@ export class OptionsListEmbeddable extends Embeddable<
8888
constructor(
8989
input: OptionsListEmbeddableInput,
9090
output: InputControlOutput,
91-
private fetchData: OptionsListDataFetcher
91+
private fetchData: OptionsListDataFetcher,
92+
parent?: IContainer
9293
) {
93-
super(input, output);
94+
super(input, output, parent);
9495
this.fetchData = fetchData;
9596

9697
// populate default selections from input

src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable_factory.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import React from 'react';
10-
import { EmbeddableFactoryDefinition } from '../../../../../../embeddable/public';
10+
import { EmbeddableFactoryDefinition, IContainer } from '../../../../../../embeddable/public';
1111
import {
1212
ControlEditorProps,
1313
GetControlEditorComponentProps,
@@ -24,7 +24,8 @@ import {
2424
} from './options_list_embeddable';
2525

2626
export class OptionsListEmbeddableFactory
27-
implements EmbeddableFactoryDefinition, IEditableControlFactory {
27+
implements EmbeddableFactoryDefinition, IEditableControlFactory
28+
{
2829
public type = OPTIONS_LIST_CONTROL;
2930

3031
constructor(
@@ -37,8 +38,8 @@ export class OptionsListEmbeddableFactory
3738
this.fetchData = fetchData;
3839
}
3940

40-
public create(initialInput: OptionsListEmbeddableInput) {
41-
return Promise.resolve(new OptionsListEmbeddable(initialInput, {}, this.fetchData));
41+
public create(initialInput: OptionsListEmbeddableInput, parent?: IContainer) {
42+
return Promise.resolve(new OptionsListEmbeddable(initialInput, {}, this.fetchData, parent));
4243
}
4344

4445
public getControlEditor = ({

yarn.lock

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,15 +1374,15 @@
13741374
opentracing "^0.14.3"
13751375
promise-polyfill "^8.1.3"
13761376

1377-
"@elastic/apm-rum-react@^1.2.11":
1377+
"@elastic/apm-rum-react@^1.3.1":
13781378
version "1.3.1"
13791379
resolved "https://registry.yarnpkg.com/@elastic/apm-rum-react/-/apm-rum-react-1.3.1.tgz#2b1a5cfe3763538d7e655816a333162696f906c9"
13801380
integrity sha512-nJebgxMUWsWWz93v39ok0DwFGUvv9qZkA+oElUzCKyVvWpgHsWE2pvgjthrvay64qzfEg5QeM56ywaef9V13rw==
13811381
dependencies:
13821382
"@elastic/apm-rum" "^5.9.1"
13831383
hoist-non-react-statics "^3.3.0"
13841384

1385-
"@elastic/apm-rum@^5.8.0", "@elastic/apm-rum@^5.9.1":
1385+
"@elastic/apm-rum@^5.9.1":
13861386
version "5.9.1"
13871387
resolved "https://registry.yarnpkg.com/@elastic/apm-rum/-/apm-rum-5.9.1.tgz#23b12650d443ec0a5f7c6b7b4039334e42d2fe8a"
13881388
integrity sha512-NJAdzxXxf+LeCI0Dz3P+RMVY66C8sAztIg4tvnrhvBqxf8d7se+FpYw3oYjw3BZ8UDycmXEaIqEGcynUUndgqA==
@@ -1396,10 +1396,10 @@
13961396
dependencies:
13971397
object-hash "^1.3.0"
13981398

1399-
"@elastic/charts@33.2.2":
1400-
version "33.2.2"
1401-
resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-33.2.2.tgz#403c46eebe71f4ca7e5c9c1a135eec66869961cc"
1402-
integrity sha512-g+z1T8s6m7eySaxcY7R6yqUHUstUtEIH0P4FineKWdZ5L6IkxBNrhM7r0FaddIurNxvBy/SGQorhmFZAksWhiQ==
1399+
"@elastic/charts@34.2.1":
1400+
version "34.2.1"
1401+
resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-34.2.1.tgz#90ac2a32cb47b371f5d814c9181e59aa3d55c029"
1402+
integrity sha512-C4qERgrcobaTDH2QLmdog0sM5FhWQot6QdsDTFASsSuWtj+a5Ujvex1tlBgiwcuIDP/1OY/tvWhiod8YhmAomg==
14031403
dependencies:
14041404
"@popperjs/core" "^2.4.0"
14051405
chroma-js "^2.1.0"
@@ -1411,7 +1411,6 @@
14111411
d3-interpolate "^1.4.0"
14121412
d3-scale "^1.0.7"
14131413
d3-shape "^1.3.4"
1414-
newtype-ts "^0.2.4"
14151414
prop-types "^15.7.2"
14161415
re-reselect "^3.4.0"
14171416
react-redux "^7.1.0"
@@ -14106,11 +14105,6 @@ forwarded@~0.1.2:
1410614105
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84"
1410714106
integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=
1410814107

14109-
fp-ts@^1.0.0:
14110-
version "1.12.0"
14111-
resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.12.0.tgz#d333310e4ac104cdcb6bea47908e381bb09978e7"
14112-
integrity sha512-fWwnAgVlTsV26Ruo9nx+fxNHIm6l1puE1VJ/C0XJ3nRQJJJIgRHYw6sigB3MuNFZL1o4fpGlhwFhcbxHK0RsOA==
14113-
1411414108
fp-ts@^2.3.1:
1411514109
version "2.8.6"
1411614110
resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.8.6.tgz#1a0e6c3f29f5b0fbfa3120f034ea266aa73c811b"
@@ -19588,11 +19582,6 @@ monitor-event-loop-delay@^1.0.0:
1958819582
resolved "https://registry.yarnpkg.com/monitor-event-loop-delay/-/monitor-event-loop-delay-1.0.0.tgz#b5ab78165a3bb93f2b275c50d01430c7f155d1f7"
1958919583
integrity sha512-YRIr1exCIfBDLZle8WHOfSo7Xg3M+phcZfq9Fx1L6Abo+atGp7cge5pM7PjyBn4s1oZI/BRD4EMrzQBbPpVb5Q==
1959019584

19591-
monocle-ts@^1.0.0:
19592-
version "1.7.1"
19593-
resolved "https://registry.yarnpkg.com/monocle-ts/-/monocle-ts-1.7.1.tgz#03a615938aa90983a4fa29749969d30f72d80ba1"
19594-
integrity sha512-X9OzpOyd/R83sYex8NYpJjUzi/MLQMvGNVfxDYiIvs+QMXMEUDwR61MQoARFN10Cqz5h/mbFSPnIQNUIGhYd2Q==
19595-
1959619585
moo-color@^1.0.2:
1959719586
version "1.0.2"
1959819587
resolved "https://registry.yarnpkg.com/moo-color/-/moo-color-1.0.2.tgz#837c40758d2d58763825d1359a84e330531eca64"
@@ -19882,14 +19871,6 @@ nested-error-stacks@^2.0.0, nested-error-stacks@^2.1.0:
1988219871
resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz#0fbdcf3e13fe4994781280524f8b96b0cdff9c61"
1988319872
integrity sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==
1988419873

19885-
newtype-ts@^0.2.4:
19886-
version "0.2.4"
19887-
resolved "https://registry.yarnpkg.com/newtype-ts/-/newtype-ts-0.2.4.tgz#a02a8f160a3d179f871848d687a93de73a964a41"
19888-
integrity sha512-HrzPdG0+0FK1qHbc3ld/HXu252OYgmN993bFxUtZ6NFCLUk1eq+yKwdvP07BblXQibGqMWNXBUrNoLUq23Ma2Q==
19889-
dependencies:
19890-
fp-ts "^1.0.0"
19891-
monocle-ts "^1.0.0"
19892-
1989319874
next-line@^1.1.0:
1989419875
version "1.1.0"
1989519876
resolved "https://registry.yarnpkg.com/next-line/-/next-line-1.1.0.tgz#fcae57853052b6a9bae8208e40dd7d3c2d304603"

0 commit comments

Comments
 (0)