@salesforce/webapp-template-app-react-sample-b2e-experimental 1.116.13 → 1.117.1
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/webapplications/propertymanagementapp/package.json +3 -3
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/components/layout/FilterRow.tsx +1 -1
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/__examples__/pages/AccountSearch.tsx +15 -6
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/FilterContext.tsx +1 -32
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/filters/BooleanFilter.tsx +9 -5
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/filters/DateFilter.tsx +15 -8
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/filters/DateRangeFilter.tsx +8 -7
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/filters/FilterFieldWrapper.tsx +33 -0
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/filters/MultiSelectFilter.tsx +4 -5
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/filters/NumericRangeFilter.tsx +113 -82
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/filters/SearchFilter.tsx +24 -11
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/filters/SelectFilter.tsx +9 -5
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/components/filters/TextFilter.tsx +29 -12
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/hooks/useDebouncedCallback.ts +34 -0
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/hooks/useObjectSearchParams.ts +5 -86
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/utils/debounce.ts +4 -1
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/features/object-search/utils/filterUtils.ts +24 -1
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/pages/ApplicationSearch.tsx +13 -18
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/pages/MaintenanceRequestSearch.tsx +13 -18
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/pages/MaintenanceWorkerSearch.tsx +11 -18
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/pages/PropertySearch.tsx +6 -15
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/package.json +2 -2
- package/dist/force-app/main/default/webapplications/propertymanagementapp/src/lib/filterUtils.ts +0 -11
|
@@ -15,7 +15,6 @@ import type { SortFieldConfig } from "../features/object-search/utils/sortUtils"
|
|
|
15
15
|
import { PageHeader } from "../components/layout/PageHeader";
|
|
16
16
|
import { PageContainer } from "../components/layout/PageContainer";
|
|
17
17
|
import {
|
|
18
|
-
FilterApplyButton,
|
|
19
18
|
FilterProvider,
|
|
20
19
|
FilterResetButton,
|
|
21
20
|
} from "../features/object-search/components/FilterContext";
|
|
@@ -42,7 +41,6 @@ import type {
|
|
|
42
41
|
Maintenance_Worker__C_OrderBy,
|
|
43
42
|
} from "../api/graphql-operations-types";
|
|
44
43
|
import { PAGINATION_CONFIG } from "../lib/constants";
|
|
45
|
-
import { nonNegativeNumberInputProps } from "../lib/filterUtils";
|
|
46
44
|
|
|
47
45
|
const FILTER_CONFIGS: FilterFieldConfig[] = [
|
|
48
46
|
{
|
|
@@ -55,7 +53,7 @@ const FILTER_CONFIGS: FilterFieldConfig[] = [
|
|
|
55
53
|
{ field: "Employment_Type__c", label: "Employment Type", type: "picklist" },
|
|
56
54
|
{ field: "Location__c", label: "Location", type: "text", placeholder: "Location" },
|
|
57
55
|
{ field: "Hourly_Rate__c", label: "Hourly Rate", type: "numeric" },
|
|
58
|
-
{ field: "CreatedDate", label: "Created Date", type: "
|
|
56
|
+
{ field: "CreatedDate", label: "Created Date", type: "datetime" },
|
|
59
57
|
];
|
|
60
58
|
|
|
61
59
|
const SORT_CONFIGS: SortFieldConfig<string>[] = [
|
|
@@ -74,10 +72,10 @@ export default function MaintenanceWorkerSearch() {
|
|
|
74
72
|
ttl: 30_000,
|
|
75
73
|
});
|
|
76
74
|
|
|
77
|
-
const { filters,
|
|
75
|
+
const { filters, query, pagination, resetAll } = useObjectSearchParams<
|
|
78
76
|
Maintenance_Worker__C_Filter,
|
|
79
77
|
Maintenance_Worker__C_OrderBy
|
|
80
|
-
>(FILTER_CONFIGS, SORT_CONFIGS, PAGINATION_CONFIG
|
|
78
|
+
>(FILTER_CONFIGS, SORT_CONFIGS, PAGINATION_CONFIG);
|
|
81
79
|
|
|
82
80
|
const searchKey = `maintenance-workers:${JSON.stringify({ where: query.where, orderBy: query.orderBy, first: pagination.pageSize, after: pagination.afterCursor })}`;
|
|
83
81
|
const { data, loading, error } = useCachedAsyncData(
|
|
@@ -111,7 +109,6 @@ export default function MaintenanceWorkerSearch() {
|
|
|
111
109
|
<PageHeader title="Maintenance Workers" description="View and filter maintenance workers" />
|
|
112
110
|
<MaintenanceWorkerSearchFilters
|
|
113
111
|
filters={filters}
|
|
114
|
-
filterState={filterState}
|
|
115
112
|
typeOptions={typeOptions ?? []}
|
|
116
113
|
resetAll={resetAll}
|
|
117
114
|
/>
|
|
@@ -166,7 +163,6 @@ export default function MaintenanceWorkerSearch() {
|
|
|
166
163
|
|
|
167
164
|
function MaintenanceWorkerSearchFilters({
|
|
168
165
|
filters,
|
|
169
|
-
filterState,
|
|
170
166
|
typeOptions,
|
|
171
167
|
resetAll,
|
|
172
168
|
}: {
|
|
@@ -174,10 +170,6 @@ function MaintenanceWorkerSearchFilters({
|
|
|
174
170
|
Maintenance_Worker__C_Filter,
|
|
175
171
|
Maintenance_Worker__C_OrderBy
|
|
176
172
|
>["filters"];
|
|
177
|
-
filterState: UseObjectSearchParamsReturn<
|
|
178
|
-
Maintenance_Worker__C_Filter,
|
|
179
|
-
Maintenance_Worker__C_OrderBy
|
|
180
|
-
>["filterState"];
|
|
181
173
|
typeOptions: Array<{ value: string; label: string }>;
|
|
182
174
|
resetAll: () => void;
|
|
183
175
|
}) {
|
|
@@ -187,9 +179,6 @@ function MaintenanceWorkerSearchFilters({
|
|
|
187
179
|
onFilterChange={filters.set}
|
|
188
180
|
onFilterRemove={filters.remove}
|
|
189
181
|
onReset={resetAll}
|
|
190
|
-
onApply={filterState.apply}
|
|
191
|
-
hasPendingChanges={filterState.hasPendingChanges}
|
|
192
|
-
hasValidationError={filterState.hasValidationError}
|
|
193
182
|
>
|
|
194
183
|
<FilterRow ariaLabel="Maintenance Workers filters">
|
|
195
184
|
<SearchFilter
|
|
@@ -213,12 +202,16 @@ function MaintenanceWorkerSearchFilters({
|
|
|
213
202
|
<NumericRangeFilter
|
|
214
203
|
field="Hourly_Rate__c"
|
|
215
204
|
label="Hourly Rate"
|
|
205
|
+
min={0}
|
|
206
|
+
max={1000}
|
|
216
207
|
className="w-full sm:w-50"
|
|
217
|
-
minInputProps={nonNegativeNumberInputProps}
|
|
218
|
-
maxInputProps={nonNegativeNumberInputProps}
|
|
219
208
|
/>
|
|
220
|
-
<DateFilter
|
|
221
|
-
|
|
209
|
+
<DateFilter
|
|
210
|
+
field="CreatedDate"
|
|
211
|
+
label="Created Date"
|
|
212
|
+
filterType="datetime"
|
|
213
|
+
className="w-full sm:w-56"
|
|
214
|
+
/>
|
|
222
215
|
<FilterResetButton />
|
|
223
216
|
</FilterRow>
|
|
224
217
|
</FilterProvider>
|
|
@@ -17,7 +17,6 @@ import type { Property__C_Filter, Property__C_OrderBy } from "../api/graphql-ope
|
|
|
17
17
|
import { PageHeader } from "../components/layout/PageHeader";
|
|
18
18
|
import { PageContainer } from "../components/layout/PageContainer";
|
|
19
19
|
import {
|
|
20
|
-
FilterApplyButton,
|
|
21
20
|
FilterProvider,
|
|
22
21
|
FilterResetButton,
|
|
23
22
|
} from "../features/object-search/components/FilterContext";
|
|
@@ -31,7 +30,6 @@ import { PropertyCard } from "../components/properties/PropertyCard";
|
|
|
31
30
|
import { PropertyDetailsModal } from "../components/properties/PropertyDetailsModal";
|
|
32
31
|
import { Skeleton } from "../components/ui/skeleton";
|
|
33
32
|
import { PAGINATION_CONFIG } from "../lib/constants";
|
|
34
|
-
import { nonNegativeNumberInputProps } from "../lib/filterUtils";
|
|
35
33
|
|
|
36
34
|
const FILTER_CONFIGS: FilterFieldConfig[] = [
|
|
37
35
|
{
|
|
@@ -67,10 +65,10 @@ export default function PropertySearch() {
|
|
|
67
65
|
ttl: 30_000,
|
|
68
66
|
});
|
|
69
67
|
|
|
70
|
-
const { filters,
|
|
68
|
+
const { filters, query, pagination, resetAll } = useObjectSearchParams<
|
|
71
69
|
Property__C_Filter,
|
|
72
70
|
Property__C_OrderBy
|
|
73
|
-
>(FILTER_CONFIGS, PROPERTY_SORT_CONFIGS, PAGINATION_CONFIG
|
|
71
|
+
>(FILTER_CONFIGS, PROPERTY_SORT_CONFIGS, PAGINATION_CONFIG);
|
|
74
72
|
|
|
75
73
|
const searchKey = `properties:${JSON.stringify({ where: query.where, orderBy: query.orderBy, first: pagination.pageSize, after: pagination.afterCursor })}`;
|
|
76
74
|
const { data, loading, error } = useCachedAsyncData(
|
|
@@ -104,7 +102,6 @@ export default function PropertySearch() {
|
|
|
104
102
|
<PageHeader title="Properties" description="Browse and manage available properties" />
|
|
105
103
|
<PropertySearchFilters
|
|
106
104
|
filters={filters}
|
|
107
|
-
filterState={filterState}
|
|
108
105
|
statusOptions={statusOptions ?? []}
|
|
109
106
|
typeOptions={typeOptions ?? []}
|
|
110
107
|
resetAll={resetAll}
|
|
@@ -151,13 +148,11 @@ export default function PropertySearch() {
|
|
|
151
148
|
|
|
152
149
|
function PropertySearchFilters({
|
|
153
150
|
filters,
|
|
154
|
-
filterState,
|
|
155
151
|
statusOptions,
|
|
156
152
|
typeOptions,
|
|
157
153
|
resetAll,
|
|
158
154
|
}: {
|
|
159
155
|
filters: UseObjectSearchParamsReturn<Property__C_Filter, Property__C_OrderBy>["filters"];
|
|
160
|
-
filterState: UseObjectSearchParamsReturn<Property__C_Filter, Property__C_OrderBy>["filterState"];
|
|
161
156
|
statusOptions: Array<{ value: string; label: string }>;
|
|
162
157
|
typeOptions: Array<{ value: string; label: string }>;
|
|
163
158
|
resetAll: () => void;
|
|
@@ -168,9 +163,6 @@ function PropertySearchFilters({
|
|
|
168
163
|
onFilterChange={filters.set}
|
|
169
164
|
onFilterRemove={filters.remove}
|
|
170
165
|
onReset={resetAll}
|
|
171
|
-
onApply={filterState.apply}
|
|
172
|
-
hasPendingChanges={filterState.hasPendingChanges}
|
|
173
|
-
hasValidationError={filterState.hasValidationError}
|
|
174
166
|
>
|
|
175
167
|
<FilterRow ariaLabel="Properties filters">
|
|
176
168
|
<SearchFilter
|
|
@@ -194,18 +186,17 @@ function PropertySearchFilters({
|
|
|
194
186
|
<NumericRangeFilter
|
|
195
187
|
field="Monthly_Rent__c"
|
|
196
188
|
label="Monthly Rent"
|
|
189
|
+
min={0}
|
|
190
|
+
max={100_000}
|
|
197
191
|
className="w-full sm:w-50"
|
|
198
|
-
minInputProps={nonNegativeNumberInputProps}
|
|
199
|
-
maxInputProps={nonNegativeNumberInputProps}
|
|
200
192
|
/>
|
|
201
193
|
<NumericRangeFilter
|
|
202
194
|
field="Bedrooms__c"
|
|
203
195
|
label="Bedrooms"
|
|
196
|
+
min={0}
|
|
197
|
+
max={20}
|
|
204
198
|
className="w-full sm:w-50"
|
|
205
|
-
minInputProps={nonNegativeNumberInputProps}
|
|
206
|
-
maxInputProps={nonNegativeNumberInputProps}
|
|
207
199
|
/>
|
|
208
|
-
<FilterApplyButton className="h-8 px-3 rounded-lg bg-purple-600 text-white text-sm font-medium hover:bg-purple-700 disabled:bg-purple-300 disabled:cursor-not-allowed transition-colors" />
|
|
209
200
|
<FilterResetButton />
|
|
210
201
|
</FilterRow>
|
|
211
202
|
</FilterProvider>
|
package/dist/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/webapp-template-base-sfdx-project-experimental",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.117.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/webapp-template-base-sfdx-project-experimental",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.117.1",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@lwc/eslint-plugin-lwc": "^3.3.0",
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/webapp-template-app-react-sample-b2e-experimental",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.117.1",
|
|
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/webapp-experimental": "^1.
|
|
19
|
+
"@salesforce/webapp-experimental": "^1.117.1",
|
|
20
20
|
"sonner": "^1.7.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
package/dist/force-app/main/default/webapplications/propertymanagementapp/src/lib/filterUtils.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
|
|
3
|
-
export const nonNegativeNumberInputProps: ComponentProps<"input"> = {
|
|
4
|
-
min: 0,
|
|
5
|
-
onKeyDown: (event) => {
|
|
6
|
-
if (event.key === "-" || event.key === "Minus") event.preventDefault();
|
|
7
|
-
},
|
|
8
|
-
onPaste: (event) => {
|
|
9
|
-
if (event.clipboardData.getData("text").includes("-")) event.preventDefault();
|
|
10
|
-
},
|
|
11
|
-
};
|