@panneau/app 3.0.290 → 3.0.291

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.
Files changed (2) hide show
  1. package/es/index.js +15 -3
  2. package/package.json +3 -3
package/es/index.js CHANGED
@@ -636,7 +636,7 @@ var ResourceItemsList = function ResourceItemsList(_ref) {
636
636
  };
637
637
  ResourceItemsList.propTypes = propTypes$b;
638
638
 
639
- var _excluded$2 = ["id", "component"];
639
+ var _excluded$2 = ["id", "component", "withQuery", "href"];
640
640
  var propTypes$a = {
641
641
  resource: PropTypes$1.resource.isRequired,
642
642
  defaultActions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])) // eslint-disable-line react/forbid-prop-types
@@ -726,11 +726,23 @@ var ResourceIndexPage = function ResourceIndexPage(_ref) {
726
726
  var id = _ref5.id,
727
727
  _ref5$component = _ref5.component,
728
728
  component = _ref5$component === void 0 ? Button : _ref5$component,
729
+ _ref5$withQuery = _ref5.withQuery,
730
+ withQuery = _ref5$withQuery === void 0 ? false : _ref5$withQuery,
731
+ _ref5$href = _ref5.href,
732
+ href = _ref5$href === void 0 ? null : _ref5$href,
729
733
  actionsProps = _objectWithoutProperties(_ref5, _excluded$2);
730
734
  var ActionComponent = isString(component) ? componentsManager.getComponent(component) : component;
735
+ var isButton = ActionComponent === Button;
736
+ var finalHref = href;
737
+ if (isButton && withQuery && href !== null) {
738
+ finalHref = "".concat(finalHref).concat(finalHref.indexOf('?') !== -1 ? '&' : '?').concat(queryString.stringify(query, {
739
+ arrayFormat: 'bracket'
740
+ }));
741
+ }
731
742
  return ActionComponent !== null ? /*#__PURE__*/React.createElement(ActionComponent, Object.assign({
732
- key: "action-".concat(id)
733
- }, actionsProps, ActionComponent !== Button ? {
743
+ key: "action-".concat(id),
744
+ href: finalHref
745
+ }, actionsProps, !isButton ? {
734
746
  resource: resource,
735
747
  query: query,
736
748
  onQueryChange: onQueryChange
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/app",
3
- "version": "3.0.290",
3
+ "version": "3.0.291",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -67,7 +67,7 @@
67
67
  "@fortawesome/fontawesome-svg-core": "^6.5.1",
68
68
  "@fortawesome/free-solid-svg-icons": "^6.5.1",
69
69
  "@fortawesome/react-fontawesome": "^0.2.0",
70
- "@panneau/actions": "^3.0.290",
70
+ "@panneau/actions": "^3.0.291",
71
71
  "@panneau/auth": "^3.0.290",
72
72
  "@panneau/core": "^3.0.290",
73
73
  "@panneau/data": "^3.0.290",
@@ -116,5 +116,5 @@
116
116
  "publishConfig": {
117
117
  "access": "public"
118
118
  },
119
- "gitHead": "682156ae8f9e789cca229bd2aab2c8f3228b5ffe"
119
+ "gitHead": "d3e9a429a0efa8eb39f12c6b7f4ff414f30d9cdd"
120
120
  }