fix: remove dolar sign#680
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes the dollar sign ($) from template placeholders used for dynamic user ID replacement, changing the placeholder format from ${CURRENT_USER} to {CURRENT_USER} across the codebase.
Key Changes
- Updated the string replacement pattern in the discrete layer view to match the new placeholder format
- Modified configuration files and templates to use the new
{CURRENT_USER}placeholder format consistently
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/discrete-layer/views/discrete-layer-view.tsx | Updated replace() call to search for {CURRENT_USER} instead of ${CURRENT_USER} |
| src/mocks/confEnvShim.js | Changed mock configuration to use new placeholder format |
| helm/values.yaml | Updated Helm values to reflect new placeholder format |
| confd/production.tmpl | Modified production template default value to use new placeholder format |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (!CONFIG.GEOCODER.CALLBACK_URL) return; | ||
|
|
||
| const CATALOG_APP_USER_ID = CONFIG.CATALOG_APP_USER_ID.replace('${CURRENT_USER}', store.userStore?.user?.role as string); | ||
| const CATALOG_APP_USER_ID = CONFIG.CATALOG_APP_USER_ID.replace('{CURRENT_USER}', store.userStore?.user?.role as string); |
There was a problem hiding this comment.
The replace() method only replaces the first occurrence. If CATALOG_APP_USER_ID contains multiple instances of {CURRENT_USER}, only the first will be replaced. Consider using replaceAll('{CURRENT_USER}', ...) or a global regex pattern .replace(/{CURRENT_USER}/g, ...) to ensure all occurrences are replaced.
| const CATALOG_APP_USER_ID = CONFIG.CATALOG_APP_USER_ID.replace('{CURRENT_USER}', store.userStore?.user?.role as string); | |
| const CATALOG_APP_USER_ID = CONFIG.CATALOG_APP_USER_ID.replaceAll('{CURRENT_USER}', store.userStore?.user?.role as string); |
No description provided.