Skip to content

Commit 1d0b768

Browse files
[8.19] [Graph/SCSS] Migrate /graph/public/_main.scss file to Emotion (#215280) (#218864)
# Backport This will backport the following commits from `main` to `8.19`: - [[Graph/SCSS] Migrate `/graph/public/_main.scss` file to Emotion (#215280)](#215280) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Maria Iriarte","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-04-22T16:45:42Z","message":"[Graph/SCSS] Migrate `/graph/public/_main.scss` file to Emotion (#215280)\n\n## Summary\n\nPart of https://github.com/elastic/kibana/issues/208908\n\n### Screenshots\n\n#### .gphAppWrapper\n\n<img width=\"1752\" alt=\"Screenshot 2025-03-20 at 10 19 47\"\nsrc=\"https://github.com/user-attachments/assets/79bce260-b286-4951-8005-540c5528580b\"\n/>\n\n#### .gphColorPicker__color\n\n<img width=\"1752\" alt=\"Screenshot 2025-03-20 at 10 18 17\"\nsrc=\"https://github.com/user-attachments/assets/a10ccb3a-fcd1-49bb-8e1b-024cf08f9c78\"\n/>\n\n\n#### .gphFormGroup--small\n\n<img width=\"1752\" alt=\"Screenshot 2025-03-20 at 10 10 17\"\nsrc=\"https://github.com/user-attachments/assets/b029965e-de0e-4e85-88f2-62c341298ea6\"\n/>\n\n<img width=\"1753\" alt=\"Screenshot 2025-03-20 at 10 12 52\"\nsrc=\"https://github.com/user-attachments/assets/88bbeb52-c822-44f3-a6f2-aa7cbce09ebf\"\n/>\n\n### Checklist\n\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"c84380fe0137da7b83e83c92c1d6895a03026bcb","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Graph","technical debt","Team:Visualizations","release_note:skip","backport:version","v9.1.0","v8.19.0","scss-removal"],"title":"[Graph/SCSS] Migrate `/graph/public/_main.scss` file to Emotion","number":215280,"url":"https://github.com/elastic/kibana/pull/215280","mergeCommit":{"message":"[Graph/SCSS] Migrate `/graph/public/_main.scss` file to Emotion (#215280)\n\n## Summary\n\nPart of https://github.com/elastic/kibana/issues/208908\n\n### Screenshots\n\n#### .gphAppWrapper\n\n<img width=\"1752\" alt=\"Screenshot 2025-03-20 at 10 19 47\"\nsrc=\"https://github.com/user-attachments/assets/79bce260-b286-4951-8005-540c5528580b\"\n/>\n\n#### .gphColorPicker__color\n\n<img width=\"1752\" alt=\"Screenshot 2025-03-20 at 10 18 17\"\nsrc=\"https://github.com/user-attachments/assets/a10ccb3a-fcd1-49bb-8e1b-024cf08f9c78\"\n/>\n\n\n#### .gphFormGroup--small\n\n<img width=\"1752\" alt=\"Screenshot 2025-03-20 at 10 10 17\"\nsrc=\"https://github.com/user-attachments/assets/b029965e-de0e-4e85-88f2-62c341298ea6\"\n/>\n\n<img width=\"1753\" alt=\"Screenshot 2025-03-20 at 10 12 52\"\nsrc=\"https://github.com/user-attachments/assets/88bbeb52-c822-44f3-a6f2-aa7cbce09ebf\"\n/>\n\n### Checklist\n\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"c84380fe0137da7b83e83c92c1d6895a03026bcb"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215280","number":215280,"mergeCommit":{"message":"[Graph/SCSS] Migrate `/graph/public/_main.scss` file to Emotion (#215280)\n\n## Summary\n\nPart of https://github.com/elastic/kibana/issues/208908\n\n### Screenshots\n\n#### .gphAppWrapper\n\n<img width=\"1752\" alt=\"Screenshot 2025-03-20 at 10 19 47\"\nsrc=\"https://github.com/user-attachments/assets/79bce260-b286-4951-8005-540c5528580b\"\n/>\n\n#### .gphColorPicker__color\n\n<img width=\"1752\" alt=\"Screenshot 2025-03-20 at 10 18 17\"\nsrc=\"https://github.com/user-attachments/assets/a10ccb3a-fcd1-49bb-8e1b-024cf08f9c78\"\n/>\n\n\n#### .gphFormGroup--small\n\n<img width=\"1752\" alt=\"Screenshot 2025-03-20 at 10 10 17\"\nsrc=\"https://github.com/user-attachments/assets/b029965e-de0e-4e85-88f2-62c341298ea6\"\n/>\n\n<img width=\"1753\" alt=\"Screenshot 2025-03-20 at 10 12 52\"\nsrc=\"https://github.com/user-attachments/assets/88bbeb52-c822-44f3-a6f2-aa7cbce09ebf\"\n/>\n\n### Checklist\n\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"c84380fe0137da7b83e83c92c1d6895a03026bcb"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Maria Iriarte <[email protected]>
1 parent 556518f commit 1d0b768

File tree

6 files changed

+32
-44
lines changed

6 files changed

+32
-44
lines changed

x-pack/platform/plugins/private/graph/public/_main.scss

Lines changed: 0 additions & 27 deletions
This file was deleted.

x-pack/platform/plugins/private/graph/public/application.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ import { Storage } from '@kbn/kibana-utils-plugin/public';
2828
import { FormattedRelative } from '@kbn/i18n-react';
2929
import { Start as InspectorPublicPluginStart } from '@kbn/inspector-plugin/public';
3030
import { TableListViewKibanaProvider } from '@kbn/content-management-table-list-view-table';
31-
32-
import './index.scss';
3331
import { SpacesApi } from '@kbn/spaces-plugin/public';
3432
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
3533
import { SavedObjectsManagementPluginStart } from '@kbn/saved-objects-management-plugin/public';
3634
import { ContentClient, ContentManagementPublicStart } from '@kbn/content-management-plugin/public';
35+
3736
import { GraphSavePolicy } from './types';
3837
import { graphRouter } from './router';
3938
import { checkLicense } from '../common/check_license';
@@ -128,7 +127,6 @@ export const renderApp = ({ history, element, ...deps }: GraphDependencies) => {
128127
</KibanaRenderContextProvider>
129128
);
130129
ReactDOM.render(app, element);
131-
element.setAttribute('class', 'gphAppWrapper');
132130

133131
return () => {
134132
licenseSubscription.unsubscribe();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import { css } from '@emotion/react';
9+
import type { UseEuiTheme } from '@elastic/eui';
10+
11+
export const gphFormGroupSmallStyles = ({ euiTheme }: UseEuiTheme) =>
12+
css`
13+
margin-bottom: ${euiTheme.size.s};
14+
`;

x-pack/platform/plugins/private/graph/public/components/control_panel/select_style.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
import React from 'react';
99
import { i18n } from '@kbn/i18n';
10-
import { EuiIcon } from '@elastic/eui';
10+
import { EuiIcon, UseEuiTheme } from '@elastic/eui';
11+
import { css } from '@emotion/react';
1112
import { Workspace } from '../../types';
1213
import { gphSidebarHeaderStyles, gphSidebarPanelStyles } from '../../styles';
14+
import { gphFormGroupSmallStyles } from './control_plane.styles';
1315

1416
interface SelectStyleProps {
1517
workspace: Workspace;
@@ -26,7 +28,7 @@ export const SelectStyle = ({ colors, workspace }: SelectStyleProps) => {
2628
})}
2729
</div>
2830

29-
<div className="form-group form-group-sm gphFormGroup--small">
31+
<div className="form-group form-group-sm" css={gphFormGroupSmallStyles}>
3032
{colors.map((c) => {
3133
const onSelectColor = () => {
3234
workspace.colorSelected(c);
@@ -36,7 +38,7 @@ export const SelectStyle = ({ colors, workspace }: SelectStyleProps) => {
3638
<EuiIcon
3739
type="stopFilled"
3840
color={c}
39-
className="gphColorPicker__color"
41+
css={colorPickerIconStyles}
4042
aria-hidden="true"
4143
onClick={onSelectColor}
4244
/>
@@ -46,3 +48,13 @@ export const SelectStyle = ({ colors, workspace }: SelectStyleProps) => {
4648
</div>
4749
);
4850
};
51+
52+
const colorPickerIconStyles = ({ euiTheme }: UseEuiTheme) =>
53+
css({
54+
margin: euiTheme.size.xs,
55+
cursor: 'pointer',
56+
57+
'&:hover, &:focus': {
58+
transform: 'scale(1.4)',
59+
},
60+
});

x-pack/platform/plugins/private/graph/public/components/control_panel/selected_node_editor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { FormattedMessage } from '@kbn/i18n-react';
1212
import { Workspace, WorkspaceNode } from '../../types';
1313
import { IconRenderer } from '../icon_renderer';
1414
import { gphSidebarHeaderStyles, gphSidebarPanelStyles } from '../../styles';
15+
import { gphFormGroupSmallStyles } from './control_plane.styles';
1516

1617
interface SelectedNodeEditorProps {
1718
workspace: Workspace;
@@ -68,7 +69,7 @@ export const SelectedNodeEditor = ({ workspace, selectedNode }: SelectedNodeEdit
6869
)}
6970

7071
<form className="form-horizontal">
71-
<div className="form-group form-group-sm gphFormGroup--small">
72+
<div className="form-group form-group-sm" css={gphFormGroupSmallStyles}>
7273
<label htmlFor="labelEdit" className="col-sm-3 control-label">
7374
{i18n.translate('xpack.graph.sidebar.displayLabelLabel', {
7475
defaultMessage: 'Display label',

x-pack/platform/plugins/private/graph/public/index.scss

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)