Skip to content

Commit

Permalink
chore: deprecate syncColors option, remove related fn tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nickofthyme committed Nov 14, 2024
1 parent 53774c5 commit 4c8cb6e
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 223 deletions.
3 changes: 3 additions & 0 deletions src/plugins/dashboard/common/content_management/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const DEFAULT_PANEL_HEIGHT = 15;
export const DEFAULT_DASHBOARD_OPTIONS = {
hidePanelTitles: false,
useMargins: true,
/**
* @deprecated https://github.com/elastic/kibana/pull/197802
**/
syncColors: true,
syncCursor: true,
syncTooltips: true,
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/dashboard/common/dashboard_container/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export interface DashboardContainerInput extends EmbeddableInput {
hidePanelTitles: DashboardOptions['hidePanelTitles'];
syncTooltips: DashboardOptions['syncTooltips'];
useMargins: DashboardOptions['useMargins'];
/**
* @deprecated https://github.com/elastic/kibana/pull/197802
**/
syncColors: DashboardOptions['syncColors'];
syncCursor: DashboardOptions['syncCursor'];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ import {
EuiFlyoutHeader,
EuiForm,
EuiFormRow,
EuiIconTip,
EuiSwitch,
EuiText,
EuiTextArea,
EuiTitle,
} from '@elastic/eui';
Expand Down Expand Up @@ -267,54 +265,6 @@ export const DashboardSettings = ({ onClose }: DashboardSettingsProps) => {
)}
>
<>
<EuiFormRow>
<EuiSwitch
label={
<EuiText size="s">
{i18n.translate(
'dashboard.embeddableApi.showSettings.flyout.form.syncColorsBetweenPanelsSwitchLabel',
{
defaultMessage: 'Sync color palettes across panels',
}
)}{' '}
<EuiIconTip
color="subdued"
content={
<FormattedMessage
id="dashboard.embeddableApi.showSettings.flyout.form.syncColorsBetweenPanelsSwitchHelp"
defaultMessage="Only valid for {default} and {compatibility} palettes"
values={{
default: (
<strong>
{i18n.translate('dashboard.palettes.defaultPaletteLabel', {
defaultMessage: 'Default',
})}
</strong>
),
compatibility: (
<strong>
{i18n.translate('dashboard.palettes.kibanaPaletteLabel', {
defaultMessage: 'Compatibility',
})}
</strong>
),
}}
/>
}
iconProps={{
className: 'eui-alignTop',
}}
position="top"
size="s"
type="questionInCircle"
/>
</EuiText>
}
checked={localSettings.syncColors}
onChange={(event) => updateDashboardSetting({ syncColors: event.target.checked })}
data-test-subj="dashboardSyncColorsCheckbox"
/>
</EuiFormRow>
<EuiFormRow>
<EuiSwitch
label={i18n.translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ describe('getInheritedInput', () => {
timeslice: [number, number];
};
expect(embeddableInput.syncTooltips).toBe(false);
expect(embeddableInput.syncColors).toBe(false);
expect(embeddableInput.syncCursor).toBe(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,16 @@ export const optionsSchema = schema.object({
defaultValue: DEFAULT_DASHBOARD_OPTIONS.useMargins,
meta: { description: 'Show margins between panels in the dashboard layout.' },
}),
/**
* @deprecated https://github.com/elastic/kibana/pull/197802
**/
syncColors: schema.boolean({
defaultValue: DEFAULT_DASHBOARD_OPTIONS.syncColors,
meta: { description: 'Synchronize colors between related panels in the dashboard.' },
meta: {
deprecated: true,
description:
'Previously used to synchronize legacy colors between related panels in the dashboard.',
},
}),
syncTooltips: schema.boolean({
defaultValue: DEFAULT_DASHBOARD_OPTIONS.syncTooltips,
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/embeddable/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export type EmbeddableInput = {
searchSessionId?: string;

/**
* Flag whether colors should be synced with other panels
* Flag whether legacy colors should be synced with other panels
*
* @deprecated https://github.com/elastic/kibana/pull/197802
*/
syncColors?: boolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const getGenericEmbeddableState = (state?: Partial<EmbeddableInput>): Embeddable
disabledActions: [],
disableTriggers: false,
enhancements: undefined,
syncColors: false,
syncTooltips: false,
syncCursor: true,
viewMode: ViewMode.VIEW,
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/embeddable/public/store/input_slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export const input = createSlice({
setSearchSessionId(state, action: PayloadAction<EmbeddableInput['searchSessionId']>) {
state.searchSessionId = action.payload;
},
/**
* @deprecated https://github.com/elastic/kibana/pull/197802
**/
setSyncColors(state, action: PayloadAction<EmbeddableInput['syncColors']>) {
state.syncColors = action.payload;
},
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/expressions/public/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export interface IExpressionLoaderParams {
onRenderError?: RenderErrorHandlerFnType;
searchSessionId?: string;
renderMode?: RenderMode;
/**
* @deprecated https://github.com/elastic/kibana/pull/197802
**/
syncColors?: boolean;
syncCursor?: boolean;
syncTooltips?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ export class VisualizeEmbeddable
private query?: Query;
private filters?: Filter[];
private searchSessionId?: string;
/**
* @deprecated https://github.com/elastic/kibana/pull/197802
**/
private syncColors?: boolean;
private syncTooltips?: boolean;
private syncCursor?: boolean;
Expand Down
6 changes: 0 additions & 6 deletions test/functional/services/dashboard/dashboard_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ export function DashboardSettingsProvider({ getService }: FtrProviderContext) {
await testSubjects.setEuiSwitch('dashboardPanelTitlesCheckbox', status);
}

public async toggleSyncColors(value: boolean) {
const status = value ? 'check' : 'uncheck';
log.debug(`toggleSyncColors::${status}`);
await testSubjects.setEuiSwitch('dashboardSyncColorsCheckbox', status);
}

public async toggleSyncCursor(value: boolean) {
const status = value ? 'check' : 'uncheck';
log.debug(`toggleSyncCursor::${status}`);
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export interface ExpressionWrapperProps {
) => void;
onRender$: () => void;
renderMode?: RenderMode;
/**
* @deprecated https://github.com/elastic/kibana/pull/197802
**/
syncColors?: boolean;
syncTooltips?: boolean;
syncCursor?: boolean;
Expand Down
1 change: 0 additions & 1 deletion x-pack/test/functional/apps/dashboard/group2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ loadTestFile }: FtrProviderContext) {
describe('dashboard', function () {
loadTestFile(require.resolve('./sync_colors'));
loadTestFile(require.resolve('./_async_dashboard'));
loadTestFile(require.resolve('./dashboard_lens_by_value'));
loadTestFile(require.resolve('./dashboard_maps_by_value'));
Expand Down
162 changes: 0 additions & 162 deletions x-pack/test/functional/apps/dashboard/group2/sync_colors.ts

This file was deleted.

0 comments on commit 4c8cb6e

Please sign in to comment.