@atlassian/atlassian-connect-js 5.3.209 → 5.3.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/iframe-fedramp.js
CHANGED
|
@@ -1373,7 +1373,7 @@ var AP = (function () {
|
|
|
1373
1373
|
_this._eventHandlers = {};
|
|
1374
1374
|
_this._pendingCallbacks = {};
|
|
1375
1375
|
_this._keyListeners = [];
|
|
1376
|
-
_this._version = '5.3.
|
|
1376
|
+
_this._version = '5.3.210';
|
|
1377
1377
|
_this._apiTampered = undefined;
|
|
1378
1378
|
_this._isSubIframe = _this._topHost !== window.parent;
|
|
1379
1379
|
_this._onConfirmedFns = [];
|
package/dist/iframe.js
CHANGED
|
@@ -1373,7 +1373,7 @@ var AP = (function () {
|
|
|
1373
1373
|
_this._eventHandlers = {};
|
|
1374
1374
|
_this._pendingCallbacks = {};
|
|
1375
1375
|
_this._keyListeners = [];
|
|
1376
|
-
_this._version = '5.3.
|
|
1376
|
+
_this._version = '5.3.210';
|
|
1377
1377
|
_this._apiTampered = undefined;
|
|
1378
1378
|
_this._isSubIframe = _this._topHost !== window.parent;
|
|
1379
1379
|
_this._onConfirmedFns = [];
|
package/package.json
CHANGED
|
@@ -73,6 +73,48 @@ describe('Analytics Dispatcher', () => {
|
|
|
73
73
|
source: 'connectAddon'
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
+
describe('trackGasV3IframeClicked', () => {
|
|
77
|
+
const testData = {
|
|
78
|
+
addonKey: 'test-addon',
|
|
79
|
+
moduleType: 'generalPage',
|
|
80
|
+
moduleLocation: 'main-nav',
|
|
81
|
+
baseUrl: 'https://test.atlassian.net'
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
beforeEach(() => {
|
|
85
|
+
spyOn(AnalyticsDispatcher, '_trackAndForwardGasV3');
|
|
86
|
+
spyOn(getBooleanFeatureFlag);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('should track analytics when feature flag is disabled', () => {
|
|
90
|
+
getBooleanFeatureFlag.and.returnValue(false);
|
|
91
|
+
|
|
92
|
+
AnalyticsDispatcher.trackGasV3IframeClicked(testData);
|
|
93
|
+
|
|
94
|
+
expect(getBooleanFeatureFlag).toHaveBeenCalledWith('hoc-2574-disable-connect-iframeclicked');
|
|
95
|
+
expect(AnalyticsDispatcher._trackAndForwardGasV3).toHaveBeenCalledWith('ui', {
|
|
96
|
+
action: 'iframeClicked',
|
|
97
|
+
actionSubject: 'connectAddon',
|
|
98
|
+
source: 'host',
|
|
99
|
+
attributes: {
|
|
100
|
+
appId: testData.addonKey,
|
|
101
|
+
moduleType: testData.moduleType,
|
|
102
|
+
moduleLocation: testData.moduleLocation,
|
|
103
|
+
baseUrl: testData.baseUrl,
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('should NOT track analytics when feature flag is enabled', () => {
|
|
109
|
+
getBooleanFeatureFlag.and.returnValue(true);
|
|
110
|
+
|
|
111
|
+
AnalyticsDispatcher.trackGasV3IframeClicked(testData);
|
|
112
|
+
|
|
113
|
+
expect(getBooleanFeatureFlag).toHaveBeenCalledWith('hoc-2574-disable-connect-iframeclicked');
|
|
114
|
+
expect(AnalyticsDispatcher._trackAndForwardGasV3).not.toHaveBeenCalled();
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
76
118
|
});
|
|
77
119
|
|
|
78
120
|
it('removes the timeout when the entry is removed from addon store', () => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import EventDispatcher from './event_dispatcher';
|
|
2
2
|
import $ from '../dollar';
|
|
3
3
|
import observe from '../utils/observe';
|
|
4
|
+
import getBooleanFeatureFlag from '../utils/feature-flag';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Timings beyond 20 seconds (connect's load timeout) will be clipped to an X.
|
|
@@ -445,6 +446,14 @@ class AnalyticsDispatcher {
|
|
|
445
446
|
* Tracks when a Connect iframe is clicked
|
|
446
447
|
*/
|
|
447
448
|
trackGasV3IframeClicked(data) {
|
|
449
|
+
// Check feature flag to disable analytics when enabled
|
|
450
|
+
const isAnalyticsDisabled = getBooleanFeatureFlag('hoc-2574-disable-connect-iframeclicked');
|
|
451
|
+
|
|
452
|
+
if (isAnalyticsDisabled) {
|
|
453
|
+
// Analytics disabled by feature flag - skip tracking
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
|
|
448
457
|
this._trackAndForwardGasV3('ui', {
|
|
449
458
|
action: 'iframeClicked',
|
|
450
459
|
actionSubject: 'connectAddon',
|