feat: added an editable option for the receipt printing active status
feat: create an EditableProperty component feat: added boolean properties table and missing properties chore: integrated receipt printing page on op info page fix: fixed style issues in the boolean properties table feat: added a custom prefixText on the editable property component chore: commented out currently unused features fix: fixed boolean properties table color chore: removed debug logs fix: boolean properties table cancel button was saving instead of canceling fix: receipt printing properties where wrong (customText currently isn't used, and customerNameOrPhoneNumber was using the wrong property)
This commit is contained in:
parent
840788e044
commit
5256301eff
9 changed files with 353 additions and 23 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { makeStyles } from '@material-ui/core/styles'
|
||||
import classnames from 'classnames'
|
||||
import React, { useState, memo } from 'react'
|
||||
|
||||
import { Link } from 'src/components/buttons'
|
||||
|
|
@ -30,6 +31,7 @@ const BooleanPropertiesTable = memo(
|
|||
}
|
||||
|
||||
const innerCancel = () => {
|
||||
setRadioGroupValues(elements)
|
||||
setEditing(false)
|
||||
}
|
||||
|
||||
|
|
@ -79,23 +81,31 @@ const BooleanPropertiesTable = memo(
|
|||
{radioGroupValues &&
|
||||
radioGroupValues.map((element, idx) => (
|
||||
<TableRow key={idx} size="sm" className={classes.tableRow}>
|
||||
<TableCell className={classes.tableCell}>
|
||||
<TableCell className={classes.leftTableCell}>
|
||||
{element.display}
|
||||
{editing && (
|
||||
<RadioGroup
|
||||
options={radioButtonOptions}
|
||||
value={element.value}
|
||||
onChange={event =>
|
||||
handleRadioButtons(
|
||||
element.name,
|
||||
event.target.value === 'true'
|
||||
)
|
||||
}
|
||||
className={classes.radioButtons}
|
||||
/>
|
||||
)}
|
||||
{!editing && <BooleanCell value={element.value} />}
|
||||
</TableCell>
|
||||
{editing && (
|
||||
<RadioGroup
|
||||
options={radioButtonOptions}
|
||||
value={element.value}
|
||||
onChange={event =>
|
||||
handleRadioButtons(
|
||||
element.name,
|
||||
event.target.value === 'true'
|
||||
)
|
||||
}
|
||||
className={classnames(
|
||||
classes.radioButtons,
|
||||
classes.rightTableCell
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
{!editing && (
|
||||
<BooleanCell
|
||||
className={classes.rightTableCell}
|
||||
value={element.value}
|
||||
/>
|
||||
)}
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue