@salesforce/webapp-template-app-react-sample-b2e-experimental 1.80.1 → 1.82.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/classes/MaintenanceRequestTriggerHandler.cls +66 -0
- package/dist/force-app/main/default/classes/MaintenanceRequestTriggerHandler.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/MaintenanceRequestTriggerHandler_Test.cls +308 -0
- package/dist/force-app/main/default/classes/MaintenanceRequestTriggerHandler_Test.cls-meta.xml +5 -0
- package/dist/force-app/main/default/objects/Application__c/fields/Status__c.field-meta.xml +5 -0
- package/dist/force-app/main/default/objects/Maintenance_Request__c/fields/Assigned_Worker__c.field-meta.xml +15 -0
- package/dist/force-app/main/default/permissionsets/Property_Management_Access.permissionset-meta.xml +5 -52
- package/dist/force-app/main/default/triggers/MaintenanceRequestTrigger.trigger +5 -0
- package/dist/force-app/main/default/triggers/MaintenanceRequestTrigger.trigger-meta.xml +5 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/package.json +4 -4
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/api/applications.ts +3 -3
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/api/dashboard.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/api/graphql-operations-types.ts +161 -13
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/api/maintenance.ts +11 -9
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/api/maintenanceWorkers.ts +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/api/properties.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/appLayout.tsx +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/assets/icons/maintenance-worker.svg +8 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/ApplicationCard.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/ApplicationDetailsModal.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/ApplicationsTable.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/IssuesDonutChart.tsx +23 -3
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/ListPageFilters.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/MaintenanceDetailsModal.tsx +6 -6
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/MaintenanceRequestCard.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/MaintenanceTable.tsx +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/PropertyCard.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/PropertyDetailsModal.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/TopBar.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/VerticalNav.tsx +4 -3
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/dashboard/GlobalSearchBar.tsx +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/filters/FilterFieldRange.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/filters/FilterFieldSelect.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/filters/ListPageFilterRow.tsx +3 -3
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/components/list/ListPageWithFilters.tsx +5 -5
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/hooks/useListPage.ts +4 -4
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/applicationAdapter.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/fieldMappers.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/globalSearchConstants.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/listPageConfig.ts +9 -9
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/maintenanceAdapter.ts +8 -4
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/maintenanceColumns.ts +12 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/maintenanceWorkerAdapter.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/propertyAdapter.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/pages/Applications.tsx +8 -8
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/pages/Home.tsx +19 -20
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/pages/Maintenance.tsx +9 -9
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/pages/MaintenanceWorkers.tsx +51 -10
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/pages/Properties.tsx +15 -15
- package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/routes.tsx +1 -1
- package/dist/package.json +1 -1
- package/package.json +3 -3
package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/listPageConfig.ts
CHANGED
|
@@ -6,19 +6,19 @@ import {
|
|
|
6
6
|
MAINTENANCE_OBJECT_API_NAME,
|
|
7
7
|
MAINTENANCE_WORKER_OBJECT_API_NAME,
|
|
8
8
|
APPLICATION_OBJECT_API_NAME,
|
|
9
|
-
} from "./globalSearchConstants
|
|
10
|
-
import { getMaintenanceColumns } from "./maintenanceColumns
|
|
11
|
-
import { getMaintenanceWorkerColumns } from "./maintenanceWorkerColumns
|
|
12
|
-
import { getApplicationListColumns } from "./applicationColumns
|
|
9
|
+
} from "./globalSearchConstants";
|
|
10
|
+
import { getMaintenanceColumns } from "./maintenanceColumns";
|
|
11
|
+
import { getMaintenanceWorkerColumns } from "./maintenanceWorkerColumns";
|
|
12
|
+
import { getApplicationListColumns } from "./applicationColumns";
|
|
13
13
|
import {
|
|
14
14
|
MAINTENANCE_FILTER_EXCLUDED_FIELD_PATHS,
|
|
15
15
|
MAINTENANCE_WORKER_FILTER_EXCLUDED_FIELD_PATHS,
|
|
16
16
|
APPLICATION_FILTER_EXCLUDED_FIELD_PATHS,
|
|
17
|
-
} from "./constants
|
|
18
|
-
import { nodeToMaintenanceRequest } from "./maintenanceAdapter
|
|
19
|
-
import { nodeToMaintenanceWorker } from "./maintenanceWorkerAdapter
|
|
20
|
-
import { nodeToApplication } from "./applicationAdapter
|
|
21
|
-
import type { MaintenanceRequest, MaintenanceWorker, Application } from "./types
|
|
17
|
+
} from "./constants";
|
|
18
|
+
import { nodeToMaintenanceRequest } from "./maintenanceAdapter";
|
|
19
|
+
import { nodeToMaintenanceWorker } from "./maintenanceWorkerAdapter";
|
|
20
|
+
import { nodeToApplication } from "./applicationAdapter";
|
|
21
|
+
import type { MaintenanceRequest, MaintenanceWorker, Application } from "./types";
|
|
22
22
|
|
|
23
23
|
export interface ListPageConfig<T> {
|
|
24
24
|
objectApiName: string;
|
package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/maintenanceAdapter.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adapter: maps Maintenance_Request__c GraphQL node to app MaintenanceRequest type.
|
|
3
3
|
*/
|
|
4
|
-
import type { MaintenanceRequest } from "./types
|
|
4
|
+
import type { MaintenanceRequest } from "./types";
|
|
5
5
|
|
|
6
6
|
interface MaintenanceNode {
|
|
7
7
|
Id?: string;
|
|
@@ -16,7 +16,10 @@ interface MaintenanceNode {
|
|
|
16
16
|
Name?: { value?: string };
|
|
17
17
|
};
|
|
18
18
|
User__r?: { Name?: { value?: string }; DisplayValue?: { value?: string } };
|
|
19
|
-
|
|
19
|
+
Assigned_Worker__r?: {
|
|
20
|
+
Name?: { value?: string };
|
|
21
|
+
Employment_Type__c?: { value?: string };
|
|
22
|
+
};
|
|
20
23
|
ContentDocumentLinks?: {
|
|
21
24
|
edges?: Array<{
|
|
22
25
|
node?: {
|
|
@@ -68,7 +71,8 @@ export function nodeToMaintenanceRequest(
|
|
|
68
71
|
: undefined;
|
|
69
72
|
|
|
70
73
|
const tenantUnit = n.Property__r?.Name?.value ?? n.Property__r?.Address__c?.value;
|
|
71
|
-
const assignedWorkerName = n.
|
|
74
|
+
const assignedWorkerName = n.Assigned_Worker__r?.Name?.value;
|
|
75
|
+
const assignedWorkerOrg = n.Assigned_Worker__r?.Employment_Type__c?.value;
|
|
72
76
|
|
|
73
77
|
return {
|
|
74
78
|
id: n.Id ?? "",
|
|
@@ -83,7 +87,7 @@ export function nodeToMaintenanceRequest(
|
|
|
83
87
|
imageUrl,
|
|
84
88
|
tenantUnit,
|
|
85
89
|
assignedWorkerName: assignedWorkerName ?? undefined,
|
|
86
|
-
assignedWorkerOrg: undefined,
|
|
90
|
+
assignedWorkerOrg: assignedWorkerOrg ?? undefined,
|
|
87
91
|
formattedDate,
|
|
88
92
|
};
|
|
89
93
|
}
|
package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/lib/maintenanceColumns.ts
CHANGED
|
@@ -13,6 +13,18 @@ export const MAINTENANCE_EXTRA_COLUMNS: Column[] = [
|
|
|
13
13
|
},
|
|
14
14
|
{ fieldApiName: "Property__r.Name", label: "Property Name", searchable: false, sortable: false },
|
|
15
15
|
{ fieldApiName: "User__r.Name", label: "User Name", searchable: false, sortable: false },
|
|
16
|
+
{
|
|
17
|
+
fieldApiName: "Assigned_Worker__r.Name",
|
|
18
|
+
label: "Assigned Worker Name",
|
|
19
|
+
searchable: false,
|
|
20
|
+
sortable: false,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
fieldApiName: "Assigned_Worker__r.Employment_Type__c",
|
|
24
|
+
label: "Worker Employment Type",
|
|
25
|
+
searchable: false,
|
|
26
|
+
sortable: false,
|
|
27
|
+
},
|
|
16
28
|
{ fieldApiName: "OwnerId", label: "Owner Id", searchable: false, sortable: false },
|
|
17
29
|
{ fieldApiName: "Owner", label: "Owner", searchable: false, sortable: false },
|
|
18
30
|
];
|
package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/pages/Applications.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
|
-
import { useListPage } from "../hooks/useListPage
|
|
3
|
-
import { applicationsListConfig } from "../lib/listPageConfig
|
|
4
|
-
import { ListPageWithFilters } from "../components/list/ListPageWithFilters
|
|
5
|
-
import { PageHeader } from "../components/layout/PageHeader
|
|
6
|
-
import { ApplicationsTable } from "../components/ApplicationsTable
|
|
7
|
-
import { ApplicationDetailsModal } from "../components/ApplicationDetailsModal
|
|
8
|
-
import { updateApplicationStatus } from "../api/applications
|
|
9
|
-
import type { Application } from "../lib/types
|
|
2
|
+
import { useListPage } from "../hooks/useListPage";
|
|
3
|
+
import { applicationsListConfig } from "../lib/listPageConfig";
|
|
4
|
+
import { ListPageWithFilters } from "../components/list/ListPageWithFilters";
|
|
5
|
+
import { PageHeader } from "../components/layout/PageHeader";
|
|
6
|
+
import { ApplicationsTable } from "../components/ApplicationsTable";
|
|
7
|
+
import { ApplicationDetailsModal } from "../components/ApplicationDetailsModal";
|
|
8
|
+
import { updateApplicationStatus } from "../api/applications";
|
|
9
|
+
import type { Application } from "../lib/types";
|
|
10
10
|
|
|
11
11
|
export default function Applications() {
|
|
12
12
|
const list = useListPage(applicationsListConfig);
|
|
@@ -3,28 +3,27 @@ import { useNavigate } from "react-router";
|
|
|
3
3
|
import { useRecordListGraphQL } from "../features/global-search/hooks/useRecordListGraphQL";
|
|
4
4
|
import { useObjectInfoBatch } from "../features/global-search/hooks/useObjectInfoBatch";
|
|
5
5
|
import { useObjectListMetadata } from "../features/global-search/hooks/useObjectSearchData";
|
|
6
|
-
import { IssuesDonutChart } from "../components/IssuesDonutChart
|
|
7
|
-
import { MaintenanceTable } from "../components/MaintenanceTable
|
|
8
|
-
import { GlobalSearchBar } from "../components/dashboard/GlobalSearchBar
|
|
9
|
-
import { StatCard } from "../components/StatCard
|
|
10
|
-
import { PageContainer } from "../components/layout/PageContainer
|
|
11
|
-
import { PageLoadingState } from "../components/feedback/PageLoadingState
|
|
12
|
-
import { getDashboardMetrics, calculateMetrics } from "../api/dashboard
|
|
13
|
-
import type { DashboardMetrics, MaintenanceRequest } from "../lib/types
|
|
6
|
+
import { IssuesDonutChart } from "../components/IssuesDonutChart";
|
|
7
|
+
import { MaintenanceTable } from "../components/MaintenanceTable";
|
|
8
|
+
import { GlobalSearchBar } from "../components/dashboard/GlobalSearchBar";
|
|
9
|
+
import { StatCard } from "../components/StatCard";
|
|
10
|
+
import { PageContainer } from "../components/layout/PageContainer";
|
|
11
|
+
import { PageLoadingState } from "../components/feedback/PageLoadingState";
|
|
12
|
+
import { getDashboardMetrics, calculateMetrics } from "../api/dashboard";
|
|
13
|
+
import type { DashboardMetrics, MaintenanceRequest } from "../lib/types";
|
|
14
14
|
import {
|
|
15
15
|
GLOBAL_SEARCH_OBJECT_API_NAME,
|
|
16
16
|
SEARCHABLE_OBJECTS,
|
|
17
17
|
MAINTENANCE_OBJECT_API_NAME,
|
|
18
18
|
type SearchableObjectConfig,
|
|
19
|
-
} from "../lib/globalSearchConstants
|
|
20
|
-
import { getMaintenanceColumns } from "../lib/maintenanceColumns
|
|
21
|
-
import { nodeToMaintenanceRequest } from "../lib/maintenanceAdapter
|
|
22
|
-
import { DASHBOARD_MAINTENANCE_LIMIT } from "../lib/constants
|
|
23
|
-
import { PATHS } from "../lib/routeConfig
|
|
19
|
+
} from "../lib/globalSearchConstants";
|
|
20
|
+
import { getMaintenanceColumns } from "../lib/maintenanceColumns";
|
|
21
|
+
import { nodeToMaintenanceRequest } from "../lib/maintenanceAdapter";
|
|
22
|
+
import { DASHBOARD_MAINTENANCE_LIMIT } from "../lib/constants";
|
|
23
|
+
import { PATHS } from "../lib/routeConfig";
|
|
24
24
|
|
|
25
|
-
const CHART_ISSUE_TYPES = ["Plumbing", "HVAC", "Electrical"] as const;
|
|
26
|
-
const
|
|
27
|
-
const CHART_COLORS = ["#7C3AED", "#EC4899", "#14B8A6", "#06B6D4"] as const;
|
|
25
|
+
const CHART_ISSUE_TYPES = ["Plumbing", "HVAC", "Electrical", "Appliance", "Pest"] as const;
|
|
26
|
+
const CHART_COLORS = ["#7C3AED", "#EC4899", "#14B8A6", "#06B6D4", "#F59E0B"] as const;
|
|
28
27
|
|
|
29
28
|
export default function Home() {
|
|
30
29
|
const navigate = useNavigate();
|
|
@@ -118,21 +117,21 @@ export default function Home() {
|
|
|
118
117
|
Plumbing: 0,
|
|
119
118
|
HVAC: 0,
|
|
120
119
|
Electrical: 0,
|
|
121
|
-
|
|
120
|
+
Appliance: 0,
|
|
121
|
+
Pest: 0,
|
|
122
122
|
};
|
|
123
123
|
maintenanceRequests.forEach((request) => {
|
|
124
124
|
const type = request.issueType;
|
|
125
125
|
if (CHART_ISSUE_TYPES.includes(type as (typeof CHART_ISSUE_TYPES)[number])) {
|
|
126
126
|
counts[type]++;
|
|
127
|
-
} else {
|
|
128
|
-
counts[CHART_OTHER_LABEL]++;
|
|
129
127
|
}
|
|
130
128
|
});
|
|
131
129
|
return [
|
|
132
130
|
{ name: "Plumbing", value: counts.Plumbing, color: CHART_COLORS[0] },
|
|
133
131
|
{ name: "HVAC", value: counts.HVAC, color: CHART_COLORS[1] },
|
|
134
132
|
{ name: "Electrical", value: counts.Electrical, color: CHART_COLORS[2] },
|
|
135
|
-
{ name:
|
|
133
|
+
{ name: "Appliance", value: counts.Appliance, color: CHART_COLORS[3] },
|
|
134
|
+
{ name: "Pest Control", value: counts.Pest, color: CHART_COLORS[4] },
|
|
136
135
|
];
|
|
137
136
|
}, [maintenanceRequests]);
|
|
138
137
|
|
package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/pages/Maintenance.tsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
import { ChevronDown } from "lucide-react";
|
|
3
|
-
import { useListPage } from "../hooks/useListPage
|
|
4
|
-
import { maintenanceRequestsListConfig } from "../lib/listPageConfig
|
|
5
|
-
import { ListPageWithFilters } from "../components/list/ListPageWithFilters
|
|
6
|
-
import { PageHeader } from "../components/layout/PageHeader
|
|
7
|
-
import { UserAvatar } from "../components/UserAvatar
|
|
8
|
-
import { StatusBadge } from "../components/StatusBadge
|
|
9
|
-
import { MaintenanceDetailsModal } from "../components/MaintenanceDetailsModal
|
|
10
|
-
import { updateMaintenanceStatus } from "../api/maintenance
|
|
11
|
-
import type { MaintenanceRequest } from "../lib/types
|
|
3
|
+
import { useListPage } from "../hooks/useListPage";
|
|
4
|
+
import { maintenanceRequestsListConfig } from "../lib/listPageConfig";
|
|
5
|
+
import { ListPageWithFilters } from "../components/list/ListPageWithFilters";
|
|
6
|
+
import { PageHeader } from "../components/layout/PageHeader";
|
|
7
|
+
import { UserAvatar } from "../components/UserAvatar";
|
|
8
|
+
import { StatusBadge } from "../components/StatusBadge";
|
|
9
|
+
import { MaintenanceDetailsModal } from "../components/MaintenanceDetailsModal";
|
|
10
|
+
import { updateMaintenanceStatus } from "../api/maintenance";
|
|
11
|
+
import type { MaintenanceRequest } from "../lib/types";
|
|
12
12
|
import PlumbingIcon from "../assets/icons/plumbing.svg";
|
|
13
13
|
import HVACIcon from "../assets/icons/hvac.svg";
|
|
14
14
|
import ElectricalIcon from "../assets/icons/electrical.svg";
|
|
@@ -1,13 +1,54 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { useListPage } from "../hooks/useListPage
|
|
3
|
-
import { maintenanceWorkersListConfig } from "../lib/listPageConfig
|
|
4
|
-
import { ListPageWithFilters } from "../components/list/ListPageWithFilters
|
|
5
|
-
import { PageHeader } from "../components/layout/PageHeader
|
|
6
|
-
import
|
|
1
|
+
import { useState, useEffect, useMemo } from "react";
|
|
2
|
+
import { useListPage } from "../hooks/useListPage";
|
|
3
|
+
import { maintenanceWorkersListConfig } from "../lib/listPageConfig";
|
|
4
|
+
import { ListPageWithFilters } from "../components/list/ListPageWithFilters";
|
|
5
|
+
import { PageHeader } from "../components/layout/PageHeader";
|
|
6
|
+
import { getAllMaintenanceRequests } from "../api/maintenance";
|
|
7
|
+
import type { MaintenanceWorker } from "../lib/types";
|
|
7
8
|
|
|
8
9
|
export default function MaintenanceWorkers() {
|
|
9
10
|
const list = useListPage(maintenanceWorkersListConfig);
|
|
10
11
|
const [selectedWorker, setSelectedWorker] = useState<MaintenanceWorker | null>(null);
|
|
12
|
+
const [requestCountsLoading, setRequestCountsLoading] = useState(true);
|
|
13
|
+
const [requestCounts, setRequestCounts] = useState<Record<string, number>>({});
|
|
14
|
+
|
|
15
|
+
// Fetch maintenance requests to calculate active request counts per worker
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
let mounted = true;
|
|
18
|
+
async function fetchRequestCounts() {
|
|
19
|
+
try {
|
|
20
|
+
setRequestCountsLoading(true);
|
|
21
|
+
const requests = await getAllMaintenanceRequests(500);
|
|
22
|
+
if (!mounted) return;
|
|
23
|
+
|
|
24
|
+
// Count active requests (not "Resolved") per worker
|
|
25
|
+
const counts: Record<string, number> = {};
|
|
26
|
+
for (const req of requests) {
|
|
27
|
+
if (req.status !== "Resolved" && req.assignedWorkerName) {
|
|
28
|
+
const workerName = req.assignedWorkerName;
|
|
29
|
+
counts[workerName] = (counts[workerName] || 0) + 1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
setRequestCounts(counts);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error("Error fetching request counts:", error);
|
|
35
|
+
} finally {
|
|
36
|
+
if (mounted) setRequestCountsLoading(false);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
fetchRequestCounts();
|
|
40
|
+
return () => {
|
|
41
|
+
mounted = false;
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
|
|
45
|
+
// Enrich workers with active request counts
|
|
46
|
+
const enrichedWorkers = useMemo(() => {
|
|
47
|
+
return list.items.map((worker) => ({
|
|
48
|
+
...worker,
|
|
49
|
+
activeRequestsCount: requestCounts[worker.name] || 0,
|
|
50
|
+
}));
|
|
51
|
+
}, [list.items, requestCounts]);
|
|
11
52
|
|
|
12
53
|
return (
|
|
13
54
|
<>
|
|
@@ -24,10 +65,10 @@ export default function MaintenanceWorkers() {
|
|
|
24
65
|
ariaLabel: maintenanceWorkersListConfig.filtersAriaLabel,
|
|
25
66
|
}}
|
|
26
67
|
filterError={list.filterError}
|
|
27
|
-
loading={list.loading}
|
|
68
|
+
loading={list.loading || requestCountsLoading}
|
|
28
69
|
error={list.error}
|
|
29
70
|
loadingMessage={maintenanceWorkersListConfig.loadingMessage}
|
|
30
|
-
isEmpty={
|
|
71
|
+
isEmpty={enrichedWorkers.length === 0}
|
|
31
72
|
searchPlaceholder="Search by name, organization, status..."
|
|
32
73
|
searchAriaLabel="Search workers"
|
|
33
74
|
>
|
|
@@ -55,10 +96,10 @@ export default function MaintenanceWorkers() {
|
|
|
55
96
|
</div>
|
|
56
97
|
</div>
|
|
57
98
|
<div className="divide-y divide-gray-200">
|
|
58
|
-
{
|
|
99
|
+
{enrichedWorkers.length === 0 ? (
|
|
59
100
|
<div className="text-center py-12 text-gray-500">No maintenance workers found</div>
|
|
60
101
|
) : (
|
|
61
|
-
|
|
102
|
+
enrichedWorkers.map((worker) => (
|
|
62
103
|
<div
|
|
63
104
|
key={worker.id}
|
|
64
105
|
onClick={() => setSelectedWorker(worker)}
|
package/dist/force-app/main/default/webapplications/appreactsampleb2e/src/pages/Properties.tsx
CHANGED
|
@@ -4,25 +4,25 @@ import { type FilterCriteria } from "../features/global-search/types/filters/fil
|
|
|
4
4
|
import { useObjectListMetadata } from "../features/global-search/hooks/useObjectSearchData";
|
|
5
5
|
import { useRecordListGraphQL } from "../features/global-search/hooks/useRecordListGraphQL";
|
|
6
6
|
|
|
7
|
-
import type { Property } from "../lib/types
|
|
8
|
-
import { PropertyCard } from "../components/PropertyCard
|
|
9
|
-
import { PropertyDetailsModal } from "../components/PropertyDetailsModal
|
|
10
|
-
import { PageContainer } from "../components/layout/PageContainer
|
|
11
|
-
import { PageHeader } from "../components/layout/PageHeader
|
|
12
|
-
import { PageLoadingState } from "../components/feedback/PageLoadingState
|
|
13
|
-
import { PageErrorState } from "../components/feedback/PageErrorState
|
|
14
|
-
import { FilterErrorAlert } from "../components/feedback/FilterErrorAlert
|
|
15
|
-
import { ListPageFilterRow } from "../components/filters/ListPageFilterRow
|
|
16
|
-
import { GLOBAL_SEARCH_OBJECT_API_NAME } from "../lib/globalSearchConstants
|
|
17
|
-
import { nodeToProperty } from "../lib/propertyAdapter
|
|
18
|
-
import { getPropertyListColumns } from "../lib/propertyColumns
|
|
7
|
+
import type { Property } from "../lib/types";
|
|
8
|
+
import { PropertyCard } from "../components/PropertyCard";
|
|
9
|
+
import { PropertyDetailsModal } from "../components/PropertyDetailsModal";
|
|
10
|
+
import { PageContainer } from "../components/layout/PageContainer";
|
|
11
|
+
import { PageHeader } from "../components/layout/PageHeader";
|
|
12
|
+
import { PageLoadingState } from "../components/feedback/PageLoadingState";
|
|
13
|
+
import { PageErrorState } from "../components/feedback/PageErrorState";
|
|
14
|
+
import { FilterErrorAlert } from "../components/feedback/FilterErrorAlert";
|
|
15
|
+
import { ListPageFilterRow } from "../components/filters/ListPageFilterRow";
|
|
16
|
+
import { GLOBAL_SEARCH_OBJECT_API_NAME } from "../lib/globalSearchConstants";
|
|
17
|
+
import { nodeToProperty } from "../lib/propertyAdapter";
|
|
18
|
+
import { getPropertyListColumns } from "../lib/propertyColumns";
|
|
19
19
|
import {
|
|
20
20
|
buildFilterCriteriaFromFormValues,
|
|
21
21
|
getDefaultFilterFormValues,
|
|
22
22
|
getApplicableFilters,
|
|
23
|
-
} from "../lib/filterUtils
|
|
24
|
-
import { PAGE_SIZE_LIST, PROPERTY_FILTER_EXCLUDED_FIELD_PATHS } from "../lib/constants
|
|
25
|
-
import { useAccumulatedListPages } from "../hooks/useAccumulatedListPages
|
|
23
|
+
} from "../lib/filterUtils";
|
|
24
|
+
import { PAGE_SIZE_LIST, PROPERTY_FILTER_EXCLUDED_FIELD_PATHS } from "../lib/constants";
|
|
25
|
+
import { useAccumulatedListPages } from "../hooks/useAccumulatedListPages";
|
|
26
26
|
|
|
27
27
|
const PROPERTIES_DEFAULT_SORT = "CreatedDate DESC";
|
|
28
28
|
|
|
@@ -12,7 +12,7 @@ import Maintenance from "./pages/Maintenance";
|
|
|
12
12
|
import MaintenanceWorkers from "./pages/MaintenanceWorkers";
|
|
13
13
|
import Properties from "./pages/Properties";
|
|
14
14
|
import Applications from "./pages/Applications";
|
|
15
|
-
import { PATHS } from "./lib/routeConfig
|
|
15
|
+
import { PATHS } from "./lib/routeConfig";
|
|
16
16
|
|
|
17
17
|
export const routes: RouteObject[] = [
|
|
18
18
|
{
|
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.82.0",
|
|
4
4
|
"description": "B2E starter app template",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"clean": "rm -rf dist"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@salesforce/webapp-experimental": "^1.
|
|
20
|
-
"@salesforce/webapp-template-feature-react-global-search-experimental": "^1.
|
|
19
|
+
"@salesforce/webapp-experimental": "^1.82.0",
|
|
20
|
+
"@salesforce/webapp-template-feature-react-global-search-experimental": "^1.82.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@testing-library/jest-dom": "^6.6.3",
|