Skip to content

Commit 8856292

Browse files
authored
Add Dash settings for additions buttons (#3063)
1 parent bff365b commit 8856292

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type {DialogTextWidgetProps} from '../../../components/DialogTextWidget/DialogTextWidget';
22
import {makeDefaultEmpty} from '../../components/DefaultEmpty';
33

4+
import type {DashActionPanelAdditionalButtonsProps} from './types/DashActionPanelAdditionalButtons';
45
import type {DialogDashOtherSettingsPrependProps} from './types/DialogDashOtherSettingsPrepend';
56

67
export const dashComponentsMap = {
@@ -9,5 +10,5 @@ export const dashComponentsMap = {
910
DialogTextWidget: makeDefaultEmpty<DialogTextWidgetProps>(),
1011
DashBodyAdditionalControls: makeDefaultEmpty(),
1112
DialogDashOtherSettingsPrepend: makeDefaultEmpty<DialogDashOtherSettingsPrependProps>(),
12-
DashActionPanelAdditionalButtons: makeDefaultEmpty(),
13+
DashActionPanelAdditionalButtons: makeDefaultEmpty<DashActionPanelAdditionalButtonsProps>(),
1314
} as const;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type {DashSettings} from 'shared';
2+
3+
export type DashActionPanelAdditionalButtonsProps = {
4+
dashSettings: DashSettings;
5+
};

src/ui/units/dash/components/DashActionPanel/DashActionPanel.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import {
4848
selectDashDescription,
4949
selectDashShowOpenedDescription,
5050
selectLoadingEditMode,
51+
selectSettings,
5152
selectStateMode,
5253
} from '../../store/selectors/dashTypedSelectors';
5354
import type {DashEntry} from '../../typings/entry';
@@ -113,7 +114,10 @@ class DashActionPanel extends React.PureComponent<ActionPanelProps, ActionPanelS
113114
entry={entry as GetEntryResponse}
114115
additionalEntryItems={this.getAdditionalEntryItems()}
115116
rightItems={[
116-
<DashActionPanelAdditionalButtons key="additional-buttons" />,
117+
<DashActionPanelAdditionalButtons
118+
key="additional-buttons"
119+
dashSettings={this.props.settings}
120+
/>,
117121
<div className={b('controls')} key="controls">
118122
{this.renderControls()}
119123
</div>,
@@ -360,6 +364,7 @@ const mapStateToProps = (state: DatalensGlobalState) => {
360364
accessDescription: selectDashAccessDescription(state),
361365
showOpenedDescription: selectDashShowOpenedDescription(state),
362366
description: selectDashDescription(state),
367+
settings: selectSettings(state),
363368
};
364369
};
365370

0 commit comments

Comments
 (0)