@blaze-cms/plugin-data-ui 0.133.0-admin-updates.0 → 0.133.0-project-admin-customisations.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 +27 -1
- package/README.md +42 -0
- package/lib/components/EntityDataListing/EntityDataListing.js +3 -24
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +39 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +12 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -0
- package/lib/components/EntityManager/Entity/Entity.js +16 -3
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +44 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +32 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +45 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +12 -2
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +38 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -0
- package/lib/components/InfoBoxes/InfoBoxes.js +36 -0
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -0
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +44 -0
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -0
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +25 -0
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -0
- package/lib/components/InfoBoxes/hooks/useData.js +42 -0
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -0
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +26 -0
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -0
- package/lib/components/InfoBoxes/index.js +12 -0
- package/lib/components/InfoBoxes/index.js.map +1 -0
- package/lib/components/InfoBoxes/presentational/InfoBox.js +46 -0
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -0
- package/lib/components/ListingTable/ListingTable.js +113 -80
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +8 -20
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +92 -26
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +73 -11
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/index.js +3 -11
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +64 -13
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-listing-query.js +11 -2
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/get-default-query-params.js +3 -4
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib-es/components/EntityDataListing/EntityDataListing.js +3 -14
- package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +30 -0
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js +3 -0
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/Entity.js +16 -3
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +30 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +26 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +39 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +12 -2
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +24 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -0
- package/lib-es/components/InfoBoxes/InfoBoxes.js +28 -0
- package/lib-es/components/InfoBoxes/InfoBoxes.js.map +1 -0
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +30 -0
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -0
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +25 -0
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -0
- package/lib-es/components/InfoBoxes/hooks/useData.js +37 -0
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -0
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +19 -0
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +1 -0
- package/lib-es/components/InfoBoxes/index.js +3 -0
- package/lib-es/components/InfoBoxes/index.js.map +1 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js +31 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -0
- package/lib-es/components/ListingTable/ListingTable.js +46 -49
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +11 -19
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js +76 -24
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js +65 -7
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/index.js +1 -9
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js +49 -5
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-listing-query.js +10 -1
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/get-default-query-params.js +1 -3
- package/lib-es/utils/get-default-query-params.js.map +1 -1
- package/package.json +10 -9
- package/src/components/EntityDataListing/EntityDataListing.js +3 -12
- package/src/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +26 -0
- package/src/components/EntityManager/Entity/EntitiyNavLinks/index.js +3 -0
- package/src/components/EntityManager/Entity/Entity.js +10 -1
- package/src/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +22 -0
- package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +33 -0
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +28 -0
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +34 -16
- package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +33 -0
- package/src/components/InfoBoxes/InfoBoxes.js +24 -0
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +22 -0
- package/src/components/InfoBoxes/helpers/build-dynamic-query.js +25 -0
- package/src/components/InfoBoxes/hooks/useData.js +20 -0
- package/src/components/InfoBoxes/hooks/useInfoBox.js +13 -0
- package/src/components/InfoBoxes/index.js +3 -0
- package/src/components/InfoBoxes/presentational/InfoBox.js +34 -0
- package/src/components/ListingTable/ListingTable.js +57 -38
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +8 -22
- package/src/components/ListingTable/mappers/populate-rows.js +83 -18
- package/src/components/ListingTable/service/index.js +42 -5
- package/src/index.js +1 -8
- package/src/utils/add-content-menu-items.js +45 -3
- package/src/utils/build-listing-query.js +11 -1
- package/src/utils/get-default-query-params.js +1 -1
|
@@ -3,18 +3,22 @@ import { Link } from 'react-router-dom';
|
|
|
3
3
|
import TableActions from '../TableActions';
|
|
4
4
|
import { ACTIONS } from '../../../constants';
|
|
5
5
|
|
|
6
|
-
const formatRows = ({ rows, url, toggleModal, label, firstColumn = 'name' }) =>
|
|
6
|
+
const formatRows = ({ rows, url, toggleModal, label, firstColumn = 'name', isEnquiry }) =>
|
|
7
7
|
rows.map(data => {
|
|
8
8
|
const editUrl = `${url}/update/${data.id}`;
|
|
9
|
-
|
|
9
|
+
const rowProps = {
|
|
10
10
|
...data,
|
|
11
11
|
[firstColumn]: (
|
|
12
12
|
<Link to={editUrl} role="button">
|
|
13
13
|
{data[firstColumn]}
|
|
14
14
|
</Link>
|
|
15
|
-
)
|
|
16
|
-
actions: <TableActions editUrl={editUrl} data={data} showDeleteModal={toggleModal} />
|
|
15
|
+
)
|
|
17
16
|
};
|
|
17
|
+
if (!isEnquiry)
|
|
18
|
+
rowProps.actions = (
|
|
19
|
+
<TableActions editUrl={editUrl} data={data} showDeleteModal={toggleModal} />
|
|
20
|
+
);
|
|
21
|
+
return rowProps;
|
|
18
22
|
});
|
|
19
23
|
|
|
20
24
|
const getSanitizedColumnLabel = columnProp => {
|
|
@@ -28,22 +32,82 @@ const getSanitizedColumnLabel = columnProp => {
|
|
|
28
32
|
return sanitizedChar;
|
|
29
33
|
};
|
|
30
34
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const buildArrayRowContent = rowData => (
|
|
36
|
+
<div className="table-row-list">
|
|
37
|
+
{rowData.map(rowGroup => (
|
|
38
|
+
<div className="table-row-list__group">
|
|
39
|
+
{rowGroup.map(({ label, value, url }) => (
|
|
40
|
+
<div className="table-row-list__group__item">
|
|
41
|
+
<span className="table-row-list__group__item__label"> {label}:</span>
|
|
42
|
+
{url ? (
|
|
43
|
+
<Link to={url} role="button" className="table-row-list__group__item__value">
|
|
44
|
+
{value}
|
|
45
|
+
</Link>
|
|
46
|
+
) : (
|
|
47
|
+
<span className="table-row-list__group__item__value"> {value}</span>
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
50
|
+
))}
|
|
51
|
+
</div>
|
|
52
|
+
))}
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const buildArrayRowData = rowData => {
|
|
57
|
+
const dataGroups = [];
|
|
58
|
+
const groups = Math.ceil(rowData.length / 3) || 1;
|
|
59
|
+
for (let index = 0; index < groups; index += 1) {
|
|
60
|
+
const currentStart = index * groups;
|
|
61
|
+
dataGroups[index] = rowData.slice(currentStart, currentStart + 3);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return buildArrayRowContent(dataGroups);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const getParsedRowData = rows =>
|
|
68
|
+
rows.map(rowData =>
|
|
69
|
+
Object.keys(rowData).reduce((acc, key) => {
|
|
70
|
+
const parsedData = Array.isArray(rowData[key])
|
|
71
|
+
? buildArrayRowData(rowData[key])
|
|
72
|
+
: rowData[key];
|
|
73
|
+
return { ...acc, [key]: parsedData };
|
|
74
|
+
}, {})
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const getColumnsAndLabels = (listingProperties, allProperties, rows) => {
|
|
78
|
+
const columns = [];
|
|
79
|
+
const labels = {};
|
|
80
|
+
|
|
81
|
+
listingProperties.forEach(listingProperty => {
|
|
82
|
+
const propKey = listingProperty.includes(' ') ? listingProperty.split(' ')[0] : listingProperty;
|
|
83
|
+
const { label } = allProperties[propKey] || {};
|
|
84
|
+
columns.push(propKey);
|
|
85
|
+
labels[propKey] = label || getSanitizedColumnLabel(propKey);
|
|
86
|
+
});
|
|
87
|
+
const parsedRowData = getParsedRowData(rows);
|
|
88
|
+
|
|
89
|
+
return { columns, labels, parsedRowData };
|
|
37
90
|
};
|
|
38
91
|
|
|
39
92
|
const populateRows = ({ toggleModal, url, entitySchema, rows }) => {
|
|
40
|
-
const {
|
|
41
|
-
|
|
93
|
+
const {
|
|
94
|
+
id: schemaId,
|
|
95
|
+
listingProperties,
|
|
96
|
+
properties,
|
|
97
|
+
dynamicProperties = {},
|
|
98
|
+
formProperties
|
|
99
|
+
} = entitySchema;
|
|
100
|
+
|
|
101
|
+
const isEnquiry = schemaId === 'enquiry';
|
|
102
|
+
const columnOptions = !isEnquiry ? [...listingProperties, ACTIONS] : [...listingProperties];
|
|
103
|
+
|
|
104
|
+
const allProperties = { ...properties, ...dynamicProperties };
|
|
105
|
+
const { columns, labels, parsedRowData } = getColumnsAndLabels(
|
|
106
|
+
columnOptions,
|
|
107
|
+
allProperties,
|
|
108
|
+
rows
|
|
109
|
+
);
|
|
42
110
|
const [firstColumn] = columns;
|
|
43
|
-
const labels = {
|
|
44
|
-
...getColumnLabels(listingProperties, properties, dynamicProperties),
|
|
45
|
-
[ACTIONS]: ACTIONS
|
|
46
|
-
};
|
|
47
111
|
|
|
48
112
|
return {
|
|
49
113
|
identification: 'id',
|
|
@@ -51,8 +115,9 @@ const populateRows = ({ toggleModal, url, entitySchema, rows }) => {
|
|
|
51
115
|
columns,
|
|
52
116
|
labels,
|
|
53
117
|
orderBy: [...formProperties],
|
|
54
|
-
rows: formatRows({ firstColumn, rows, url, toggleModal })
|
|
118
|
+
rows: formatRows({ firstColumn, rows: parsedRowData, url, toggleModal, isEnquiry }),
|
|
119
|
+
isEnquiry
|
|
55
120
|
};
|
|
56
121
|
};
|
|
57
122
|
|
|
58
|
-
export { populateRows, formatRows };
|
|
123
|
+
export { populateRows, formatRows, getParsedRowData };
|
|
@@ -1,12 +1,49 @@
|
|
|
1
1
|
import buildListingQuery from '../../../utils/build-listing-query';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const
|
|
3
|
+
function buildVariables({ entitySchema, isSearchQuery, listFilters = [], queryParams = {} }) {
|
|
4
|
+
const { identifier } = entitySchema;
|
|
5
|
+
const { sort, offset, limit, where } = queryParams;
|
|
6
|
+
const [{ property, direction }] = sort;
|
|
7
|
+
const parsedOffset = `${property}:${direction}`;
|
|
8
|
+
|
|
9
|
+
if (!isSearchQuery)
|
|
10
|
+
return {
|
|
11
|
+
...queryParams,
|
|
12
|
+
where: !Array.isArray(listFilters) ? listFilters : where
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const rawQuery = {
|
|
16
|
+
bool: {
|
|
17
|
+
must: listFilters || [],
|
|
18
|
+
filter: [
|
|
19
|
+
{
|
|
20
|
+
term: {
|
|
21
|
+
entityIdentifier: identifier
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
limit,
|
|
30
|
+
offset,
|
|
31
|
+
sort: parsedOffset,
|
|
32
|
+
where: JSON.stringify(rawQuery)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const fetchData = async ({ client, querySettings: { entitySchema, queryParams }, listFilters }) => {
|
|
5
37
|
const {
|
|
6
|
-
|
|
7
|
-
} =
|
|
38
|
+
displayProperties: { adminListings: { dataSource: { source } = {} } = {} } = {}
|
|
39
|
+
} = entitySchema;
|
|
40
|
+
|
|
41
|
+
const isSearchQuery = source === 'search';
|
|
42
|
+
const query = buildListingQuery(entitySchema, isSearchQuery);
|
|
43
|
+
const variables = buildVariables({ entitySchema, listFilters, queryParams, isSearchQuery });
|
|
44
|
+
const { data = {} } = await client.query({ query, variables, fetchPolicy: 'network-only' });
|
|
8
45
|
|
|
9
|
-
return listingData;
|
|
46
|
+
return data.searchResults ? data.searchResults.results : data.listingData;
|
|
10
47
|
};
|
|
11
48
|
|
|
12
49
|
export { fetchData };
|
package/src/index.js
CHANGED
|
@@ -12,14 +12,7 @@ const EntityManager = React.lazy(() =>
|
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
export default async function load(app) {
|
|
15
|
-
|
|
16
|
-
const sectionKey = 'content';
|
|
17
|
-
|
|
18
|
-
app.events.once('load:menu-section', addSection => {
|
|
19
|
-
addSection(sectionKey, { header: 'content', order: 100 });
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
app.events.once('load:menu-items', getAddContentMenuItems(app, sectionKey));
|
|
15
|
+
app.events.once('admin:menu:config:load', getAddContentMenuItems(app));
|
|
23
16
|
|
|
24
17
|
app.events.once('load:custom:field:type', addFieldType => {
|
|
25
18
|
Object.keys(formFieldTypes).forEach(type => {
|
|
@@ -2,8 +2,8 @@ import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
|
2
2
|
|
|
3
3
|
const { MENU_PERMISSIONS } = require('../constants');
|
|
4
4
|
|
|
5
|
-
function getAddContentMenuItems(app
|
|
6
|
-
return async
|
|
5
|
+
function getAddContentMenuItems(app) {
|
|
6
|
+
return async ({ addConfig }) => {
|
|
7
7
|
const client = app.getClient();
|
|
8
8
|
const {
|
|
9
9
|
data: { getEntitySchemas }
|
|
@@ -14,9 +14,51 @@ function getAddContentMenuItems(app, sectionKey) {
|
|
|
14
14
|
canDoActions: MENU_PERMISSIONS
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
+
|
|
18
|
+
if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section
|
|
19
|
+
|
|
20
|
+
const menuItems = {};
|
|
21
|
+
const sectionMenuItems = { content: {} };
|
|
22
|
+
|
|
23
|
+
getEntitySchemas.forEach(({ id, displayName, displayProperties }) => {
|
|
24
|
+
if (!displayProperties) return null;
|
|
25
|
+
|
|
26
|
+
const { adminMenu: { sectionKey = 'content' } = {} } = displayProperties;
|
|
27
|
+
const sectionItems = sectionMenuItems[sectionKey] || {};
|
|
28
|
+
sectionItems[id] = {
|
|
29
|
+
label: displayName,
|
|
30
|
+
uri: `/data-listing/${id}`
|
|
31
|
+
};
|
|
32
|
+
sectionMenuItems[sectionKey] = sectionItems;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const menuConfig = {
|
|
36
|
+
main: {
|
|
37
|
+
items: {
|
|
38
|
+
content: {
|
|
39
|
+
label: 'Content',
|
|
40
|
+
loadOpen: true,
|
|
41
|
+
order: 10,
|
|
42
|
+
items: menuItems
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {
|
|
49
|
+
const sectionConfig = menuConfig.main.items[sectionKey] || {};
|
|
50
|
+
sectionConfig.items = sectionItems;
|
|
51
|
+
menuConfig.main.items[sectionKey] = sectionConfig;
|
|
52
|
+
});
|
|
53
|
+
|
|
17
54
|
getEntitySchemas.forEach(({ id, displayName }) => {
|
|
18
|
-
|
|
55
|
+
menuItems[id] = {
|
|
56
|
+
label: displayName,
|
|
57
|
+
uri: `/data-listing/${id}`
|
|
58
|
+
};
|
|
19
59
|
});
|
|
60
|
+
|
|
61
|
+
addConfig(menuConfig);
|
|
20
62
|
};
|
|
21
63
|
}
|
|
22
64
|
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { gql } from '@apollo/client';
|
|
2
2
|
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
+
import { getDynamicQuery } from '@blaze-cms/admin-ui-utils';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
const buildAdminSearchQuery = entitySchema => {
|
|
6
|
+
const { listingProperties = [] } = entitySchema || {};
|
|
7
|
+
const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;
|
|
8
|
+
|
|
9
|
+
return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function buildListingQuery(entitySchema, isSearchQuery) {
|
|
5
13
|
if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {
|
|
6
14
|
throw new BlazeError(
|
|
7
15
|
'Listing query requires getAll action and listingProperties from entity schema'
|
|
8
16
|
);
|
|
9
17
|
}
|
|
10
18
|
|
|
19
|
+
if (isSearchQuery) return buildAdminSearchQuery(entitySchema);
|
|
20
|
+
|
|
11
21
|
const sortType =
|
|
12
22
|
entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
|
|
13
23
|
|