@salesforce/webapp-template-app-react-sample-b2x-experimental 1.76.0 → 1.77.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/dist/CHANGELOG.md +16 -0
- package/dist/force-app/main/default/objects/Maintenance_Request__c/Maintenance_Request__c.object-meta.xml +0 -4
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/package.json +3 -3
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/api/objectDetailService.ts +3 -26
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/api/objectInfoGraphQLService.ts +108 -165
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/api/objectInfoService.ts +9 -113
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/UiApiDetailForm.tsx +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/hooks/useObjectInfoBatch.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/hooks/useObjectSearchData.ts +7 -228
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/hooks/useRecordDetailLayout.ts +1 -20
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/types/filters/picklist.ts +5 -31
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/types/objectInfo/objectInfo.ts +46 -163
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/types/schema.d.ts +200 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/apiUtils.ts +3 -69
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/graphQLObjectInfoAdapter.ts +37 -279
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/recordUtils.ts +4 -4
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/index.ts +120 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -49,13 +49,13 @@ const getFetchableFieldsFromLayoutItem = function (
|
|
|
49
49
|
|
|
50
50
|
// add field: fieldType
|
|
51
51
|
const fieldMetadata = metadata.fields[comp.apiName];
|
|
52
|
-
fields[comp.apiName] = fieldMetadata
|
|
52
|
+
fields[comp.apiName] = fieldMetadata?.dataType ?? "";
|
|
53
53
|
|
|
54
54
|
// add relatedField if one exists (Id field -> add relationship name so we request Owner.Name)
|
|
55
55
|
if (comp.apiName in metadata.fields) {
|
|
56
56
|
const relationshipName = fieldMetadata?.relationshipName;
|
|
57
57
|
if (relationshipName) {
|
|
58
|
-
fields[relationshipName] = fieldMetadata.dataType;
|
|
58
|
+
fields[relationshipName] = fieldMetadata.dataType ?? "";
|
|
59
59
|
|
|
60
60
|
relationFieldMap[comp.apiName] = relationshipName;
|
|
61
61
|
}
|
|
@@ -65,7 +65,7 @@ const getFetchableFieldsFromLayoutItem = function (
|
|
|
65
65
|
const idField = findIdFieldForRelationship(metadata, comp.apiName);
|
|
66
66
|
if (idField) {
|
|
67
67
|
const idMeta = metadata.fields[idField];
|
|
68
|
-
fields[idField] = idMeta
|
|
68
|
+
fields[idField] = idMeta?.dataType ?? "";
|
|
69
69
|
relationFieldMap[idField] = comp.apiName;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -137,7 +137,7 @@ export const calculateFieldsToFetch = function (
|
|
|
137
137
|
const fields = getFetchableFieldsFromLayout(metadata, layout, relationFieldMap);
|
|
138
138
|
let fieldsToFetch = Object.keys(fields);
|
|
139
139
|
if (shouldPrefixedWithEntityName) {
|
|
140
|
-
fieldsToFetch = fieldsToFetch.map((field) => `${metadata.
|
|
140
|
+
fieldsToFetch = fieldsToFetch.map((field) => `${metadata.ApiName}.${field}`);
|
|
141
141
|
}
|
|
142
142
|
// populate field types for o11y logging
|
|
143
143
|
const fieldTypes = Object.values(fields).filter((fieldType) => fieldType !== "");
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API for the Global Search feature package.
|
|
3
|
+
*
|
|
4
|
+
* Design goals:
|
|
5
|
+
* - Export **API services, hooks, types, schemas, and utilities** that customers can import from node_modules.
|
|
6
|
+
* - Do **not** export UI components or feature constants (customers build their own UI).
|
|
7
|
+
*
|
|
8
|
+
* Source implementation lives under `src/features/global-search/**`.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// API layer
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
export { objectInfoService } from "./features/global-search/api/objectInfoService";
|
|
16
|
+
export {
|
|
17
|
+
objectDetailService,
|
|
18
|
+
extractFieldsFromLayout,
|
|
19
|
+
} from "./features/global-search/api/objectDetailService";
|
|
20
|
+
export type { RecordDetailResult } from "./features/global-search/api/objectDetailService";
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
getRecordsGraphQL,
|
|
24
|
+
getRecordByIdGraphQL,
|
|
25
|
+
buildGetRecordsQuery,
|
|
26
|
+
buildWhereFromCriteria,
|
|
27
|
+
buildOrderByFromSort,
|
|
28
|
+
} from "./features/global-search/api/recordListGraphQLService";
|
|
29
|
+
export type {
|
|
30
|
+
RecordListGraphQLResult,
|
|
31
|
+
RecordListGraphQLVariables,
|
|
32
|
+
RecordListGraphQLOptions,
|
|
33
|
+
GraphQLRecordNode,
|
|
34
|
+
} from "./features/global-search/api/recordListGraphQLService";
|
|
35
|
+
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
// Hooks
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
export { useObjectInfoBatch } from "./features/global-search/hooks/useObjectInfoBatch";
|
|
41
|
+
export {
|
|
42
|
+
useObjectListMetadata,
|
|
43
|
+
useObjectColumns,
|
|
44
|
+
useObjectFilters,
|
|
45
|
+
} from "./features/global-search/hooks/useObjectSearchData";
|
|
46
|
+
export { useRecordListGraphQL } from "./features/global-search/hooks/useRecordListGraphQL";
|
|
47
|
+
export { useRecordDetailLayout } from "./features/global-search/hooks/useRecordDetailLayout";
|
|
48
|
+
|
|
49
|
+
export type { ObjectListMetadata } from "./features/global-search/hooks/useObjectSearchData";
|
|
50
|
+
|
|
51
|
+
export type {
|
|
52
|
+
UseRecordListGraphQLOptions,
|
|
53
|
+
UseRecordListGraphQLReturn,
|
|
54
|
+
} from "./features/global-search/hooks/useRecordListGraphQL";
|
|
55
|
+
|
|
56
|
+
export type {
|
|
57
|
+
UseRecordDetailLayoutParams,
|
|
58
|
+
UseRecordDetailLayoutReturn,
|
|
59
|
+
} from "./features/global-search/hooks/useRecordDetailLayout";
|
|
60
|
+
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Types + Zod schemas (runtime validation)
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
ColumnArraySchema,
|
|
67
|
+
SearchResultRecordArraySchema,
|
|
68
|
+
KeywordSearchResultSchema,
|
|
69
|
+
SearchResultsResponseSchema,
|
|
70
|
+
} from "./features/global-search/types/search/searchResults";
|
|
71
|
+
export type {
|
|
72
|
+
Column,
|
|
73
|
+
SearchResultRecord,
|
|
74
|
+
KeywordSearchResult,
|
|
75
|
+
SearchResultsResponse,
|
|
76
|
+
} from "./features/global-search/types/search/searchResults";
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
FilterArraySchema,
|
|
80
|
+
FilterCriteriaArraySchema,
|
|
81
|
+
FILTER_OPERATORS,
|
|
82
|
+
} from "./features/global-search/types/filters/filters";
|
|
83
|
+
export type {
|
|
84
|
+
Filter,
|
|
85
|
+
FilterCriteria,
|
|
86
|
+
FilterOperator,
|
|
87
|
+
FiltersResponse,
|
|
88
|
+
} from "./features/global-search/types/filters/filters";
|
|
89
|
+
|
|
90
|
+
export type { PicklistValue } from "./features/global-search/types/filters/picklist";
|
|
91
|
+
|
|
92
|
+
export type {
|
|
93
|
+
ObjectInfoBatchResponse,
|
|
94
|
+
ObjectInfoResult,
|
|
95
|
+
} from "./features/global-search/types/objectInfo/objectInfo";
|
|
96
|
+
|
|
97
|
+
export { LayoutResponseSchema } from "./features/global-search/types/recordDetail/recordDetail";
|
|
98
|
+
export type { LayoutResponse } from "./features/global-search/types/recordDetail/recordDetail";
|
|
99
|
+
|
|
100
|
+
// ---------------------------------------------------------------------------
|
|
101
|
+
// Utilities
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
|
|
104
|
+
export { fetchAndValidate, safeEncodePath } from "./features/global-search/utils/apiUtils";
|
|
105
|
+
export { debounce } from "./features/global-search/utils/debounce";
|
|
106
|
+
export { createFiltersKey } from "./features/global-search/utils/cacheUtils";
|
|
107
|
+
export {
|
|
108
|
+
calculateFieldsToFetch,
|
|
109
|
+
getSafeKey,
|
|
110
|
+
isValidSalesforceId,
|
|
111
|
+
} from "./features/global-search/utils/recordUtils";
|
|
112
|
+
export { parseFilterValue } from "./features/global-search/utils/filterUtils";
|
|
113
|
+
export { sanitizeFilterValue } from "./features/global-search/utils/sanitizationUtils";
|
|
114
|
+
export {
|
|
115
|
+
getGraphQLNodeValue,
|
|
116
|
+
getDisplayValueForDetailFieldFromNode,
|
|
117
|
+
getDisplayValueForLayoutItemFromNode,
|
|
118
|
+
getGraphQLRecordDisplayName,
|
|
119
|
+
} from "./features/global-search/utils/graphQLNodeFieldUtils";
|
|
120
|
+
export { graphQLNodeToSearchResultRecordData } from "./features/global-search/utils/graphQLRecordAdapter";
|
package/dist/package.json
CHANGED
package/package.json
CHANGED