@salesforce/templates 66.17.0 → 66.17.2
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/lib/templates/project/angularextapp/_p_/_m_/_w_/_a_/package-lock.json +3 -3
- package/lib/templates/project/angularintapp/_p_/_m_/_w_/_a_/package-lock.json +3 -3
- package/lib/templates/project/reactexternalapp/CHANGELOG.md +129 -0
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/package-lock.json +9 -9
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/package.json +6 -6
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/forms/auth-form.tsx +14 -2
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/hooks/form.tsx +12 -3
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/layouts/privateRouteLayout.tsx +1 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/menu/AuthMenu.tsx +43 -5
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/pages/ChangePassword.tsx +1 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/pages/ForgotPassword.tsx +8 -4
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/pages/Login.tsx +1 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/pages/Register.tsx +1 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/pages/ResetPassword.tsx +2 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/authentication/sessionTimeout/SessionTimeoutValidator.tsx +32 -9
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/adapters/sobject/parseResponse.ts +1 -2
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/api/distinctValuesService.ts +3 -6
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/MergedSearchResults.tsx +4 -4
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/Search.tsx +5 -2
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/SourceSection.tsx +5 -4
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/controls/PaginationControls.tsx +5 -6
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/controls/SearchBar.tsx +4 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/results/CmsResultRow.tsx +52 -5
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/results/DefaultResultRow.tsx +4 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/_f_/search/types.ts +1 -3
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/appLayout.tsx +13 -4
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/components/alerts/status-alert.tsx +1 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/components/ui/alert.tsx +1 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/components/ui/button.tsx +2 -2
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/components/ui/checkbox.tsx +1 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/components/ui/input.tsx +1 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/components/ui/select.tsx +1 -1
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/pages/AccountObjectDetailPage.tsx +34 -17
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/pages/NotFound.tsx +22 -15
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/routes.tsx +1 -0
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/src/styles/global.css +2 -2
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/tsconfig.tsbuildinfo +1 -1
- package/lib/templates/project/reactexternalapp/package.json +1 -1
- package/lib/templates/project/reactexternalapp/scripts/network-senders.mjs +84 -0
- package/lib/templates/project/reactexternalapp/scripts/org-setup-xml.mjs +11 -6
- package/lib/templates/project/reactexternalapp/scripts/org-setup.mjs +13 -5
- package/lib/templates/project/reactinternalapp/CHANGELOG.md +129 -0
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package-lock.json +9 -9
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package.json +6 -6
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/adapters/sobject/parseResponse.ts +1 -2
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/api/distinctValuesService.ts +3 -6
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/MergedSearchResults.tsx +4 -4
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/Search.tsx +5 -2
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/SourceSection.tsx +5 -4
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/controls/PaginationControls.tsx +5 -6
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/controls/SearchBar.tsx +4 -1
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/results/CmsResultRow.tsx +52 -5
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/results/DefaultResultRow.tsx +4 -1
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/types.ts +1 -3
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/appLayout.tsx +10 -4
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/alerts/status-alert.tsx +1 -1
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/ui/alert.tsx +1 -1
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/ui/button.tsx +2 -2
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/ui/checkbox.tsx +1 -1
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/ui/input.tsx +1 -1
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/ui/select.tsx +1 -1
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/pages/AccountObjectDetailPage.tsx +30 -13
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/pages/NotFound.tsx +22 -15
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/routes.tsx +1 -0
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/styles/global.css +2 -2
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/tsconfig.tsbuildinfo +1 -1
- package/lib/templates/project/reactinternalapp/package.json +1 -1
- package/lib/templates/project/reactinternalapp/scripts/network-senders.mjs +84 -0
- package/lib/templates/project/reactinternalapp/scripts/org-setup-xml.mjs +11 -6
- package/lib/templates/project/reactinternalapp/scripts/org-setup.mjs +13 -5
- package/lib/templates/uiBundles/angularbasic/package-lock.json +3 -3
- package/lib/templates/uiBundles/reactbasic/package-lock.json +9 -9
- package/lib/templates/uiBundles/reactbasic/package.json +6 -6
- package/lib/templates/uiBundles/reactbasic/src/components/alerts/status-alert.tsx +1 -1
- package/lib/templates/uiBundles/reactbasic/src/components/ui/alert.tsx +1 -1
- package/lib/templates/uiBundles/reactbasic/src/components/ui/button.tsx +2 -2
- package/lib/templates/uiBundles/reactbasic/src/components/ui/checkbox.tsx +1 -1
- package/lib/templates/uiBundles/reactbasic/src/components/ui/input.tsx +1 -1
- package/lib/templates/uiBundles/reactbasic/src/components/ui/select.tsx +1 -1
- package/lib/templates/uiBundles/reactbasic/src/styles/global.css +2 -2
- package/lib/templates/uiBundles/vuebasic/package-lock.json +10 -10
- package/package.json +6 -5
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { join, resolve, dirname } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { XMLBuilder } from 'fast-xml-parser';
|
|
6
|
+
import { parseNetworkDocument, NetworkXmlError } from './org-setup-xml.mjs';
|
|
7
|
+
import { escapeSoqlString } from './org-setup-utils.mjs';
|
|
8
|
+
|
|
9
|
+
const builder = new XMLBuilder({
|
|
10
|
+
ignoreAttributes: false,
|
|
11
|
+
commentPropName: '#comment',
|
|
12
|
+
format: true,
|
|
13
|
+
indentBy: ' ',
|
|
14
|
+
suppressEmptyNode: true,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export function preserveNetworkSenders(projectDir, targetOrg, run = execFileSync) {
|
|
18
|
+
const project = JSON.parse(readFileSync(join(projectDir, 'sfdx-project.json'), 'utf8'));
|
|
19
|
+
const files = (project.packageDirectories ?? []).flatMap(({ path }) => {
|
|
20
|
+
const dir = join(projectDir, path, 'main/default/networks');
|
|
21
|
+
if (!existsSync(dir)) return [];
|
|
22
|
+
return readdirSync(dir)
|
|
23
|
+
.filter((name) => name.endsWith('.network-meta.xml'))
|
|
24
|
+
.map((name) => ({ name: name.slice(0, -'.network-meta.xml'.length), path: join(dir, name) }));
|
|
25
|
+
});
|
|
26
|
+
if (!files.length) return;
|
|
27
|
+
|
|
28
|
+
const names = [...new Set(files.map(({ name }) => `'${escapeSoqlString(name)}'`))];
|
|
29
|
+
const response = JSON.parse(run('sf', [
|
|
30
|
+
'data', 'query', '--target-org', targetOrg,
|
|
31
|
+
'--query', `SELECT Name, EmailSenderAddress FROM Network WHERE Name IN (${names.join(',')})`,
|
|
32
|
+
'--json',
|
|
33
|
+
], { cwd: projectDir, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 60000 }));
|
|
34
|
+
if (response.status !== 0 || !Array.isArray(response.result?.records) || !response.result.done) {
|
|
35
|
+
throw new Error('Could not read all target Network sender addresses; deployment stopped.');
|
|
36
|
+
}
|
|
37
|
+
const senders = new Map(response.result.records.map((record) => [record.Name, record.EmailSenderAddress]));
|
|
38
|
+
|
|
39
|
+
const updates = files.map((file) => {
|
|
40
|
+
const original = readFileSync(file.path, 'utf8');
|
|
41
|
+
const document = parseNetworkDocument(original);
|
|
42
|
+
const network = document.Network;
|
|
43
|
+
let changed = false;
|
|
44
|
+
if (senders.has(file.name)) {
|
|
45
|
+
const sender = senders.get(file.name);
|
|
46
|
+
if (typeof sender !== 'string' || !sender.trim()) {
|
|
47
|
+
throw new Error(`The target Network "${file.name}" has no sender address; deployment stopped.`);
|
|
48
|
+
}
|
|
49
|
+
if (typeof network.emailSenderAddress !== 'string') {
|
|
50
|
+
throw new NetworkXmlError(`Expected one emailSenderAddress in ${file.name}.network-meta.xml`);
|
|
51
|
+
}
|
|
52
|
+
if (network.emailSenderAddress !== sender) {
|
|
53
|
+
network.emailSenderAddress = sender;
|
|
54
|
+
changed = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Sender changes belong to the site's Administration workspace.
|
|
58
|
+
if ('newSenderAddress' in network) {
|
|
59
|
+
delete network.newSenderAddress;
|
|
60
|
+
changed = true;
|
|
61
|
+
}
|
|
62
|
+
return { ...file, xml: changed ? builder.build(document) : original, changed };
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
for (const file of updates) {
|
|
66
|
+
if (file.changed) writeFileSync(file.path, file.xml);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
71
|
+
const args = process.argv.slice(2);
|
|
72
|
+
if (args.length !== 2 || args[0] !== '--target-org' || !args[1].trim()) {
|
|
73
|
+
console.error('Usage: node scripts/network-senders.mjs --target-org <alias>');
|
|
74
|
+
process.exitCode = 1;
|
|
75
|
+
} else {
|
|
76
|
+
try {
|
|
77
|
+
preserveNetworkSenders(resolve(dirname(fileURLToPath(import.meta.url)), '..'), args[1]);
|
|
78
|
+
console.log('Network metadata prepared with the target org sender addresses.');
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error(`Network metadata preparation failed: ${error.message}`);
|
|
81
|
+
process.exitCode = 1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -39,6 +39,7 @@ const parser = new XMLParser({
|
|
|
39
39
|
ignoreAttributes: false,
|
|
40
40
|
parseTagValue: false,
|
|
41
41
|
parseAttributeValue: false,
|
|
42
|
+
commentPropName: '#comment',
|
|
42
43
|
});
|
|
43
44
|
|
|
44
45
|
/**
|
|
@@ -73,22 +74,26 @@ export function assertSafeProfileName(name) {
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
/**
|
|
76
|
-
* Parse + assert this is a Network metadata document. Returns the parsed
|
|
77
|
-
*
|
|
77
|
+
* Parse + assert this is a Network metadata document. Returns the full parsed
|
|
78
|
+
* document. Throws NetworkXmlError if the root is missing (e.g. a file
|
|
78
79
|
* that is not actually network metadata).
|
|
79
80
|
*/
|
|
80
|
-
export function
|
|
81
|
+
export function parseNetworkDocument(xml) {
|
|
81
82
|
let parsed;
|
|
82
83
|
try {
|
|
83
|
-
parsed = parser.parse(xml);
|
|
84
|
+
parsed = parser.parse(xml, true);
|
|
84
85
|
} catch (e) {
|
|
85
86
|
throw new NetworkXmlError(`network metadata is not well-formed XML: ${e.message}`);
|
|
86
87
|
}
|
|
87
88
|
const network = parsed?.[NETWORK_ROOT];
|
|
88
|
-
if (network == null || typeof network !== 'object') {
|
|
89
|
+
if (network == null || typeof network !== 'object' || Array.isArray(network)) {
|
|
89
90
|
throw new NetworkXmlError(`expected a <${NETWORK_ROOT}> root node, but none was found`);
|
|
90
91
|
}
|
|
91
|
-
return
|
|
92
|
+
return parsed;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function parseNetwork(xml) {
|
|
96
|
+
return parseNetworkDocument(xml)[NETWORK_ROOT];
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
/** Normalize a fast-xml-parser child (absent | scalar | array) to an array. */
|
|
@@ -55,6 +55,7 @@ import {
|
|
|
55
55
|
import { tmpdir } from 'node:os';
|
|
56
56
|
|
|
57
57
|
import { validateConfig } from './org-setup-config-schema.mjs';
|
|
58
|
+
import { preserveNetworkSenders } from './network-senders.mjs';
|
|
58
59
|
import {
|
|
59
60
|
addProfileToMemberGroups,
|
|
60
61
|
enableSelfRegInXml,
|
|
@@ -1149,9 +1150,14 @@ function ensureLogoutUrl(logoutUrl, siteName, targetOrg) {
|
|
|
1149
1150
|
writeFileSync(networkXmlPath, result.xml);
|
|
1150
1151
|
console.log(` Set <logoutUrl>${absoluteUrl}</logoutUrl> in ${siteName}.network-meta.xml`);
|
|
1151
1152
|
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1153
|
+
try {
|
|
1154
|
+
preserveNetworkSenders(ROOT, targetOrg);
|
|
1155
|
+
} catch (e) {
|
|
1156
|
+
console.error(` ERROR: cannot prepare Network metadata for "${siteName}" — ${e.message}. Skipping logout URL deployment.`);
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
// Logout URL deployment is best-effort.
|
|
1155
1161
|
const deployResult = spawnSync('sf', [
|
|
1156
1162
|
'project', 'deploy', 'start',
|
|
1157
1163
|
'--target-org', targetOrg,
|
|
@@ -1160,8 +1166,7 @@ function ensureLogoutUrl(logoutUrl, siteName, targetOrg) {
|
|
|
1160
1166
|
if (deployResult.status !== 0) {
|
|
1161
1167
|
console.error(
|
|
1162
1168
|
` ERROR: failed to deploy <logoutUrl> for "${siteName}" (sf exit ${deployResult.status ?? 1}). ` +
|
|
1163
|
-
`
|
|
1164
|
-
`set the logout URL manually in the site's Administration settings.`,
|
|
1169
|
+
`Set the logout URL manually in the site's Administration settings.`,
|
|
1165
1170
|
);
|
|
1166
1171
|
return;
|
|
1167
1172
|
}
|
|
@@ -1208,6 +1213,8 @@ function enableSelfRegistration(selfRegConfig, siteName, targetOrg) {
|
|
|
1208
1213
|
writeFileSync(networkXmlPath, result.xml);
|
|
1209
1214
|
console.log(` Updated ${siteName}.network-meta.xml: selfRegistration=true, selfRegProfile=${selfRegProfile}`);
|
|
1210
1215
|
|
|
1216
|
+
preserveNetworkSenders(ROOT, targetOrg);
|
|
1217
|
+
|
|
1211
1218
|
// Re-deploy only the network file
|
|
1212
1219
|
const deployResult = spawnSync('sf', [
|
|
1213
1220
|
'project', 'deploy', 'start',
|
|
@@ -2118,6 +2125,7 @@ async function main() {
|
|
|
2118
2125
|
throw new StepError(`deploy blocked — ${licenseGate.reason}`);
|
|
2119
2126
|
}
|
|
2120
2127
|
}
|
|
2128
|
+
preserveNetworkSenders(ROOT, targetOrg);
|
|
2121
2129
|
run('Deploy metadata', 'sf', ['project', 'deploy', 'start', '--target-org', targetOrg], {
|
|
2122
2130
|
timeout: 180000,
|
|
2123
2131
|
});
|
|
@@ -3,6 +3,135 @@
|
|
|
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
|
+
## [12.9.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.8.0...v12.9.0) (2026-09-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [12.8.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.7.0...v12.8.0) (2026-09-23)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [12.7.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.6.3...v12.7.0) (2026-09-22)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **template-sfdx-project:** preserve target network sender addresses @W-24209513@ ([#993](https://github.com/salesforce-experience-platform-emu/webapps/issues/993)) ([fddbfdd](https://github.com/salesforce-experience-platform-emu/webapps/commit/fddbfddcb41270720372b0fd4c486f043d9ba8c5))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## [12.6.3](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.6.2...v12.6.3) (2026-09-14)
|
|
32
|
+
|
|
33
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [12.6.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.6.1...v12.6.2) (2026-09-14)
|
|
40
|
+
|
|
41
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## [12.6.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.6.0...v12.6.1) (2026-09-11)
|
|
48
|
+
|
|
49
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## [12.6.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.5.8...v12.6.0) (2026-09-11)
|
|
56
|
+
|
|
57
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## [12.5.8](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.5.7...v12.5.8) (2026-09-11)
|
|
64
|
+
|
|
65
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## [12.5.7](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.5.6...v12.5.7) (2026-09-11)
|
|
72
|
+
|
|
73
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## [12.5.6](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.5.5...v12.5.6) (2026-09-11)
|
|
80
|
+
|
|
81
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## [12.5.5](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.5.4...v12.5.5) (2026-09-10)
|
|
88
|
+
|
|
89
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## [12.5.4](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.5.3...v12.5.4) (2026-09-09)
|
|
96
|
+
|
|
97
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## [12.5.3](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.5.2...v12.5.3) (2026-09-08)
|
|
104
|
+
|
|
105
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
## [12.5.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.5.1...v12.5.2) (2026-09-08)
|
|
112
|
+
|
|
113
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
## [12.5.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.5.0...v12.5.1) (2026-09-07)
|
|
120
|
+
|
|
121
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## [12.5.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.4.5...v12.5.0) (2026-09-04)
|
|
128
|
+
|
|
129
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
6
135
|
## [12.4.5](https://github.com/salesforce-experience-platform-emu/webapps/compare/v12.4.4...v12.4.5) (2026-09-03)
|
|
7
136
|
|
|
8
137
|
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@salesforce/agentforce-conversation-client": "^12.0.0",
|
|
13
|
-
"@salesforce/platform-sdk": "^12.
|
|
14
|
-
"@salesforce/ui-bundle": "^12.
|
|
13
|
+
"@salesforce/platform-sdk": "^12.9.0",
|
|
14
|
+
"@salesforce/ui-bundle": "^12.9.0",
|
|
15
15
|
"@tailwindcss/vite": "^4.1.17",
|
|
16
16
|
"class-variance-authority": "^0.7.1",
|
|
17
17
|
"clsx": "^2.1.1",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
37
37
|
"@graphql-tools/utils": "^11.0.0",
|
|
38
38
|
"@playwright/test": "^1.49.0",
|
|
39
|
-
"@salesforce/graphiti": "^12.
|
|
40
|
-
"@salesforce/vite-plugin-ui-bundle": "^12.
|
|
39
|
+
"@salesforce/graphiti": "^12.9.0",
|
|
40
|
+
"@salesforce/vite-plugin-ui-bundle": "^12.9.0",
|
|
41
41
|
"@testing-library/jest-dom": "^6.6.3",
|
|
42
42
|
"@testing-library/react": "^16.1.0",
|
|
43
43
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/react": "^19.2.5",
|
|
46
46
|
"@types/react-dom": "^19.2.3",
|
|
47
47
|
"@vitejs/plugin-react": "^5.1.1",
|
|
48
|
-
"@vitest/ui": "^4.1.
|
|
48
|
+
"@vitest/ui": "^4.1.11",
|
|
49
49
|
"eslint": "^9.39.1",
|
|
50
50
|
"eslint-plugin-react": "^7.37.2",
|
|
51
51
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"typescript-eslint": "^8.46.4",
|
|
61
61
|
"vite": "^7.2.4",
|
|
62
62
|
"vite-plugin-graphql-codegen": "^3.6.3",
|
|
63
|
-
"vitest": "^4.1.
|
|
63
|
+
"vitest": "^4.1.11"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=22"
|
|
@@ -14676,9 +14676,9 @@
|
|
|
14676
14676
|
"license": "MIT"
|
|
14677
14677
|
},
|
|
14678
14678
|
"node_modules/electron-to-chromium": {
|
|
14679
|
-
"version": "1.5.
|
|
14680
|
-
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.
|
|
14681
|
-
"integrity": "sha512-
|
|
14679
|
+
"version": "1.5.454",
|
|
14680
|
+
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.454.tgz",
|
|
14681
|
+
"integrity": "sha512-NqD5GhkXnxJpDQVCmmpc546qjH6kei2VI9m45CTF+sQU7bcS7YeVt7ba0cnjueMH1AXGRu/driZUP9iYVSv7vg==",
|
|
14682
14682
|
"license": "ISC"
|
|
14683
14683
|
},
|
|
14684
14684
|
"node_modules/emoji-regex": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@salesforce/platform-sdk": "^12.
|
|
23
|
-
"@salesforce/ui-bundle": "^12.
|
|
22
|
+
"@salesforce/platform-sdk": "^12.9.0",
|
|
23
|
+
"@salesforce/ui-bundle": "^12.9.0",
|
|
24
24
|
"@tailwindcss/vite": "^4.1.17",
|
|
25
25
|
"class-variance-authority": "^0.7.1",
|
|
26
26
|
"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": "^12.
|
|
50
|
-
"@salesforce/vite-plugin-ui-bundle": "^12.
|
|
49
|
+
"@salesforce/graphiti": "^12.9.0",
|
|
50
|
+
"@salesforce/vite-plugin-ui-bundle": "^12.9.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",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/react": "^19.2.5",
|
|
56
56
|
"@types/react-dom": "^19.2.3",
|
|
57
57
|
"@vitejs/plugin-react": "^5.1.1",
|
|
58
|
-
"@vitest/ui": "^4.1.
|
|
58
|
+
"@vitest/ui": "^4.1.11",
|
|
59
59
|
"eslint": "^9.39.1",
|
|
60
60
|
"eslint-plugin-react": "^7.37.2",
|
|
61
61
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"typescript-eslint": "^8.46.4",
|
|
71
71
|
"vite": "^7.2.4",
|
|
72
72
|
"vite-plugin-graphql-codegen": "^3.6.3",
|
|
73
|
-
"vitest": "^4.1.
|
|
73
|
+
"vitest": "^4.1.11"
|
|
74
74
|
},
|
|
75
75
|
"overrides": {
|
|
76
76
|
"lodash": "^4.18.1",
|
|
@@ -31,8 +31,7 @@ export function parseSObjectResponse(
|
|
|
31
31
|
request: SourceRequest<SObjectSourceConfig>,
|
|
32
32
|
): SourceResult | null {
|
|
33
33
|
const queryRoot = (root?.uiapi as Record<string, unknown> | undefined)?.query as
|
|
34
|
-
|
|
35
|
-
| undefined;
|
|
34
|
+
Record<string, RawSourceResult | null | undefined> | undefined;
|
|
36
35
|
|
|
37
36
|
const raw = queryRoot?.[request.source.key];
|
|
38
37
|
if (raw == null) return null;
|
|
@@ -64,18 +64,15 @@ export async function fetchDistinctValues(
|
|
|
64
64
|
|
|
65
65
|
const root = response.data as Record<string, unknown> | undefined;
|
|
66
66
|
const aggregate = (root?.uiapi as Record<string, unknown> | undefined)?.aggregate as
|
|
67
|
-
|
|
68
|
-
| undefined;
|
|
67
|
+
Record<string, unknown> | undefined;
|
|
69
68
|
const objectAgg = aggregate?.[objectName] as
|
|
70
|
-
|
|
71
|
-
| undefined;
|
|
69
|
+
{ edges?: Array<{ node?: { aggregate?: Record<string, unknown> } }> } | undefined;
|
|
72
70
|
const edges = objectAgg?.edges ?? [];
|
|
73
71
|
|
|
74
72
|
return edges
|
|
75
73
|
.map((edge) => {
|
|
76
74
|
const field = edge?.node?.aggregate?.[fieldName] as
|
|
77
|
-
|
|
78
|
-
| undefined;
|
|
75
|
+
{ value?: string | null; displayValue?: string | null; label?: string | null } | undefined;
|
|
79
76
|
const value = field?.value;
|
|
80
77
|
if (value == null || value === "") return null;
|
|
81
78
|
return { value, label: field?.label ?? field?.displayValue ?? value };
|
|
@@ -137,7 +137,7 @@ export function MergedSearchResults({
|
|
|
137
137
|
whole-request/network failure). Shown once, above the grid. */}
|
|
138
138
|
{error && (
|
|
139
139
|
<Alert variant="destructive" role="alert">
|
|
140
|
-
<AlertCircle />
|
|
140
|
+
<AlertCircle aria-hidden="true" />
|
|
141
141
|
<AlertTitle>Search failed</AlertTitle>
|
|
142
142
|
<AlertDescription>{error}</AlertDescription>
|
|
143
143
|
</Alert>
|
|
@@ -151,7 +151,7 @@ export function MergedSearchResults({
|
|
|
151
151
|
.filter((c) => !!c.error)
|
|
152
152
|
.map((c) => (
|
|
153
153
|
<Alert key={c.config.key} variant="destructive" role="alert">
|
|
154
|
-
<AlertCircle />
|
|
154
|
+
<AlertCircle aria-hidden="true" />
|
|
155
155
|
<AlertTitle>Failed to load {c.config.label}</AlertTitle>
|
|
156
156
|
<AlertDescription>{c.error}</AlertDescription>
|
|
157
157
|
</Alert>
|
|
@@ -171,14 +171,14 @@ export function MergedSearchResults({
|
|
|
171
171
|
<Skeleton key={i} className="h-48 w-full rounded-lg" />
|
|
172
172
|
))}
|
|
173
173
|
</div>
|
|
174
|
-
) : isShortQuery ? (
|
|
174
|
+
) : error ? null : isShortQuery ? (
|
|
175
175
|
<p className="py-12 text-center text-sm text-muted-foreground">{shortQueryMessage}</p>
|
|
176
176
|
) : mergedResults.length === 0 ? (
|
|
177
177
|
<p className="py-12 text-center text-sm text-muted-foreground">
|
|
178
178
|
{emptyMessage ?? "No results found."}
|
|
179
179
|
</p>
|
|
180
180
|
) : (
|
|
181
|
-
<ul className={gridClassName}>
|
|
181
|
+
<ul role="list" className={gridClassName}>
|
|
182
182
|
{mergedResults.map(({ sourceKey, node }, i) => {
|
|
183
183
|
const source = handle.sources[sourceKey]?.config;
|
|
184
184
|
if (!source) return null;
|
package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/_f_/search/components/Search.tsx
CHANGED
|
@@ -82,6 +82,8 @@ interface SearchProps {
|
|
|
82
82
|
/** Optional override for the entire header region. */
|
|
83
83
|
renderHeader?: (handle: SearchHandle) => ReactNode;
|
|
84
84
|
className?: string;
|
|
85
|
+
/** Root element tag; use `"main"` when this owns its route's landmark (WCAG 1.3.1). */
|
|
86
|
+
as?: "div" | "main";
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
export function Search({
|
|
@@ -97,6 +99,7 @@ export function Search({
|
|
|
97
99
|
allScopeLabel,
|
|
98
100
|
renderHeader,
|
|
99
101
|
className,
|
|
102
|
+
as: Root = "div",
|
|
100
103
|
}: SearchProps) {
|
|
101
104
|
// Resolve restrictTo to a lockedScope value, surfacing a clear error if
|
|
102
105
|
// the (kind, key) pair doesn't match any source. Memoize so it's
|
|
@@ -136,7 +139,7 @@ export function Search({
|
|
|
136
139
|
const showTotalResults = !merged && sourcesInScope >= 2;
|
|
137
140
|
|
|
138
141
|
return (
|
|
139
|
-
<
|
|
142
|
+
<Root className={`max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-6 space-y-6 ${className ?? ""}`}>
|
|
140
143
|
{renderHeader ? (
|
|
141
144
|
renderHeader(handle)
|
|
142
145
|
) : (
|
|
@@ -198,6 +201,6 @@ export function Search({
|
|
|
198
201
|
)}
|
|
199
202
|
</>
|
|
200
203
|
)}
|
|
201
|
-
</
|
|
204
|
+
</Root>
|
|
202
205
|
);
|
|
203
206
|
}
|
|
@@ -152,14 +152,14 @@ export function SourceSection({
|
|
|
152
152
|
|
|
153
153
|
{error && (
|
|
154
154
|
<Alert variant="destructive" role="alert">
|
|
155
|
-
<AlertCircle />
|
|
155
|
+
<AlertCircle aria-hidden="true" />
|
|
156
156
|
<AlertTitle>Failed to load {config.label}</AlertTitle>
|
|
157
157
|
<AlertDescription>{error}</AlertDescription>
|
|
158
158
|
</Alert>
|
|
159
159
|
)}
|
|
160
160
|
|
|
161
161
|
{showResults && (
|
|
162
|
-
<ul className="divide-y">
|
|
162
|
+
<ul role="list" className="divide-y">
|
|
163
163
|
{nodes.map((node, i) => (
|
|
164
164
|
<li key={getNodeKey(node, idField, i)} className="py-3">
|
|
165
165
|
{renderResult(node)}
|
|
@@ -171,9 +171,9 @@ export function SourceSection({
|
|
|
171
171
|
{showEmpty && (
|
|
172
172
|
<div className="flex flex-col items-center justify-center py-10 text-center">
|
|
173
173
|
{isShortQuery ? (
|
|
174
|
-
<Search className="size-10 text-muted-foreground mb-3" />
|
|
174
|
+
<Search aria-hidden="true" className="size-10 text-muted-foreground mb-3" />
|
|
175
175
|
) : (
|
|
176
|
-
<SearchX className="size-10 text-muted-foreground mb-3" />
|
|
176
|
+
<SearchX aria-hidden="true" className="size-10 text-muted-foreground mb-3" />
|
|
177
177
|
)}
|
|
178
178
|
<p className="text-sm text-muted-foreground">
|
|
179
179
|
{isShortQuery
|
|
@@ -195,6 +195,7 @@ export function SourceSection({
|
|
|
195
195
|
onPageSizeChange={pagination.setPageSize}
|
|
196
196
|
disabled={loading || !!error}
|
|
197
197
|
idPrefix={`page-size-${config.key}`}
|
|
198
|
+
navLabel={`${config.label} pagination`}
|
|
198
199
|
/>
|
|
199
200
|
</div>
|
|
200
201
|
</section>
|
|
@@ -37,6 +37,8 @@ interface PaginationControlsProps {
|
|
|
37
37
|
onGoToPage?: (pageIndex: number) => void;
|
|
38
38
|
disabled?: boolean;
|
|
39
39
|
idPrefix?: string;
|
|
40
|
+
/** Accessible name for the pagination `<nav>` landmark; keep it unique per instance (WCAG 1.3.1, landmark-unique). */
|
|
41
|
+
navLabel?: string;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
/**
|
|
@@ -76,6 +78,7 @@ export function PaginationControls({
|
|
|
76
78
|
onGoToPage,
|
|
77
79
|
disabled = false,
|
|
78
80
|
idPrefix = "page-size",
|
|
81
|
+
navLabel = "Pagination",
|
|
79
82
|
}: PaginationControlsProps) {
|
|
80
83
|
const handlePageSizeChange = (next: string) => {
|
|
81
84
|
const size = parseInt(next, 10);
|
|
@@ -104,11 +107,7 @@ export function PaginationControls({
|
|
|
104
107
|
<Label htmlFor={selectId} className="text-sm font-normal whitespace-nowrap">
|
|
105
108
|
Results per page:
|
|
106
109
|
</Label>
|
|
107
|
-
<Select
|
|
108
|
-
value={pageSize.toString()}
|
|
109
|
-
onValueChange={handlePageSizeChange}
|
|
110
|
-
disabled={disabled}
|
|
111
|
-
>
|
|
110
|
+
<Select value={pageSize.toString()} onValueChange={handlePageSizeChange}>
|
|
112
111
|
<SelectTrigger id={selectId} className="w-16">
|
|
113
112
|
<SelectValue />
|
|
114
113
|
</SelectTrigger>
|
|
@@ -121,7 +120,7 @@ export function PaginationControls({
|
|
|
121
120
|
</SelectContent>
|
|
122
121
|
</Select>
|
|
123
122
|
</div>
|
|
124
|
-
<Pagination className="w-full mx-0 sm:justify-end">
|
|
123
|
+
<Pagination aria-label={navLabel} className="w-full mx-0 sm:justify-end">
|
|
125
124
|
<PaginationContent>
|
|
126
125
|
<PaginationItem>
|
|
127
126
|
<PaginationPrevious
|
|
@@ -38,7 +38,10 @@ export function SearchBar({ value, onChange, placeholder = "Search…", classNam
|
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
40
|
<div className={`relative flex-1 ${className ?? ""}`}>
|
|
41
|
-
<Search
|
|
41
|
+
<Search
|
|
42
|
+
aria-hidden="true"
|
|
43
|
+
className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"
|
|
44
|
+
/>
|
|
42
45
|
<Input
|
|
43
46
|
type="text"
|
|
44
47
|
value={draft}
|