@blaze-cms/plugin-data-ui 0.146.0-alpha.4 → 0.146.0-alpha.40

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 (175) hide show
  1. package/CHANGELOG.md +190 -0
  2. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  3. package/lib/components/EntityDataListing/index.js.map +1 -1
  4. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  5. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  6. package/lib/components/EntityManager/Entity/Entity.js +12 -12
  7. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  8. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -1
  9. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  10. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  11. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  12. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  13. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +1 -1
  14. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  15. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +1 -1
  16. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  17. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  18. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +3 -3
  19. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  20. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +10 -3
  21. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  22. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  23. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +1 -1
  24. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  25. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  26. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  27. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  28. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  29. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  30. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  31. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +5 -5
  32. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  33. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  34. package/lib/components/EntityManager/EntityManager.js +6 -6
  35. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  36. package/lib/components/EntityManager/index.js.map +1 -1
  37. package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  38. package/lib/components/EntityManager/utils/data-mappers.js +8 -8
  39. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  40. package/lib/components/EntityManager/utils/entity.js +7 -7
  41. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  42. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  43. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  44. package/lib/components/EntityManager/utils/query.js.map +1 -1
  45. package/lib/components/InfoBoxes/InfoBoxTooltip.js +40 -0
  46. package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
  47. package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
  48. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +3 -3
  49. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  50. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +1 -1
  51. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  52. package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
  53. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  54. package/lib/components/InfoBoxes/index.js.map +1 -1
  55. package/lib/components/InfoBoxes/presentational/InfoBox.js +6 -3
  56. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  57. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  58. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  59. package/lib/components/ListingTable/ListingTable.js +13 -12
  60. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  61. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  62. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  63. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  64. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  65. package/lib/components/ListingTable/index.js.map +1 -1
  66. package/lib/components/ListingTable/mappers/populate-rows.js +25 -13
  67. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  68. package/lib/components/ListingTable/service/index.js +6 -6
  69. package/lib/components/ListingTable/service/index.js.map +1 -1
  70. package/lib/components/Tabs/index.js +2 -2
  71. package/lib/components/Tabs/index.js.map +1 -1
  72. package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
  73. package/lib/constants.js.map +1 -1
  74. package/lib/icons/ContentIcon.js.map +1 -1
  75. package/lib/icons/SettingsIcon.js.map +1 -1
  76. package/lib/icons/TaxonomyIcon.js.map +1 -1
  77. package/lib/icons/UsersIcon.js.map +1 -1
  78. package/lib/icons/index.js.map +1 -1
  79. package/lib/index.js +6 -6
  80. package/lib/index.js.map +1 -1
  81. package/lib/utils/add-content-menu-items.js +1 -1
  82. package/lib/utils/add-content-menu-items.js.map +1 -1
  83. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  84. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  85. package/lib/utils/build-listing-query.js.map +1 -1
  86. package/lib/utils/build-update-data-query.js.map +1 -1
  87. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  88. package/lib/utils/get-default-query-params.js.map +1 -1
  89. package/lib/utils/hoc/withContext.js.map +1 -1
  90. package/lib/utils/hooks/useToggle.js.map +1 -1
  91. package/lib/utils/index.js.map +1 -1
  92. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
  93. package/lib-es/components/EntityDataListing/index.js.map +1 -1
  94. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  95. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  96. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  97. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  98. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  99. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  100. package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  101. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  102. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
  103. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  104. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  105. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  106. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +8 -2
  107. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  108. package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  109. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  110. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  111. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  112. package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  113. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  114. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  115. package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  116. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  117. package/lib-es/components/EntityManager/Entity/index.js.map +1 -1
  118. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  119. package/lib-es/components/EntityManager/index.js.map +1 -1
  120. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  121. package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
  122. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  123. package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  124. package/lib-es/components/EntityManager/utils/is-form-empty.js.map +1 -1
  125. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  126. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js +36 -0
  127. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
  128. package/lib-es/components/InfoBoxes/InfoBoxes.js.map +1 -1
  129. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  130. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
  131. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  132. package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
  133. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  134. package/lib-es/components/InfoBoxes/index.js.map +1 -1
  135. package/lib-es/components/InfoBoxes/presentational/InfoBox.js +4 -1
  136. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  137. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  138. package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  139. package/lib-es/components/ListingTable/ListingTable.js +2 -1
  140. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  141. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  142. package/lib-es/components/ListingTable/ListingTableContent/index.js.map +1 -1
  143. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
  144. package/lib-es/components/ListingTable/TableActions/index.js.map +1 -1
  145. package/lib-es/components/ListingTable/index.js.map +1 -1
  146. package/lib-es/components/ListingTable/mappers/populate-rows.js +16 -4
  147. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  148. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  149. package/lib-es/components/Tabs/index.js.map +1 -1
  150. package/lib-es/components/hooks/useCallbackDebounce.js.map +1 -1
  151. package/lib-es/constants.js.map +1 -1
  152. package/lib-es/icons/ContentIcon.js.map +1 -1
  153. package/lib-es/icons/SettingsIcon.js.map +1 -1
  154. package/lib-es/icons/TaxonomyIcon.js.map +1 -1
  155. package/lib-es/icons/UsersIcon.js.map +1 -1
  156. package/lib-es/icons/index.js.map +1 -1
  157. package/lib-es/index.js.map +1 -1
  158. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  159. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  160. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  161. package/lib-es/utils/build-listing-query.js.map +1 -1
  162. package/lib-es/utils/build-update-data-query.js.map +1 -1
  163. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  164. package/lib-es/utils/get-default-query-params.js.map +1 -1
  165. package/lib-es/utils/hoc/withContext.js.map +1 -1
  166. package/lib-es/utils/hooks/useToggle.js.map +1 -1
  167. package/lib-es/utils/index.js.map +1 -1
  168. package/package.json +8 -7
  169. package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
  170. package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +5 -3
  171. package/src/components/InfoBoxes/InfoBoxTooltip.js +32 -0
  172. package/src/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
  173. package/src/components/InfoBoxes/presentational/InfoBox.js +4 -2
  174. package/src/components/ListingTable/ListingTable.js +2 -1
  175. package/src/components/ListingTable/mappers/populate-rows.js +33 -5
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import InfoBoxValue from '../../../../InfoBoxes/presentational/InfoBoxValue';
4
4
  import InfoBoxLabel from '../../../../InfoBoxes/presentational/InfoBoxLabel';
5
+ import InfoBoxTooltip from '../../../../InfoBoxes/InfoBoxTooltip';
5
6
 
6
7
  const CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {
7
8
  if (!items) return null;
@@ -12,10 +13,11 @@ const CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {
12
13
  if (!info.label || !info.value) return null;
13
14
 
14
15
  return (
15
- <p>
16
+ <p key={`${customSidebarInfoKey}-${info.label.toLowerCase()}`}>
16
17
  <InfoBoxLabel item={info} />
17
18
  <span>
18
19
  <InfoBoxValue item={info} />
20
+ <InfoBoxTooltip info={info} position="left" />
19
21
  </span>
20
22
  </p>
21
23
  );
@@ -30,9 +32,9 @@ const CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {
30
32
  );
31
33
  };
32
34
 
33
- export default CustomSidebarInfo;
34
-
35
35
  CustomSidebarInfo.propTypes = {
36
36
  customSidebarInfoKey: PropTypes.string.isRequired,
37
37
  items: PropTypes.array.isRequired
38
38
  };
39
+
40
+ export default CustomSidebarInfo;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import Tooltip from '@blaze-react/tooltip';
4
+
5
+ const InfoBoxTooltip = ({ info, ...tooltipProps }) => {
6
+ const { tooltipContent, tooltipIcon } = info;
7
+ if (!tooltipContent) return null;
8
+
9
+ const renderTooltipIcon = icon => {
10
+ if (!icon) return null;
11
+ return <i className={`${icon} info-box--icon`} />;
12
+ };
13
+
14
+ return (
15
+ <Tooltip
16
+ tooltipContent={tooltipContent}
17
+ trigger="click"
18
+ className="info-box--tooltip"
19
+ {...tooltipProps}>
20
+ {renderTooltipIcon(tooltipIcon)}
21
+ </Tooltip>
22
+ );
23
+ };
24
+
25
+ InfoBoxTooltip.propTypes = {
26
+ info: PropTypes.shape({
27
+ tooltipContent: PropTypes.node,
28
+ tooltipIcon: PropTypes.string
29
+ }).isRequired
30
+ };
31
+
32
+ export default InfoBoxTooltip;
@@ -17,6 +17,8 @@ export default function buildDynamicQuery({ id, schema, properties }) {
17
17
  value
18
18
  showLabel
19
19
  url
20
+ tooltipIcon
21
+ tooltipContent
20
22
  }`
21
23
  );
22
24
 
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import InfoBoxValue from './InfoBoxValue';
4
4
  import InfoBoxLabel from './InfoBoxLabel';
5
+ import InfoBoxTooltip from '../InfoBoxTooltip';
5
6
 
6
7
  const InfoBox = ({ items, infoBoxKey }) => {
7
8
  if (!items) return null;
@@ -18,6 +19,7 @@ const InfoBox = ({ items, infoBoxKey }) => {
18
19
  </div>
19
20
  <div className="info-box--value">
20
21
  <InfoBoxValue item={info} />
22
+ <InfoBoxTooltip info={info} />
21
23
  </div>
22
24
  </div>
23
25
  );
@@ -32,9 +34,9 @@ const InfoBox = ({ items, infoBoxKey }) => {
32
34
  );
33
35
  };
34
36
 
35
- export default InfoBox;
36
-
37
37
  InfoBox.propTypes = {
38
38
  infoBoxKey: PropTypes.string.isRequired,
39
39
  items: PropTypes.array.isRequired
40
40
  };
41
+
42
+ export default InfoBox;
@@ -138,7 +138,8 @@ const ListingTable = ({ match, entitySchema, history }) => {
138
138
  url: match.url,
139
139
  toggleModal,
140
140
  firstColumn,
141
- isEnquiry
141
+ isEnquiry,
142
+ entitySchema
142
143
  })
143
144
  });
144
145
  history.push('?page=1');
@@ -1,19 +1,39 @@
1
1
  import React from 'react';
2
2
  import { Link } from 'react-router-dom';
3
+ import { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';
3
4
  import TableActions from '../TableActions';
4
5
  import { ACTIONS } from '../../../constants';
5
6
  import InfoBoxValue from '../../InfoBoxes/presentational/InfoBoxValue';
6
7
  import InfoBoxLabel from '../../InfoBoxes/presentational/InfoBoxLabel';
8
+ import InfoBoxTooltip from '../../InfoBoxes/InfoBoxTooltip';
7
9
 
8
- const formatRows = ({ rows, url, toggleModal, label, firstColumn = 'name', isEnquiry }) =>
10
+ const formatRows = ({
11
+ rows,
12
+ url,
13
+ toggleModal,
14
+ label,
15
+ firstColumn = 'name',
16
+ isEnquiry,
17
+ entitySchema
18
+ }) =>
9
19
  rows.map(data => {
10
20
  const editUrl = `${url}/update/${data.id}`;
21
+
11
22
  const rowProps = {
12
23
  ...data,
13
24
  [firstColumn]: (
14
- <Link to={editUrl} role="button">
15
- {data[firstColumn]}
16
- </Link>
25
+ <>
26
+ <Link to={editUrl} role="button">
27
+ {data[firstColumn]}
28
+ </Link>
29
+ <RenderHook
30
+ hookKey="entity:listing:table:row:column:after"
31
+ schema={entitySchema}
32
+ data={data}
33
+ value={data[firstColumn]}
34
+ column={firstColumn}
35
+ />
36
+ </>
17
37
  )
18
38
  };
19
39
  if (!isEnquiry)
@@ -47,6 +67,7 @@ const buildArrayRowContent = rowData => (
47
67
  </span>
48
68
  <span className="table-row-list__group__item__value">
49
69
  <InfoBoxValue item={item} />
70
+ <InfoBoxTooltip info={item} />
50
71
  </span>
51
72
  </div>
52
73
  ))}
@@ -117,7 +138,14 @@ const populateRows = ({ toggleModal, url, entitySchema, rows }) => {
117
138
  columns,
118
139
  labels,
119
140
  orderBy: [...formProperties],
120
- rows: formatRows({ firstColumn, rows: parsedRowData, url, toggleModal, isEnquiry }),
141
+ rows: formatRows({
142
+ firstColumn,
143
+ rows: parsedRowData,
144
+ url,
145
+ toggleModal,
146
+ isEnquiry,
147
+ entitySchema
148
+ }),
121
149
  isEnquiry
122
150
  };
123
151
  };