@blaze-cms/plugin-data-ui 0.146.0-translations.6 → 0.147.0-rc-eagle.2

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 (273) hide show
  1. package/README.md +57 -0
  2. package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
  3. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  4. package/lib/components/EntityDataListing/index.js +2 -3
  5. package/lib/components/EntityDataListing/index.js.map +1 -1
  6. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
  7. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  8. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
  9. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  10. package/lib/components/EntityManager/Entity/Entity.js +289 -452
  11. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  12. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
  13. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  14. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +34 -50
  15. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  16. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
  17. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  18. package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
  19. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  20. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
  21. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  22. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
  23. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  24. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
  25. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  26. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +104 -150
  27. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  28. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +24 -24
  29. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  30. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
  31. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  32. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
  33. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  34. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
  35. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  36. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
  37. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  38. package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
  39. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  40. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
  41. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  42. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
  43. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  44. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
  45. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  46. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
  47. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  48. package/lib/components/EntityManager/Entity/index.js +2 -3
  49. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  50. package/lib/components/EntityManager/EntityManager.js +91 -166
  51. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  52. package/lib/components/EntityManager/index.js +2 -3
  53. package/lib/components/EntityManager/index.js.map +1 -1
  54. package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
  55. package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  56. package/lib/components/EntityManager/utils/data-mappers.js +34 -46
  57. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  58. package/lib/components/EntityManager/utils/entity.js +35 -73
  59. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  60. package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
  61. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  62. package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
  63. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  64. package/lib/components/EntityManager/utils/query.js +17 -10
  65. package/lib/components/EntityManager/utils/query.js.map +1 -1
  66. package/lib/components/InfoBoxes/InfoBoxTooltip.js +43 -0
  67. package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
  68. package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
  69. package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
  70. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
  71. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  72. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
  73. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  74. package/lib/components/InfoBoxes/hooks/useData.js +33 -30
  75. package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
  76. package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
  77. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  78. package/lib/components/InfoBoxes/index.js +2 -3
  79. package/lib/components/InfoBoxes/index.js.map +1 -1
  80. package/lib/components/InfoBoxes/presentational/InfoBox.js +28 -32
  81. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  82. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
  83. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  84. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
  85. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  86. package/lib/components/ListingTable/ListingTable.js +163 -303
  87. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  88. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +61 -40
  89. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  90. package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
  91. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  92. package/lib/components/ListingTable/SearchFilter/SearchContainer.js +215 -0
  93. package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
  94. package/lib/components/ListingTable/SearchFilter/SearchFilter.js +48 -0
  95. package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
  96. package/lib/components/ListingTable/SearchFilter/helpers.js +105 -0
  97. package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -0
  98. package/lib/components/ListingTable/SearchFilter/querys.js +13 -0
  99. package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -0
  100. package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
  101. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  102. package/lib/components/ListingTable/TableActions/index.js +2 -3
  103. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  104. package/lib/components/ListingTable/index.js +2 -3
  105. package/lib/components/ListingTable/index.js.map +1 -1
  106. package/lib/components/ListingTable/mappers/populate-rows.js +104 -120
  107. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  108. package/lib/components/ListingTable/service/index.js +66 -83
  109. package/lib/components/ListingTable/service/index.js.map +1 -1
  110. package/lib/components/Tabs/index.js +26 -42
  111. package/lib/components/Tabs/index.js.map +1 -1
  112. package/lib/components/hooks/useCallbackDebounce.js +5 -9
  113. package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
  114. package/lib/constants.js +31 -29
  115. package/lib/constants.js.map +1 -1
  116. package/lib/icons/ContentIcon.js +17 -20
  117. package/lib/icons/ContentIcon.js.map +1 -1
  118. package/lib/icons/SettingsIcon.js +12 -15
  119. package/lib/icons/SettingsIcon.js.map +1 -1
  120. package/lib/icons/TaxonomyIcon.js +15 -18
  121. package/lib/icons/TaxonomyIcon.js.map +1 -1
  122. package/lib/icons/UsersIcon.js +11 -14
  123. package/lib/icons/UsersIcon.js.map +1 -1
  124. package/lib/icons/index.js +8 -9
  125. package/lib/icons/index.js.map +1 -1
  126. package/lib/index.js +81 -121
  127. package/lib/index.js.map +1 -1
  128. package/lib/utils/add-content-menu-items.js +67 -93
  129. package/lib/utils/add-content-menu-items.js.map +1 -1
  130. package/lib/utils/build-create-entity-mutation.js +12 -9
  131. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  132. package/lib/utils/build-delete-entity-mutation.js +11 -8
  133. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  134. package/lib/utils/build-listing-query.js +20 -17
  135. package/lib/utils/build-listing-query.js.map +1 -1
  136. package/lib/utils/build-update-data-query.js +15 -9
  137. package/lib/utils/build-update-data-query.js.map +1 -1
  138. package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
  139. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  140. package/lib/utils/get-default-query-params.js +7 -6
  141. package/lib/utils/get-default-query-params.js.map +1 -1
  142. package/lib/utils/hoc/withContext.js +4 -6
  143. package/lib/utils/hoc/withContext.js.map +1 -1
  144. package/lib/utils/hooks/useToggle.js +4 -12
  145. package/lib/utils/hooks/useToggle.js.map +1 -1
  146. package/lib/utils/index.js +2 -3
  147. package/lib/utils/index.js.map +1 -1
  148. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
  149. package/lib-es/components/EntityDataListing/index.js.map +1 -1
  150. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  151. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  152. package/lib-es/components/EntityManager/Entity/Entity.js +21 -28
  153. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  154. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  155. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +6 -1
  156. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  157. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  158. package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  159. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  160. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
  161. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  162. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  163. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +26 -7
  164. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  165. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +8 -2
  166. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  167. package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  168. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  169. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  170. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  171. package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  172. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  173. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  174. package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  175. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  176. package/lib-es/components/EntityManager/Entity/index.js.map +1 -1
  177. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  178. package/lib-es/components/EntityManager/index.js.map +1 -1
  179. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  180. package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
  181. package/lib-es/components/EntityManager/utils/entity.js +6 -2
  182. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  183. package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  184. package/lib-es/components/EntityManager/utils/is-form-empty.js.map +1 -1
  185. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  186. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js +36 -0
  187. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
  188. package/lib-es/components/InfoBoxes/InfoBoxes.js.map +1 -1
  189. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  190. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
  191. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  192. package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
  193. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  194. package/lib-es/components/InfoBoxes/index.js.map +1 -1
  195. package/lib-es/components/InfoBoxes/presentational/InfoBox.js +4 -1
  196. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  197. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  198. package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  199. package/lib-es/components/ListingTable/ListingTable.js +12 -11
  200. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  201. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +34 -16
  202. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  203. package/lib-es/components/ListingTable/ListingTableContent/index.js.map +1 -1
  204. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +207 -0
  205. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
  206. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +40 -0
  207. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
  208. package/lib-es/components/ListingTable/SearchFilter/helpers.js +96 -0
  209. package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -0
  210. package/lib-es/components/ListingTable/SearchFilter/querys.js +8 -0
  211. package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -0
  212. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
  213. package/lib-es/components/ListingTable/TableActions/index.js.map +1 -1
  214. package/lib-es/components/ListingTable/index.js.map +1 -1
  215. package/lib-es/components/ListingTable/mappers/populate-rows.js +3 -0
  216. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  217. package/lib-es/components/ListingTable/service/index.js +3 -2
  218. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  219. package/lib-es/components/Tabs/index.js +6 -7
  220. package/lib-es/components/Tabs/index.js.map +1 -1
  221. package/lib-es/components/hooks/useCallbackDebounce.js.map +1 -1
  222. package/lib-es/constants.js +4 -1
  223. package/lib-es/constants.js.map +1 -1
  224. package/lib-es/icons/ContentIcon.js.map +1 -1
  225. package/lib-es/icons/SettingsIcon.js.map +1 -1
  226. package/lib-es/icons/TaxonomyIcon.js.map +1 -1
  227. package/lib-es/icons/UsersIcon.js.map +1 -1
  228. package/lib-es/icons/index.js.map +1 -1
  229. package/lib-es/index.js +11 -3
  230. package/lib-es/index.js.map +1 -1
  231. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  232. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  233. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  234. package/lib-es/utils/build-listing-query.js +4 -4
  235. package/lib-es/utils/build-listing-query.js.map +1 -1
  236. package/lib-es/utils/build-update-data-query.js.map +1 -1
  237. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  238. package/lib-es/utils/get-default-query-params.js.map +1 -1
  239. package/lib-es/utils/hoc/withContext.js +1 -1
  240. package/lib-es/utils/hoc/withContext.js.map +1 -1
  241. package/lib-es/utils/hooks/useToggle.js.map +1 -1
  242. package/lib-es/utils/index.js.map +1 -1
  243. package/package.json +28 -22
  244. package/src/components/EntityManager/Entity/Entity.js +72 -80
  245. package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
  246. package/src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +8 -1
  247. package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
  248. package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
  249. package/src/components/EntityManager/Entity/SideBarRelations/index.js +82 -59
  250. package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +5 -3
  251. package/src/components/EntityManager/EntityManager.js +52 -45
  252. package/src/components/EntityManager/utils/entity.js +13 -2
  253. package/src/components/InfoBoxes/InfoBoxTooltip.js +32 -0
  254. package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
  255. package/src/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
  256. package/src/components/InfoBoxes/hooks/useData.js +6 -1
  257. package/src/components/InfoBoxes/presentational/InfoBox.js +4 -2
  258. package/src/components/ListingTable/ListingTable.js +23 -31
  259. package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +43 -27
  260. package/src/components/ListingTable/SearchFilter/SearchContainer.js +228 -0
  261. package/src/components/ListingTable/SearchFilter/SearchFilter.js +38 -0
  262. package/src/components/ListingTable/SearchFilter/helpers.js +99 -0
  263. package/src/components/ListingTable/SearchFilter/querys.js +9 -0
  264. package/src/components/ListingTable/mappers/populate-rows.js +3 -0
  265. package/src/components/ListingTable/service/index.js +3 -4
  266. package/src/components/Tabs/index.js +17 -21
  267. package/src/constants.js +9 -1
  268. package/src/index.js +9 -7
  269. package/src/utils/build-listing-query.js +4 -4
  270. package/src/utils/hoc/withContext.js +5 -4
  271. package/CHANGELOG.md +0 -1939
  272. package/babel.config.js +0 -3
  273. package/jest.config.js +0 -5
@@ -1,6 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import uuidv1 from 'uuid/v1';
4
+ import Accordion from '@blaze-react/accordion';
4
5
  import { useApolloClient } from '@apollo/client';
5
6
  import { getQuery } from '@blaze-cms/admin-ui-utils';
6
7
  import { formFieldTypes } from '@blaze-cms/react-form-builder';
@@ -10,53 +11,51 @@ import { PUBLISHED, UNPUBLISHED } from '../../../../constants';
10
11
  import CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';
11
12
  import EntityNavLinks from '../EntitiyNavLinks';
12
13
 
13
- const SideBarRelations = ({ schema, onChange, formData, entity }) => {
14
+ const SideBarRelations = ({ schema, onChange, formData, entity, isOpen, onToggle }) => {
14
15
  const { relation: RelationComponent } = formFieldTypes;
15
16
  const {
16
17
  formattedStatus,
17
18
  formattedUpdated,
18
19
  formattedCreated,
19
20
  formattedPublished,
21
+ updatedBy,
20
22
  status
21
23
  } = formData;
22
24
  const client = useApolloClient();
23
25
 
24
26
  const [relationsComponents, setRelationsComponents] = useState(null);
25
27
 
26
- useEffect(
27
- () => {
28
- (async () => {
29
- const fetchRelationSchema = async ({ entityIdentifier }) => {
30
- if (!entityIdentifier) return null;
28
+ useEffect(() => {
29
+ (async () => {
30
+ const fetchRelationSchema = async ({ entityIdentifier }) => {
31
+ if (!entityIdentifier) return null;
31
32
 
32
- const {
33
- data: {
34
- getEntitySchemas: [relationSchema]
35
- }
36
- } = await client.query({
37
- query: getQuery('GET_ENTITY_SCHEMA'),
38
- variables: { identifier: entityIdentifier }
39
- });
40
- return relationSchema;
41
- };
33
+ const {
34
+ data: {
35
+ getEntitySchemas: [relationSchema]
36
+ }
37
+ } = await client.query({
38
+ query: getQuery('GET_ENTITY_SCHEMA'),
39
+ variables: { identifier: entityIdentifier }
40
+ });
41
+ return relationSchema;
42
+ };
42
43
 
43
- if (!relationsComponents && schema) {
44
- const allRelationComponents = await Promise.all(
45
- schema.relations
46
- .filter(({ showInForm, foreignKey }) => showInForm && schema.properties[foreignKey])
47
- .map(async relation => ({
48
- id: uuidv1(),
49
- staticData: relation,
50
- schema: await fetchRelationSchema(relation)
51
- }))
52
- );
44
+ if (!relationsComponents && schema) {
45
+ const allRelationComponents = await Promise.all(
46
+ schema.relations
47
+ .filter(({ showInForm, foreignKey }) => showInForm && schema.properties[foreignKey])
48
+ .map(async relation => ({
49
+ id: uuidv1(),
50
+ staticData: relation,
51
+ schema: await fetchRelationSchema(relation)
52
+ }))
53
+ );
53
54
 
54
- setRelationsComponents(allRelationComponents);
55
- }
56
- })();
57
- },
58
- [client, relationsComponents, schema, schema.relations]
59
- );
55
+ setRelationsComponents(allRelationComponents);
56
+ }
57
+ })();
58
+ }, [client, relationsComponents, schema, schema.relations]);
60
59
  const { id: itemId } = entity;
61
60
  const { identifier: itemEntity, interfaces } = schema;
62
61
 
@@ -66,7 +65,16 @@ const SideBarRelations = ({ schema, onChange, formData, entity }) => {
66
65
  });
67
66
 
68
67
  return (
69
- <div className="sidebar" data-testid="sideBarRelations-main-div">
68
+ <div
69
+ className={classnames('sidebar', { 'sidebar--collapsed': !isOpen })}
70
+ data-testid="sideBarRelations-main-div">
71
+ <div
72
+ className="sidebar__toggle-button"
73
+ onClick={onToggle}
74
+ role="button"
75
+ aria-label={isOpen ? 'Collapse sidebar' : 'Expand sidebar'}>
76
+ <i className="material-icons">{isOpen ? 'keyboard_arrow_right' : 'keyboard_arrow_left'}</i>
77
+ </div>
70
78
  <div className="sidebar__content">
71
79
  <div className="sidebar__status">
72
80
  {formattedCreated && (
@@ -82,19 +90,21 @@ const SideBarRelations = ({ schema, onChange, formData, entity }) => {
82
90
  )}
83
91
  </div>
84
92
  )}
85
- {!schema.displayProperties.disableDefaultAdminInfo &&
86
- formattedCreated && (
87
- <>
88
- <>
89
- <p>
90
- Created: <span>{formattedCreated}</span>
91
- </p>
92
- <p>
93
- Updated: <span>{formattedUpdated}</span>
94
- </p>
95
- </>
96
- </>
97
- )}
93
+ {!schema.displayProperties.disableDefaultAdminInfo && formattedCreated && (
94
+ <>
95
+ <p>
96
+ Created: <span>{formattedCreated}</span>
97
+ </p>
98
+ <p>
99
+ Updated: <span>{formattedUpdated}</span>
100
+ </p>
101
+ {updatedBy && (
102
+ <p>
103
+ Updated by: <span>{updatedBy.name}</span>
104
+ </p>
105
+ )}
106
+ </>
107
+ )}
98
108
 
99
109
  <CustomSidebarInfoContainer
100
110
  id={itemId}
@@ -106,16 +116,26 @@ const SideBarRelations = ({ schema, onChange, formData, entity }) => {
106
116
  <VersionsList itemEntity={itemEntity} itemId={itemId} interfaces={interfaces} />
107
117
  <EntityNavLinks schema={schema} />
108
118
 
109
- {relationsComponents &&
110
- relationsComponents.map(({ id, staticData, schema: entitySchema }) => (
111
- <RelationComponent
112
- formData={formData}
113
- schema={entitySchema}
114
- key={id}
115
- staticData={staticData}
116
- onSelect={onChange}
117
- />
118
- ))}
119
+ {relationsComponents && (
120
+ <Accordion isOpen>
121
+ <Accordion.Header>
122
+ <b>Classification</b>
123
+ </Accordion.Header>
124
+ <Accordion.Content>
125
+ <Accordion.ContentDetails>
126
+ {relationsComponents.map(({ id, staticData, schema: entitySchema }) => (
127
+ <RelationComponent
128
+ formData={formData}
129
+ schema={entitySchema}
130
+ key={id}
131
+ staticData={staticData}
132
+ onSelect={onChange}
133
+ />
134
+ ))}
135
+ </Accordion.ContentDetails>
136
+ </Accordion.Content>
137
+ </Accordion>
138
+ )}
119
139
  </div>
120
140
  </div>
121
141
  );
@@ -125,11 +145,14 @@ SideBarRelations.propTypes = {
125
145
  schema: PropTypes.object.isRequired,
126
146
  onChange: PropTypes.func.isRequired,
127
147
  formData: PropTypes.object.isRequired,
128
- entity: PropTypes.object
148
+ entity: PropTypes.object,
149
+ isOpen: PropTypes.bool,
150
+ onToggle: PropTypes.func
129
151
  };
130
-
131
152
  SideBarRelations.defaultProps = {
132
- entity: {}
153
+ entity: {},
154
+ isOpen: true,
155
+ onToggle: () => {}
133
156
  };
134
157
 
135
158
  export default SideBarRelations;
@@ -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;
@@ -19,56 +19,63 @@ const EntityManager = ({ match, history }) => {
19
19
 
20
20
  const { action, entityIdentifier, id = null, onViewUrl } = match.params;
21
21
 
22
- useEffect(
23
- () => {
24
- (async () => {
25
- try {
26
- const [entitySchema, data = {}, requestedQuery] = await entityAvailableActions[action]({
27
- client,
28
- identifier: entityIdentifier,
29
- id
30
- });
31
-
32
- if (!data) {
33
- addToast(PAGE_NOT_FOUND, {
34
- appearance: ERROR,
35
- autoDismiss: true
36
- });
37
-
38
- history.push(`/data-listing/${entityIdentifier}`);
39
- }
40
-
41
- let localData = data;
42
-
43
- if (isPageBuilderTemplateSet(data)) {
44
- const pageBuilderComponents = await getPageBuilderComponents({
45
- entitySchema,
46
- client,
47
- id
48
- });
49
-
50
- localData = {
51
- ...localData,
52
- pageBuilder: pageBuilderComponents || localData.pageBuilder
53
- };
54
- }
55
-
56
- setFormData({ values: localData });
57
- setEntity(data);
58
- setSchema(entitySchema);
59
- setPreviousQuery(requestedQuery);
60
- setShouldRefetch(false);
61
- } catch (error) {
62
- addToast(error.message, {
22
+ useEffect(() => {
23
+ (async () => {
24
+ try {
25
+ const [entitySchema, data = {}, requestedQuery] = await entityAvailableActions[action]({
26
+ client,
27
+ identifier: entityIdentifier,
28
+ id
29
+ });
30
+
31
+ if (!data) {
32
+ addToast(PAGE_NOT_FOUND, {
63
33
  appearance: ERROR,
64
34
  autoDismiss: true
65
35
  });
36
+
66
37
  history.push(`/data-listing/${entityIdentifier}`);
67
38
  }
68
- })();
69
- },
70
- [action, addToast, client, entityIdentifier, history, history.push, id, schema, shouldRefetch]
71
- );
39
+
40
+ let localData = data;
41
+
42
+ if (isPageBuilderTemplateSet(data)) {
43
+ const pageBuilderComponents = await getPageBuilderComponents({
44
+ entitySchema,
45
+ client,
46
+ id
47
+ });
48
+
49
+ localData = {
50
+ ...localData,
51
+ pageBuilder: pageBuilderComponents || localData.pageBuilder
52
+ };
53
+ }
54
+
55
+ setFormData({ values: localData });
56
+ setEntity(data);
57
+ setSchema(entitySchema);
58
+ setPreviousQuery(requestedQuery);
59
+ setShouldRefetch(false);
60
+ } catch (error) {
61
+ addToast(error.message, {
62
+ appearance: ERROR,
63
+ autoDismiss: true
64
+ });
65
+ history.push(`/data-listing/${entityIdentifier}`);
66
+ }
67
+ })();
68
+ }, [
69
+ action,
70
+ addToast,
71
+ client,
72
+ entityIdentifier,
73
+ history,
74
+ history.push,
75
+ id,
76
+ schema,
77
+ shouldRefetch
78
+ ]);
72
79
 
73
80
  const updateFormData = (updatedFormData, shouldRefresh) => {
74
81
  if (shouldRefresh) setShouldRefetch(true);
@@ -1,5 +1,10 @@
1
1
  import has from 'lodash.has';
2
- import { ENTITY_PUBLISHED, KEY_TO_CHECK, SELECT_DEFAULT_VALUE } from '../../../constants';
2
+ import {
3
+ DEBUG_PARAM,
4
+ ENTITY_PUBLISHED,
5
+ KEY_TO_CHECK,
6
+ SELECT_DEFAULT_VALUE
7
+ } from '../../../constants';
3
8
 
4
9
  function canViewPage(formData, entity, schema, entityIsPublished) {
5
10
  return (
@@ -28,7 +33,13 @@ function validateSideBarRelations(updatedFormValues, requiredChildField) {
28
33
 
29
34
  async function onViewUrlClick(getFullUrl) {
30
35
  const fullUrl = await getFullUrl();
31
- if (fullUrl) window.open(fullUrl, '_blank');
36
+ if (fullUrl) {
37
+ const delimiter = fullUrl.includes('?') ? '&' : '?';
38
+ const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM
39
+ ? ''
40
+ : `${delimiter}${DEBUG_PARAM}`;
41
+ window.open(`${fullUrl}${debugParam}`, '_blank');
42
+ }
32
43
  }
33
44
 
34
45
  function getUpdatedFormValues({ id, value, requiredChildField, formValues }) {
@@ -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;
@@ -9,12 +9,9 @@ const InfoBoxContainer = ({ id, schema, infoBox }) => {
9
9
 
10
10
  const { data, refetch } = useData({ id, schema, infoBox });
11
11
 
12
- useEffect(
13
- () => {
14
- refetch();
15
- },
16
- [externalUpdateTime, refetch]
17
- );
12
+ useEffect(() => {
13
+ refetch();
14
+ }, [externalUpdateTime, refetch]);
18
15
 
19
16
  if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
20
17
 
@@ -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
 
@@ -12,7 +12,12 @@ function useData({ id, schema, infoBox }) {
12
12
  }
13
13
  `;
14
14
 
15
- const { data = {}, loading, error, refetch } = useQuery(infoBoxQuery, {
15
+ const {
16
+ data = {},
17
+ loading,
18
+ error,
19
+ refetch
20
+ } = useQuery(infoBoxQuery, {
16
21
  variables: { id },
17
22
  skip: !query
18
23
  });
@@ -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;
@@ -1,12 +1,12 @@
1
1
  import React, { useEffect, useState, Fragment } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import More from '@blaze-react/more';
4
3
  import { useApolloClient } from '@apollo/client';
5
4
  import { withRouter, Link, useLocation } from 'react-router-dom';
6
5
  import { PageHeader, DeleteAction, CardPrompt } from '@blaze-cms/admin';
7
6
  import { useToasts } from '@blaze-react/toaster';
8
7
  import { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';
9
8
  import ListingTableContent from './ListingTableContent';
9
+ import SearchFilter from './SearchFilter/SearchFilter';
10
10
  import availableActions from '../EntityManager/Entity/actions-handlers';
11
11
  import { fetchData } from './service';
12
12
  import { populateRows, formatRows, getParsedRowData } from './mappers/populate-rows';
@@ -38,7 +38,7 @@ const ListingTable = ({ match, entitySchema, history }) => {
38
38
  ...queryParams,
39
39
  offset: currentPage * queryParamsDefault.limit - queryParamsDefault.limit
40
40
  };
41
- await doQuery(listFilters, updatedQueryParams);
41
+ await doQuery([], updatedQueryParams);
42
42
  setPreviousSchema({ id: entitySchema.id });
43
43
  }
44
44
  })();
@@ -144,7 +144,6 @@ const ListingTable = ({ match, entitySchema, history }) => {
144
144
  });
145
145
  history.push('?page=1');
146
146
  };
147
-
148
147
  if (!tableData || !tableData.rows) return 'loading';
149
148
 
150
149
  const {
@@ -160,35 +159,20 @@ const ListingTable = ({ match, entitySchema, history }) => {
160
159
 
161
160
  return (
162
161
  <div className="page">
163
- {modalStatus &&
164
- _deleteAction.active && (
165
- <DeleteAction
166
- data-testid="deleteEntity"
167
- onClose={toggleModal}
168
- deleteAction={deleteAction}
169
- itemName={itemToDelete.name}
170
- />
171
- )}
162
+ {modalStatus && _deleteAction.active && (
163
+ <DeleteAction
164
+ data-testid="deleteEntity"
165
+ onClose={toggleModal}
166
+ deleteAction={deleteAction}
167
+ itemName={itemToDelete.name}
168
+ />
169
+ )}
172
170
  <PageHeader title={entitySchema.displayName} subtitle="">
173
- {createAction.active &&
174
- !showAddButton && (
175
- <Fragment>
176
- <Link
177
- data-testid="addEntity"
178
- className="button button--small"
179
- to={`${match.url}/create`}>
180
- Add
181
- </Link>
182
- <PageHeader.Actions>
183
- <More>
184
- <More.Avatar isMoreMenu>
185
- <span className="material-icons">more_vert</span>
186
- </More.Avatar>
187
- <More.Content isMoreMenu />
188
- </More>
189
- </PageHeader.Actions>
190
- </Fragment>
191
- )}
171
+ {createAction.active && !showAddButton && (
172
+ <Link data-testid="addEntity" className="button button--small" to={`${match.url}/create`}>
173
+ Add
174
+ </Link>
175
+ )}
192
176
  </PageHeader>
193
177
  {showAddButton ? (
194
178
  <CardPrompt>
@@ -207,6 +191,11 @@ const ListingTable = ({ match, entitySchema, history }) => {
207
191
  listFilters={listFilters}
208
192
  setListFilters={updateListingFilters}
209
193
  />
194
+ <SearchFilter
195
+ schema={entitySchema}
196
+ listFilters={listFilters}
197
+ setListFilters={updateListingFilters}
198
+ />
210
199
  <ListingTableContent
211
200
  totalItems={totalItems}
212
201
  currentPage={currentPage}
@@ -214,6 +203,9 @@ const ListingTable = ({ match, entitySchema, history }) => {
214
203
  handleOnPageChange={handleOnPageChange}
215
204
  tableData={tableData}
216
205
  onCloseCardPrompt={onCloseCardPrompt}
206
+ schema={entitySchema}
207
+ listFilters={listFilters}
208
+ setListFilters={updateListingFilters}
217
209
  />
218
210
  </>
219
211
  )}
@@ -1,7 +1,6 @@
1
- import React from 'react';
1
+ import React, { useEffect, useRef } from 'react';
2
2
  import Table from '@blaze-react/table';
3
3
  import Pagination from '@blaze-react/pagination';
4
-
5
4
  import PropTypes from 'prop-types';
6
5
  import { withRouter } from 'react-router-dom';
7
6
 
@@ -13,36 +12,53 @@ const ListingTableContent = ({
13
12
  currentPage,
14
13
  totalItems
15
14
  }) => {
15
+ const ref = useRef(null);
16
16
  const displayTable = tableData && tableData.rows && !!tableData.rows.length;
17
17
  const { isEnquiry } = tableData;
18
18
  const className = `page__content${isEnquiry ? ' array-table' : ''}`;
19
19
 
20
+ useEffect(() => {
21
+ // set table head to match body column widths to handle dynamic content
22
+ if (ref.current && displayTable) {
23
+ const tableHeadCells = ref.current.querySelectorAll('.table-head .table-cell');
24
+ const firstRowCells = ref.current.querySelectorAll(
25
+ '.table-body .table-row:first-child .table-cell'
26
+ );
27
+
28
+ firstRowCells.forEach((element, i) => {
29
+ const styles = window.getComputedStyle(element);
30
+
31
+ if (tableHeadCells[i]) {
32
+ tableHeadCells[i].style.flex = styles.flex;
33
+ tableHeadCells[i].style['justify-content'] = styles['justify-content'];
34
+ }
35
+ });
36
+ }
37
+ }, [tableData, displayTable]);
38
+
39
+ if (displayTable) {
40
+ return (
41
+ <div ref={ref} className={className}>
42
+ <Table
43
+ onSort={onSort}
44
+ data={tableData}
45
+ onSelect={handleSelect}
46
+ data-testid="listing-table-content"
47
+ />
48
+ <Pagination
49
+ visiblePages={10}
50
+ totalItems={totalItems}
51
+ currentPage={currentPage}
52
+ onPageChange={handleOnPageChange}
53
+ />
54
+ </div>
55
+ );
56
+ }
57
+
20
58
  return (
21
- <>
22
- {displayTable ? (
23
- <>
24
- <div className={className}>
25
- <Table
26
- onSort={onSort}
27
- data={tableData}
28
- checkboxes={!isEnquiry}
29
- onSelect={handleSelect}
30
- data-testid="listing-table-content"
31
- />
32
- <Pagination
33
- visiblePages={10}
34
- totalItems={totalItems}
35
- currentPage={currentPage}
36
- onPageChange={handleOnPageChange}
37
- />
38
- </div>
39
- </>
40
- ) : (
41
- <span className="table-no-results" data-testid="no-results">
42
- No results
43
- </span>
44
- )}
45
- </>
59
+ <span className="table-no-results" data-testid="no-results">
60
+ No results
61
+ </span>
46
62
  );
47
63
  };
48
64