Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/ui/components/DialogEditItem/DialogEditItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {useEffectOnce} from 'ui/hooks';
import {initControlDialog, resetControlDialog} from 'ui/store/actions/controlDialog/controlDialog';
import {selectOpenedDialogType} from 'ui/store/selectors/controlDialog';
import type {DialogEditItemFeaturesProp} from 'ui/store/typings/controlDialog';
import type {SetItemDataArgs, SetItemDataPayload} from 'ui/units/dash/store/actions/dashTyped';
import type {SetItemDataPayload} from 'ui/units/dash/store/actions/dashTyped';

import type {CommonVisualSettings} from '../DashKit/DashKit';
import DialogChartWidget from '../DialogChartWidget/DialogChartWidget';
Expand Down Expand Up @@ -93,7 +93,7 @@ export type DialogEditItemProps = {
changeNavigationPath: (newNavigationPath: string) => void;
features?: DialogEditItemFeaturesProp;
theme?: RealTheme;
setItemData: (args: SetItemDataPayload | SetItemDataArgs) => void;
setItemData: (args: SetItemDataPayload) => void;
} & DialogEditSpecificProps;

export const isDialogEditItemType = (type: string): type is DashTabItemType =>
Expand Down
5 changes: 2 additions & 3 deletions src/ui/components/DialogTextWidget/DialogTextWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {PaletteBackground} from 'ui/units/dash/containers/Dialogs/components/Pal
import {isEnabledFeature} from 'ui/utils/isEnabledFeature';
import {useInternalMarginsEnabled} from 'ui/utils/widgets/internalMargins';

import type {SetItemDataArgs, SetItemDataPayload} from '../../units/dash/store/actions/dashTyped';
import type {SetItemDataPayload} from '../../units/dash/store/actions/dashTyped';
import type {CommonVisualSettings} from '../DashKit/DashKit';
import {useBackgroundColorSettings} from '../DialogTitleWidget/useColorSettings';
import {WidgetRoundingsInput} from '../WidgetRoundingsInput/WidgetRoundingsInput';
Expand All @@ -45,8 +45,7 @@ export interface DialogTextWidgetProps extends DialogTextWidgetFeatureProps {
dialogIsVisible: boolean;

closeDialog: () => void;
// TODO: Remove args after platform up
setItemData: (newItemData: SetItemDataPayload | SetItemDataArgs) => void;
setItemData: (newItemData: SetItemDataPayload) => void;

theme?: RealTheme;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/units/dash/containers/Dialogs/Dialogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {ValuesType} from 'utility-types';
import {DIALOG_TYPE} from '../../../../constants/dialogs';
import {selectControlDialogTheme} from '../../../../store/selectors/controlDialog';
import {changeNavigationPath, setItemData} from '../../store/actions/dashTyped';
import type {SetItemDataArgs, SetItemDataPayload} from '../../store/actions/dashTyped';
import type {SetItemDataPayload} from '../../store/actions/dashTyped';
import {closeDialog} from '../../store/actions/dialogs/actions';
import {
selectCurrentTabId,
Expand Down Expand Up @@ -74,7 +74,7 @@ export function Dialogs() {
});

const setItemDataHandle = React.useCallback(
(newItemData: SetItemDataPayload | SetItemDataArgs) => {
(newItemData: SetItemDataPayload) => {
dispatch(setItemData(newItemData));
},
[dispatch],
Expand Down
23 changes: 2 additions & 21 deletions src/ui/units/dash/store/actions/dashTyped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,25 +521,6 @@ export type SetItemDataItem = {
| {type?: DashTabItemType.Image; data: SetItemDataImage}
);

// TODO: Remove after update platform
export type SetItemDataArgs = {
defaults?: SetItemDataDefaults;
namespace?: string;
// context for selectors pasted from the buffer
contextList?: {
index: number;
targetId: string;
targetEntryId: string;
targetDashTabId: string;
}[];
} & (
| {type?: DashTabItemType.Control; data: SetItemDataExternalControl}
| {type?: DashTabItemType.GroupControl; data: SetItemDataGroupControl}
| {type?: DashTabItemType.Text; data: SetItemDataText}
| {type?: DashTabItemType.Title; data: SetItemDataTitle}
| {type?: DashTabItemType.Image; data: SetItemDataImage}
);

export type AddingGlobalItemArgs = {
itemLayout?: Omit<ConfigLayout, 'i'>;
options?: Omit<AddNewItemOptions, 'reflowLayoutOptions'>;
Expand All @@ -553,10 +534,10 @@ export type SetItemDataPayload = {

export type SetItemDataAction = {
type: typeof actionTypes.SET_ITEM_DATA;
payload: SetItemDataPayload | SetItemDataArgs;
payload: SetItemDataPayload;
};

export const setItemData = (data: SetItemDataPayload | SetItemDataArgs) => {
export const setItemData = (data: SetItemDataPayload) => {
return (dispatch: DashDispatch, getState: () => DatalensGlobalState) => {
dispatch({
type: actionTypes.SET_ITEM_DATA,
Expand Down
3 changes: 1 addition & 2 deletions src/ui/units/dash/store/reducers/dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,7 @@ function dash(state = initialState, action) {
defaults,
contextList,
id: itemId,
// TODO: remove after up platform
} = 'item' in action.payload ? action.payload.item : action.payload;
} = action.payload.item;

let targetTab = tab;
let targetTabIndex = tabIndex;
Expand Down
Loading