@salesforce/webapp-template-app-react-template-b2x-experimental 1.116.7 → 1.116.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +16 -0
- package/dist/force-app/main/default/webapplications/reactexternalapp/eslint.config.js +13 -2
- package/dist/force-app/main/default/webapplications/reactexternalapp/package.json +3 -3
- package/dist/force-app/main/default/webapplications/reactexternalapp/src/features/authentication/context/AuthContext.tsx +1 -1
- package/dist/force-app/main/default/webapplications/reactexternalapp/src/features/authentication/hooks/useCountdownTimer.ts +1 -1
- package/dist/force-app/main/default/webapplications/reactexternalapp/src/features/authentication/pages/Profile.tsx +3 -3
- package/dist/force-app/main/default/webapplications/reactexternalapp/src/features/authentication/pages/Register.tsx +1 -1
- package/dist/force-app/main/default/webapplications/reactexternalapp/src/features/authentication/sessionTimeout/SessionTimeoutValidator.tsx +12 -18
- package/dist/force-app/main/default/webapplications/reactexternalapp/src/features/object-search/components/FilterContext.tsx +1 -1
- package/dist/force-app/main/default/webapplications/reactexternalapp/src/features/object-search/hooks/useObjectSearchParams.ts +10 -5
- 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.116.9](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.116.8...v1.116.9) (2026-03-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.116.8](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.116.7...v1.116.8) (2026-03-27)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.116.7](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.116.6...v1.116.7) (2026-03-27)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
|
|
@@ -18,7 +18,12 @@ const schemaExists = existsSync(schemaPath);
|
|
|
18
18
|
const config = [
|
|
19
19
|
// Global ignores
|
|
20
20
|
{
|
|
21
|
-
ignores: [
|
|
21
|
+
ignores: [
|
|
22
|
+
'build/**/*',
|
|
23
|
+
'dist/**/*',
|
|
24
|
+
'coverage/**/*',
|
|
25
|
+
'src/api/graphql-operations-types.ts',
|
|
26
|
+
],
|
|
22
27
|
},
|
|
23
28
|
// Config files and build tools (first to avoid inheritance)
|
|
24
29
|
{
|
|
@@ -89,11 +94,17 @@ const config = [
|
|
|
89
94
|
'react/no-unescaped-entities': 'off',
|
|
90
95
|
'@typescript-eslint/no-unused-vars': [
|
|
91
96
|
'error',
|
|
92
|
-
{
|
|
97
|
+
{
|
|
98
|
+
argsIgnorePattern: '^_',
|
|
99
|
+
varsIgnorePattern: '^_',
|
|
100
|
+
caughtErrorsIgnorePattern: '^_',
|
|
101
|
+
ignoreRestSiblings: true,
|
|
102
|
+
},
|
|
93
103
|
],
|
|
94
104
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
95
105
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
96
106
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
107
|
+
'react-hooks/set-state-in-effect': 'warn',
|
|
97
108
|
},
|
|
98
109
|
settings: {
|
|
99
110
|
react: {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@salesforce/sdk-data": "^1.116.
|
|
19
|
-
"@salesforce/webapp-experimental": "^1.116.
|
|
18
|
+
"@salesforce/sdk-data": "^1.116.9",
|
|
19
|
+
"@salesforce/webapp-experimental": "^1.116.9",
|
|
20
20
|
"@tailwindcss/vite": "^4.1.17",
|
|
21
21
|
"class-variance-authority": "^0.7.1",
|
|
22
22
|
"clsx": "^2.1.1",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
44
44
|
"@graphql-tools/utils": "^11.0.0",
|
|
45
45
|
"@playwright/test": "^1.49.0",
|
|
46
|
-
"@salesforce/vite-plugin-webapp-experimental": "^1.116.
|
|
46
|
+
"@salesforce/vite-plugin-webapp-experimental": "^1.116.9",
|
|
47
47
|
"@testing-library/jest-dom": "^6.6.3",
|
|
48
48
|
"@testing-library/react": "^16.1.0",
|
|
49
49
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -86,7 +86,7 @@ export function useAuth(): AuthContextType {
|
|
|
86
86
|
* @returns {User} The authenticated user object
|
|
87
87
|
* @throws {Error} If not used within AuthProvider or user is not authenticated
|
|
88
88
|
*/
|
|
89
|
-
export function
|
|
89
|
+
export function useUser(): User {
|
|
90
90
|
const context = useAuth();
|
|
91
91
|
if (!context.user) {
|
|
92
92
|
throw new Error("Authenticated context not established");
|
|
@@ -107,7 +107,7 @@ function formatAccessibilityAnnouncement(seconds: number): string {
|
|
|
107
107
|
// @ts-expect-error - DurationFormat is not yet in TypeScript lib
|
|
108
108
|
const formatter = new Intl.DurationFormat(navigator.language, { style: "long" });
|
|
109
109
|
return formatter.format({ minutes, seconds: secs });
|
|
110
|
-
} catch
|
|
110
|
+
} catch {
|
|
111
111
|
// Fallback to manual formatting
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -8,7 +8,7 @@ import { useAppForm } from "../hooks/form";
|
|
|
8
8
|
import { ROUTES } from "../authenticationConfig";
|
|
9
9
|
import { emailSchema } from "../authHelpers";
|
|
10
10
|
import { getErrorMessage } from "../utils/helpers";
|
|
11
|
-
import {
|
|
11
|
+
import { useUser } from "../context/AuthContext";
|
|
12
12
|
import { fetchUserProfile, updateUserProfile } from "../api/userProfileApi";
|
|
13
13
|
|
|
14
14
|
const optionalString = z
|
|
@@ -33,7 +33,7 @@ const profileSchema = z.object({
|
|
|
33
33
|
type ProfileFormValues = z.infer<typeof profileSchema>;
|
|
34
34
|
|
|
35
35
|
export default function Profile() {
|
|
36
|
-
const user =
|
|
36
|
+
const user = useUser();
|
|
37
37
|
const [profile, setProfile] = useState<ProfileFormValues | null>(null);
|
|
38
38
|
const [loadError, setLoadError] = useState<string | null>(null);
|
|
39
39
|
const [success, setSuccess] = useState(false);
|
|
@@ -104,7 +104,7 @@ export default function Profile() {
|
|
|
104
104
|
const formData = profileSchema.parse(profile);
|
|
105
105
|
form.reset(formData);
|
|
106
106
|
}
|
|
107
|
-
}, [profile]);
|
|
107
|
+
}, [profile, form]);
|
|
108
108
|
|
|
109
109
|
if (!profile && !loadError) {
|
|
110
110
|
return <CardSkeleton contentMaxWidth="md" loadingText="Loading profile…" />;
|
|
@@ -46,7 +46,7 @@ export default function Register() {
|
|
|
46
46
|
// "/services/apexrest/auth/register" refers to a custom Apex Class exposed as a REST resource.
|
|
47
47
|
// You must ensure this Apex class exists in your org and handles registration
|
|
48
48
|
// (e.g., duplicate checks and user creation such as Site.createExternalUser).
|
|
49
|
-
const { confirmPassword, ...request } = formFieldValues;
|
|
49
|
+
const { confirmPassword: _confirmPassword, ...request } = formFieldValues;
|
|
50
50
|
const sdk = await createDataSDK();
|
|
51
51
|
const response = await sdk.fetch!("/services/apexrest/auth/register", {
|
|
52
52
|
method: "POST",
|
|
@@ -496,8 +496,18 @@ export default function SessionTimeoutValidator({
|
|
|
496
496
|
// Get current location from React Router
|
|
497
497
|
const location = useLocation();
|
|
498
498
|
|
|
499
|
-
//
|
|
500
|
-
|
|
499
|
+
// Session expired alert — checked once at mount via lazy initializer.
|
|
500
|
+
// The session timeout handler triggers a hard navigation (window.location.replace),
|
|
501
|
+
// so the component always mounts fresh on the login page after expiry.
|
|
502
|
+
const [showExpiredAlert, setShowExpiredAlert] = useState(() => {
|
|
503
|
+
const isLoginPage = location.pathname === ROUTES.LOGIN.PATH;
|
|
504
|
+
const shouldShow =
|
|
505
|
+
isLoginPage && sessionStorage.getItem(STORAGE_KEYS.SHOW_SESSION_MESSAGE) === "true";
|
|
506
|
+
if (shouldShow) {
|
|
507
|
+
sessionStorage.removeItem(STORAGE_KEYS.SHOW_SESSION_MESSAGE);
|
|
508
|
+
}
|
|
509
|
+
return shouldShow;
|
|
510
|
+
});
|
|
501
511
|
|
|
502
512
|
// Session timeout monitoring hook
|
|
503
513
|
const sessionTimeout = useSessionTimeout({
|
|
@@ -505,22 +515,6 @@ export default function SessionTimeoutValidator({
|
|
|
505
515
|
isGuest,
|
|
506
516
|
});
|
|
507
517
|
|
|
508
|
-
/**
|
|
509
|
-
* Check if we should show expired session message
|
|
510
|
-
* Called on mount and whenever pathname changes
|
|
511
|
-
*/
|
|
512
|
-
useEffect(() => {
|
|
513
|
-
// Check if we're on the login page and should show expired message
|
|
514
|
-
const isLoginPage = location.pathname === ROUTES.LOGIN.PATH;
|
|
515
|
-
const shouldShowMessage = sessionStorage.getItem(STORAGE_KEYS.SHOW_SESSION_MESSAGE) === "true";
|
|
516
|
-
|
|
517
|
-
if (isLoginPage && shouldShowMessage) {
|
|
518
|
-
setShowExpiredAlert(true);
|
|
519
|
-
// Clear the flag immediately after reading
|
|
520
|
-
sessionStorage.removeItem(STORAGE_KEYS.SHOW_SESSION_MESSAGE);
|
|
521
|
-
}
|
|
522
|
-
}, [location.pathname]);
|
|
523
|
-
|
|
524
518
|
/**
|
|
525
519
|
* Handle session extension
|
|
526
520
|
* Called when user clicks "Continue Working" in warning modal
|
|
@@ -60,7 +60,7 @@ export function useFilterPanel() {
|
|
|
60
60
|
return { hasActiveFilters: filters.length > 0, resetAll: onReset };
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
type FilterResetButtonProps = Omit<React.ComponentProps<typeof Button>, "onClick">;
|
|
64
64
|
|
|
65
65
|
export function FilterResetButton({ children, ...props }: FilterResetButtonProps) {
|
|
66
66
|
const { hasActiveFilters, resetAll } = useFilterPanel();
|
|
@@ -61,7 +61,10 @@ export function useObjectSearchParams<TFilter, TOrderBy>(
|
|
|
61
61
|
paginationConfig?: PaginationConfig,
|
|
62
62
|
) {
|
|
63
63
|
const defaultPageSize = paginationConfig?.defaultPageSize ?? 10;
|
|
64
|
-
const validPageSizes =
|
|
64
|
+
const validPageSizes = useMemo(
|
|
65
|
+
() => paginationConfig?.validPageSizes ?? [defaultPageSize],
|
|
66
|
+
[paginationConfig?.validPageSizes, defaultPageSize],
|
|
67
|
+
);
|
|
65
68
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
66
69
|
|
|
67
70
|
// Seed local state from URL on initial load
|
|
@@ -76,8 +79,10 @@ export function useObjectSearchParams<TFilter, TOrderBy>(
|
|
|
76
79
|
const [sort, setLocalSort] = useState<SortState | null>(initial.sort);
|
|
77
80
|
|
|
78
81
|
// Pagination — cursor-based with a stack to support "previous page" navigation.
|
|
79
|
-
const getValidPageSize = (
|
|
80
|
-
validPageSizes.includes(size) ? size : defaultPageSize
|
|
82
|
+
const getValidPageSize = useCallback(
|
|
83
|
+
(size: number) => (validPageSizes.includes(size) ? size : defaultPageSize),
|
|
84
|
+
[validPageSizes, defaultPageSize],
|
|
85
|
+
);
|
|
81
86
|
|
|
82
87
|
const [pageSize, setPageSizeState] = useState<number>(
|
|
83
88
|
getValidPageSize(initial.pageSize ?? defaultPageSize),
|
|
@@ -166,7 +171,7 @@ export function useObjectSearchParams<TFilter, TOrderBy>(
|
|
|
166
171
|
resetPagination();
|
|
167
172
|
syncToUrl([], null, defaultPageSize, 0);
|
|
168
173
|
setPageSizeState(defaultPageSize);
|
|
169
|
-
}, [syncToUrl, resetPagination]);
|
|
174
|
+
}, [syncToUrl, resetPagination, defaultPageSize]);
|
|
170
175
|
|
|
171
176
|
// -- Pagination callbacks ---------------------------------------------------
|
|
172
177
|
// Uses a cursor stack to track visited pages. "Next" pushes the current
|
|
@@ -204,7 +209,7 @@ export function useObjectSearchParams<TFilter, TOrderBy>(
|
|
|
204
209
|
resetPagination();
|
|
205
210
|
debouncedSyncRef.current(f, s, validated);
|
|
206
211
|
},
|
|
207
|
-
[resetPagination],
|
|
212
|
+
[resetPagination, getValidPageSize],
|
|
208
213
|
);
|
|
209
214
|
|
|
210
215
|
// -- Derived query objects ---------------------------------------------------
|
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.116.
|
|
3
|
+
"version": "1.116.9",
|
|
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.116.
|
|
9
|
+
"version": "1.116.9",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@lwc/eslint-plugin-lwc": "^3.3.0",
|
package/dist/package.json
CHANGED
package/package.json
CHANGED