fix: change header settings (#3391)

This commit is contained in:
Yury Molodov 2022-11-25 16:26:35 +01:00 committed by Aliaksandr Valialkin
parent 805d93dfec
commit fc8ff75e27
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
3 changed files with 16 additions and 11 deletions

View file

@ -9,11 +9,14 @@ import Tooltip from "../../Main/Tooltip/Tooltip";
import LimitsConfigurator from "./LimitsConfigurator/LimitsConfigurator";
import { SeriesLimits } from "../../../types";
import { useCustomPanelDispatch, useCustomPanelState } from "../../../state/customPanel/CustomPanelStateContext";
import { getAppModeEnable } from "../../../utils/app-mode";
import classNames from "classnames";
const title = "Settings";
const GlobalSettings: FC = () => {
const appModeEnable = getAppModeEnable();
const { serverUrl: stateServerUrl } = useAppState();
const { seriesLimits } = useCustomPanelState();
@ -36,7 +39,9 @@ const GlobalSettings: FC = () => {
return <>
<Tooltip title={title}>
<Button
className="vm-header-button"
className={classNames({
"vm-header-button": !appModeEnable
})}
variant="contained"
color="primary"
startIcon={<SettingsIcon/>}
@ -49,13 +54,15 @@ const GlobalSettings: FC = () => {
onClose={handleClose}
>
<div className="vm-server-configurator">
<div className="vm-server-configurator__input">
<ServerConfigurator
serverUrl={serverUrl}
onChange={setServerUrl}
onEnter={handlerApply}
/>
</div>
{!appModeEnable && (
<div className="vm-server-configurator__input">
<ServerConfigurator
serverUrl={serverUrl}
onChange={setServerUrl}
onEnter={handlerApply}
/>
</div>
)}
<div className="vm-server-configurator__input">
<LimitsConfigurator
limits={limits}

View file

@ -115,7 +115,7 @@ const Header: FC = () => {
{headerSetup?.timeSelector && <TimeSelector/>}
{headerSetup?.cardinalityDatePicker && <CardinalityDatePicker/>}
{headerSetup?.executionControls && <ExecutionControls/>}
{headerSetup?.globalSettings && !appModeEnable && <GlobalSettings/>}
<GlobalSettings/>
<ShortcutKeys/>
</div>
</header>;

View file

@ -19,7 +19,6 @@ const routerOptionsDefault = {
header: {
timeSelector: true,
executionControls: true,
globalSettings: true,
}
};
@ -29,7 +28,6 @@ export const routerOptions: {[key: string]: RouterOptions} = {
[router.cardinality]: {
header: {
cardinalityDatePicker: true,
globalSettings: true,
}
}
};