diff options
| author | Dayana31 <[email protected]> | 2022-06-01 16:43:23 -0500 |
|---|---|---|
| committer | Dayana31 <[email protected]> | 2022-06-01 16:43:23 -0500 |
| commit | ec0c33156713e51c64f2a9de4f932cd5507c654b (patch) | |
| tree | cc46421686a49bbc0a0c343e460c13a21af1015d /front/odiparpack/app/components/Tables/tableParts | |
| parent | 6971201caffc2fccee5bfb12e88e5510c85eeb49 (diff) | |
| parent | e9cb09907f8dbc9a4a64549a3ea4d1d8313e7c25 (diff) | |
| download | DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.tar.gz DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.tar.bz2 DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.zip | |
Merge branch 'develop' into dayana
Diffstat (limited to 'front/odiparpack/app/components/Tables/tableParts')
3 files changed, 41 insertions, 12 deletions
diff --git a/front/odiparpack/app/components/Tables/tableParts/Form.js b/front/odiparpack/app/components/Tables/tableParts/Form.js index da66966..66188c7 100644 --- a/front/odiparpack/app/components/Tables/tableParts/Form.js +++ b/front/odiparpack/app/components/Tables/tableParts/Form.js @@ -31,14 +31,14 @@ class Form extends Component { </section> <div className={css.buttonArea}> <Button variant="contained" color="secondary" type="submit" disabled={submitting}> - Submit + Guardar </Button> <Button type="button" disabled={pristine || submitting} onClick={reset} > - Reset + Limpiar </Button> </div> </form> diff --git a/front/odiparpack/app/components/Tables/tableParts/MainTableForm.js b/front/odiparpack/app/components/Tables/tableParts/MainTableForm.js index ccf0e4a..1437fa8 100644 --- a/front/odiparpack/app/components/Tables/tableParts/MainTableForm.js +++ b/front/odiparpack/app/components/Tables/tableParts/MainTableForm.js @@ -29,7 +29,8 @@ class MainTableForm extends React.Component { editRow, addNew, anchor, - branch + branch, + removeRowAPI } = this.props; const getItems = dataArray => dataArray.map(item => ( <RowReadOnly @@ -39,6 +40,7 @@ class MainTableForm extends React.Component { editRow={() => editRow(item, branch)} anchor={anchor} branch={branch} + removeRowAPI = {removeRowAPI} /> )); @@ -61,7 +63,7 @@ class MainTableForm extends React.Component { <Tooltip title="Add Item"> <Button variant="contained" onClick={() => addNew(anchor, branch)} color="secondary" className={classes.button}> <AddIcon className={classNames(classes.leftIcon, classes.iconSmall)} /> - Add New + AƱadir </Button> </Tooltip> </div> diff --git a/front/odiparpack/app/components/Tables/tableParts/RowReadOnly.js b/front/odiparpack/app/components/Tables/tableParts/RowReadOnly.js index 7da655f..d060d02 100644 --- a/front/odiparpack/app/components/Tables/tableParts/RowReadOnly.js +++ b/front/odiparpack/app/components/Tables/tableParts/RowReadOnly.js @@ -5,8 +5,10 @@ import classNames from 'classnames'; import css from 'ba-styles/Table.scss'; import DeleteIcon from '@material-ui/icons/Delete'; import EditIcon from '@material-ui/icons/BorderColor'; +import { etiqueta } from 'ba-components/Odipar/common'; -import { TableCell, IconButton } from '@material-ui/core'; +import { TableCell, IconButton, LinearProgress } from '@material-ui/core'; +import { connect } from 'react-redux'; const styles = theme => ({ button: { @@ -22,21 +24,40 @@ class RowReadOnly extends React.Component { item, removeRow, editRow, - branch + branch, + removeRowAPI } = this.props; const eventDel = () => { removeRow(item, branch); + this.props.dispatch(removeRowAPI()).then((res) => { + if (res) { + console.log("REMOVE READ ONLY ", res) + } + }) }; const eventEdit = () => { editRow(item, branch); }; const renderCell = dataArray => dataArray.map((itemCell, index) => { if (itemCell.name !== 'action' && !itemCell.hidden) { - return ( - <TableCell padding="none" key={index.toString()}> - {item.get(itemCell.name) !== undefined ? item.get(itemCell.name).toString() : ''} - </TableCell> - ); + const inputType = anchor[index].type; + switch (inputType) { + case 'etiq_pedido': + case 'etiq_camion': + case 'etiq_bloqueo': + case 'etiq_alma': + return ( + <TableCell padding="none" key={index.toString()}> + {etiqueta(inputType, item.get(itemCell.name))} + </TableCell> + ); + case 'texto': + return ( + <TableCell padding="none" key={index.toString()}> + {item.get(itemCell.name) !== undefined ? item.get(itemCell.name).toString() : ''} + </TableCell> + ); + } } return false; }); @@ -72,5 +93,11 @@ RowReadOnly.propTypes = { editRow: PropTypes.func.isRequired, branch: PropTypes.string.isRequired, }; +const mapDispatchToProps = dispatch => ({ + dispatch +}); -export default withStyles(styles)(RowReadOnly); +const RowReadOnlyMapped = connect( + mapDispatchToProps +)(RowReadOnly); +export default withStyles(styles)(RowReadOnlyMapped); |
