diff options
Diffstat (limited to 'front/odiparpack/app/components/Tables/tableParts')
3 files changed, 20 insertions, 5 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 8869212..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} /> )); diff --git a/front/odiparpack/app/components/Tables/tableParts/RowReadOnly.js b/front/odiparpack/app/components/Tables/tableParts/RowReadOnly.js index 2f4a519..d060d02 100644 --- a/front/odiparpack/app/components/Tables/tableParts/RowReadOnly.js +++ b/front/odiparpack/app/components/Tables/tableParts/RowReadOnly.js @@ -8,6 +8,7 @@ import EditIcon from '@material-ui/icons/BorderColor'; import { etiqueta } from 'ba-components/Odipar/common'; import { TableCell, IconButton, LinearProgress } from '@material-ui/core'; +import { connect } from 'react-redux'; const styles = theme => ({ button: { @@ -23,10 +24,16 @@ 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); @@ -86,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); |
