@salesforce/ui-bundle-template-app-react-sample-b2e 11.68.5 → 11.68.6
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 +8 -0
- package/dist/force-app/main/default/uiBundles/propertymanagementapp/package.json +4 -4
- package/dist/force-app/main/default/uiBundles/propertymanagementapp/src/features/search/adapters/cms/__tests__/contentTypeUtils.test.ts +15 -0
- package/dist/force-app/main/default/uiBundles/propertymanagementapp/src/features/search/adapters/cms/__tests__/searchableContentTypesService.test.ts +27 -0
- package/dist/force-app/main/default/uiBundles/propertymanagementapp/src/features/search/adapters/cms/api/searchableContentTypesService.ts +9 -6
- package/dist/force-app/main/default/uiBundles/propertymanagementapp/src/features/search/adapters/cms/contentTypeUtils.ts +7 -5
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/package.json +2 -2
package/dist/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.68.6](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.68.5...v11.68.6) (2026-08-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [11.68.5](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.68.4...v11.68.5) (2026-08-24)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@salesforce/platform-sdk": "^11.68.
|
|
22
|
-
"@salesforce/ui-bundle": "^11.68.
|
|
21
|
+
"@salesforce/platform-sdk": "^11.68.6",
|
|
22
|
+
"@salesforce/ui-bundle": "^11.68.6",
|
|
23
23
|
"@tailwindcss/vite": "^4.1.17",
|
|
24
24
|
"class-variance-authority": "^0.7.1",
|
|
25
25
|
"clsx": "^2.1.1",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
47
47
|
"@graphql-tools/utils": "^11.0.0",
|
|
48
48
|
"@playwright/test": "^1.49.0",
|
|
49
|
-
"@salesforce/graphiti": "^11.68.
|
|
50
|
-
"@salesforce/vite-plugin-ui-bundle": "^11.68.
|
|
49
|
+
"@salesforce/graphiti": "^11.68.6",
|
|
50
|
+
"@salesforce/vite-plugin-ui-bundle": "^11.68.6",
|
|
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",
|
|
@@ -30,6 +30,12 @@ describe("contentTypeUtils", () => {
|
|
|
30
30
|
expect(formatContentTypeLabel("sfdc_cms__videoContentAsset")).toBe("Video Content Asset");
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
+
it("strips the c__ prefix for custom content types", () => {
|
|
34
|
+
expect(formatContentTypeLabel("c__NewsArticle")).toBe("News Article");
|
|
35
|
+
expect(formatContentTypeLabel("c__Recipe")).toBe("Recipe");
|
|
36
|
+
expect(formatContentTypeLabel("c__BlogPost")).toBe("Blog Post");
|
|
37
|
+
});
|
|
38
|
+
|
|
33
39
|
it("handles edge cases gracefully", () => {
|
|
34
40
|
expect(formatContentTypeLabel("news")).toBe("News");
|
|
35
41
|
expect(formatContentTypeLabel("sfdc_cms__all_lowercase")).toBe("All_lowercase");
|
|
@@ -45,10 +51,19 @@ describe("contentTypeUtils", () => {
|
|
|
45
51
|
expect(isValidCmsFqn("sfdc_cms__a123456789012345678901234567890123456789")).toBe(true);
|
|
46
52
|
});
|
|
47
53
|
|
|
54
|
+
it("returns true for custom content type FQNs (c__ prefix)", () => {
|
|
55
|
+
expect(isValidCmsFqn("c__NewsArticle")).toBe(true);
|
|
56
|
+
expect(isValidCmsFqn("c__Recipe")).toBe(true);
|
|
57
|
+
expect(isValidCmsFqn("c__BlogPost")).toBe(true);
|
|
58
|
+
expect(isValidCmsFqn("c__a")).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
|
|
48
61
|
it("returns false for FQNs without correct prefix", () => {
|
|
49
62
|
expect(isValidCmsFqn("news")).toBe(false);
|
|
50
63
|
expect(isValidCmsFqn("cms__news")).toBe(false);
|
|
51
64
|
expect(isValidCmsFqn("sfdc_news")).toBe(false);
|
|
65
|
+
// A raw ManagedContentType record id is not an FQN.
|
|
66
|
+
expect(isValidCmsFqn("0T1RZ000006MbdN")).toBe(false);
|
|
52
67
|
});
|
|
53
68
|
|
|
54
69
|
it("returns false for FQNs with invalid characters", () => {
|
|
@@ -107,6 +107,33 @@ describe("fetchSearchableContentTypes", () => {
|
|
|
107
107
|
expect(result).toEqual([{ fqn: "sfdc_cms__news", label: "News" }]);
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
+
it("builds a c__ FQN from name when id is a ManagedContentType record id (custom type)", async () => {
|
|
111
|
+
// For custom content types the Connect response puts the ManagedContentType
|
|
112
|
+
// record id (0T1…) in `id` instead of an FQN; the FQN is reconstructed as
|
|
113
|
+
// c__<name> — the form the GraphQL search accepts and echoes in contentType.
|
|
114
|
+
connectGetJson.mockResolvedValueOnce({
|
|
115
|
+
items: [
|
|
116
|
+
{ id: "sfdc_cms__news", name: "news", label: "News", isSearchable: true },
|
|
117
|
+
{ id: "0T1RZ000006MbdN", name: "NewsArticle", label: "News Article", isSearchable: true },
|
|
118
|
+
{ id: "0T1RZ000006MbdO", name: "Recipe", label: "Recipe", isSearchable: true },
|
|
119
|
+
],
|
|
120
|
+
});
|
|
121
|
+
const result = await fetchSearchableContentTypes(VALID_CHANNEL);
|
|
122
|
+
expect(result).toEqual([
|
|
123
|
+
{ fqn: "sfdc_cms__news", label: "News" },
|
|
124
|
+
{ fqn: "c__NewsArticle", label: "News Article" },
|
|
125
|
+
{ fqn: "c__Recipe", label: "Recipe" },
|
|
126
|
+
]);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("drops a custom-type record id when the entry has no name to rebuild the FQN", async () => {
|
|
130
|
+
connectGetJson.mockResolvedValueOnce({
|
|
131
|
+
items: [{ id: "0T1RZ000006MbdN", label: "News Article", isSearchable: true }],
|
|
132
|
+
});
|
|
133
|
+
const result = await fetchSearchableContentTypes(VALID_CHANNEL);
|
|
134
|
+
expect(result).toEqual([]);
|
|
135
|
+
});
|
|
136
|
+
|
|
110
137
|
it("filters out non-searchable and invalid-FQN entries", async () => {
|
|
111
138
|
connectGetJson.mockResolvedValueOnce({
|
|
112
139
|
items: [
|
|
@@ -60,13 +60,16 @@ function isSearchable(entry: RawContentTypeEntry): boolean {
|
|
|
60
60
|
return true;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
* `isValidCmsFqn`.
|
|
68
|
-
*/
|
|
63
|
+
/** ManagedContentType key prefix — the `id` custom content types carry instead of an FQN. */
|
|
64
|
+
const CONTENT_TYPE_RECORD_ID_PATTERN = /^0T1[a-zA-Z0-9]{12,15}$/;
|
|
65
|
+
|
|
66
|
+
/** Extracts the prefixed FQN from an entry, rebuilding `c__<name>` when `id` is a custom-type record id. */
|
|
69
67
|
function entryFqn(entry: RawContentTypeEntry): string | undefined {
|
|
68
|
+
// Custom types put a ManagedContentType id in `id`; the FQN the GraphQL filter
|
|
69
|
+
// accepts is `c__<name>`.
|
|
70
|
+
if (entry.id && CONTENT_TYPE_RECORD_ID_PATTERN.test(entry.id)) {
|
|
71
|
+
return entry.name ? `c__${entry.name}` : undefined;
|
|
72
|
+
}
|
|
70
73
|
return entry.id ?? entry.contentType ?? entry.fqn ?? entry.developerName;
|
|
71
74
|
}
|
|
72
75
|
|
|
@@ -8,21 +8,23 @@
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Formats a CMS content type FQN into a human-readable label.
|
|
11
|
-
* Strips "sfdc_cms__" prefix, splits camelCase, title-cases each word.
|
|
11
|
+
* Strips the "sfdc_cms__" (OOTB) or "c__" (custom) prefix, splits camelCase, title-cases each word.
|
|
12
12
|
*
|
|
13
13
|
* Examples:
|
|
14
14
|
* "sfdc_cms__blogPost" → "Blog Post"
|
|
15
15
|
* "sfdc_cms__news" → "News"
|
|
16
|
-
* "
|
|
17
|
-
* "
|
|
16
|
+
* "c__NewsArticle" → "News Article"
|
|
17
|
+
* "c__Recipe" → "Recipe"
|
|
18
18
|
*/
|
|
19
19
|
export function formatContentTypeLabel(fqn: string): string {
|
|
20
|
-
const stripped = fqn.replace(/^sfdc_cms__/, "");
|
|
20
|
+
const stripped = fqn.replace(/^(?:sfdc_cms__|c__)/, "");
|
|
21
21
|
const words = stripped.replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
22
22
|
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
// OOTB content types are namespaced `sfdc_cms__<name>`; custom types created in
|
|
26
|
+
// a namespace-less org take the default `c__<name>` prefix. Both are valid FQNs.
|
|
27
|
+
export const CMS_FQN_PATTERN = /^(?:sfdc_cms__|c__)[a-zA-Z][a-zA-Z0-9]{0,39}$/;
|
|
26
28
|
|
|
27
29
|
export function isValidCmsFqn(fqn: string): boolean {
|
|
28
30
|
return CMS_FQN_PATTERN.test(fqn);
|
package/dist/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/ui-bundle-template-base-sfdx-project",
|
|
3
|
-
"version": "11.68.
|
|
3
|
+
"version": "11.68.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/ui-bundle-template-base-sfdx-project",
|
|
9
|
-
"version": "11.68.
|
|
9
|
+
"version": "11.68.6",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"fast-xml-parser": "^5.9.3",
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/ui-bundle-template-app-react-sample-b2e",
|
|
3
|
-
"version": "11.68.
|
|
3
|
+
"version": "11.68.6",
|
|
4
4
|
"description": "Salesforce sample property rental React app",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"clean": "rm -rf dist"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@salesforce/ui-bundle": "^11.68.
|
|
19
|
+
"@salesforce/ui-bundle": "^11.68.6",
|
|
20
20
|
"sonner": "^1.7.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|