Skip to content

Conversation

@StanZGenchev
Copy link
Contributor

@StanZGenchev StanZGenchev commented Jun 12, 2025

What does this PR do?

Changes the way we set the Google analytics script.

Now the env var DIRIGIBLE_BRANDING_ANALYTICS should contain the GTag ID and in order to enable analytics for a shell, perspective, view, etc. the user should include the analytics tag just before the theme tag.

What issues does this PR fix or reference?

#5119

@StanZGenchev StanZGenchev requested a review from delchev June 12, 2025 10:10
Comment on lines +16 to +18
.config(($sceDelegateProvider) => {
$sceDelegateProvider.resourceUrlWhitelist(['self', 'https://www.googletagmanager.com/gtag/js**']);
})

Check warning

Code scanning / CodeQL

Missing explicit dependency injection Warning

This function has no explicit dependency injections, but
this function
has an explicit dependency injection.

Copilot Autofix

AI 7 months ago

To fix the issue, we will replace the implicit dependency injection in the function on line 16 with explicit annotations. This involves wrapping the dependency name ($sceDelegateProvider) and the function in an array. The array's first element will be the dependency name as a string, and the second element will be the function itself. This ensures that the dependency injection works correctly even after minification.


Suggested changeset 1
components/ui/platform-core/src/main/resources/META-INF/dirigible/platform-core/ui/platform/view.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/components/ui/platform-core/src/main/resources/META-INF/dirigible/platform-core/ui/platform/view.js b/components/ui/platform-core/src/main/resources/META-INF/dirigible/platform-core/ui/platform/view.js
--- a/components/ui/platform-core/src/main/resources/META-INF/dirigible/platform-core/ui/platform/view.js
+++ b/components/ui/platform-core/src/main/resources/META-INF/dirigible/platform-core/ui/platform/view.js
@@ -15,5 +15,5 @@
     .constant('clientOS', { isMac: () => navigator.userAgent.includes('Mac') })
-    .config(($sceDelegateProvider) => {
+    .config(['$sceDelegateProvider', ($sceDelegateProvider) => {
         $sceDelegateProvider.resourceUrlWhitelist(['self', 'https://www.googletagmanager.com/gtag/js**']);
-    })
+    }])
     .factory('baseHttpInterceptor', () => {
EOF
@@ -15,5 +15,5 @@
.constant('clientOS', { isMac: () => navigator.userAgent.includes('Mac') })
.config(($sceDelegateProvider) => {
.config(['$sceDelegateProvider', ($sceDelegateProvider) => {
$sceDelegateProvider.resourceUrlWhitelist(['self', 'https://www.googletagmanager.com/gtag/js**']);
})
}])
.factory('baseHttpInterceptor', () => {
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants