@salesforce/ui-bundle-template-app-react-sample-b2e 11.59.1 → 11.60.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/uiBundles/propertymanagementapp/package.json +4 -4
- package/dist/force-app/main/default/uiBundles/propertymanagementapp/src/features/search/components/filters/DefaultFilterPanel.tsx +7 -1
- package/dist/force-app/main/default/uiBundles/propertymanagementapp/src/features/search/utils/__tests__/filterUtils.test.ts +38 -0
- package/dist/force-app/main/default/uiBundles/propertymanagementapp/src/features/search/utils/filterUtils.ts +12 -3
- package/dist/force-app/main/default/uiBundles/propertymanagementapp/src/lib/searchConfig.ts +3 -3
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/package.json +2 -2
package/dist/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.60.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.59.2...v11.60.0) (2026-08-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [11.59.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.59.1...v11.59.2) (2026-08-15)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [11.59.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.59.0...v11.59.1) (2026-08-14)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@salesforce/platform-sdk": "^11.
|
|
22
|
-
"@salesforce/ui-bundle": "^11.
|
|
21
|
+
"@salesforce/platform-sdk": "^11.60.0",
|
|
22
|
+
"@salesforce/ui-bundle": "^11.60.0",
|
|
23
23
|
"@tailwindcss/vite": "^4.1.17",
|
|
24
24
|
"class-variance-authority": "^0.7.1",
|
|
25
25
|
"clsx": "^2.1.1",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
47
47
|
"@graphql-tools/utils": "^11.0.0",
|
|
48
48
|
"@playwright/test": "^1.49.0",
|
|
49
|
-
"@salesforce/graphiti": "^11.
|
|
50
|
-
"@salesforce/vite-plugin-ui-bundle": "^11.
|
|
49
|
+
"@salesforce/graphiti": "^11.60.0",
|
|
50
|
+
"@salesforce/vite-plugin-ui-bundle": "^11.60.0",
|
|
51
51
|
"@testing-library/jest-dom": "^6.6.3",
|
|
52
52
|
"@testing-library/react": "^16.1.0",
|
|
53
53
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -64,7 +64,13 @@ function DefaultFilterField({ filter, source }: DefaultFilterFieldProps) {
|
|
|
64
64
|
return <PicklistField filter={filter} source={source} multi={true} />;
|
|
65
65
|
case "numeric":
|
|
66
66
|
return (
|
|
67
|
-
<NumericRangeFilter
|
|
67
|
+
<NumericRangeFilter
|
|
68
|
+
field={filter.field}
|
|
69
|
+
label={filter.label}
|
|
70
|
+
helpText={filter.helpText}
|
|
71
|
+
min={filter.min}
|
|
72
|
+
max={filter.max}
|
|
73
|
+
/>
|
|
68
74
|
);
|
|
69
75
|
case "boolean":
|
|
70
76
|
return <BooleanFilter field={filter.field} label={filter.label} helpText={filter.helpText} />;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// W-23860670: negative min must clamp to the configured bound.
|
|
8
|
+
import { describe, it, expect } from "vitest";
|
|
9
|
+
import { buildFilter } from "../filterUtils";
|
|
10
|
+
import type { ActiveFilterValue, FilterFieldConfig } from "../filterUtils";
|
|
11
|
+
|
|
12
|
+
describe("buildFilter numeric bounds", () => {
|
|
13
|
+
it("clamps a negative min to the configured bound, and leaves unbounded fields unchanged", () => {
|
|
14
|
+
const configs: FilterFieldConfig[] = [
|
|
15
|
+
{ field: "Price", label: "Price", type: "numeric", min: 0 },
|
|
16
|
+
{ field: "Quantity", label: "Quantity", type: "numeric" },
|
|
17
|
+
];
|
|
18
|
+
const filters: ActiveFilterValue[] = [
|
|
19
|
+
{ field: "Price", label: "Price", type: "numeric", min: "-500" },
|
|
20
|
+
{ field: "Quantity", label: "Quantity", type: "numeric", min: "-500" },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
expect(buildFilter(filters, configs)).toEqual({
|
|
24
|
+
and: [{ Price: { gte: 0 } }, { Quantity: { gte: -500 } }],
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("clamps the max endpoint into the declared bounds too", () => {
|
|
29
|
+
const configs: FilterFieldConfig[] = [
|
|
30
|
+
{ field: "Price", label: "Price", type: "numeric", min: 0 },
|
|
31
|
+
];
|
|
32
|
+
const filters: ActiveFilterValue[] = [
|
|
33
|
+
{ field: "Price", label: "Price", type: "numeric", max: "-500" },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
expect(buildFilter(filters, configs)).toEqual({ Price: { lte: 0 } });
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -49,6 +49,9 @@ export type FilterFieldConfig<TFieldName extends string = string> = {
|
|
|
49
49
|
/** Date-family only — see {@link DateFilterMode}. Defaults to `"comparison"`. */
|
|
50
50
|
dateMode?: DateFilterMode;
|
|
51
51
|
helpText?: string;
|
|
52
|
+
// Numeric-family only.
|
|
53
|
+
min?: number;
|
|
54
|
+
max?: number;
|
|
52
55
|
};
|
|
53
56
|
|
|
54
57
|
export type ActiveFilterValue<TFieldName extends string = string> = {
|
|
@@ -205,7 +208,7 @@ function toEndOfDay(d: string) {
|
|
|
205
208
|
return `${d}T23:59:59.999Z`;
|
|
206
209
|
}
|
|
207
210
|
|
|
208
|
-
function buildSingleFilter(filter: ActiveFilterValue,
|
|
211
|
+
function buildSingleFilter(filter: ActiveFilterValue, config?: FilterFieldConfig): unknown {
|
|
209
212
|
const { field, type, value, min, max } = filter;
|
|
210
213
|
switch (type) {
|
|
211
214
|
case "text": {
|
|
@@ -219,8 +222,14 @@ function buildSingleFilter(filter: ActiveFilterValue, _config?: FilterFieldConfi
|
|
|
219
222
|
case "numeric": {
|
|
220
223
|
if (!min && !max) return null;
|
|
221
224
|
const ops: Record<string, number> = {};
|
|
222
|
-
|
|
223
|
-
|
|
225
|
+
// clamp both endpoints into the declared [min,max] bounds
|
|
226
|
+
const clamp = (n: number) => {
|
|
227
|
+
if (config?.min != null) n = Math.max(n, config.min);
|
|
228
|
+
if (config?.max != null) n = Math.min(n, config.max);
|
|
229
|
+
return n;
|
|
230
|
+
};
|
|
231
|
+
if (min) ops.gte = clamp(Number(min));
|
|
232
|
+
if (max) ops.lte = clamp(Number(max));
|
|
224
233
|
return { [field]: ops };
|
|
225
234
|
}
|
|
226
235
|
case "boolean": {
|
|
@@ -76,8 +76,8 @@ export const searchConfig: SearchConfig = {
|
|
|
76
76
|
filterBy: [
|
|
77
77
|
{ field: "Status__c", label: "Status", type: "multipicklist" },
|
|
78
78
|
{ field: "Type__c", label: "Type", type: "multipicklist" },
|
|
79
|
-
{ field: "Monthly_Rent__c", label: "Monthly Rent", type: "numeric" },
|
|
80
|
-
{ field: "Bedrooms__c", label: "Bedrooms", type: "numeric" },
|
|
79
|
+
{ field: "Monthly_Rent__c", label: "Monthly Rent", type: "numeric", min: 0 },
|
|
80
|
+
{ field: "Bedrooms__c", label: "Bedrooms", type: "numeric", min: 0 },
|
|
81
81
|
],
|
|
82
82
|
sortBy: [
|
|
83
83
|
{ field: "Name", label: "Name" },
|
|
@@ -145,7 +145,7 @@ export const searchConfig: SearchConfig = {
|
|
|
145
145
|
filterBy: [
|
|
146
146
|
{ field: "Employment_Type__c", label: "Employment Type", type: "multipicklist" },
|
|
147
147
|
{ field: "Location__c", label: "Location", type: "text", placeholder: "Location" },
|
|
148
|
-
{ field: "Hourly_Rate__c", label: "Hourly Rate", type: "numeric" },
|
|
148
|
+
{ field: "Hourly_Rate__c", label: "Hourly Rate", type: "numeric", min: 0 },
|
|
149
149
|
{ field: "CreatedDate", label: "Created Date", type: "datetime" },
|
|
150
150
|
],
|
|
151
151
|
sortBy: [
|
package/dist/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/ui-bundle-template-base-sfdx-project",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.60.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/ui-bundle-template-base-sfdx-project",
|
|
9
|
-
"version": "11.
|
|
9
|
+
"version": "11.60.0",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"fast-xml-parser": "^5.9.3",
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/ui-bundle-template-app-react-sample-b2e",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.60.0",
|
|
4
4
|
"description": "Salesforce sample property rental React app",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"clean": "rm -rf dist"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@salesforce/ui-bundle": "^11.
|
|
19
|
+
"@salesforce/ui-bundle": "^11.60.0",
|
|
20
20
|
"sonner": "^1.7.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|