Conversation
…nsuring consistent formatting
There was a problem hiding this comment.
Pull request overview
This PR aims to fix consent manager initialization so the correct locale’s consent script is loaded (and re-loaded) rather than ending up with stale/default language behavior, and updates repository automation around registry/lockfile handling.
Changes:
- Update consent manager loader to de-dupe concurrent requests and remove previously injected consent-manager scripts before injecting the new locale.
- Adjust root
update:registryscript (JFrog URL) and remove the “Update npm registry” step from CI. - Regenerate/update multiple package
package-lock.jsonfiles.
Reviewed changes
Copilot reviewed 3 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/utils/src/integration/integration.ts | Adds request de-duping and script cleanup for consent manager script injection. |
| .github/workflows/continuous.yml | Removes the workflow step that ran npm run update:registry. |
| package.json | Updates the registry replacement URL used by update:registry. |
| packages/validators/package-lock.json | Lockfile updated; notably drops entries for internal deps. |
| packages/validators-vue/package-lock.json | Lockfile updated; notably drops entries for internal deps. |
| packages/validators-angular/package-lock.json | Lockfile updated; notably drops entries for internal deps. |
| packages/pipes/package-lock.json | Lockfile updated; notably drops entries for internal deps. |
| packages/pipes-vue/package-lock.json | Lockfile updated; notably drops entries for internal deps. |
| packages/pipes-angular/package-lock.json | Lockfile updated; notably drops entries for internal deps. |
| packages/form-vue/package-lock.json | Lockfile updated; notably drops entries for internal deps. |
| packages/utils/package-lock.json | Lockfile formatting update (EOF change). |
| packages/unsupported-browsers/package-lock.json | Lockfile updated (metadata/EOF changes). |
| packages/clean-architecture/package-lock.json | Lockfile formatting update (EOF change). |
Files not reviewed (8)
- packages/form-vue/package-lock.json: Language not supported
- packages/pipes-angular/package-lock.json: Language not supported
- packages/pipes-vue/package-lock.json: Language not supported
- packages/pipes/package-lock.json: Language not supported
- packages/unsupported-browsers/package-lock.json: Language not supported
- packages/validators-angular/package-lock.json: Language not supported
- packages/validators-vue/package-lock.json: Language not supported
- packages/validators/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "version": "3.17.0", | ||
| "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@baloise/web-app-utils": "^3.17.0", | ||
| "date-fns": "^2.28.0", | ||
| "lodash.capitalize": "^4.2.1", |
There was a problem hiding this comment.
package-lock.json no longer lists @baloise/web-app-utils under the root package dependencies (and its node_modules/@baloise/web-app-utils entry was removed), but packages/validators/package.json still declares @baloise/web-app-utils as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs (e.g., npm ci not installing required runtime deps). Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.
packages/pipes/package-lock.json
Outdated
| "version": "3.17.0", | ||
| "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@baloise/web-app-utils": "^3.17.0", | ||
| "lodash.capitalize": "^4.2.1", | ||
| "lodash.isarray": "^4.0.0", |
There was a problem hiding this comment.
package-lock.json no longer lists @baloise/web-app-utils under the root package dependencies (and its node_modules/@baloise/web-app-utils entry was removed), but packages/pipes/package.json still declares @baloise/web-app-utils as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs. Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.
| "version": "3.17.0", | ||
| "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@baloise/web-app-validators": "^3.17.0", | ||
| "lodash.isarray": "^4.0.0" | ||
| }, |
There was a problem hiding this comment.
package-lock.json no longer lists @baloise/web-app-validators under the root package dependencies (and the corresponding node_modules/@baloise/web-app-validators entry was removed), but packages/validators-vue/package.json still declares @baloise/web-app-validators as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs. Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.
| "version": "3.17.0", | ||
| "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@baloise/web-app-validators": "^3.17.0", | ||
| "tslib": "^2.2.0" | ||
| }, |
There was a problem hiding this comment.
package-lock.json no longer lists @baloise/web-app-validators under the root package dependencies (and the corresponding node_modules/@baloise/web-app-validators entry was removed), but packages/validators-angular/package.json still declares @baloise/web-app-validators as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs. Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.
| @@ -8,9 +8,6 @@ | |||
| "name": "@baloise/web-app-pipes-vue", | |||
| "version": "3.17.0", | |||
| "license": "Apache-2.0", | |||
There was a problem hiding this comment.
The root package entry in package-lock.json no longer includes the @baloise/web-app-pipes dependency, but packages/pipes-vue/package.json still declares @baloise/web-app-pipes as a dependency. This lockfile/manifest mismatch can lead to incorrect installs. Regenerate this lockfile from the package manifest so the lock reflects the declared dependencies.
| "license": "Apache-2.0", | |
| "license": "Apache-2.0", | |
| "dependencies": { | |
| "@baloise/web-app-pipes": "^3.17.0" | |
| }, |
| "version": "3.17.0", | ||
| "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@baloise/web-app-pipes": "^3.17.0", | ||
| "tslib": "^2.2.0" | ||
| }, |
There was a problem hiding this comment.
package-lock.json no longer lists @baloise/web-app-pipes under the root package dependencies (and the corresponding node_modules/@baloise/web-app-pipes entry was removed), but packages/pipes-angular/package.json still declares @baloise/web-app-pipes as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs. Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.
| "@baloise/web-app-validators": "^3.17.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@baloise/design-system-components": "^10.12.0", |
There was a problem hiding this comment.
The root package entry in package-lock.json no longer includes the @baloise/web-app-validators dependency, but packages/form-vue/package.json still declares @baloise/web-app-validators as a dependency. This lockfile/manifest mismatch can lead to incorrect installs. Regenerate this lockfile from the package manifest so the lock reflects the declared dependencies.
| "@baloise/design-system-components": "^10.12.0", | |
| "@baloise/design-system-components": "^10.12.0", | |
| "@baloise/web-app-validators": "^3.17.0", |
| export const loadConsentManagerBaloiseSwitzerland = (lang?: Language): Promise<void> => { | ||
| return loadConsentManager().then((cmsData: ConsentManagerData[]) => { | ||
| const effectiveLang = LanguagesOfSwitzerland.valueOfOrDefault(lang ? lang.key : undefined) | ||
| const requestId = ++activeConsentManagerRequestId | ||
|
|
||
| return loadConsentManager(effectiveLang).then((cmsData: ConsentManagerData[]) => { | ||
| if (requestId !== activeConsentManagerRequestId) { | ||
| return | ||
| } | ||
|
|
There was a problem hiding this comment.
New behavior here (request de-duping via activeConsentManagerRequestId and cleanup of previously injected consent-manager scripts) is not covered by tests. Given this package already uses Jest specs (e.g. app-integration.spec.ts), it would be good to add unit tests that mock fetch and document.head to verify (1) older in-flight requests don’t inject scripts and (2) previously injected scripts are removed before injecting a new locale.
…package management
… fix-consent-managment-load
…and package-lock.json
| const removeInjectedConsentManagerScripts = (): void => { | ||
| const scripts = document.querySelectorAll(`script[${CONSENT_MANAGER_SCRIPT_ATTRIBUTE}="true"]`) | ||
| scripts.forEach(script => script.parentNode?.removeChild(script)) | ||
| } |
Closes #
Fixed consent management locale loading so it no longer defaults to German and now resolves the correct language from app/user locale settings.
Changelog
New
Changed