@blaze-cms/plugin-data-ui 0.139.0-project-admin-customisations.0 → 0.139.1-alpha.0

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 (152) hide show
  1. package/CHANGELOG.md +62 -1
  2. package/lib/components/EntityDataListing/EntityDataListing.js +1 -2
  3. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  4. package/lib/components/EntityDataListing/index.js +1 -2
  5. package/lib/components/EntityDataListing/index.js.map +1 -1
  6. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +1 -2
  7. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  8. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +1 -2
  9. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  10. package/lib/components/EntityManager/Entity/Entity.js +21 -11
  11. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  12. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
  13. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  14. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +1 -2
  15. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  16. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +1 -2
  17. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  18. package/lib/components/EntityManager/Entity/EntityHeader/index.js +1 -2
  19. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  20. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +1 -2
  21. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  22. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +10 -3
  23. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  24. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +3 -4
  25. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  26. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +1 -2
  27. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  28. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +1 -2
  29. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  30. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +1 -2
  31. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  32. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +1 -2
  33. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  34. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +1 -2
  35. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  36. package/lib/components/EntityManager/Entity/actions-handlers/index.js +1 -2
  37. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  38. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +1 -2
  39. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  40. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +1 -2
  41. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  42. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +1 -2
  43. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  44. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +1 -2
  45. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  46. package/lib/components/EntityManager/Entity/index.js +1 -2
  47. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  48. package/lib/components/EntityManager/EntityManager.js +3 -4
  49. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  50. package/lib/components/EntityManager/index.js +1 -2
  51. package/lib/components/EntityManager/index.js.map +1 -1
  52. package/lib/components/EntityManager/utils/RecordEditContext/index.js +13 -0
  53. package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -0
  54. package/lib/components/EntityManager/utils/data-mappers.js +4 -8
  55. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  56. package/lib/components/EntityManager/utils/entityAvailableActions.js +1 -2
  57. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  58. package/lib/components/EntityManager/utils/is-form-empty.js +1 -2
  59. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  60. package/lib/components/EntityManager/utils/query.js +1 -2
  61. package/lib/components/EntityManager/utils/query.js.map +1 -1
  62. package/lib/components/InfoBoxes/InfoBoxes.js +1 -2
  63. package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
  64. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +18 -4
  65. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  66. package/lib/components/InfoBoxes/hooks/useData.js +5 -4
  67. package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
  68. package/lib/components/InfoBoxes/hooks/useInfoBox.js +1 -2
  69. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  70. package/lib/components/InfoBoxes/index.js +1 -2
  71. package/lib/components/InfoBoxes/index.js.map +1 -1
  72. package/lib/components/InfoBoxes/presentational/InfoBox.js +1 -2
  73. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  74. package/lib/components/ListingTable/ListingTable.js +5 -15
  75. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  76. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +1 -2
  77. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  78. package/lib/components/ListingTable/ListingTableContent/index.js +1 -2
  79. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  80. package/lib/components/ListingTable/TableActions/TableActions.js +1 -2
  81. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  82. package/lib/components/ListingTable/TableActions/index.js +1 -2
  83. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  84. package/lib/components/ListingTable/index.js +1 -2
  85. package/lib/components/ListingTable/index.js.map +1 -1
  86. package/lib/components/ListingTable/mappers/populate-rows.js +3 -6
  87. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  88. package/lib/components/ListingTable/service/index.js +1 -2
  89. package/lib/components/ListingTable/service/index.js.map +1 -1
  90. package/lib/components/Tabs/index.js +3 -4
  91. package/lib/components/Tabs/index.js.map +1 -1
  92. package/lib/constants.js +26 -52
  93. package/lib/constants.js.map +1 -1
  94. package/lib/icons/ContentIcon.js +48 -48
  95. package/lib/icons/ContentIcon.js.map +1 -1
  96. package/lib/icons/SettingsIcon.js +14 -34
  97. package/lib/icons/SettingsIcon.js.map +1 -1
  98. package/lib/icons/TaxonomyIcon.js +34 -54
  99. package/lib/icons/TaxonomyIcon.js.map +1 -1
  100. package/lib/icons/UsersIcon.js +14 -35
  101. package/lib/icons/UsersIcon.js.map +1 -1
  102. package/lib/index.js +2 -2
  103. package/lib/index.js.map +1 -1
  104. package/lib/utils/add-content-menu-items.js +1 -2
  105. package/lib/utils/add-content-menu-items.js.map +1 -1
  106. package/lib/utils/build-create-entity-mutation.js +1 -2
  107. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  108. package/lib/utils/build-delete-entity-mutation.js +1 -2
  109. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  110. package/lib/utils/build-listing-query.js +1 -2
  111. package/lib/utils/build-listing-query.js.map +1 -1
  112. package/lib/utils/build-update-data-query.js +1 -2
  113. package/lib/utils/build-update-data-query.js.map +1 -1
  114. package/lib/utils/build-update-publish-unpublish-mutation.js +1 -2
  115. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  116. package/lib/utils/get-default-query-params.js +1 -2
  117. package/lib/utils/get-default-query-params.js.map +1 -1
  118. package/lib/utils/hoc/withContext.js +1 -2
  119. package/lib/utils/hoc/withContext.js.map +1 -1
  120. package/lib/utils/hooks/useToggle.js +1 -2
  121. package/lib/utils/hooks/useToggle.js.map +1 -1
  122. package/lib-es/components/EntityManager/Entity/Entity.js +11 -3
  123. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  124. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +10 -1
  125. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  126. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js +6 -0
  127. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +1 -0
  128. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +10 -2
  129. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  130. package/lib-es/components/InfoBoxes/hooks/useData.js +4 -2
  131. package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
  132. package/lib-es/components/ListingTable/ListingTable.js +2 -8
  133. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  134. package/lib-es/icons/ContentIcon.js +45 -45
  135. package/lib-es/icons/ContentIcon.js.map +1 -1
  136. package/lib-es/icons/SettingsIcon.js +13 -33
  137. package/lib-es/icons/SettingsIcon.js.map +1 -1
  138. package/lib-es/icons/TaxonomyIcon.js +33 -53
  139. package/lib-es/icons/TaxonomyIcon.js.map +1 -1
  140. package/lib-es/icons/UsersIcon.js +13 -34
  141. package/lib-es/icons/UsersIcon.js.map +1 -1
  142. package/package.json +11 -11
  143. package/src/components/EntityManager/Entity/Entity.js +86 -75
  144. package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +12 -1
  145. package/src/components/EntityManager/utils/RecordEditContext/index.js +7 -0
  146. package/src/components/InfoBoxes/container/InfoBoxContainer.js +12 -2
  147. package/src/components/InfoBoxes/hooks/useData.js +5 -2
  148. package/src/components/ListingTable/ListingTable.js +11 -16
  149. package/src/icons/ContentIcon.js +68 -57
  150. package/src/icons/SettingsIcon.js +24 -36
  151. package/src/icons/TaxonomyIcon.js +46 -58
  152. package/src/icons/UsersIcon.js +21 -34
@@ -36,6 +36,7 @@ import {
36
36
  } from '../utils/entity';
37
37
  import useToggle from '../../../utils/hooks/useToggle';
38
38
  import InfoBoxes from '../../InfoBoxes/InfoBoxes';
39
+ import { RecordEditContextProvider } from '../utils/RecordEditContext';
39
40
 
40
41
  const Entity = ({
41
42
  formData,
@@ -68,6 +69,7 @@ const Entity = ({
68
69
  const [formDataFromCopy, setFormDataFromCopy] = useState(null);
69
70
  const [newUpdatedDate, setNewUpdatedDate] = useState(null);
70
71
  const [saveButtonText, setSaveButtonText] = useState(SAVE_BUTTON_TEXTS.save);
72
+ const [externalUpdateTime, setExternalUpdateTime] = useState(null);
71
73
 
72
74
  const isCreatePage = history.location.pathname.includes('create');
73
75
  const [isNewEntity, setIsNewEntity] = useState(isCreatePage);
@@ -238,6 +240,7 @@ const Entity = ({
238
240
  if (componentIsMounted.current) {
239
241
  setIsFormValid(isValid);
240
242
  }
243
+
241
244
  if (isValidAndNewValueSet && componentIsMounted.current) {
242
245
  setIsSaveButtonAvailable(true);
243
246
  setSaveButtonText(SAVE_BUTTON_TEXTS.save);
@@ -404,89 +407,97 @@ const Entity = ({
404
407
  schema?.interfaces?.includes('page-builder/page-builder');
405
408
 
406
409
  return (
407
- <div className="page">
408
- <EntityHeader
409
- entityData={entityData}
410
- entityIdentifier={entityIdentifier}
411
- pageTitle={pageTitle}
412
- pageName={pageName}
413
- onSubmit={onSubmit}
414
- handlePublishAndUnpublish={handlePublishAndUnpublish}
415
- isSaveButtonAvailable={isSaveButtonAvailable}
416
- isEnablePublishButton={isEnablePublishButton}
417
- isEnablePreviewButton={isEnablePreviewButton}
418
- toggleCopyModal={setCopyModalStatus}
419
- toggleModal={setModalStatus}
420
- formData={formData}
421
- onViewUrl={onViewUrlHandler}
422
- saveButtonText={saveButtonText}
423
- />
424
- <div className="page-wrapper__content">
425
- <div className="tabs-wrapper tabs-wrapper__tab">
426
- <Prompt when={hasToDisplayPrompt} message={LEAVE_PAGE_MESSAGE} />
427
- {showModal && (
428
- <DeleteAction
429
- onClose={setModalStatus}
430
- deleteAction={onDelete}
431
- itemName={formData.values.name}
432
- />
433
- )}
434
- {copyModalStatus && (
435
- <CopyDataFromAction
436
- onClose={handleCopyDataFromClose}
437
- copyAction={onCopy}
438
- getFormData={getFormData}
439
- />
440
- )}
441
-
442
- <div className="page__content--fixed">
443
- <div className="page__content">
444
- <div className="content">
445
- <RenderHook hookKey={`entity:${action}:main:top`} entity={entity} schema={schema} />
446
- <InfoBoxes id={entity.id} schema={schema} />
447
- <Tabs
448
- enabled={showPageBuilderTabs}
449
- onTabChange={tabId => {
450
- client.writeQuery({
451
- query: GET_CURRENT_TAB_ID,
452
- data: { currentTabId: tabId }
453
- });
454
- setCurrentTabId(tabId);
455
- }}>
456
- <FormBuilder
457
- getIsFormValid={setIsFormValid}
458
- getFormValues={getFormValues}
410
+ <RecordEditContextProvider value={{ externalUpdateTime }}>
411
+ <div className="page">
412
+ <EntityHeader
413
+ entityData={entityData}
414
+ entityIdentifier={entityIdentifier}
415
+ pageTitle={pageTitle}
416
+ pageName={pageName}
417
+ onSubmit={onSubmit}
418
+ handlePublishAndUnpublish={handlePublishAndUnpublish}
419
+ isSaveButtonAvailable={isSaveButtonAvailable}
420
+ isEnablePublishButton={isEnablePublishButton}
421
+ isEnablePreviewButton={isEnablePreviewButton}
422
+ toggleCopyModal={setCopyModalStatus}
423
+ toggleModal={setModalStatus}
424
+ formData={formData}
425
+ onViewUrl={onViewUrlHandler}
426
+ saveButtonText={saveButtonText}
427
+ />
428
+ <div className="page-wrapper__content">
429
+ <div className="tabs-wrapper tabs-wrapper__tab">
430
+ <Prompt when={hasToDisplayPrompt} message={LEAVE_PAGE_MESSAGE} />
431
+ {showModal && (
432
+ <DeleteAction
433
+ onClose={setModalStatus}
434
+ deleteAction={onDelete}
435
+ itemName={formData.values.name}
436
+ />
437
+ )}
438
+ {copyModalStatus && (
439
+ <CopyDataFromAction
440
+ onClose={handleCopyDataFromClose}
441
+ copyAction={onCopy}
442
+ getFormData={getFormData}
443
+ />
444
+ )}
445
+
446
+ <div className="page__content--fixed">
447
+ <div className="page__content">
448
+ <div className="content">
449
+ <RenderHook
450
+ hookKey={`entity:${action}:main:top`}
451
+ entity={entity}
452
+ schema={schema}
453
+ />
454
+ <InfoBoxes id={entity.id} schema={schema} />
455
+ <Tabs
456
+ enabled={showPageBuilderTabs}
457
+ onTabChange={tabId => {
458
+ client.writeQuery({
459
+ query: GET_CURRENT_TAB_ID,
460
+ data: { currentTabId: tabId }
461
+ });
462
+ setCurrentTabId(tabId);
463
+ }}>
464
+ <FormBuilder
465
+ getIsFormValid={setIsFormValid}
466
+ getFormValues={getFormValues}
467
+ schema={schema}
468
+ data={clonedFormData}
469
+ onChange={onChangeFormValues}
470
+ shouldCopyData={shouldCopyData}
471
+ updateCopyData={updateCopyData}
472
+ formValues={formValues}
473
+ isNewEntity={isNewEntity}
474
+ onExternalUpdate={setExternalUpdateTime}
475
+ dataUpdatedDateTime={newUpdatedDate}
476
+ />
477
+ </Tabs>
478
+ <RenderHook
479
+ hookKey={`entity:${action}:main:bottom`}
480
+ entity={entity}
459
481
  schema={schema}
460
- data={clonedFormData}
461
- onChange={onChangeFormValues}
462
- shouldCopyData={shouldCopyData}
463
- updateCopyData={updateCopyData}
464
- formValues={formValues}
465
- isNewEntity={isNewEntity}
466
482
  />
467
- </Tabs>
468
- <RenderHook
469
- hookKey={`entity:${action}:main:bottom`}
470
- entity={entity}
471
- schema={schema}
472
- />
483
+ </div>
473
484
  </div>
474
485
  </div>
475
486
  </div>
476
- </div>
477
487
 
478
- <div className="column column--one-third page-sidebar page-sidebar--relations">
479
- {showSideBarRelations && (
480
- <SideBarRelations
481
- entity={entity}
482
- formData={formData.values}
483
- schema={schema}
484
- onChange={onChangeSideBarRelations}
485
- />
486
- )}
488
+ <div className="column column--one-third page-sidebar page-sidebar--relations">
489
+ {showSideBarRelations && (
490
+ <SideBarRelations
491
+ entity={entity}
492
+ formData={formData.values}
493
+ schema={schema}
494
+ onChange={onChangeSideBarRelations}
495
+ />
496
+ )}
497
+ </div>
487
498
  </div>
488
499
  </div>
489
- </div>
500
+ </RecordEditContextProvider>
490
501
  );
491
502
  };
492
503
 
@@ -1,8 +1,12 @@
1
+ import { useContext, useEffect } from 'react';
1
2
  import ProptTypes from 'prop-types';
2
3
  import { useQuery, gql } from '@apollo/client';
3
4
  import buildDynamicQuery from '../helpers/build-dynamic-query';
5
+ import { RecordEditContext } from '../../../utils/RecordEditContext';
4
6
 
5
7
  const useCustomSidebarData = ({ id, schema, displayProperties }) => {
8
+ const { externalUpdateTime } = useContext(RecordEditContext);
9
+
6
10
  const query = buildDynamicQuery({ id, schema, displayProperties });
7
11
 
8
12
  const customSidebarInfoQuery =
@@ -13,11 +17,18 @@ const useCustomSidebarData = ({ id, schema, displayProperties }) => {
13
17
  }
14
18
  `;
15
19
 
16
- const { data = {}, loading, error } = useQuery(customSidebarInfoQuery, {
20
+ const { data = {}, loading, error, refetch } = useQuery(customSidebarInfoQuery, {
17
21
  variables: { id },
18
22
  skip: !query
19
23
  });
20
24
 
25
+ useEffect(
26
+ () => {
27
+ refetch();
28
+ },
29
+ [externalUpdateTime, refetch]
30
+ );
31
+
21
32
  return { data: data.__typename !== 'Query' ? data : null, loading, error };
22
33
  };
23
34
 
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+
3
+ const RecordEditContext = React.createContext();
4
+ const RecordEditContextProvider = RecordEditContext.Provider;
5
+ const RecordEditContextConsumer = RecordEditContext.Consumer;
6
+
7
+ export { RecordEditContext, RecordEditContextProvider, RecordEditContextConsumer };
@@ -1,10 +1,20 @@
1
1
  import PropTypes from 'prop-types';
2
- import React from 'react';
2
+ import React, { useContext, useEffect } from 'react';
3
3
  import useData from '../hooks/useData';
4
4
  import InfoBox from '../presentational/InfoBox';
5
+ import { RecordEditContext } from '../../EntityManager/utils/RecordEditContext';
5
6
 
6
7
  const InfoBoxContainer = ({ id, schema, infoBox }) => {
7
- const { data } = useData({ id, schema, infoBox });
8
+ const { externalUpdateTime } = useContext(RecordEditContext);
9
+
10
+ const { data, refetch } = useData({ id, schema, infoBox });
11
+
12
+ useEffect(
13
+ () => {
14
+ refetch();
15
+ },
16
+ [externalUpdateTime, refetch]
17
+ );
8
18
 
9
19
  if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
10
20
 
@@ -12,9 +12,12 @@ function useData({ id, schema, infoBox }) {
12
12
  }
13
13
  `;
14
14
 
15
- const { data = {}, loading, error } = useQuery(infoBoxQuery, { variables: { id }, skip: !query });
15
+ const { data = {}, loading, error, refetch } = useQuery(infoBoxQuery, {
16
+ variables: { id },
17
+ skip: !query
18
+ });
16
19
 
17
- return { data: data.__typename !== 'Query' ? data : null, loading, error };
20
+ return { data: data.__typename !== 'Query' ? data : null, loading, error, refetch };
18
21
  }
19
22
 
20
23
  export default useData;
@@ -24,7 +24,6 @@ const ListingTable = ({ match, entitySchema }) => {
24
24
  const queryParamsDefault = getDefaultQueryParams(entitySchema);
25
25
  const [queryParams, setQueryParams] = useState(queryParamsDefault);
26
26
  const [listFilters, setListFilters] = useState([]);
27
- const [displayCardPrompt, setDisplayCardPrompt] = useState(true);
28
27
  const client = useApolloClient();
29
28
  const { addToast } = useToasts();
30
29
 
@@ -167,7 +166,7 @@ const ListingTable = ({ match, entitySchema }) => {
167
166
  };
168
167
 
169
168
  if (!tableData || !tableData.rows) return 'loading';
170
- const showAddButton = !!tableData.rows.length && !tableData.isEnquiry;
169
+ const showAddButton = !!tableData.rows.length;
171
170
 
172
171
  return (
173
172
  <div className="page">
@@ -198,20 +197,16 @@ const ListingTable = ({ match, entitySchema }) => {
198
197
  </Fragment>
199
198
  )}
200
199
  </PageHeader>
201
- {displayCardPrompt &&
202
- !showAddButton && (
203
- <CardPrompt
204
- onClose={() => {
205
- setDisplayCardPrompt(false);
206
- }}>
207
- <Link
208
- className="button button--rounded button--cta"
209
- to={`${match.url}/create`}
210
- data-testid="add-button">
211
- Add
212
- </Link>
213
- </CardPrompt>
214
- )}
200
+ {!showAddButton && (
201
+ <CardPrompt>
202
+ <Link
203
+ className="button button--rounded button--cta"
204
+ to={`${match.url}/create`}
205
+ data-testid="add-button">
206
+ Add
207
+ </Link>
208
+ </CardPrompt>
209
+ )}
215
210
  <RenderHook
216
211
  hookKey="entity:listing:main:top"
217
212
  schema={entitySchema}
@@ -1,68 +1,79 @@
1
1
  import React from 'react';
2
- import { ICON_SIZE } from '../constants';
2
+ import { ICON_COLOR } from '../constants';
3
3
 
4
- function ContentIcon({ width = ICON_SIZE.WIDTH, height = ICON_SIZE.HEIGHT }) {
4
+ function ContentIcon({ fill = ICON_COLOR.FILL, stroke = ICON_COLOR.STROKE }) {
5
5
  return (
6
6
  <svg
7
- width={width}
8
- height={height}
9
- viewBox="0 0 20 20"
7
+ width="19px"
8
+ height="19px"
9
+ viewBox="0 0 21 21"
10
10
  version="1.1"
11
11
  xmlns="http://www.w3.org/2000/svg"
12
12
  xmlnsXlink="http://www.w3.org/1999/xlink">
13
- <title>icons/content</title>
14
- <g id="Symbols" stroke="none" strokeWidth={1} fill="none" fillRule="evenodd">
15
- <g id="main-menu/collapsed" transform="translate(-15, -201)">
16
- <g id="Group-4" transform="translate(9, 19)">
17
- <g id="Group-3" transform="translate(0, 176)">
18
- <g id="photograph" transform="translate(7, 7)">
19
- <g id="Group">
20
- <path
21
- d="M0,8.25 L5.15925,3.09075 C6.03787467,2.21239064 7.46212533,2.21239064 8.34075,3.09075 L13.5,8.25 M11.25,6 L13.03425,4.21575 C13.9128747,3.33739064 15.3371253,3.33739064 16.21575,4.21575 L18,6 M2.25,18 L15.75,18 C16.9926407,18 18,16.9926407 18,15.75 L18,2.25 C18,1.00735931 16.9926407,0 15.75,0 L2.25,0 C1.00735931,0 0,1.00735931 0,2.25 L0,15.75 C0,16.9926407 1.00735931,18 2.25,18 Z"
22
- id="Shape"
23
- stroke="#63779C"
24
- strokeWidth="1.5"
25
- strokeLinecap="round"
26
- strokeLinejoin="round"
27
- />
28
- <circle id="Oval" fill="#63779C" cx="10.875" cy="2.625" r="1.125" />
29
- </g>
30
- <line
31
- x1={0}
32
- y1="8.75"
33
- x2={18}
34
- y2="8.75"
35
- id="Path"
36
- stroke="#63779C"
37
- strokeWidth="1.5"
38
- strokeLinecap="round"
39
- strokeLinejoin="round"
40
- />
41
- <line
42
- x1="3.75"
43
- y1="11.75"
44
- x2="14.4999997"
45
- y2="11.75"
46
- id="Path"
47
- stroke="#63779C"
48
- strokeWidth="1.5"
49
- strokeLinecap="round"
50
- strokeLinejoin="round"
51
- />
52
- <line
53
- x1="3.75"
54
- y1="14.75"
55
- x2="11.4999997"
56
- y2="14.75"
57
- id="Path"
58
- stroke="#63779C"
59
- strokeWidth="1.5"
60
- strokeLinecap="round"
61
- strokeLinejoin="round"
62
- />
63
- </g>
64
- </g>
13
+ <title>content</title>
14
+ <g id="Page-1" stroke="none" strokeWidth={1} fill="none" fillRule="evenodd">
15
+ <g id="content" transform="translate(1, 1)">
16
+ <g id="Group">
17
+ <path
18
+ d="M0,8.70833334 L5.445875,3.26245834 C6.37331215,2.33530123 7.87668785,2.33530123 8.804125,3.26245834 L14.25,8.70833334"
19
+ id="Shape-path"
20
+ stroke={stroke}
21
+ strokeLinecap="round"
22
+ strokeLinejoin="round"
23
+ />
24
+ <path
25
+ d="M11.875,6.33333334 L13.758375,4.44995834 C14.6858122,3.52280123 16.1891878,3.52280123 17.116625,4.44995834 L19,6.33333334"
26
+ id="Shape-path"
27
+ stroke={stroke}
28
+ strokeLinecap="round"
29
+ strokeLinejoin="round"
30
+ />
31
+ <path
32
+ d="M2.375,19 L16.625,19 C17.9366763,19 19,17.9366763 19,16.625 L19,2.375 C19,1.06332371 17.9366763,0 16.625,0 L2.375,0 C1.06332371,0 0,1.06332371 0,2.375 L0,16.625 C0,17.9366763 1.06332371,19 2.375,19 Z"
33
+ id="Shape-path"
34
+ stroke={stroke}
35
+ strokeLinecap="round"
36
+ strokeLinejoin="round"
37
+ />
38
+ <circle
39
+ id="Oval"
40
+ fill={fill}
41
+ fillRule="nonzero"
42
+ cx="11.4791666"
43
+ cy="2.77083334"
44
+ r="1.1875"
45
+ />
65
46
  </g>
47
+ <line
48
+ x1={0}
49
+ y1="9.23611111"
50
+ x2={19}
51
+ y2="9.23611111"
52
+ id="Path"
53
+ stroke={stroke}
54
+ strokeLinecap="round"
55
+ strokeLinejoin="round"
56
+ />
57
+ <line
58
+ x1="3.95833334"
59
+ y1="12.4027778"
60
+ x2="15.3055553"
61
+ y2="12.4027778"
62
+ id="Path"
63
+ stroke={stroke}
64
+ strokeLinecap="round"
65
+ strokeLinejoin="round"
66
+ />
67
+ <line
68
+ x1="3.95833334"
69
+ y1="15.5694445"
70
+ x2="12.1388885"
71
+ y2="15.5694445"
72
+ id="Path"
73
+ stroke={stroke}
74
+ strokeLinecap="round"
75
+ strokeLinejoin="round"
76
+ />
66
77
  </g>
67
78
  </g>
68
79
  </svg>
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
- import { ICON_SIZE } from '../constants';
2
+ import { ICON_SIZE, ICON_COLOR } from '../constants';
3
3
 
4
- function SettingsIcon({ width = ICON_SIZE.WIDTH, height = ICON_SIZE.HEIGHT }) {
4
+ function SettingsIcon({
5
+ width = ICON_SIZE.WIDTH,
6
+ height = ICON_SIZE.HEIGHT,
7
+ stroke = ICON_COLOR.STROKE
8
+ }) {
5
9
  return (
6
10
  <svg
7
11
  width={width}
@@ -10,40 +14,24 @@ function SettingsIcon({ width = ICON_SIZE.WIDTH, height = ICON_SIZE.HEIGHT }) {
10
14
  version="1.1"
11
15
  xmlns="http://www.w3.org/2000/svg"
12
16
  xmlnsXlink="http://www.w3.org/1999/xlink">
13
- <title>icons/setting</title>
14
- <g id="Symbols" stroke="none" strokeWidth={1} fill="none" fillRule="evenodd">
15
- <g id="main-menu/collapsed" transform="translate(-14, -494)">
16
- <g id="Group-4" transform="translate(9, 19)">
17
- <g id="settings" transform="translate(0, 470)">
18
- <g id="icons/setting" transform="translate(6, 6)">
19
- <g
20
- id="Group"
21
- stroke="#63779C"
22
- strokeLinecap="round"
23
- strokeLinejoin="round"
24
- strokeWidth="1.5">
25
- <path
26
- d="M8.13888889,1.46333333 C8.61222222,-0.487777778 11.3877778,-0.487777778 11.8611111,1.46333333 C12.0051589,2.05784356 12.4244819,2.54780471 12.9896128,2.78193979 C13.5547438,3.01607487 14.1977123,2.96622362 14.72,2.64777778 C16.4344444,1.60333333 18.3977778,3.56555556 17.3533333,5.28111111 C17.0353472,5.803171 16.9856162,6.44564563 17.2194755,7.0104213 C17.4533348,7.57519696 17.9426987,7.99444609 18.5366667,8.13888889 C20.4877778,8.61222222 20.4877778,11.3877778 18.5366667,11.8611111 C17.9421564,12.0051589 17.4521953,12.4244819 17.2180602,12.9896128 C16.9839251,13.5547438 17.0337764,14.1977123 17.3522222,14.72 C18.3966667,16.4344444 16.4344444,18.3977778 14.7188889,17.3533333 C14.196829,17.0353472 13.5543544,16.9856162 12.9895787,17.2194755 C12.424803,17.4533348 12.0055539,17.9426987 11.8611111,18.5366667 C11.3877778,20.4877778 8.61222222,20.4877778 8.13888889,18.5366667 C7.99484107,17.9421564 7.57551807,17.4521953 7.01038716,17.2180602 C6.44525624,16.9839251 5.80228769,17.0337764 5.28,17.3522222 C3.56555556,18.3966667 1.60222222,16.4344444 2.64666667,14.7188889 C2.96465281,14.196829 3.01438377,13.5543544 2.78052448,12.9895787 C2.5466652,12.424803 2.05730134,12.0055539 1.46333333,11.8611111 C-0.487777778,11.3877778 -0.487777778,8.61222222 1.46333333,8.13888889 C2.05784356,7.99484107 2.54780471,7.57551807 2.78193979,7.01038716 C3.01607487,6.44525624 2.96622362,5.80228769 2.64777778,5.28 C1.60333333,3.56555556 3.56555556,1.60222222 5.28111111,2.64666667 C6.38777778,3.32222222 7.83222222,2.72444444 8.13888889,1.46333333 Z"
27
- id="Path"
28
- />
29
- <path
30
- d="M13.3333333,10 C13.3333333,11.8409492 11.8409492,13.3333333 10,13.3333333 C8.15905083,13.3333333 6.66666667,11.8409492 6.66666667,10 C6.66666667,8.15905083 8.15905083,6.66666667 10,6.66666667 C11.8409492,6.66666667 13.3333333,8.15905083 13.3333333,10 L13.3333333,10 Z"
31
- id="Path"
32
- />
33
- </g>
34
- <rect
35
- id="Rectangle"
36
- fillOpacity={0}
37
- fill="#000000"
38
- fillRule="nonzero"
39
- x={0}
40
- y={0}
41
- width={20}
42
- height={20}
43
- />
44
- </g>
45
- </g>
46
- </g>
17
+ <title>setting</title>
18
+ <g
19
+ id="Page-1"
20
+ stroke="none"
21
+ strokeWidth={1}
22
+ fill="none"
23
+ fillRule="evenodd"
24
+ strokeLinecap="round"
25
+ strokeLinejoin="round">
26
+ <g id="Group" transform="translate(1, 1)" stroke={stroke}>
27
+ <path
28
+ d="M8.13888889,1.46333333 C8.61222222,-0.487777777 11.3877778,-0.487777777 11.8611111,1.46333333 C12.0051589,2.05784356 12.4244819,2.54780471 12.9896128,2.78193979 C13.5547438,3.01607487 14.1977123,2.96622362 14.72,2.64777778 C16.4344444,1.60333333 18.3977778,3.56555556 17.3533333,5.28111111 C17.0353472,5.803171 16.9856162,6.44564563 17.2194755,7.0104213 C17.4533348,7.57519696 17.9426987,7.99444609 18.5366667,8.13888889 C20.4877778,8.61222222 20.4877778,11.3877778 18.5366667,11.8611111 C17.9421564,12.0051589 17.4521953,12.4244819 17.2180602,12.9896128 C16.9839251,13.5547438 17.0337764,14.1977123 17.3522222,14.72 C18.3966667,16.4344444 16.4344444,18.3977778 14.7188889,17.3533333 C14.196829,17.0353472 13.5543544,16.9856162 12.9895787,17.2194755 C12.424803,17.4533348 12.0055539,17.9426987 11.8611111,18.5366667 C11.3877778,20.4877778 8.61222222,20.4877778 8.13888889,18.5366667 C7.99484107,17.9421564 7.57551807,17.4521953 7.01038716,17.2180602 C6.44525624,16.9839251 5.80228769,17.0337764 5.28,17.3522222 C3.56555556,18.3966667 1.60222222,16.4344444 2.64666667,14.7188889 C2.96465281,14.196829 3.01438377,13.5543544 2.78052448,12.9895787 C2.5466652,12.424803 2.05730134,12.0055539 1.46333333,11.8611111 C-0.487777777,11.3877778 -0.487777777,8.61222222 1.46333333,8.13888889 C2.05784356,7.99484107 2.54780471,7.57551807 2.78193979,7.01038716 C3.01607487,6.44525624 2.96622362,5.80228769 2.64777778,5.28 C1.60333333,3.56555556 3.56555556,1.60222222 5.28111111,2.64666667 C6.38777778,3.32222222 7.83222222,2.72444444 8.13888889,1.46333333 Z"
29
+ id="Path"
30
+ />
31
+ <path
32
+ d="M13.6666666,10.3333333 C13.6666666,12.1742825 12.1742825,13.6666666 10.3333333,13.6666666 C8.49238416,13.6666666 7,12.1742825 7,10.3333333 C7,8.49238416 8.49238416,7 10.3333333,7 C12.1742825,7 13.6666666,8.49238416 13.6666666,10.3333333 L13.6666666,10.3333333 Z"
33
+ id="Path"
34
+ />
47
35
  </g>
48
36
  </g>
49
37
  </svg>