Skip to content

Commit 1c6d3f7

Browse files
Remove not relevant SetItemsArgs type (#3554)
1 parent c9321b3 commit 1c6d3f7

File tree

5 files changed

+9
-30
lines changed

5 files changed

+9
-30
lines changed

src/ui/components/DialogEditItem/DialogEditItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {useEffectOnce} from 'ui/hooks';
99
import {initControlDialog, resetControlDialog} from 'ui/store/actions/controlDialog/controlDialog';
1010
import {selectOpenedDialogType} from 'ui/store/selectors/controlDialog';
1111
import type {DialogEditItemFeaturesProp} from 'ui/store/typings/controlDialog';
12-
import type {SetItemDataArgs, SetItemDataPayload} from 'ui/units/dash/store/actions/dashTyped';
12+
import type {SetItemDataPayload} from 'ui/units/dash/store/actions/dashTyped';
1313

1414
import type {CommonVisualSettings} from '../DashKit/DashKit';
1515
import DialogChartWidget from '../DialogChartWidget/DialogChartWidget';
@@ -93,7 +93,7 @@ export type DialogEditItemProps = {
9393
changeNavigationPath: (newNavigationPath: string) => void;
9494
features?: DialogEditItemFeaturesProp;
9595
theme?: RealTheme;
96-
setItemData: (args: SetItemDataPayload | SetItemDataArgs) => void;
96+
setItemData: (args: SetItemDataPayload) => void;
9797
} & DialogEditSpecificProps;
9898

9999
export const isDialogEditItemType = (type: string): type is DashTabItemType =>

src/ui/components/DialogTextWidget/DialogTextWidget.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {PaletteBackground} from 'ui/units/dash/containers/Dialogs/components/Pal
1818
import {isEnabledFeature} from 'ui/utils/isEnabledFeature';
1919
import {useInternalMarginsEnabled} from 'ui/utils/widgets/internalMargins';
2020

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

4747
closeDialog: () => void;
48-
// TODO: Remove args after platform up
49-
setItemData: (newItemData: SetItemDataPayload | SetItemDataArgs) => void;
48+
setItemData: (newItemData: SetItemDataPayload) => void;
5049

5150
theme?: RealTheme;
5251
}

src/ui/units/dash/containers/Dialogs/Dialogs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type {ValuesType} from 'utility-types';
1414
import {DIALOG_TYPE} from '../../../../constants/dialogs';
1515
import {selectControlDialogTheme} from '../../../../store/selectors/controlDialog';
1616
import {changeNavigationPath, setItemData} from '../../store/actions/dashTyped';
17-
import type {SetItemDataArgs, SetItemDataPayload} from '../../store/actions/dashTyped';
17+
import type {SetItemDataPayload} from '../../store/actions/dashTyped';
1818
import {closeDialog} from '../../store/actions/dialogs/actions';
1919
import {
2020
selectCurrentTabId,
@@ -74,7 +74,7 @@ export function Dialogs() {
7474
});
7575

7676
const setItemDataHandle = React.useCallback(
77-
(newItemData: SetItemDataPayload | SetItemDataArgs) => {
77+
(newItemData: SetItemDataPayload) => {
7878
dispatch(setItemData(newItemData));
7979
},
8080
[dispatch],

src/ui/units/dash/store/actions/dashTyped.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -521,25 +521,6 @@ export type SetItemDataItem = {
521521
| {type?: DashTabItemType.Image; data: SetItemDataImage}
522522
);
523523

524-
// TODO: Remove after update platform
525-
export type SetItemDataArgs = {
526-
defaults?: SetItemDataDefaults;
527-
namespace?: string;
528-
// context for selectors pasted from the buffer
529-
contextList?: {
530-
index: number;
531-
targetId: string;
532-
targetEntryId: string;
533-
targetDashTabId: string;
534-
}[];
535-
} & (
536-
| {type?: DashTabItemType.Control; data: SetItemDataExternalControl}
537-
| {type?: DashTabItemType.GroupControl; data: SetItemDataGroupControl}
538-
| {type?: DashTabItemType.Text; data: SetItemDataText}
539-
| {type?: DashTabItemType.Title; data: SetItemDataTitle}
540-
| {type?: DashTabItemType.Image; data: SetItemDataImage}
541-
);
542-
543524
export type AddingGlobalItemArgs = {
544525
itemLayout?: Omit<ConfigLayout, 'i'>;
545526
options?: Omit<AddNewItemOptions, 'reflowLayoutOptions'>;
@@ -553,10 +534,10 @@ export type SetItemDataPayload = {
553534

554535
export type SetItemDataAction = {
555536
type: typeof actionTypes.SET_ITEM_DATA;
556-
payload: SetItemDataPayload | SetItemDataArgs;
537+
payload: SetItemDataPayload;
557538
};
558539

559-
export const setItemData = (data: SetItemDataPayload | SetItemDataArgs) => {
540+
export const setItemData = (data: SetItemDataPayload) => {
560541
return (dispatch: DashDispatch, getState: () => DatalensGlobalState) => {
561542
dispatch({
562543
type: actionTypes.SET_ITEM_DATA,

src/ui/units/dash/store/reducers/dash.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,7 @@ function dash(state = initialState, action) {
372372
defaults,
373373
contextList,
374374
id: itemId,
375-
// TODO: remove after up platform
376-
} = 'item' in action.payload ? action.payload.item : action.payload;
375+
} = action.payload.item;
377376

378377
let targetTab = tab;
379378
let targetTabIndex = tabIndex;

0 commit comments

Comments
 (0)