Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
pro-blocks
Commits
36d3f395
Commit
36d3f395
authored
Oct 26, 2017
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgrade to React 16
parent
82d5b5dd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
235 additions
and
225 deletions
+235
-225
package.json
package.json
+5
-4
src/index.js
src/index.js
+1
-0
src/polyfill.js
src/polyfill.js
+7
-0
src/routes/Forms/AdvancedForm.js
src/routes/Forms/AdvancedForm.js
+219
-216
tests/setupTests.js
tests/setupTests.js
+3
-5
No files found.
package.json
View file @
36d3f395
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
"dependencies"
:
{
"dependencies"
:
{
"
antd
"
:
"
next
"
,
"
antd
"
:
"
next
"
,
"
classnames
"
:
"
^2.2.5
"
,
"
classnames
"
:
"
^2.2.5
"
,
"
core-js
"
:
"
^2.5.1
"
,
"
dva
"
:
"
^2.0.3
"
,
"
dva
"
:
"
^2.0.3
"
,
"
lodash
"
:
"
^4.17.4
"
,
"
lodash
"
:
"
^4.17.4
"
,
"
lodash-decorators
"
:
"
^4.4.1
"
,
"
lodash-decorators
"
:
"
^4.4.1
"
,
...
@@ -26,9 +27,9 @@
...
@@ -26,9 +27,9 @@
"
numeral
"
:
"
^2.0.6
"
,
"
numeral
"
:
"
^2.0.6
"
,
"
prop-types
"
:
"
^15.5.10
"
,
"
prop-types
"
:
"
^15.5.10
"
,
"
qs
"
:
"
^6.5.0
"
,
"
qs
"
:
"
^6.5.0
"
,
"
react
"
:
"
^1
5.6.2
"
,
"
react
"
:
"
^1
6.0.0
"
,
"
react-document-title
"
:
"
^2.0.3
"
,
"
react-document-title
"
:
"
^2.0.3
"
,
"
react-dom
"
:
"
^1
5.6.2
"
"
react-dom
"
:
"
^1
6.0.0
"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
babel-eslint
"
:
"
^8.0.1
"
,
"
babel-eslint
"
:
"
^8.0.1
"
,
...
@@ -43,7 +44,7 @@
...
@@ -43,7 +44,7 @@
"
babel-runtime
"
:
"
^6.9.2
"
,
"
babel-runtime
"
:
"
^6.9.2
"
,
"
cross-port-killer
"
:
"
^1.0.1
"
,
"
cross-port-killer
"
:
"
^1.0.1
"
,
"
enzyme
"
:
"
^3.1.0
"
,
"
enzyme
"
:
"
^3.1.0
"
,
"
enzyme-adapter-react-1
5
"
:
"
^1.0.2
"
,
"
enzyme-adapter-react-1
6
"
:
"
^1.0.2
"
,
"
eslint
"
:
"
^4.8.0
"
,
"
eslint
"
:
"
^4.8.0
"
,
"
eslint-config-airbnb
"
:
"
^16.0.0
"
,
"
eslint-config-airbnb
"
:
"
^16.0.0
"
,
"
eslint-plugin-babel
"
:
"
^4.0.0
"
,
"
eslint-plugin-babel
"
:
"
^4.0.0
"
,
...
@@ -57,7 +58,7 @@
...
@@ -57,7 +58,7 @@
"
lint-staged
"
:
"
^4.3.0
"
,
"
lint-staged
"
:
"
^4.3.0
"
,
"
mockjs
"
:
"
^1.0.1-beta3
"
,
"
mockjs
"
:
"
^1.0.1-beta3
"
,
"
nightmare
"
:
"
^2.10.0
"
,
"
nightmare
"
:
"
^2.10.0
"
,
"
react-test-renderer
"
:
"
^1
5.6.2
"
,
"
react-test-renderer
"
:
"
^1
6.0.0
"
,
"
redbox-react
"
:
"
^1.3.2
"
,
"
redbox-react
"
:
"
^1.3.2
"
,
"
roadhog
"
:
"
^1.2.1
"
,
"
roadhog
"
:
"
^1.2.1
"
,
"
roadhog-api-doc
"
:
"
^0.1.8
"
,
"
roadhog-api-doc
"
:
"
^0.1.8
"
,
...
...
src/index.js
View file @
36d3f395
import
dva
from
'
dva
'
;
import
dva
from
'
dva
'
;
import
'
moment/locale/zh-cn
'
;
import
'
moment/locale/zh-cn
'
;
import
models
from
'
./models
'
;
import
models
from
'
./models
'
;
import
'
./polyfill
'
;
import
'
./g2
'
;
import
'
./g2
'
;
// import { browserHistory } from 'dva/router';
// import { browserHistory } from 'dva/router';
import
'
./index.less
'
;
import
'
./index.less
'
;
...
...
src/polyfill.js
0 → 100644
View file @
36d3f395
import
'
core-js/es6/map
'
;
import
'
core-js/es6/set
'
;
global
.
requestAnimationFrame
=
global
.
requestAnimationFrame
||
function
requestAnimationFrame
(
callback
)
{
setTimeout
(
callback
,
0
);
};
src/routes/Forms/AdvancedForm.js
View file @
36d3f395
import
React
from
'
react
'
;
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
Card
,
Button
,
Form
,
Icon
,
Col
,
Row
,
DatePicker
,
TimePicker
,
Input
,
Select
,
Popover
}
from
'
antd
'
;
import
{
Card
,
Button
,
Form
,
Icon
,
Col
,
Row
,
DatePicker
,
TimePicker
,
Input
,
Select
,
Popover
}
from
'
antd
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
...
@@ -41,7 +41,9 @@ const tableData = [{
...
@@ -41,7 +41,9 @@ const tableData = [{
department
:
'
Sidney No. 1 Lake Park
'
,
department
:
'
Sidney No. 1 Lake Park
'
,
}];
}];
function
AdvancedForm
({
form
,
dispatch
,
submitting
})
{
class
AdvancedForm
extends
PureComponent
{
render
()
{
const
{
form
,
dispatch
,
submitting
}
=
this
.
props
;
const
{
getFieldDecorator
,
validateFieldsAndScroll
,
getFieldsError
}
=
form
;
const
{
getFieldDecorator
,
validateFieldsAndScroll
,
getFieldsError
}
=
form
;
const
validate
=
()
=>
{
const
validate
=
()
=>
{
validateFieldsAndScroll
((
error
,
values
)
=>
{
validateFieldsAndScroll
((
error
,
values
)
=>
{
...
@@ -263,6 +265,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -263,6 +265,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
<
/FooterToolbar
>
<
/FooterToolbar
>
<
/PageHeaderLayout
>
<
/PageHeaderLayout
>
);
);
}
}
}
export
default
connect
(
state
=>
({
export
default
connect
(
state
=>
({
...
...
tests/setupTests.js
View file @
36d3f395
/* eslint-disable import/first */
import
'
../src/polyfill
'
;
import
{
jsdom
}
from
'
jsdom
'
;
import
{
jsdom
}
from
'
jsdom
'
;
import
Enzyme
from
'
enzyme
'
;
import
Enzyme
from
'
enzyme
'
;
import
Adapter
from
'
enzyme-adapter-react-1
5
'
;
import
Adapter
from
'
enzyme-adapter-react-1
6
'
;
Enzyme
.
configure
({
adapter
:
new
Adapter
()
});
Enzyme
.
configure
({
adapter
:
new
Adapter
()
});
...
@@ -9,7 +11,3 @@ const documentHTML = '<!doctype html><html><body><div id="root"></div></body></h
...
@@ -9,7 +11,3 @@ const documentHTML = '<!doctype html><html><body><div id="root"></div></body></h
global
.
document
=
jsdom
(
documentHTML
);
global
.
document
=
jsdom
(
documentHTML
);
global
.
window
=
document
.
defaultView
;
global
.
window
=
document
.
defaultView
;
global
.
navigator
=
global
.
window
.
navigator
;
global
.
navigator
=
global
.
window
.
navigator
;
global
.
requestAnimationFrame
=
global
.
requestAnimationFrame
||
function
requestAnimationFrame
(
cb
)
{
return
setTimeout
(
cb
,
0
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment