@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.
- package/CHANGELOG.md +62 -1
- package/lib/components/EntityDataListing/EntityDataListing.js +1 -2
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js +1 -2
- package/lib/components/EntityDataListing/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +1 -2
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +1 -2
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +21 -11
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +1 -2
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +1 -2
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js +1 -2
- package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +1 -2
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +10 -3
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +3 -4
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +1 -2
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js +1 -2
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +3 -4
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js +1 -2
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/RecordEditContext/index.js +13 -0
- package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -0
- package/lib/components/EntityManager/utils/data-mappers.js +4 -8
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +1 -2
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js +1 -2
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js +1 -2
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxes.js +1 -2
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +18 -4
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useData.js +5 -4
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +1 -2
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/index.js +1 -2
- package/lib/components/InfoBoxes/index.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +1 -2
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +5 -15
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +1 -2
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js +1 -2
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/TableActions/TableActions.js +1 -2
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js +1 -2
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js +1 -2
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +3 -6
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +1 -2
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +3 -4
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/constants.js +26 -52
- package/lib/constants.js.map +1 -1
- package/lib/icons/ContentIcon.js +48 -48
- package/lib/icons/ContentIcon.js.map +1 -1
- package/lib/icons/SettingsIcon.js +14 -34
- package/lib/icons/SettingsIcon.js.map +1 -1
- package/lib/icons/TaxonomyIcon.js +34 -54
- package/lib/icons/TaxonomyIcon.js.map +1 -1
- package/lib/icons/UsersIcon.js +14 -35
- package/lib/icons/UsersIcon.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +1 -2
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js +1 -2
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js +1 -2
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js +1 -2
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js +1 -2
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js +1 -2
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js +1 -2
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js +1 -2
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js +1 -2
- package/lib/utils/hooks/useToggle.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +11 -3
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +10 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib-es/components/EntityManager/utils/RecordEditContext/index.js +6 -0
- package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +1 -0
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +10 -2
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib-es/components/InfoBoxes/hooks/useData.js +4 -2
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTable.js +2 -8
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/icons/ContentIcon.js +45 -45
- package/lib-es/icons/ContentIcon.js.map +1 -1
- package/lib-es/icons/SettingsIcon.js +13 -33
- package/lib-es/icons/SettingsIcon.js.map +1 -1
- package/lib-es/icons/TaxonomyIcon.js +33 -53
- package/lib-es/icons/TaxonomyIcon.js.map +1 -1
- package/lib-es/icons/UsersIcon.js +13 -34
- package/lib-es/icons/UsersIcon.js.map +1 -1
- package/package.json +11 -11
- package/src/components/EntityManager/Entity/Entity.js +86 -75
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +12 -1
- package/src/components/EntityManager/utils/RecordEditContext/index.js +7 -0
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +12 -2
- package/src/components/InfoBoxes/hooks/useData.js +5 -2
- package/src/components/ListingTable/ListingTable.js +11 -16
- package/src/icons/ContentIcon.js +68 -57
- package/src/icons/SettingsIcon.js +24 -36
- package/src/icons/TaxonomyIcon.js +46 -58
- 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
|
-
<
|
|
408
|
-
<
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
<div className="
|
|
426
|
-
<
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
<div className="page__content">
|
|
444
|
-
<div className="
|
|
445
|
-
<
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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
|
-
</
|
|
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
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
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
|
-
</
|
|
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 {
|
|
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, {
|
|
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
|
|
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
|
-
{
|
|
202
|
-
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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}
|
package/src/icons/ContentIcon.js
CHANGED
|
@@ -1,68 +1,79 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ICON_COLOR } from '../constants';
|
|
3
3
|
|
|
4
|
-
function ContentIcon({
|
|
4
|
+
function ContentIcon({ fill = ICON_COLOR.FILL, stroke = ICON_COLOR.STROKE }) {
|
|
5
5
|
return (
|
|
6
6
|
<svg
|
|
7
|
-
width=
|
|
8
|
-
height=
|
|
9
|
-
viewBox="0 0
|
|
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>
|
|
14
|
-
<g id="
|
|
15
|
-
<g id="
|
|
16
|
-
<g id="Group
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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({
|
|
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>
|
|
14
|
-
<g
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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>
|