Merge branch 'main' into avm99963-monorail
Merged commit 4137ed7879acadbf891e8c471108acb874dae886.
GitOrigin-RevId: b6100ffc5b1da355a35f37b13fcaaf746ee8b307
diff --git a/static_src/elements/mr-app/mr-app.js b/static_src/elements/mr-app/mr-app.js
index c91511f..8fe3dad 100644
--- a/static_src/elements/mr-app/mr-app.js
+++ b/static_src/elements/mr-app/mr-app.js
@@ -30,6 +30,7 @@
import {SHARED_STYLES} from 'shared/shared-styles.js';
const QUERY_PARAMS_THAT_RESET_SCROLL = ['q', 'mode', 'id'];
+const GOOGLE_EMAIL_SUFFIX = '@google.com';
/**
* `<mr-app>`
@@ -256,6 +257,8 @@
connectedCallback() {
super.connectedCallback();
+ this._logGooglerUsage();
+
// TODO(zhangtiff): Figure out some way to save Redux state between
// page loads.
@@ -311,6 +314,21 @@
}
/**
+ * Helper to log how often Googlers access Monorail.
+ */
+ _logGooglerUsage() {
+ const email = this.userDisplayName;
+ if (!email) return;
+ if (!email.endsWith(GOOGLE_EMAIL_SUFFIX)) return;
+
+ const username = email.replace(GOOGLE_EMAIL_SUFFIX, '');
+
+ // Context: b/229758140
+ window.fetch(`https://buganizer.corp.google.com/action/yes?monorail=yes&username=${username}`,
+ {mode: 'no-cors'});
+ }
+
+ /**
* Handler that runs on every single route change, before the new page has
* loaded. This function should not use store.dispatch() or assign properties
* on this because running these actions causes extra re-renders to happen.
@@ -513,7 +531,7 @@
const mount = document.getElementById('reactMount');
- renderWizard(mount);
+ renderWizard(mount, this.loginUrl, this.userDisplayName);
}
/**