@panneau/core 0.4.28 → 0.4.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/panneau.css +7 -7
- package/dist/panneau.js +1 -1
- package/es/components/Layout.js +1 -1
- package/es/components/pages/ResourceCreate.js +1 -1
- package/es/components/pages/ResourceForm.js +2 -2
- package/es/components/pages/ResourceIndex.js +9 -4
- package/es/reducers/index.js +5 -2
- package/lib/components/Layout.js +3 -3
- package/lib/components/pages/ResourceCreate.js +2 -2
- package/lib/components/pages/ResourceForm.js +3 -3
- package/lib/components/pages/ResourceIndex.js +10 -5
- package/lib/reducers/index.js +7 -2
- package/package.json +5 -5
- package/src/components/Layout.jsx +1 -1
- package/src/components/pages/ResourceCreate.jsx +1 -1
- package/src/components/pages/ResourceForm.jsx +2 -2
- package/src/components/pages/ResourceIndex.jsx +13 -5
- package/src/reducers/index.js +5 -2
- package/src/styles/pages/resource-index.scss +10 -1
package/es/components/Layout.js
CHANGED
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutPropert
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import get from 'lodash/get';
|
|
5
5
|
import { connect } from 'react-redux';
|
|
6
|
-
import { push } from 'react-router
|
|
6
|
+
import { push } from 'connected-react-router';
|
|
7
7
|
import { withUrlGenerator } from '@folklore/react-app';
|
|
8
8
|
|
|
9
9
|
import * as PanneauPropTypes from '../lib/PropTypes';
|
|
@@ -7,7 +7,7 @@ import _inherits from 'babel-runtime/helpers/inherits';
|
|
|
7
7
|
import React, { Component } from 'react';
|
|
8
8
|
import { defineMessages } from 'react-intl';
|
|
9
9
|
import { withRouter } from 'react-router';
|
|
10
|
-
import { push } from 'react-router
|
|
10
|
+
import { push } from 'connected-react-router';
|
|
11
11
|
import { connect } from 'react-redux';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
13
|
import get from 'lodash/get';
|
|
@@ -12,7 +12,7 @@ import { connect } from 'react-redux';
|
|
|
12
12
|
import get from 'lodash/get';
|
|
13
13
|
import isObject from 'lodash/isObject';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
|
-
import { push } from 'react-router
|
|
15
|
+
import { push } from 'connected-react-router';
|
|
16
16
|
import { withUrlGenerator } from '@folklore/react-app';
|
|
17
17
|
import { defineMessages, FormattedMessage } from 'react-intl';
|
|
18
18
|
import { PulseLoader } from 'react-spinners';
|
|
@@ -60,7 +60,7 @@ var propTypes = {
|
|
|
60
60
|
}).isRequired,
|
|
61
61
|
location: PropTypes.shape({
|
|
62
62
|
search: PropTypes.string,
|
|
63
|
-
state: PropTypes.object
|
|
63
|
+
state: PropTypes.object // eslint-disable-line
|
|
64
64
|
}).isRequired,
|
|
65
65
|
title: PanneauPropTypes.message,
|
|
66
66
|
action: PropTypes.string,
|
|
@@ -10,7 +10,7 @@ import React, { Component } from 'react';
|
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import { withRouter } from 'react-router';
|
|
12
12
|
import { Link } from 'react-router-dom';
|
|
13
|
-
import { push } from 'react-router
|
|
13
|
+
import { push } from 'connected-react-router';
|
|
14
14
|
import { connect } from 'react-redux';
|
|
15
15
|
import get from 'lodash/get';
|
|
16
16
|
import isString from 'lodash/isString';
|
|
@@ -33,6 +33,7 @@ var styles = {
|
|
|
33
33
|
'listContainer': 'panneau-core-resource-index-listContainer',
|
|
34
34
|
'list': 'panneau-core-resource-index-list',
|
|
35
35
|
'loading': 'panneau-core-resource-index-loading',
|
|
36
|
+
'inner': 'panneau-core-resource-index-inner',
|
|
36
37
|
'middle': 'panneau-core-resource-index-middle',
|
|
37
38
|
'alone': 'panneau-core-resource-index-alone'
|
|
38
39
|
};
|
|
@@ -480,8 +481,12 @@ var ResourceIndex = function (_Component) {
|
|
|
480
481
|
},
|
|
481
482
|
React.createElement(
|
|
482
483
|
'div',
|
|
483
|
-
{ className: styles.
|
|
484
|
-
React.createElement(
|
|
484
|
+
{ className: styles.inner },
|
|
485
|
+
React.createElement(
|
|
486
|
+
'div',
|
|
487
|
+
{ className: styles.middle },
|
|
488
|
+
React.createElement(PulseLoader, { loading: true })
|
|
489
|
+
)
|
|
485
490
|
)
|
|
486
491
|
);
|
|
487
492
|
}
|
|
@@ -517,7 +522,7 @@ var ResourceIndex = function (_Component) {
|
|
|
517
522
|
),
|
|
518
523
|
isLoading ? this.renderLoading() : null
|
|
519
524
|
),
|
|
520
|
-
pagination !== null ? this.renderPagination() : null
|
|
525
|
+
pagination !== null && pagination.last_page > 1 ? this.renderPagination() : null
|
|
521
526
|
)
|
|
522
527
|
)
|
|
523
528
|
)
|
package/es/reducers/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { connectRouter } from 'connected-react-router';
|
|
2
|
+
import { createBrowserHistory } from 'history';
|
|
2
3
|
import layoutReducer from './LayoutReducer';
|
|
3
4
|
import panneauReducer from './PanneauReducer';
|
|
4
5
|
|
|
6
|
+
export var history = createBrowserHistory();
|
|
7
|
+
|
|
5
8
|
export default {
|
|
6
|
-
|
|
9
|
+
router: connectRouter(history),
|
|
7
10
|
layout: layoutReducer,
|
|
8
11
|
panneau: panneauReducer
|
|
9
12
|
};
|
package/lib/components/Layout.js
CHANGED
|
@@ -22,7 +22,7 @@ var _get2 = _interopRequireDefault(_get);
|
|
|
22
22
|
|
|
23
23
|
var _reactRedux = require('react-redux');
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _connectedReactRouter = require('connected-react-router');
|
|
26
26
|
|
|
27
27
|
var _reactApp = require('@folklore/react-app');
|
|
28
28
|
|
|
@@ -72,10 +72,10 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, _ref3) {
|
|
|
72
72
|
var urlGenerator = _ref3.urlGenerator;
|
|
73
73
|
return {
|
|
74
74
|
gotoHome: function gotoHome() {
|
|
75
|
-
return dispatch((0,
|
|
75
|
+
return dispatch((0, _connectedReactRouter.push)(urlGenerator.route('home')));
|
|
76
76
|
},
|
|
77
77
|
goto: function goto(path) {
|
|
78
|
-
return dispatch((0,
|
|
78
|
+
return dispatch((0, _connectedReactRouter.push)(path));
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
};
|
|
@@ -36,7 +36,7 @@ var _reactIntl = require('react-intl');
|
|
|
36
36
|
|
|
37
37
|
var _reactRouter = require('react-router');
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var _connectedReactRouter = require('connected-react-router');
|
|
40
40
|
|
|
41
41
|
var _reactRedux = require('react-redux');
|
|
42
42
|
|
|
@@ -132,7 +132,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, _ref3) {
|
|
|
132
132
|
var urlGenerator = _ref3.urlGenerator;
|
|
133
133
|
return {
|
|
134
134
|
gotoResourceEdit: function gotoResourceEdit(resource, id) {
|
|
135
|
-
return dispatch((0,
|
|
135
|
+
return dispatch((0, _connectedReactRouter.push)(urlGenerator.route('resource.edit', {
|
|
136
136
|
resource: resource.id,
|
|
137
137
|
id: id
|
|
138
138
|
})));
|
|
@@ -56,7 +56,7 @@ var _classnames = require('classnames');
|
|
|
56
56
|
|
|
57
57
|
var _classnames2 = _interopRequireDefault(_classnames);
|
|
58
58
|
|
|
59
|
-
var
|
|
59
|
+
var _connectedReactRouter = require('connected-react-router');
|
|
60
60
|
|
|
61
61
|
var _reactApp = require('@folklore/react-app');
|
|
62
62
|
|
|
@@ -121,7 +121,7 @@ var propTypes = {
|
|
|
121
121
|
}).isRequired,
|
|
122
122
|
location: _propTypes2.default.shape({
|
|
123
123
|
search: _propTypes2.default.string,
|
|
124
|
-
state: _propTypes2.default.object
|
|
124
|
+
state: _propTypes2.default.object // eslint-disable-line
|
|
125
125
|
}).isRequired,
|
|
126
126
|
title: PanneauPropTypes.message,
|
|
127
127
|
action: _propTypes2.default.string,
|
|
@@ -565,7 +565,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, _ref3) {
|
|
|
565
565
|
var urlGenerator = _ref3.urlGenerator;
|
|
566
566
|
return {
|
|
567
567
|
gotoResourceIndex: function gotoResourceIndex(resource) {
|
|
568
|
-
return dispatch((0,
|
|
568
|
+
return dispatch((0, _connectedReactRouter.push)(typeof resource.routes !== 'undefined' ? urlGenerator.route('resource.' + resource.id + '.index') : urlGenerator.route('resource.index', {
|
|
569
569
|
resource: resource.id
|
|
570
570
|
})));
|
|
571
571
|
}
|
|
@@ -44,7 +44,7 @@ var _reactRouter = require('react-router');
|
|
|
44
44
|
|
|
45
45
|
var _reactRouterDom = require('react-router-dom');
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var _connectedReactRouter = require('connected-react-router');
|
|
48
48
|
|
|
49
49
|
var _reactRedux = require('react-redux');
|
|
50
50
|
|
|
@@ -96,6 +96,7 @@ var styles = {
|
|
|
96
96
|
'listContainer': 'panneau-core-resource-index-listContainer',
|
|
97
97
|
'list': 'panneau-core-resource-index-list',
|
|
98
98
|
'loading': 'panneau-core-resource-index-loading',
|
|
99
|
+
'inner': 'panneau-core-resource-index-inner',
|
|
99
100
|
'middle': 'panneau-core-resource-index-middle',
|
|
100
101
|
'alone': 'panneau-core-resource-index-alone'
|
|
101
102
|
};
|
|
@@ -545,8 +546,12 @@ var ResourceIndex = function (_Component) {
|
|
|
545
546
|
},
|
|
546
547
|
_react2.default.createElement(
|
|
547
548
|
'div',
|
|
548
|
-
{ className: styles.
|
|
549
|
-
_react2.default.createElement(
|
|
549
|
+
{ className: styles.inner },
|
|
550
|
+
_react2.default.createElement(
|
|
551
|
+
'div',
|
|
552
|
+
{ className: styles.middle },
|
|
553
|
+
_react2.default.createElement(_reactSpinners.PulseLoader, { loading: true })
|
|
554
|
+
)
|
|
550
555
|
)
|
|
551
556
|
);
|
|
552
557
|
}
|
|
@@ -582,7 +587,7 @@ var ResourceIndex = function (_Component) {
|
|
|
582
587
|
),
|
|
583
588
|
isLoading ? this.renderLoading() : null
|
|
584
589
|
),
|
|
585
|
-
pagination !== null ? this.renderPagination() : null
|
|
590
|
+
pagination !== null && pagination.last_page > 1 ? this.renderPagination() : null
|
|
586
591
|
)
|
|
587
592
|
)
|
|
588
593
|
)
|
|
@@ -624,7 +629,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, _ref5) {
|
|
|
624
629
|
return {
|
|
625
630
|
getResourceActionUrl: getResourceActionUrl,
|
|
626
631
|
gotoResourceAction: function gotoResourceAction(resource, action, id) {
|
|
627
|
-
return dispatch((0,
|
|
632
|
+
return dispatch((0, _connectedReactRouter.push)(getResourceActionUrl(resource, action, id)));
|
|
628
633
|
}
|
|
629
634
|
};
|
|
630
635
|
};
|
package/lib/reducers/index.js
CHANGED
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.history = undefined;
|
|
6
7
|
|
|
7
|
-
var
|
|
8
|
+
var _connectedReactRouter = require('connected-react-router');
|
|
9
|
+
|
|
10
|
+
var _history = require('history');
|
|
8
11
|
|
|
9
12
|
var _LayoutReducer = require('./LayoutReducer');
|
|
10
13
|
|
|
@@ -16,8 +19,10 @@ var _PanneauReducer2 = _interopRequireDefault(_PanneauReducer);
|
|
|
16
19
|
|
|
17
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
21
|
|
|
22
|
+
var history = exports.history = (0, _history.createBrowserHistory)();
|
|
23
|
+
|
|
19
24
|
exports.default = {
|
|
20
|
-
|
|
25
|
+
router: (0, _connectedReactRouter.connectRouter)(history),
|
|
21
26
|
layout: _LayoutReducer2.default,
|
|
22
27
|
panneau: _PanneauReducer2.default
|
|
23
28
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.42",
|
|
4
4
|
"description": "Core utilities of the Panneau package",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"babel-runtime": "^6.26.0",
|
|
60
60
|
"bootstrap": "^4.1.1",
|
|
61
61
|
"classnames": "^2.2.5",
|
|
62
|
+
"connected-react-router": "^6.9.1",
|
|
62
63
|
"history": "^4.7.2",
|
|
63
64
|
"hoist-non-react-statics": "^2.3.1",
|
|
64
65
|
"invariant": "^2.2.2",
|
|
@@ -71,12 +72,10 @@
|
|
|
71
72
|
"prop-types": "^15.6.0",
|
|
72
73
|
"query-string": "^6.1.0",
|
|
73
74
|
"react-intl": "^2.4.0",
|
|
74
|
-
"react-redux": "^
|
|
75
|
+
"react-redux": "^6.0.0",
|
|
75
76
|
"react-router": "^4.2.0",
|
|
76
77
|
"react-router-dom": "^4.2.2",
|
|
77
|
-
"react-router-redux": "^5.0.0-alpha.9",
|
|
78
78
|
"react-spinners": "^0.3.2",
|
|
79
|
-
"redux": "^3.7.2",
|
|
80
79
|
"redux-promise": "^0.5.3",
|
|
81
80
|
"redux-thunk": "^2.2.0",
|
|
82
81
|
"whatwg-fetch": "^2.0.3",
|
|
@@ -91,5 +90,6 @@
|
|
|
91
90
|
"peerDependencies": {
|
|
92
91
|
"react": ">=15.0.0 || ^16.0.0",
|
|
93
92
|
"react-dom": ">=15.0.0 || ^16.0.0"
|
|
94
|
-
}
|
|
93
|
+
},
|
|
94
|
+
"gitHead": "c99ff782fa7d71836b78dffef25517988b71efe0"
|
|
95
95
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import get from 'lodash/get';
|
|
3
3
|
import { connect } from 'react-redux';
|
|
4
|
-
import { push } from 'react-router
|
|
4
|
+
import { push } from 'connected-react-router';
|
|
5
5
|
import { withUrlGenerator } from '@folklore/react-app';
|
|
6
6
|
|
|
7
7
|
import * as PanneauPropTypes from '../lib/PropTypes';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { defineMessages } from 'react-intl';
|
|
3
3
|
import { withRouter } from 'react-router';
|
|
4
|
-
import { push } from 'react-router
|
|
4
|
+
import { push } from 'connected-react-router';
|
|
5
5
|
import { connect } from 'react-redux';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import get from 'lodash/get';
|
|
@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
|
|
|
5
5
|
import get from 'lodash/get';
|
|
6
6
|
import isObject from 'lodash/isObject';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import { push } from 'react-router
|
|
8
|
+
import { push } from 'connected-react-router';
|
|
9
9
|
import { withUrlGenerator } from '@folklore/react-app';
|
|
10
10
|
import { defineMessages, FormattedMessage } from 'react-intl';
|
|
11
11
|
import { PulseLoader } from 'react-spinners';
|
|
@@ -52,7 +52,7 @@ const propTypes = {
|
|
|
52
52
|
}).isRequired,
|
|
53
53
|
location: PropTypes.shape({
|
|
54
54
|
search: PropTypes.string,
|
|
55
|
-
state: PropTypes.object,
|
|
55
|
+
state: PropTypes.object, // eslint-disable-line
|
|
56
56
|
}).isRequired,
|
|
57
57
|
title: PanneauPropTypes.message,
|
|
58
58
|
action: PropTypes.string,
|
|
@@ -3,7 +3,7 @@ import React, { Component } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { withRouter } from 'react-router';
|
|
5
5
|
import { Link } from 'react-router-dom';
|
|
6
|
-
import { push } from 'react-router
|
|
6
|
+
import { push } from 'connected-react-router';
|
|
7
7
|
import { connect } from 'react-redux';
|
|
8
8
|
import get from 'lodash/get';
|
|
9
9
|
import isString from 'lodash/isString';
|
|
@@ -406,8 +406,10 @@ class ResourceIndex extends Component {
|
|
|
406
406
|
[styles.alone]: items === null,
|
|
407
407
|
})}
|
|
408
408
|
>
|
|
409
|
-
<div className={styles.
|
|
410
|
-
<
|
|
409
|
+
<div className={styles.inner}>
|
|
410
|
+
<div className={styles.middle}>
|
|
411
|
+
<PulseLoader loading />
|
|
412
|
+
</div>
|
|
411
413
|
</div>
|
|
412
414
|
</div>
|
|
413
415
|
);
|
|
@@ -430,7 +432,9 @@ class ResourceIndex extends Component {
|
|
|
430
432
|
</div>
|
|
431
433
|
{isLoading ? this.renderLoading() : null}
|
|
432
434
|
</div>
|
|
433
|
-
{pagination !== null
|
|
435
|
+
{pagination !== null && pagination.last_page > 1
|
|
436
|
+
? this.renderPagination()
|
|
437
|
+
: null}
|
|
434
438
|
</div>
|
|
435
439
|
</div>
|
|
436
440
|
</div>
|
|
@@ -483,7 +487,11 @@ const mergeProps = (
|
|
|
483
487
|
gotoResourceAction: (action, id) => gotoResourceAction(stateProps.resource, action, id),
|
|
484
488
|
});
|
|
485
489
|
|
|
486
|
-
const WithStateComponent = connect(
|
|
490
|
+
const WithStateComponent = connect(
|
|
491
|
+
mapStateToProps,
|
|
492
|
+
mapDispatchToProps,
|
|
493
|
+
mergeProps,
|
|
494
|
+
)(ResourceIndex);
|
|
487
495
|
const WithRouterContainer = withRouter(WithStateComponent);
|
|
488
496
|
const WithListsCollectionContainer = withListsCollection()(WithRouterContainer);
|
|
489
497
|
const WithUrlGeneratorContainer = withUrlGenerator()(WithListsCollectionContainer);
|
package/src/reducers/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { connectRouter } from 'connected-react-router';
|
|
2
|
+
import { createBrowserHistory } from 'history';
|
|
2
3
|
import layoutReducer from './LayoutReducer';
|
|
3
4
|
import panneauReducer from './PanneauReducer';
|
|
4
5
|
|
|
6
|
+
export const history = createBrowserHistory();
|
|
7
|
+
|
|
5
8
|
export default {
|
|
6
|
-
|
|
9
|
+
router: connectRouter(history),
|
|
7
10
|
layout: layoutReducer,
|
|
8
11
|
panneau: panneauReducer,
|
|
9
12
|
};
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.loading {
|
|
30
|
-
display:
|
|
30
|
+
display: block;
|
|
31
31
|
position: absolute;
|
|
32
32
|
top: 0;
|
|
33
33
|
left: 0;
|
|
@@ -36,6 +36,15 @@
|
|
|
36
36
|
background: rgba(255, 255, 255, .5);
|
|
37
37
|
z-index: 2;
|
|
38
38
|
|
|
39
|
+
.inner {
|
|
40
|
+
display: table;
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
.middle {
|
|
40
49
|
display: table-cell;
|
|
41
50
|
text-align: center;
|