@salesforce/ui-bundle-template-app-react-sample-b2x 1.119.1 → 1.119.3
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/README.md +433 -40
- package/dist/force-app/main/default/classes/MaintenanceRequestTriggerHandler_Test.cls +5 -5
- package/dist/force-app/main/default/data/Maintenance_Request__c.json +8 -8
- package/dist/force-app/main/default/objects/Maintenance_Request__c/fields/Priority__c.field-meta.xml +2 -2
- package/dist/force-app/main/default/uiBundles/propertyrentalapp/package.json +3 -3
- package/dist/force-app/main/default/uiBundles/propertyrentalapp/src/pages/Maintenance.tsx +2 -2
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
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
|
+
## [1.119.3](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.119.2...v1.119.3) (2026-03-31)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.119.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.119.1...v1.119.2) (2026-03-31)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.119.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.119.0...v1.119.1) (2026-03-31)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
package/dist/README.md
CHANGED
|
@@ -2,51 +2,180 @@
|
|
|
2
2
|
|
|
3
3
|
A property rental sample React UI Bundle for Salesforce Experience Cloud. Demonstrates property listings, maintenance requests, and a dashboard with an app shell designed for external-facing deployment. Built with React, Vite, TypeScript, and Tailwind/shadcn.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
1. [What's Included](#whats-included)
|
|
8
|
+
2. [Prerequisites](#prerequisites)
|
|
9
|
+
3. [Quick Start (Automated)](#quick-start-automated)
|
|
10
|
+
4. [Step-by-Step Setup](#step-by-step-setup)
|
|
11
|
+
- [1. Install Dependencies](#1-install-dependencies)
|
|
12
|
+
- [2. Authenticate Your Org](#2-authenticate-your-org)
|
|
13
|
+
- [3. Deploy Metadata](#3-deploy-metadata)
|
|
14
|
+
- [4. Assign Permission Sets](#4-assign-permission-sets)
|
|
15
|
+
- [5. Import Sample Data](#5-import-sample-data)
|
|
16
|
+
- [6. Generate GraphQL Types](#6-generate-graphql-types)
|
|
17
|
+
- [7. Rebuild the UI Bundle](#7-rebuild-the-ui-bundle)
|
|
18
|
+
- [8. Deploy the UI Bundle](#8-deploy-the-ui-bundle)
|
|
19
|
+
5. [Org Configuration](#org-configuration)
|
|
20
|
+
- [Step 1: Assign a Role to Your Admin User](#step-1-assign-a-role-to-your-admin-user)
|
|
21
|
+
- [Step 2: Create and Configure the Community Profile](#step-2-create-and-configure-the-community-profile)
|
|
22
|
+
- [Step 3: Configure the Experience Cloud Site](#step-3-configure-the-experience-cloud-site)
|
|
23
|
+
- [Step 4: Configure the Guest User Profile](#step-4-configure-the-guest-user-profile)
|
|
24
|
+
- [Step 5: Create Criteria-Based Sharing Rules for Guest Access](#step-5-create-criteria-based-sharing-rules-for-guest-access)
|
|
25
|
+
6. [Local Development](#local-development)
|
|
26
|
+
7. [Resources](#resources)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## What's Included
|
|
6
31
|
|
|
7
32
|
| Path | Description |
|
|
8
33
|
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
34
|
| `force-app/main/default/uiBundles/propertyrentalapp/` | React UI Bundle (source, config, tests) |
|
|
10
|
-
| `force-app/main/default/objects/` | 17 custom objects —
|
|
35
|
+
| `force-app/main/default/objects/` | 17 custom objects — `Agent__c`, `Application__c`, `KPI_Snapshot__c`, `Lease__c`, `Maintenance_Request__c`, `Maintenance_Worker__c`, `Notification__c`, `Payment__c`, `Property__c`, `Property_Cost__c`, `Property_Feature__c`, `Property_Image__c`, `Property_Listing__c`, `Property_Management_Company__c`, `Property_Owner__c`, `Property_Sale__c`, `Tenant__c` |
|
|
11
36
|
| `force-app/main/default/layouts/` | Page layouts for each custom object |
|
|
12
|
-
| `force-app/main/default/permissionsets/` | `Property_Management_Access`
|
|
13
|
-
| `force-app/main/default/classes/` | Apex classes — `
|
|
14
|
-
| `force-app/main/default/
|
|
37
|
+
| `force-app/main/default/permissionsets/` | `Property_Management_Access` (full admin access) and `Tenant_Maintenance_Access` (scoped tenant access) |
|
|
38
|
+
| `force-app/main/default/classes/` | Apex classes — `MaintenanceRequestTriggerHandler`, `TenantTriggerHandler`, `UIBundleAuthUtils`, `UIBundleChangePassword`, `UIBundleForgotPassword`, `UIBundleLogin`, `UIBundleAppRegistration` |
|
|
39
|
+
| `force-app/main/default/triggers/` | Apex triggers — `MaintenanceRequestTrigger`, `TenantTrigger` |
|
|
40
|
+
| `force-app/main/default/cspTrustedSites/` | CSP trusted sites for external resources (Google Fonts, Pexels, Unsplash, GitHub Avatars, OpenStreetMap, Open-Meteo) |
|
|
15
41
|
| `force-app/main/default/data/` | Sample data (JSON) for all objects, importable via `sf data import tree` |
|
|
16
42
|
| `force-app/main/default/digitalExperienceConfigs/` | Experience Cloud site configuration |
|
|
17
43
|
| `force-app/main/default/digitalExperiences/` | Experience Cloud site definition |
|
|
18
|
-
| `force-app/main/default/networks/` | Experience Cloud network
|
|
19
|
-
| `force-app/main/default/sites/` | Salesforce
|
|
44
|
+
| `force-app/main/default/networks/` | Experience Cloud network metadata |
|
|
45
|
+
| `force-app/main/default/sites/` | Salesforce Sites configuration |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Prerequisites
|
|
50
|
+
|
|
51
|
+
Before you begin, ensure the following are in place.
|
|
52
|
+
|
|
53
|
+
### Tools
|
|
54
|
+
|
|
55
|
+
| Tool | Minimum Version | Install |
|
|
56
|
+
| ----------------------------------------------------------------------------- | ------------------ | ----------------------------------- |
|
|
57
|
+
| [Salesforce CLI (`sf`)](https://developer.salesforce.com/tools/salesforcecli) | v2+ | `npm install -g @salesforce/cli` |
|
|
58
|
+
| [Node.js](https://nodejs.org/) | v22+ | [nodejs.org](https://nodejs.org/) |
|
|
59
|
+
| [Git](https://git-scm.com/) | Any recent version | [git-scm.com](https://git-scm.com/) |
|
|
60
|
+
|
|
61
|
+
Verify your Salesforce CLI version with:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
sf --version
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Salesforce Org Requirements
|
|
68
|
+
|
|
69
|
+
This project requires a Salesforce org with the following features and licenses. **Developer Edition orgs do not include these by default.** Use a sandbox, an org configured with add-ons, or request a pre-configured org from your Salesforce account team.
|
|
70
|
+
|
|
71
|
+
- **Digital Experiences (Experience Cloud) enabled** — required to deploy and run the Experience Cloud site. To verify, go to **Setup > Digital Experiences > Settings** and confirm "Enable Digital Experiences" is checked.
|
|
72
|
+
- **Customer Community** or **Customer Community Plus** user licenses — required to create community (portal) users. Customer Community Plus is recommended if you need record-level sharing via sharing rules.
|
|
73
|
+
- **Salesforce Sites enabled** — required for guest user access.
|
|
20
74
|
|
|
21
|
-
|
|
75
|
+
> **Note:** If Digital Experiences is not yet enabled in your org, go to **Setup > Digital Experiences > Settings**, check "Enable Digital Experiences", set a domain name, and save. This action cannot be undone.
|
|
22
76
|
|
|
23
|
-
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Quick Start (Automated)
|
|
80
|
+
|
|
81
|
+
Two npm scripts at the project root streamline getting started and deployment.
|
|
82
|
+
|
|
83
|
+
**`npm run sf-project-setup`** — installs the UI Bundle dependencies, builds the app, and starts the dev server (see [Local Development](#local-development)).
|
|
84
|
+
|
|
85
|
+
**`npm run setup`** — automates the full setup: login, deploy metadata, assign permission sets, import sample data, fetch the GraphQL schema, run codegen, build the UI Bundle, and optionally launch the dev server:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm run setup -- --target-org <alias>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Replace `<alias>` with your target org alias or username. Running without flags presents an interactive step picker. Pass `--yes` to skip it and run all steps immediately:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm run setup -- --target-org <alias> --yes
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Common Options
|
|
98
|
+
|
|
99
|
+
| Option | Description |
|
|
100
|
+
| ------------------------- | ------------------------------------------------------------------------------------ |
|
|
101
|
+
| `--skip-login` | Skip browser login (auto-skipped if org is already connected) |
|
|
102
|
+
| `--skip-deploy` | Skip the metadata deploy step |
|
|
103
|
+
| `--skip-permset` | Skip permission set assignment |
|
|
104
|
+
| `--skip-data` | Skip data preparation and import |
|
|
105
|
+
| `--skip-graphql` | Skip GraphQL schema fetch and codegen |
|
|
106
|
+
| `--skip-ui-bundle-build` | Skip `npm install` and UI Bundle build |
|
|
107
|
+
| `--skip-dev` | Do not launch the dev server at the end |
|
|
108
|
+
| `--permset-name <name>` | Assign only a specific permission set (repeatable). Default: all sets in the project |
|
|
109
|
+
| `--ui-bundle-name <name>` | UI Bundle folder name under `uiBundles/` (default: auto-detected) |
|
|
110
|
+
| `-y, --yes` | Skip interactive step picker and run all enabled steps immediately |
|
|
111
|
+
|
|
112
|
+
For a full list of options:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm run setup -- --help
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
> **After the automated setup completes**, proceed to [Org Configuration](#org-configuration) for the manual steps that cannot be automated via CLI (profile cloning, site member configuration, guest user setup, and publishing the Experience Cloud site).
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Step-by-Step Setup
|
|
123
|
+
|
|
124
|
+
Use this section if you prefer to run each step manually, or if the automated script is not available.
|
|
125
|
+
|
|
126
|
+
### 1. Install Dependencies
|
|
127
|
+
|
|
128
|
+
Install root-level project dependencies:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
npm install
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Install the UI Bundle dependencies and build it:
|
|
24
135
|
|
|
25
136
|
```bash
|
|
26
137
|
cd force-app/main/default/uiBundles/propertyrentalapp
|
|
27
138
|
npm install
|
|
28
|
-
npm run
|
|
139
|
+
npm run build
|
|
140
|
+
cd -
|
|
29
141
|
```
|
|
30
142
|
|
|
31
|
-
|
|
143
|
+
This produces the static bundle artifacts that are packaged into the Salesforce metadata. Having them built now means any deploy option in [Step 3](#3-deploy-metadata) is ready to run without an additional build step.
|
|
32
144
|
|
|
33
|
-
|
|
145
|
+
### 2. Authenticate Your Org
|
|
34
146
|
|
|
35
|
-
|
|
147
|
+
Log in to your target org using the Salesforce CLI. This opens a browser window for OAuth authentication:
|
|
36
148
|
|
|
37
149
|
```bash
|
|
38
|
-
|
|
39
|
-
sf project deploy start --source-dir force-app --target-org <alias>
|
|
150
|
+
sf org login web --alias <alias>
|
|
40
151
|
```
|
|
41
152
|
|
|
42
|
-
|
|
153
|
+
To verify the login was successful:
|
|
43
154
|
|
|
44
155
|
```bash
|
|
45
|
-
|
|
46
|
-
sf project deploy start --source-dir force-app/main/default/ui-bundles --target-org <alias>
|
|
156
|
+
sf org display --target-org <alias>
|
|
47
157
|
```
|
|
48
158
|
|
|
49
|
-
|
|
159
|
+
If you are working with a sandbox, use:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
sf org login web --alias <alias> --instance-url https://test.salesforce.com
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 3. Deploy Metadata
|
|
166
|
+
|
|
167
|
+
#### Option A: Deploy Everything (metadata + Experience Cloud site + UI Bundle)
|
|
168
|
+
|
|
169
|
+
Build the UI Bundle first, then deploy all source directories in a single command:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
cd force-app/main/default/uiBundles/propertyrentalapp && npm run build && cd -
|
|
173
|
+
sf project deploy start --source-dir force-app --target-org <alias>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### Option B: Deploy Metadata Only (objects, layouts, permission sets, Apex)
|
|
177
|
+
|
|
178
|
+
Use this approach for an initial deploy to verify metadata before deploying the Experience Cloud site:
|
|
50
179
|
|
|
51
180
|
```bash
|
|
52
181
|
sf project deploy start \
|
|
@@ -54,10 +183,12 @@ sf project deploy start \
|
|
|
54
183
|
--source-dir force-app/main/default/layouts \
|
|
55
184
|
--source-dir force-app/main/default/permissionsets \
|
|
56
185
|
--source-dir force-app/main/default/classes \
|
|
186
|
+
--source-dir force-app/main/default/triggers \
|
|
187
|
+
--source-dir force-app/main/default/cspTrustedSites \
|
|
57
188
|
--target-org <alias>
|
|
58
189
|
```
|
|
59
190
|
|
|
60
|
-
|
|
191
|
+
#### Option C: Deploy Experience Cloud Site Only
|
|
61
192
|
|
|
62
193
|
```bash
|
|
63
194
|
sf project deploy start \
|
|
@@ -68,45 +199,307 @@ sf project deploy start \
|
|
|
68
199
|
--target-org <alias>
|
|
69
200
|
```
|
|
70
201
|
|
|
71
|
-
|
|
202
|
+
#### Option D: Deploy the UI Bundle Only
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
cd force-app/main/default/uiBundles/propertyrentalapp && npm run build && cd -
|
|
206
|
+
sf project deploy start --source-dir force-app/main/default/uiBundles --target-org <alias>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
> **Deployment order matters.** Deploy metadata (Option B) before deploying the Experience Cloud site (Option C). The site configuration depends on the custom objects and classes being present in the org.
|
|
210
|
+
|
|
211
|
+
### 4. Assign Permission Sets
|
|
212
|
+
|
|
213
|
+
Two permission sets are included in this project:
|
|
214
|
+
|
|
215
|
+
| Permission Set | Purpose | Assign To |
|
|
216
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------- |
|
|
217
|
+
| `Property_Management_Access` | Full CRUD access to all custom objects. Intended for property managers and admin users. | Internal users managing the app |
|
|
218
|
+
| `Tenant_Maintenance_Access` | Scoped read/write access for tenants. Allows creating and updating their own maintenance requests only. | Tenant community users |
|
|
72
219
|
|
|
73
|
-
|
|
220
|
+
Assign permission sets using the CLI:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Assign Property_Management_Access to a specific user
|
|
224
|
+
sf org assign permset --name Property_Management_Access --on-behalf-of <username> --target-org <alias>
|
|
225
|
+
|
|
226
|
+
# Assign Tenant_Maintenance_Access to a tenant user
|
|
227
|
+
sf org assign permset --name Tenant_Maintenance_Access --on-behalf-of <username> --target-org <alias>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
To assign to multiple users, repeat the command for each user, or use the automated script which assigns all permission sets to the running user by default.
|
|
231
|
+
|
|
232
|
+
### 5. Import Sample Data
|
|
233
|
+
|
|
234
|
+
Once the metadata has been successfully deployed:
|
|
74
235
|
|
|
75
236
|
```bash
|
|
76
237
|
sf data import tree --plan force-app/main/default/data/data-plan.json --target-org <alias>
|
|
77
238
|
```
|
|
78
239
|
|
|
79
|
-
|
|
240
|
+
The data plan imports records in dependency order: Contacts, Agents, Maintenance Workers, Properties, Tenants, Applications, Maintenance Requests, Notifications, Property Management Companies, Property Owners, Leases, Property Sales, Property Costs, Payments, KPI Snapshots, Property Listings, Property Images, and Property Features.
|
|
241
|
+
|
|
242
|
+
> **Note:** If you re-run the import, duplicate records will be created. Wipe existing records first or use the `--upsert` flag if your plan supports it.
|
|
243
|
+
|
|
244
|
+
### 6. Generate GraphQL Types
|
|
245
|
+
|
|
246
|
+
After metadata is deployed, generate the GraphQL schema and TypeScript types for the UI Bundle. These are used to provide type-safe queries against the Salesforce GraphQL API.
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
cd force-app/main/default/uiBundles/propertyrentalapp
|
|
250
|
+
npm run graphql:schema # Fetches schema from org → outputs schema.graphql
|
|
251
|
+
npm run graphql:codegen # Generates TypeScript types → updates src/api/graphql-operations-types.ts
|
|
252
|
+
cd -
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
> **Prerequisite:** The org must be authenticated and metadata must already be deployed before running these commands, as the schema is generated from the org's live metadata.
|
|
256
|
+
|
|
257
|
+
### 7. Rebuild the UI Bundle
|
|
258
|
+
|
|
259
|
+
Step 6 updates the generated GraphQL types in the UI Bundle source. Rebuild the app to compile those changes into the bundle before deploying:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
cd force-app/main/default/uiBundles/propertyrentalapp
|
|
263
|
+
npm run build
|
|
264
|
+
cd -
|
|
265
|
+
```
|
|
80
266
|
|
|
81
|
-
|
|
267
|
+
### 8. Deploy the UI Bundle
|
|
82
268
|
|
|
83
|
-
|
|
269
|
+
Once the build is complete, deploy the UI Bundle to your org:
|
|
84
270
|
|
|
85
271
|
```bash
|
|
86
|
-
|
|
272
|
+
sf project deploy start --source-dir force-app/main/default/uiBundles --target-org <alias>
|
|
87
273
|
```
|
|
88
274
|
|
|
89
|
-
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Org Configuration
|
|
278
|
+
|
|
279
|
+
The following steps must be completed manually in the Salesforce Setup UI. They configure Experience Cloud, user profiles, and data sharing for guest and community users. Complete these steps **after** the metadata and UI Bundle have been deployed.
|
|
280
|
+
|
|
281
|
+
> **License requirement:** Your org must have **Customer Community** or **Customer Community Plus** user licenses available before you can complete these steps. Customer Community Plus licenses are required if you need ownership-based record sharing (Private OWD with sharing rules). Verify available licenses at **Setup > Company Settings > Company Information**, in the "User Licenses" section.
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
### Step 1: Assign a Role to Your Admin User
|
|
286
|
+
|
|
287
|
+
Salesforce requires that the org's admin user has a role assigned before Experience Cloud sites can be created or managed. If your admin user already has a role, skip this step.
|
|
288
|
+
|
|
289
|
+
1. Go to **Setup > Users > Roles**.
|
|
290
|
+
2. Click **Set Up Roles**.
|
|
291
|
+
3. Click **Add Role**. Provide a label (e.g., `CEO`) and save.
|
|
292
|
+
4. From the role hierarchy, click the role you just created, then click **Assign Users to Role**.
|
|
293
|
+
5. Add your system administrator user and click **Save**.
|
|
294
|
+
|
|
295
|
+
> **Why this matters:** Salesforce prevents users without a role in the hierarchy from owning Experience Cloud sites. This is a platform-level requirement, not specific to this app.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
### Step 2: Create and Configure the Community Profile
|
|
300
|
+
|
|
301
|
+
Community users require a profile that is based on one of the standard community profile templates. You will clone one of these templates and configure its permissions for this app.
|
|
302
|
+
|
|
303
|
+
#### 2a. Clone the Base Profile
|
|
304
|
+
|
|
305
|
+
1. Go to **Setup > Users > Profiles**.
|
|
306
|
+
2. Locate either **Customer Community User** or **Customer Community Plus User**.
|
|
307
|
+
- Choose **Customer Community Plus User** if you need ownership-based record-level sharing (recommended).
|
|
308
|
+
3. Click **Clone** next to the profile. Give it a descriptive name such as `Property Rental Tenant`.
|
|
309
|
+
4. Click **Save**.
|
|
310
|
+
|
|
311
|
+
#### 2b. Edit the Cloned Profile
|
|
312
|
+
|
|
313
|
+
Open the newly cloned profile and configure the following settings.
|
|
314
|
+
|
|
315
|
+
**Administrative Permissions:**
|
|
316
|
+
|
|
317
|
+
| Permission | Setting |
|
|
318
|
+
| ----------- | ------- |
|
|
319
|
+
| API Enabled | Checked |
|
|
320
|
+
|
|
321
|
+
**Custom Object Permissions:**
|
|
322
|
+
|
|
323
|
+
Set the following object-level access. After saving, also review field-level security for each object to ensure all relevant fields are readable.
|
|
324
|
+
|
|
325
|
+
| Object | Read | Create | Edit | Delete |
|
|
326
|
+
| :--------------------------------------------------------------- | :--: | :----: | :--: | :----: |
|
|
327
|
+
| Agents (`Agent__c`) | ✓ | | | |
|
|
328
|
+
| Applications (`Application__c`) | ✓ | ✓ | ✓ | ✓ |
|
|
329
|
+
| KPI Snapshots (`KPI_Snapshot__c`) | ✓ | | | |
|
|
330
|
+
| Leases (`Lease__c`) | ✓ | | | |
|
|
331
|
+
| Maintenance Requests (`Maintenance_Request__c`) | ✓ | ✓ | ✓ | ✓ |
|
|
332
|
+
| Maintenance Workers (`Maintenance_Worker__c`) | ✓ | | ✓ | |
|
|
333
|
+
| Notifications (`Notification__c`) | ✓ | | | |
|
|
334
|
+
| Payments (`Payment__c`) | ✓ | | | |
|
|
335
|
+
| Properties (`Property__c`) | ✓ | | | |
|
|
336
|
+
| Property Costs (`Property_Cost__c`) | ✓ | | | |
|
|
337
|
+
| Property Features (`Property_Feature__c`) | ✓ | | | |
|
|
338
|
+
| Property Images (`Property_Image__c`) | ✓ | | | |
|
|
339
|
+
| Property Listings (`Property_Listing__c`) | ✓ | | | |
|
|
340
|
+
| Property Management Companies (`Property_Management_Company__c`) | ✓ | | | |
|
|
341
|
+
| Property Owners (`Property_Owner__c`) | ✓ | | | |
|
|
342
|
+
| Property Sales (`Property_Sale__c`) | ✓ | | | |
|
|
343
|
+
| Tenants (`Tenant__c`) | ✓ | | | |
|
|
344
|
+
|
|
345
|
+
**Apex Class Access:**
|
|
346
|
+
|
|
347
|
+
Scroll to the **Enabled Apex Class Access** section and add the following classes. These classes handle authentication flows called by the UI Bundle:
|
|
348
|
+
|
|
349
|
+
- `UIBundleAuthUtils`
|
|
350
|
+
- `UIBundleChangePassword`
|
|
351
|
+
- `UIBundleForgotPassword`
|
|
352
|
+
|
|
353
|
+
> **Note:** `MaintenanceRequestTriggerHandler` and `TenantTriggerHandler` are trigger handler classes that run in system context when DML operations are performed. They do not need to be explicitly enabled in community profiles.
|
|
354
|
+
|
|
355
|
+
#### 2c. Configure View All for Property, Property Listing, Maintenance Worker
|
|
356
|
+
|
|
357
|
+
Tenants need to see all available properties and listings, not just records they own. Enable **View All** on these three objects for the community profile:
|
|
358
|
+
|
|
359
|
+
1. Go to **Setup > Object Manager**.
|
|
360
|
+
2. Search for and open **Property**.
|
|
361
|
+
3. Click **Object Access** in the left navigation.
|
|
362
|
+
4. Set the profile's access to allow viewing all records.
|
|
363
|
+
5. Repeat for **Property Listing** and **Maintenance Worker**.
|
|
364
|
+
|
|
365
|
+
- **Note**: the access for the **Maintenance Worker** is required for the `MaintenanceRequestTriggerHandler` to auto assign a worker on submission
|
|
366
|
+
|
|
367
|
+
#### 2d. Configure Field Level Security for the Application
|
|
368
|
+
|
|
369
|
+
1. Go to **Setup > Object Manager**.
|
|
370
|
+
2. Search for and open **Application**.
|
|
371
|
+
3. Click **Fields and Relationships** in the left navigation.
|
|
372
|
+
4. Select the `References__c` field, then click **Set Field-Level Security**.
|
|
373
|
+
5. Enable the field to be "Visible" to the community profile.
|
|
374
|
+
6. Click **Save**.
|
|
375
|
+
7. Repeat for the following fields:
|
|
376
|
+
|
|
377
|
+
- `Property__c`
|
|
378
|
+
- `Employment__c`
|
|
379
|
+
- `User__c`
|
|
380
|
+
- `Status__c`
|
|
381
|
+
- `Start_Date__c`
|
|
382
|
+
|
|
383
|
+
---
|
|
90
384
|
|
|
91
|
-
|
|
92
|
-
| ------------------------ | ---------------------------------------------------------------- |
|
|
93
|
-
| `--skip-login` | Skip browser login (org already authenticated) |
|
|
94
|
-
| `--skip-data` | Skip data preparation and import |
|
|
95
|
-
| `--skip-graphql` | Skip GraphQL schema fetch and codegen |
|
|
96
|
-
| `--skip-ui-bundle-build` | Skip `npm install` and UI Bundle build |
|
|
97
|
-
| `--skip-dev` | Do not start the dev server at the end |
|
|
98
|
-
| `--permset <name>` | Permission set to assign (default: `Property_Management_Access`) |
|
|
99
|
-
| `--app <name>` | Web app folder name when multiple exist |
|
|
385
|
+
### Step 3: Configure the Experience Cloud Site
|
|
100
386
|
|
|
101
|
-
|
|
387
|
+
After deploying the Experience Cloud site metadata, configure its membership and self-registration settings.
|
|
388
|
+
|
|
389
|
+
1. In the App Launcher, open the **Digital Experiences** app (search for it if needed).
|
|
390
|
+
2. Find the **Property Rental App** site and click **Workspaces**.
|
|
391
|
+
3. Click the **Administration** tile.
|
|
392
|
+
|
|
393
|
+
#### Members
|
|
394
|
+
|
|
395
|
+
1. In the left navigation, click **Members**.
|
|
396
|
+
2. Under **Select Profiles**, add the cloned community profile (`Property Rental Tenant`) to the **Selected Profiles** list.
|
|
397
|
+
3. Click **Save**.
|
|
398
|
+
|
|
399
|
+
#### Login & Registration
|
|
400
|
+
|
|
401
|
+
1. In the left navigation, click **Login & Registration**.
|
|
402
|
+
2. Check **Allow customers and partners to self-register**.
|
|
403
|
+
3. Under **Registration**, set:
|
|
404
|
+
- **Profile**: Select your cloned community profile (`Property Rental Tenant`).
|
|
405
|
+
- **Account**: Select or create an account record to associate self-registered users with (e.g., a generic "Portal Account").
|
|
406
|
+
4. Click **Save**.
|
|
407
|
+
|
|
408
|
+
#### Guest User Profile
|
|
409
|
+
|
|
410
|
+
The site's guest user profile controls what unauthenticated visitors can see. You will configure this profile in [Step 4](#step-4-configure-the-guest-user-profile). To navigate to it:
|
|
411
|
+
|
|
412
|
+
1. In the **Administration** area, click **Preferences** in the left navigation.
|
|
413
|
+
2. Click the link next to **Guest user profile** to open it directly.
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
### Step 4: Configure the Guest User Profile
|
|
418
|
+
|
|
419
|
+
The guest user profile is auto-generated by Salesforce when an Experience Cloud site is created. It controls what unauthenticated visitors can access. Configure it to allow browsing of available properties only.
|
|
420
|
+
|
|
421
|
+
Open the guest user profile (linked from the site's Preferences page, as described above) and apply the following settings.
|
|
422
|
+
|
|
423
|
+
**Administrative Permissions:**
|
|
424
|
+
|
|
425
|
+
| Permission | Setting |
|
|
426
|
+
| ----------- | ------- |
|
|
427
|
+
| API Enabled | Checked |
|
|
428
|
+
|
|
429
|
+
> **Security note:** Enabling API access for the guest profile is required for the UI Bundle to make GraphQL API calls on behalf of unauthenticated users. Ensure that object-level and field-level permissions are restrictive (as listed below) to avoid exposing sensitive data.
|
|
430
|
+
|
|
431
|
+
**Custom Object Permissions:**
|
|
432
|
+
|
|
433
|
+
Guest users can only browse available properties and listings. All other objects are restricted.
|
|
434
|
+
|
|
435
|
+
| Object | Read | Create | Edit | Delete |
|
|
436
|
+
| :---------------------------------------- | :--: | :----: | :--: | :----: |
|
|
437
|
+
| Properties (`Property__c`) | ✓ | | | |
|
|
438
|
+
| Property Costs (`Property_Cost__c`) | ✓ | | | |
|
|
439
|
+
| Property Features (`Property_Feature__c`) | ✓ | | | |
|
|
440
|
+
| Property Images (`Property_Image__c`) | ✓ | | | |
|
|
441
|
+
| Property Listings (`Property_Listing__c`) | ✓ | | | |
|
|
442
|
+
| All other objects | — | — | — | — |
|
|
443
|
+
|
|
444
|
+
**Apex Class Access:**
|
|
445
|
+
|
|
446
|
+
Add the following classes. These are required for the self-registration and login flows available to unauthenticated users:
|
|
447
|
+
|
|
448
|
+
- `UIBundleLogin`
|
|
449
|
+
- `UIBundleRegistration`
|
|
450
|
+
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
### Step 5: Create Criteria-Based Sharing Rules for Guest Access
|
|
454
|
+
|
|
455
|
+
By default, Salesforce does not expose any records to guest users. You must create **criteria-based sharing rules** to make available properties and listings visible to unauthenticated site visitors.
|
|
456
|
+
|
|
457
|
+
> **Organization-Wide Defaults (OWD):** Criteria-based sharing rules for guest users only work correctly when the object's OWD is set to **Public Read Only** or **Private**. Verify your OWD settings at **Setup > Sharing Settings** before proceeding.
|
|
458
|
+
|
|
459
|
+
#### Create a Sharing Rule for Properties
|
|
460
|
+
|
|
461
|
+
1. Go to **Setup > Sharing Settings**.
|
|
462
|
+
2. Scroll to the **Property Sharing Rules** section and click **New**.
|
|
463
|
+
3. Configure the rule:
|
|
464
|
+
- **Label**: `Available Properties for Guest Users`
|
|
465
|
+
- **Rule Type**: Select **Based on criteria**
|
|
466
|
+
- **Criteria**: `Status Equals Available` (adjust the field and value to match your data model)
|
|
467
|
+
- **Share with**: Select **Guests of the Property Rental App site** (the guest user group for your Experience Cloud site)
|
|
468
|
+
- **Access Level**: `Read Only`
|
|
469
|
+
4. Click **Save**.
|
|
470
|
+
|
|
471
|
+
#### Create a Sharing Rule for Property Listings
|
|
472
|
+
|
|
473
|
+
Repeat the same steps in the **Property Listing Sharing Rules** section:
|
|
474
|
+
|
|
475
|
+
- **Label**: `Available Property Listings for Guest Users`
|
|
476
|
+
- **Rule Type**: `Based on criteria`
|
|
477
|
+
- **Criteria**: Match listings you want to expose (e.g., `Status Equals Active`)
|
|
478
|
+
- **Share with**: `Guests of the Property Rental App site`
|
|
479
|
+
- **Access Level**: `Read Only`
|
|
480
|
+
|
|
481
|
+
> **Note:** The "Guests of [site name]" option only appears in the sharing rule target list after the Experience Cloud site has been created and saved. If you do not see it, confirm the site metadata has been deployed and the site exists in the org.
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
## Local Development
|
|
486
|
+
|
|
487
|
+
Install project dependencies and start the dev server:
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
npm install
|
|
491
|
+
npm run sf-project-setup
|
|
492
|
+
```
|
|
102
493
|
|
|
103
|
-
|
|
494
|
+
This installs the UI Bundle dependencies, builds the app, and opens the dev server at `http://localhost:5173`. For manual build and test instructions, see the [UI Bundle README](force-app/main/default/uiBundles/propertyrentalapp/README.md).
|
|
104
495
|
|
|
105
|
-
|
|
496
|
+
---
|
|
106
497
|
|
|
107
|
-
##
|
|
498
|
+
## Resources
|
|
108
499
|
|
|
109
500
|
- [Salesforce Extensions Documentation](https://developer.salesforce.com/tools/vscode/)
|
|
110
501
|
- [Salesforce CLI Setup Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm)
|
|
111
502
|
- [Salesforce DX Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm)
|
|
112
503
|
- [Salesforce CLI Command Reference](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm)
|
|
504
|
+
- [Experience Cloud Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.communities_dev.meta/communities_dev/communities_dev_intro.htm)
|
|
505
|
+
- [Salesforce DX Project Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm)
|
|
@@ -103,7 +103,7 @@ private class MaintenanceRequestTriggerHandler_Test {
|
|
|
103
103
|
Maintenance_Request__c request = new Maintenance_Request__c(
|
|
104
104
|
Type__c = 'Electrical',
|
|
105
105
|
Description__c = 'Outlet not working',
|
|
106
|
-
Priority__c = 'High
|
|
106
|
+
Priority__c = 'High'
|
|
107
107
|
);
|
|
108
108
|
insert request;
|
|
109
109
|
Test.stopTest();
|
|
@@ -129,7 +129,7 @@ private class MaintenanceRequestTriggerHandler_Test {
|
|
|
129
129
|
Maintenance_Request__c request = new Maintenance_Request__c(
|
|
130
130
|
Type__c = 'HVAC',
|
|
131
131
|
Description__c = 'AC not cooling',
|
|
132
|
-
Priority__c = 'High
|
|
132
|
+
Priority__c = 'High'
|
|
133
133
|
);
|
|
134
134
|
insert request;
|
|
135
135
|
Test.stopTest();
|
|
@@ -203,10 +203,10 @@ private class MaintenanceRequestTriggerHandler_Test {
|
|
|
203
203
|
static void testBulkRequestAssignment() {
|
|
204
204
|
Test.startTest();
|
|
205
205
|
List<Maintenance_Request__c> requests = new List<Maintenance_Request__c>{
|
|
206
|
-
new Maintenance_Request__c(Type__c = 'Plumbing', Description__c = 'Leak 1', Priority__c = 'High
|
|
206
|
+
new Maintenance_Request__c(Type__c = 'Plumbing', Description__c = 'Leak 1', Priority__c = 'High'),
|
|
207
207
|
new Maintenance_Request__c(Type__c = 'Electrical', Description__c = 'Issue 1', Priority__c = 'Standard'),
|
|
208
208
|
new Maintenance_Request__c(Type__c = 'Plumbing', Description__c = 'Leak 2', Priority__c = 'Standard'),
|
|
209
|
-
new Maintenance_Request__c(Type__c = 'HVAC', Description__c = 'AC Issue', Priority__c = 'High
|
|
209
|
+
new Maintenance_Request__c(Type__c = 'HVAC', Description__c = 'AC Issue', Priority__c = 'High'),
|
|
210
210
|
new Maintenance_Request__c(Type__c = 'Appliance', Description__c = 'Fridge Issue', Priority__c = 'Standard')
|
|
211
211
|
};
|
|
212
212
|
insert requests;
|
|
@@ -261,7 +261,7 @@ private class MaintenanceRequestTriggerHandler_Test {
|
|
|
261
261
|
Maintenance_Request__c request = new Maintenance_Request__c(
|
|
262
262
|
Type__c = 'Plumbing',
|
|
263
263
|
Description__c = 'Emergency leak',
|
|
264
|
-
Priority__c = 'High
|
|
264
|
+
Priority__c = 'High'
|
|
265
265
|
);
|
|
266
266
|
insert request;
|
|
267
267
|
Test.stopTest();
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"User__c": "@TenantRef2",
|
|
27
27
|
"Description__c": "Main bedroom electrical outlet stopped working. No power to the entire wall. Possible circuit breaker issue.",
|
|
28
28
|
"Type__c": "Electrical",
|
|
29
|
-
"Priority__c": "High
|
|
29
|
+
"Priority__c": "High",
|
|
30
30
|
"Status__c": "Resolved",
|
|
31
31
|
"Est_Cost__c": 200.0,
|
|
32
32
|
"Actual_Cost__c": 185.0,
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"User__c": "@TenantRef3",
|
|
44
44
|
"Description__c": "Air conditioning unit is making loud grinding noises when running. May need bearing replacement or refrigerant check.",
|
|
45
45
|
"Type__c": "HVAC",
|
|
46
|
-
"Priority__c": "High
|
|
46
|
+
"Priority__c": "High",
|
|
47
47
|
"Status__c": "In Progress",
|
|
48
48
|
"Est_Cost__c": 300.0,
|
|
49
49
|
"Actual_Cost__c": null,
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"User__c": "@TenantRef15",
|
|
163
163
|
"Description__c": "Post-tenant move-out deep cleaning including carpets, windows, appliances, and all surfaces.",
|
|
164
164
|
"Type__c": "Appliance",
|
|
165
|
-
"Priority__c": "High
|
|
165
|
+
"Priority__c": "High",
|
|
166
166
|
"Status__c": "Resolved",
|
|
167
167
|
"Est_Cost__c": 450.0,
|
|
168
168
|
"Actual_Cost__c": 425.0,
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
"User__c": "@TenantRef8",
|
|
180
180
|
"Description__c": "Annual roof inspection revealed loose tiles that need securing and replacement before winter season.",
|
|
181
181
|
"Type__c": "Plumbing",
|
|
182
|
-
"Priority__c": "High
|
|
182
|
+
"Priority__c": "High",
|
|
183
183
|
"Status__c": "In Progress",
|
|
184
184
|
"Est_Cost__c": 800.0,
|
|
185
185
|
"Actual_Cost__c": null,
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
"User__c": "@TenantRef7",
|
|
214
214
|
"Description__c": "Main entrance lock is sticking and needs replacement for new tenant security and smooth operation.",
|
|
215
215
|
"Type__c": "Appliance",
|
|
216
|
-
"Priority__c": "High
|
|
216
|
+
"Priority__c": "High",
|
|
217
217
|
"Status__c": "Resolved",
|
|
218
218
|
"Est_Cost__c": 120.0,
|
|
219
219
|
"Actual_Cost__c": 110.0,
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
"User__c": "@TenantRef6",
|
|
282
282
|
"Description__c": "Monthly elevator maintenance and safety inspection as required by local building code regulations.",
|
|
283
283
|
"Type__c": "Electrical",
|
|
284
|
-
"Priority__c": "High
|
|
284
|
+
"Priority__c": "High",
|
|
285
285
|
"Status__c": "Resolved",
|
|
286
286
|
"Est_Cost__c": 300.0,
|
|
287
287
|
"Actual_Cost__c": 300.0,
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
"User__c": "@TenantRef10",
|
|
367
367
|
"Description__c": "Annual electrical panel inspection and circuit breaker testing to ensure electrical safety compliance.",
|
|
368
368
|
"Type__c": "Electrical",
|
|
369
|
-
"Priority__c": "High
|
|
369
|
+
"Priority__c": "High",
|
|
370
370
|
"Status__c": "New",
|
|
371
371
|
"Est_Cost__c": 250.0,
|
|
372
372
|
"Actual_Cost__c": null,
|
|
@@ -417,7 +417,7 @@
|
|
|
417
417
|
"User__c": "@TenantRef15",
|
|
418
418
|
"Description__c": "Install new washer and dryer units in laundry room for incoming tenant. Connect water, drain, and electrical.",
|
|
419
419
|
"Type__c": "Appliance",
|
|
420
|
-
"Priority__c": "High
|
|
420
|
+
"Priority__c": "High",
|
|
421
421
|
"Status__c": "In Progress",
|
|
422
422
|
"Est_Cost__c": 200.0,
|
|
423
423
|
"Actual_Cost__c": null,
|
package/dist/force-app/main/default/objects/Maintenance_Request__c/fields/Priority__c.field-meta.xml
CHANGED
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
<valueSetDefinition>
|
|
14
14
|
<sorted>false</sorted>
|
|
15
15
|
<value>
|
|
16
|
-
<fullName>Emergency
|
|
16
|
+
<fullName>Emergency</fullName>
|
|
17
17
|
<default>false</default>
|
|
18
18
|
<label>Emergency (2hr)</label>
|
|
19
19
|
</value>
|
|
20
20
|
<value>
|
|
21
|
-
<fullName>High
|
|
21
|
+
<fullName>High</fullName>
|
|
22
22
|
<default>false</default>
|
|
23
23
|
<label>High (Same Day)</label>
|
|
24
24
|
</value>
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@salesforce/sdk-data": "^1.119.
|
|
19
|
-
"@salesforce/ui-bundle": "^1.119.
|
|
18
|
+
"@salesforce/sdk-data": "^1.119.3",
|
|
19
|
+
"@salesforce/ui-bundle": "^1.119.3",
|
|
20
20
|
"@tailwindcss/vite": "^4.1.17",
|
|
21
21
|
"class-variance-authority": "^0.7.1",
|
|
22
22
|
"clsx": "^2.1.1",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
48
48
|
"@graphql-tools/utils": "^11.0.0",
|
|
49
49
|
"@playwright/test": "^1.49.0",
|
|
50
|
-
"@salesforce/vite-plugin-ui-bundle": "^1.119.
|
|
50
|
+
"@salesforce/vite-plugin-ui-bundle": "^1.119.3",
|
|
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",
|
|
@@ -44,8 +44,8 @@ const TYPE_OPTIONS = [
|
|
|
44
44
|
|
|
45
45
|
const PRIORITY_OPTIONS = [
|
|
46
46
|
{ value: "Standard", label: "Standard" },
|
|
47
|
-
{ value: "High
|
|
48
|
-
{ value: "Emergency
|
|
47
|
+
{ value: "High", label: "High (Same Day)" },
|
|
48
|
+
{ value: "Emergency", label: "Emergency (2hr)" },
|
|
49
49
|
] as const;
|
|
50
50
|
|
|
51
51
|
const FILTER_CONFIGS: FilterFieldConfig[] = [];
|
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.119.
|
|
3
|
+
"version": "1.119.3",
|
|
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.119.
|
|
9
|
+
"version": "1.119.3",
|
|
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