Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Domino987 committed Jun 27, 2021
2 parents 88bb78f + d817419 commit 7dbd7a4
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#
# Should run on each push, this should include pull requests
#
# If the commit message starts with "skip:build" we will skip this action
#
# If the commit message starts with "Release " we skip build
#

name: Build

on:
Expand All @@ -10,7 +17,9 @@ on:

jobs:
build:
if:
if: |
(startsWith(github.event.head_commit.message, 'skip:build') != true) &&
(startsWith(github.event.head_commit.message, 'Release ') != true)
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
2 changes: 2 additions & 0 deletions .slugignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
esbuild.cocnfig.js
jest.config.js
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
#### 3.0.10 (2021-06-26)

##### Other Changes

- build update readme ([1fb439b6](https://github.com/material-table-core/core/commit/1fb439b698e887bfaa39099e4ab8299fa470d163))

#### 3.0.9 (2021-06-26)

##### Other Changes

- build update readme ([dfc74a89](https://github.com/material-table-core/core/commit/dfc74a8994701b91459df3ac6e42ba72c8a633b2))
- build ([8b5925fc](https://github.com/material-table-core/core/commit/8b5925fc60b90e1edf7afba147e4e11c55a40a37))

#### 3.0.8 (2021-06-26)

#### 3.0.7 (2021-06-19)

##### Bug Fixes
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,13 @@
💾 [Installation](https://material-table-core.com/docs/#installation) 🎉 [Usage](https://material-table-core.com/docs/#basic-usage)
[Why does this repo exist?](https://material-table-core.com/docs/about) 🚧 [Documentation](https://material-table-core.com/docs) ⚙️ [Demos](https://material-table-core.com/demos)
</div>

# Contributing

Thanks for taking interest in contributing! :rocket: In being a community based repository, we wouldn't be here without you!

**Urgent items include**:

- Get rid of [`data-manager.js`](https://github.com/material-table-core/core/blob/master/src/utils/data-manager.js) (which is a homegrown global state manager of sorts) and integrate [React context](https://github.com/material-table-core/core/tree/context/src/store) via the `context` branch
- Documentation over at [`material-table-core/website`](https://github.com/material-table-core/website)
- Implementing tests via Jest
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "3.0.7",
"version": "3.0.10",
"description": "Datatable for React based on https://material-ui.com/api/table/ with additional features",
"main": "dist/index.js",
"types": "types/index.d.ts",
Expand Down
17 changes: 15 additions & 2 deletions src/components/m-table-edit-cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ class MTableEditCell extends React.Component {
super(props);

this.state = {
errorState: {
isValid: true,
helperText: ''
},
isLoading: false,
value: this.props.rowData[this.props.columnDef.field]
};
Expand Down Expand Up @@ -104,7 +108,7 @@ class MTableEditCell extends React.Component {
icon: this.props.icons.Check,
tooltip: this.props.localization.saveTooltip,
onClick: this.onApprove,
disabled: this.state.isLoading || !isValid
disabled: !this.state.isLoading || !isValid
},
{
icon: this.props.icons.Clear,
Expand All @@ -123,6 +127,13 @@ class MTableEditCell extends React.Component {
);
}

handleChange(value) {
const errorState = this.props.columnDef.validate({
[this.props.columnDef.field]: value
});
this.setState({ errorState, value });
}

render() {
const error = validateInput(this.props.columnDef, this.state.value);
console.log(error);
Expand All @@ -135,7 +146,9 @@ class MTableEditCell extends React.Component {
error={!error.isValid}
helperText={error.helperText}
value={this.state.value}
onChange={(value) => this.setState({ value })}
error={!this.state.errorState.isValid}
helperText={this.state.errorState.helperText}
onChange={(value) => this.handleChange(value)}
onKeyDown={this.handleKeyDown}
disabled={this.state.isLoading}
rowData={this.props.rowData}
Expand Down

0 comments on commit 7dbd7a4

Please sign in to comment.