Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bf3dc89
try using matchpath for allowlisting
yunakim714 Apr 21, 2025
ee053db
skip geturlmapping api call if path is found
yunakim714 Apr 21, 2025
75104c5
read config value matchingStrategy
yunakim714 Apr 29, 2025
330f896
Merge branch 'useBlock' into W-17543649-seo-allowlist-routes
yunakim714 Apr 29, 2025
060f04d
add config to default json
yunakim714 Apr 29, 2025
034834d
revert package lock
yunakim714 Apr 29, 2025
eb3159e
lint
yunakim714 Apr 29, 2025
6280b64
lint
yunakim714 Apr 29, 2025
a08eaaa
setup jest and add test cases
yunakim714 Apr 30, 2025
150fb0c
Merge branch 'useBlock' into W-17543649-seo-allowlist-routes
yunakim714 Apr 30, 2025
7f350dc
refactor seo to resolve react errors
yunakim714 Apr 30, 2025
a67efe3
Merge branch 'W-17543649-seo-allowlist-routes' of github.com:Salesfor…
yunakim714 Apr 30, 2025
047b4ac
Merge branch 'useBlock' into W-17543649-seo-allowlist-routes
yunakim714 Apr 30, 2025
c5db1a0
lint
yunakim714 Apr 30, 2025
a308fb1
fix matching logic
yunakim714 May 1, 2025
4c5e397
add comments, exit early
yunakim714 May 5, 2025
f836d94
update config naming
yunakim714 May 6, 2025
84214ea
fix naming
yunakim714 May 6, 2025
a6e6240
add config details in readme
yunakim714 May 6, 2025
89e73a4
Merge branch 'useBlock' into W-17543649-seo-allowlist-routes
yunakim714 May 6, 2025
b0d54cc
add warning if there are multiple wildcard routes
yunakim714 May 6, 2025
ddd8641
Merge branch 'W-17543649-seo-allowlist-routes' of github.com:Salesfor…
yunakim714 May 6, 2025
324b91f
move to correct readme file, add sample.json
yunakim714 May 6, 2025
6f73931
resolve merge conflicts
yunakim714 May 6, 2025
c759e50
resolve merge conflicts
yunakim714 May 6, 2025
365615b
resolve merge conflicts
yunakim714 May 6, 2025
2634f86
resolve merge conflicts
yunakim714 May 6, 2025
67e146a
move matchPath function to utils module
yunakim714 May 7, 2025
a812e24
add tests for matchpath
yunakim714 May 7, 2025
71f5c40
Fix tests
jeremy-jung1 May 7, 2025
bbc7563
Merge branch 'W-17543649-seo-allowlist-routes' of github.com:Salesfor…
jeremy-jung1 May 7, 2025
91d604b
cleanup
yunakim714 May 7, 2025
bd7762c
Merge branch 'W-17543649-seo-allowlist-routes' of github.com:Salesfor…
jeremy-jung1 May 7, 2025
e0d9221
Merge branch 'useBlock' into W-17543649-seo-allowlist-routes
yunakim714 May 7, 2025
5cf882f
cleanup
yunakim714 May 7, 2025
98aa1d9
Merge branch 'useBlock' into W-17543649-seo-allowlist-routes
yunakim714 May 8, 2025
5dcf5c6
resolve merge conflicts
yunakim714 May 9, 2025
23075cd
update package-lock
yunakim714 May 9, 2025
ba5a6f4
fix useblock test
yunakim714 May 12, 2025
6093098
Merge branch 'useBlock' into W-17543649-seo-allowlist-routes
yunakim714 May 12, 2025
66d3228
Merge branch 'useBlock' into W-17543649-seo-allowlist-routes
yunakim714 May 12, 2025
34fd298
fix comments and add test case
yunakim714 May 13, 2025
f6a0bc3
log warning for undefined paths
yunakim714 May 13, 2025
2f16eff
address comments
yunakim714 May 13, 2025
a0d4b18
remove console log
yunakim714 May 13, 2025
610912b
change matchpath return type
yunakim714 May 13, 2025
acea559
cleanup
yunakim714 May 13, 2025
b7a593f
Merge branch 'useBlock' into W-17543649-seo-allowlist-routes
yunakim714 May 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ const withLayout = <P extends object>(WrappedComponent: React.ComponentType<P>)
const authModal = useAuthModal()
const [siteLocale, _] = useState(siteConfig.locale)
const {isNavigationBlocked, setSiteLocale} = useApplicationExtensionsStore((state) => {
return state.state['@salesforce/extension-commerce-bm-seo'] || SEO_STATE_WITHOUT_EXTENSION
return (
state.state['@salesforce/extension-commerce-bm-seo'] || SEO_STATE_WITHOUT_EXTENSION
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: You could write this without the return.

const {isNavigationBlocked, setSiteLocale} = useApplicationExtensionsStore((state) => (
    state.state['@salesforce/extension-commerce-bm-seo'] || SEO_STATE_WITHOUT_EXTENSION
))

})
useEffect(() => {
setSiteLocale(siteLocale)
Expand Down
7 changes: 7 additions & 0 deletions packages/extension-commerce-bm-seo/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2025, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
module.exports = require('@salesforce/pwa-kit-dev/configs/babel/babel-config')
1 change: 1 addition & 0 deletions packages/extension-commerce-bm-seo/config/default.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"enabled": true,
"matchingStrategy": "API_FIRST",
"commerceApi": {
"proxyPath": "/mobify/proxy/api",
"parameters": {
Expand Down
7 changes: 7 additions & 0 deletions packages/extension-commerce-bm-seo/jest-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2025, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import '@testing-library/jest-dom'
28 changes: 28 additions & 0 deletions packages/extension-commerce-bm-seo/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2025, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
const path = require('path')
// eslint-disable-next-line @typescript-eslint/no-var-requires
const base = require('@salesforce/pwa-kit-dev/configs/jest/jest.config.js')

module.exports = {
...base,
moduleNameMapper: {
...base.moduleNameMapper,

// handle pwa-kit extensibility special import
'^overridable!(.*)': '$1'
},
setupFilesAfterEnv: [path.join(__dirname, 'jest-setup.js')],
coverageThreshold: {
global: {
branches: 87,
functions: 100,
lines: 100,
statements: 100
}
}
}
Loading
Loading