>;
let instance: ReactWrapper;
beforeEach(() => {
subject = new Rx.BehaviorSubject(props);
- instance = mountWithIntl();
+ instance = mountWithIntl();
});
function toTab(tab: string) {
diff --git a/x-pack/legacy/plugins/graph/public/components/graph_settings/graph_settings.tsx b/x-pack/legacy/plugins/graph/public/components/settings/settings.tsx
similarity index 92%
rename from x-pack/legacy/plugins/graph/public/components/graph_settings/graph_settings.tsx
rename to x-pack/legacy/plugins/graph/public/components/settings/settings.tsx
index 319e7747bbbc9..4cb4b473f7372 100644
--- a/x-pack/legacy/plugins/graph/public/components/graph_settings/graph_settings.tsx
+++ b/x-pack/legacy/plugins/graph/public/components/settings/settings.tsx
@@ -35,7 +35,7 @@ const tabs = [
},
];
-export interface GraphSettingsProps {
+export interface SettingsProps {
advancedSettings: AdvancedSettings;
updateAdvancedSettings: (advancedSettings: AdvancedSettings) => void;
blacklistedNodes?: WorkspaceNode[];
@@ -51,8 +51,8 @@ interface AsObservable {
observable: Readonly>;
}
-export function GraphSettings({ observable }: AsObservable) {
- const [currentProps, setCurrentProps] = useState(undefined);
+export function Settings({ observable }: AsObservable) {
+ const [currentProps, setCurrentProps] = useState(undefined);
const [activeTab, setActiveTab] = useState(0);
useEffect(() => {
diff --git a/x-pack/legacy/plugins/graph/public/components/graph_settings/url_template_form.tsx b/x-pack/legacy/plugins/graph/public/components/settings/url_template_form.tsx
similarity index 97%
rename from x-pack/legacy/plugins/graph/public/components/graph_settings/url_template_form.tsx
rename to x-pack/legacy/plugins/graph/public/components/settings/url_template_form.tsx
index 9e1c686ccc012..c01c3166f3dcf 100644
--- a/x-pack/legacy/plugins/graph/public/components/graph_settings/url_template_form.tsx
+++ b/x-pack/legacy/plugins/graph/public/components/settings/url_template_form.tsx
@@ -20,13 +20,9 @@ import { i18n } from '@kbn/i18n';
import classNames from 'classnames';
import { UrlTemplate } from '../../types';
import { LegacyIcon } from './legacy_icon';
-import { outlinkEncoders } from '../../services/outlink_encoders';
-import { urlTemplateIconChoices } from '../../services/style_choices';
-import {
- isUrlTemplateValid,
- isKibanaUrl,
- replaceKibanaUrlParam,
-} from '../../services/url_template';
+import { outlinkEncoders } from '../../helpers/outlink_encoders';
+import { urlTemplateIconChoices } from '../../helpers/style_choices';
+import { isUrlTemplateValid, isKibanaUrl, replaceKibanaUrlParam } from '../../helpers/url_template';
export interface NewFormProps {
onSubmit: (template: UrlTemplate) => void;
diff --git a/x-pack/legacy/plugins/graph/public/components/graph_settings/url_template_list.tsx b/x-pack/legacy/plugins/graph/public/components/settings/url_template_list.tsx
similarity index 94%
rename from x-pack/legacy/plugins/graph/public/components/graph_settings/url_template_list.tsx
rename to x-pack/legacy/plugins/graph/public/components/settings/url_template_list.tsx
index 4b0869ea95d87..2e41f78bb9403 100644
--- a/x-pack/legacy/plugins/graph/public/components/graph_settings/url_template_list.tsx
+++ b/x-pack/legacy/plugins/graph/public/components/settings/url_template_list.tsx
@@ -7,7 +7,7 @@
import React, { useState } from 'react';
import { EuiText, EuiSpacer, EuiTextAlign, EuiButton, htmlIdGenerator } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { GraphSettingsProps } from './graph_settings';
+import { SettingsProps } from './settings';
import { UrlTemplateForm } from './url_template_form';
import { useListKeys } from './use_list_keys';
@@ -17,7 +17,7 @@ export function UrlTemplateList({
removeUrlTemplate,
saveUrlTemplate,
urlTemplates,
-}: Pick) {
+}: Pick) {
const [uncommittedForms, setUncommittedForms] = useState([]);
const getListKey = useListKeys(urlTemplates);
diff --git a/x-pack/legacy/plugins/graph/public/components/graph_settings/use_list_keys.test.tsx b/x-pack/legacy/plugins/graph/public/components/settings/use_list_keys.test.tsx
similarity index 100%
rename from x-pack/legacy/plugins/graph/public/components/graph_settings/use_list_keys.test.tsx
rename to x-pack/legacy/plugins/graph/public/components/settings/use_list_keys.test.tsx
diff --git a/x-pack/legacy/plugins/graph/public/components/graph_settings/use_list_keys.ts b/x-pack/legacy/plugins/graph/public/components/settings/use_list_keys.ts
similarity index 100%
rename from x-pack/legacy/plugins/graph/public/components/graph_settings/use_list_keys.ts
rename to x-pack/legacy/plugins/graph/public/components/settings/use_list_keys.ts
diff --git a/x-pack/legacy/plugins/graph/public/services/as_observable.ts b/x-pack/legacy/plugins/graph/public/helpers/as_observable.ts
similarity index 100%
rename from x-pack/legacy/plugins/graph/public/services/as_observable.ts
rename to x-pack/legacy/plugins/graph/public/helpers/as_observable.ts
diff --git a/x-pack/legacy/plugins/graph/public/services/kql_encoder.test.ts b/x-pack/legacy/plugins/graph/public/helpers/kql_encoder.test.ts
similarity index 100%
rename from x-pack/legacy/plugins/graph/public/services/kql_encoder.test.ts
rename to x-pack/legacy/plugins/graph/public/helpers/kql_encoder.test.ts
diff --git a/x-pack/legacy/plugins/graph/public/services/kql_encoder.ts b/x-pack/legacy/plugins/graph/public/helpers/kql_encoder.ts
similarity index 100%
rename from x-pack/legacy/plugins/graph/public/services/kql_encoder.ts
rename to x-pack/legacy/plugins/graph/public/helpers/kql_encoder.ts
diff --git a/x-pack/legacy/plugins/graph/public/services/outlink_encoders.ts b/x-pack/legacy/plugins/graph/public/helpers/outlink_encoders.ts
similarity index 100%
rename from x-pack/legacy/plugins/graph/public/services/outlink_encoders.ts
rename to x-pack/legacy/plugins/graph/public/helpers/outlink_encoders.ts
diff --git a/x-pack/legacy/plugins/graph/public/services/style_choices.ts b/x-pack/legacy/plugins/graph/public/helpers/style_choices.ts
similarity index 100%
rename from x-pack/legacy/plugins/graph/public/services/style_choices.ts
rename to x-pack/legacy/plugins/graph/public/helpers/style_choices.ts
diff --git a/x-pack/legacy/plugins/graph/public/services/url_template.ts b/x-pack/legacy/plugins/graph/public/helpers/url_template.ts
similarity index 100%
rename from x-pack/legacy/plugins/graph/public/services/url_template.ts
rename to x-pack/legacy/plugins/graph/public/helpers/url_template.ts
diff --git a/x-pack/legacy/plugins/graph/public/services/persistence/deserialize.test.ts b/x-pack/legacy/plugins/graph/public/services/persistence/deserialize.test.ts
index 53a826faf7ca5..ddf2dc1b1cc66 100644
--- a/x-pack/legacy/plugins/graph/public/services/persistence/deserialize.test.ts
+++ b/x-pack/legacy/plugins/graph/public/services/persistence/deserialize.test.ts
@@ -8,7 +8,7 @@ import { GraphWorkspaceSavedObject } from '../../types';
import { savedWorkspaceToAppState } from './deserialize';
import { IndexPattern } from 'src/legacy/core_plugins/data/public';
import { createWorkspace } from '../../angular/graph_client_workspace';
-import { outlinkEncoders } from '../outlink_encoders';
+import { outlinkEncoders } from '../../helpers/outlink_encoders';
describe('deserialize', () => {
let savedWorkspace: GraphWorkspaceSavedObject;
diff --git a/x-pack/legacy/plugins/graph/public/services/persistence/deserialize.ts b/x-pack/legacy/plugins/graph/public/services/persistence/deserialize.ts
index 4a30f21cef335..003f0b5e48141 100644
--- a/x-pack/legacy/plugins/graph/public/services/persistence/deserialize.ts
+++ b/x-pack/legacy/plugins/graph/public/services/persistence/deserialize.ts
@@ -19,13 +19,13 @@ import {
Workspace,
SerializedField,
} from '../../types';
-import { outlinkEncoders } from '../outlink_encoders';
+import { outlinkEncoders } from '../../helpers/outlink_encoders';
import {
urlTemplateIconChoicesByClass,
getSuitableIcon,
colorChoices,
iconChoicesByClass,
-} from '../style_choices';
+} from '../../helpers/style_choices';
const defaultAdvancedSettings: AdvancedSettings = {
useSignificance: true,
diff --git a/x-pack/legacy/plugins/graph/public/services/persistence/serialize.test.ts b/x-pack/legacy/plugins/graph/public/services/persistence/serialize.test.ts
index 1f4f608f95c61..eb6e2f48ac68b 100644
--- a/x-pack/legacy/plugins/graph/public/services/persistence/serialize.test.ts
+++ b/x-pack/legacy/plugins/graph/public/services/persistence/serialize.test.ts
@@ -12,7 +12,7 @@ import {
WorkspaceEdge,
AppState,
} from '../../types';
-import { outlinkEncoders } from '../outlink_encoders';
+import { outlinkEncoders } from '../../helpers/outlink_encoders';
describe('serialize', () => {
let appState: AppState;
diff --git a/x-pack/legacy/plugins/graph/public/services/save_modal.tsx b/x-pack/legacy/plugins/graph/public/services/save_modal.tsx
index 7680cdaa085e9..bb453bd95df5e 100644
--- a/x-pack/legacy/plugins/graph/public/services/save_modal.tsx
+++ b/x-pack/legacy/plugins/graph/public/services/save_modal.tsx
@@ -5,15 +5,16 @@
*/
import React from 'react';
-import { showSaveModal, SaveResult } from 'ui/saved_objects/show_saved_object_save_modal';
+import { SaveResult } from 'ui/saved_objects/show_saved_object_save_modal';
import { GraphWorkspaceSavedObject, GraphSavePolicy } from '../types';
-import { GraphSaveModal, OnSaveGraphProps } from '../components/graph_save_modal';
+import { SaveModal, OnSaveGraphProps } from '../components/save_modal';
-export function save({
+export function openSaveModal({
savePolicy,
hasData,
workspace,
saveWorkspace,
+ showSaveModal,
}: {
savePolicy: GraphSavePolicy;
hasData: boolean;
@@ -26,6 +27,7 @@ export function save({
},
dataConsent: boolean
) => Promise;
+ showSaveModal: (el: React.ReactNode) => void;
}) {
const currentTitle = workspace.title;
const currentDescription = workspace.description;
@@ -55,7 +57,7 @@ export function save({
});
};
showSaveModal(
-