u
This commit is contained in:
@@ -228,11 +228,13 @@ class PriceOverlay extends Component {
|
|||||||
unitOptions,
|
unitOptions,
|
||||||
articleUnitSi,
|
articleUnitSi,
|
||||||
onOpenEditor,
|
onOpenEditor,
|
||||||
|
onOpenTiers,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
if (!editing || draft == null) return null;
|
if (!editing || draft == null) return null;
|
||||||
return (
|
return (
|
||||||
<PriceUnitCorner
|
<PriceUnitCorner
|
||||||
hasUnit={draft.hasUnit}
|
hasUnit={draft.hasUnit}
|
||||||
|
onOpenTiers={onOpenTiers}
|
||||||
onToggleHasUnit={(hasUnit) => {
|
onToggleHasUnit={(hasUnit) => {
|
||||||
if (hasUnit) {
|
if (hasUnit) {
|
||||||
const unitamount = draft.unitamount || '1';
|
const unitamount = draft.unitamount || '1';
|
||||||
@@ -557,7 +559,6 @@ export default class ArticleViewPrice extends PureComponent {
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
readOnly={!editing}
|
readOnly={!editing}
|
||||||
onOpenTiers={this.openTiersDialog}
|
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
@@ -575,6 +576,7 @@ export default class ArticleViewPrice extends PureComponent {
|
|||||||
unitOptions={unitOptions}
|
unitOptions={unitOptions}
|
||||||
articleUnitSi={articleData.unit?.si}
|
articleUnitSi={articleData.unit?.si}
|
||||||
onOpenEditor={this.openUnitEditor}
|
onOpenEditor={this.openUnitEditor}
|
||||||
|
onOpenTiers={this.openTiersDialog}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
display={
|
display={
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
import Chip from '@mui/material/Chip';
|
import Chip from '@mui/material/Chip';
|
||||||
import IconButton from '@mui/material/IconButton';
|
|
||||||
import LayersOutlinedIcon from '@mui/icons-material/LayersOutlined';
|
|
||||||
import {
|
import {
|
||||||
TINT_CHIP,
|
TINT_CHIP,
|
||||||
TINT_PILL_ACTIVE,
|
TINT_PILL_ACTIVE,
|
||||||
@@ -50,7 +48,7 @@ export class TaxRatePills extends Component {
|
|||||||
|
|
||||||
export class PriceTaxRow extends Component {
|
export class PriceTaxRow extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { rates, selected, onSelectTax, readOnly, onOpenTiers } = this.props;
|
const { rates, selected, onSelectTax, readOnly } = this.props;
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -67,20 +65,6 @@ export class PriceTaxRow extends Component {
|
|||||||
onSelect={onSelectTax}
|
onSelect={onSelectTax}
|
||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
/>
|
/>
|
||||||
<IconButton
|
|
||||||
type="button"
|
|
||||||
size="small"
|
|
||||||
aria-label="Staffelpreise"
|
|
||||||
disabled={readOnly}
|
|
||||||
onClick={readOnly ? undefined : onOpenTiers}
|
|
||||||
sx={{
|
|
||||||
p: 0.5,
|
|
||||||
visibility: readOnly ? 'hidden' : 'visible',
|
|
||||||
pointerEvents: readOnly ? 'none' : 'auto',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<LayersOutlinedIcon sx={{ fontSize: 28 }} />
|
|
||||||
</IconButton>
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import IconButton from '@mui/material/IconButton';
|
|||||||
import InputLabel from '@mui/material/InputLabel';
|
import InputLabel from '@mui/material/InputLabel';
|
||||||
import MenuItem from '@mui/material/MenuItem';
|
import MenuItem from '@mui/material/MenuItem';
|
||||||
import Select from '@mui/material/Select';
|
import Select from '@mui/material/Select';
|
||||||
|
import LayersOutlinedIcon from '@mui/icons-material/LayersOutlined';
|
||||||
import StraightenOutlinedIcon from '@mui/icons-material/StraightenOutlined';
|
import StraightenOutlinedIcon from '@mui/icons-material/StraightenOutlined';
|
||||||
import Switch from '@mui/material/Switch';
|
import Switch from '@mui/material/Switch';
|
||||||
import TextInput from '../../TextInput';
|
import TextInput from '../../TextInput';
|
||||||
@@ -16,12 +17,12 @@ import {
|
|||||||
|
|
||||||
const priceUnitCornerSx = {
|
const priceUnitCornerSx = {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: 72,
|
bottom: 8,
|
||||||
right: 4,
|
right: 4,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
gap: 1.25,
|
gap: 0.25,
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -119,9 +120,18 @@ export class PriceUnitRow extends Component {
|
|||||||
|
|
||||||
export class PriceUnitCorner extends Component {
|
export class PriceUnitCorner extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { hasUnit, onToggleHasUnit, onOpenEditor } = this.props;
|
const { hasUnit, onToggleHasUnit, onOpenEditor, onOpenTiers } = this.props;
|
||||||
return (
|
return (
|
||||||
<Box sx={priceUnitCornerSx}>
|
<Box sx={priceUnitCornerSx}>
|
||||||
|
<IconButton
|
||||||
|
type="button"
|
||||||
|
size="small"
|
||||||
|
aria-label="Staffelpreise"
|
||||||
|
onClick={onOpenTiers}
|
||||||
|
sx={{ p: 0.5 }}
|
||||||
|
>
|
||||||
|
<LayersOutlinedIcon sx={{ fontSize: 28 }} />
|
||||||
|
</IconButton>
|
||||||
<Switch
|
<Switch
|
||||||
size="small"
|
size="small"
|
||||||
checked={Boolean(hasUnit)}
|
checked={Boolean(hasUnit)}
|
||||||
|
|||||||
Reference in New Issue
Block a user