@atlaskit/rovo-agent-analytics 0.13.0 → 0.15.0
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/CHANGELOG.md +14 -0
- package/dist/cjs/actions/index.js +6 -6
- package/dist/cjs/common/csid/index.js +2 -0
- package/dist/cjs/create/index.js +19 -10
- package/dist/es2019/actions/index.js +7 -5
- package/dist/es2019/common/csid/index.js +2 -0
- package/dist/es2019/create/index.js +25 -13
- package/dist/esm/actions/index.js +7 -7
- package/dist/esm/common/csid/index.js +2 -0
- package/dist/esm/create/index.js +22 -13
- package/dist/types/actions/index.d.ts +4 -1
- package/dist/types/common/csid/index.d.ts +2 -2
- package/dist/types/create/index.d.ts +5 -1
- package/dist/types-ts4.5/actions/index.d.ts +4 -1
- package/dist/types-ts4.5/common/csid/index.d.ts +2 -2
- package/dist/types-ts4.5/create/index.d.ts +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/rovo-agent-analytics
|
|
2
2
|
|
|
3
|
+
## 0.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`d4d7d91e006ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d4d7d91e006ac) -
|
|
8
|
+
Update no skills modal analytics to use rovo agents analytics lib
|
|
9
|
+
|
|
10
|
+
## 0.14.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`dd26e8d5e8e1b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dd26e8d5e8e1b) -
|
|
15
|
+
Update rovo agent analytics track landing
|
|
16
|
+
|
|
3
17
|
## 0.13.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -46,19 +46,19 @@ var AgentCommonActions = exports.AgentCommonActions = /*#__PURE__*/function (Age
|
|
|
46
46
|
AgentCommonActions["UNVERIFY"] = "unverify";
|
|
47
47
|
return AgentCommonActions;
|
|
48
48
|
}({});
|
|
49
|
+
var globalEventConfig = (0, _utils.getDefaultTrackEventConfig)();
|
|
49
50
|
var useRovoAgentActionAnalytics = exports.useRovoAgentActionAnalytics = function useRovoAgentActionAnalytics(commonAttributes) {
|
|
50
51
|
var analyticsContext = (0, _react.useContext)(_analyticsNext.AnalyticsReactContext);
|
|
51
52
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
52
53
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
53
|
-
var
|
|
54
|
-
return (0, _utils.getDefaultTrackEventConfig)();
|
|
55
|
-
}, []);
|
|
54
|
+
var commonAttributesRef = (0, _react.useRef)(commonAttributes);
|
|
56
55
|
var fireAnalyticsEvent = (0, _react.useCallback)(function (event) {
|
|
57
|
-
var attributes = _objectSpread(_objectSpread(_objectSpread({}, (0, _utils.getAttributesFromContexts)(analyticsContext.getAtlaskitAnalyticsContext())),
|
|
58
|
-
createAnalyticsEvent(_objectSpread(_objectSpread(_objectSpread({},
|
|
56
|
+
var attributes = _objectSpread(_objectSpread(_objectSpread({}, (0, _utils.getAttributesFromContexts)(analyticsContext.getAtlaskitAnalyticsContext())), commonAttributesRef.current), event.attributes);
|
|
57
|
+
createAnalyticsEvent(_objectSpread(_objectSpread(_objectSpread({}, globalEventConfig), event), {}, {
|
|
59
58
|
attributes: attributes
|
|
60
59
|
})).fire(_constants.ANALYTICS_CHANNEL);
|
|
61
|
-
}, [createAnalyticsEvent,
|
|
60
|
+
}, [createAnalyticsEvent, analyticsContext] // keep number of dependencies minimal to prevent re-rendering
|
|
61
|
+
);
|
|
62
62
|
var trackAgentAction = (0, _react.useCallback)(function (action, attributes) {
|
|
63
63
|
fireAnalyticsEvent({
|
|
64
64
|
actionSubject: 'rovoAgent',
|
|
@@ -35,6 +35,7 @@ var useRovoAgentCSID = exports.useRovoAgentCSID = function useRovoAgentCSID() {
|
|
|
35
35
|
refresh: function refresh() {
|
|
36
36
|
var newCSID = generateCSID();
|
|
37
37
|
setCSID(newCSID);
|
|
38
|
+
return newCSID;
|
|
38
39
|
},
|
|
39
40
|
clear: function clear() {
|
|
40
41
|
// remove CSID query parameter
|
|
@@ -44,6 +45,7 @@ var useRovoAgentCSID = exports.useRovoAgentCSID = function useRovoAgentCSID() {
|
|
|
44
45
|
|
|
45
46
|
// reset state
|
|
46
47
|
setCSID(null);
|
|
48
|
+
return null;
|
|
47
49
|
}
|
|
48
50
|
};
|
|
49
51
|
}, []);
|
package/dist/cjs/create/index.js
CHANGED
|
@@ -31,27 +31,35 @@ var AgentCreateActions = exports.AgentCreateActions = /*#__PURE__*/function (Age
|
|
|
31
31
|
AgentCreateActions["LAND"] = "createLandInStudio";
|
|
32
32
|
/* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
|
|
33
33
|
AgentCreateActions["DISCARD"] = "createDiscard";
|
|
34
|
+
/* Show no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97435 */
|
|
35
|
+
AgentCreateActions["SHOW_NO_SKILLS_MODAL"] = "showNoSkillsModal";
|
|
36
|
+
/* Browse click no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97436 */
|
|
37
|
+
AgentCreateActions["BROWSE_CLICK_NO_SKILLS_MODAL"] = "browseClickNoSkillsModal";
|
|
38
|
+
/* Discard no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97437 */
|
|
39
|
+
AgentCreateActions["DISCARD_NO_SKILLS_MODAL"] = "discardNoSkillsModal";
|
|
34
40
|
return AgentCreateActions;
|
|
35
41
|
}({});
|
|
42
|
+
var globalEventConfig = (0, _utils.getDefaultTrackEventConfig)();
|
|
36
43
|
var useRovoAgentCreateAnalytics = exports.useRovoAgentCreateAnalytics = function useRovoAgentCreateAnalytics(commonAttributes) {
|
|
37
44
|
var _useRovoAgentCSID = (0, _csid.useRovoAgentCSID)(),
|
|
38
45
|
_useRovoAgentCSID2 = (0, _slicedToArray2.default)(_useRovoAgentCSID, 2),
|
|
39
46
|
csid = _useRovoAgentCSID2[0],
|
|
40
47
|
refreshCSID = _useRovoAgentCSID2[1].refresh;
|
|
48
|
+
var analyticsContext = (0, _react.useContext)(_analyticsNext.AnalyticsReactContext);
|
|
41
49
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
42
50
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
43
|
-
var
|
|
44
|
-
return (0, _utils.getDefaultTrackEventConfig)();
|
|
45
|
-
}, []);
|
|
51
|
+
var commonAttributesRef = (0, _react.useRef)(commonAttributes);
|
|
46
52
|
var fireAnalyticsEvent = (0, _react.useCallback)(function (event) {
|
|
47
53
|
var referrer = typeof window !== 'undefined' ? window.document.referrer : 'unknown';
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
var attributes = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (0, _utils.getAttributesFromContexts)(analyticsContext.getAtlaskitAnalyticsContext())), commonAttributesRef.current), event.attributes), {}, {
|
|
55
|
+
csid: csid,
|
|
56
|
+
referrer: referrer
|
|
57
|
+
});
|
|
58
|
+
createAnalyticsEvent(_objectSpread(_objectSpread(_objectSpread({}, globalEventConfig), event), {}, {
|
|
59
|
+
attributes: attributes
|
|
53
60
|
})).fire(_constants.ANALYTICS_CHANNEL);
|
|
54
|
-
}, [createAnalyticsEvent,
|
|
61
|
+
}, [createAnalyticsEvent, csid, analyticsContext] // keep number of dependencies minimal to prevent re-rendering
|
|
62
|
+
);
|
|
55
63
|
|
|
56
64
|
/**
|
|
57
65
|
* This will fire analytics event for intermediate steps in the create agent flow funnel
|
|
@@ -90,6 +98,7 @@ var useRovoAgentCreateAnalytics = exports.useRovoAgentCreateAnalytics = function
|
|
|
90
98
|
return [csid, {
|
|
91
99
|
trackCreateSession: trackCreateSession,
|
|
92
100
|
trackCreateSessionStart: trackCreateSessionStart,
|
|
93
|
-
trackCreateSessionError: trackCreateSessionError
|
|
101
|
+
trackCreateSessionError: trackCreateSessionError,
|
|
102
|
+
refreshCSID: refreshCSID
|
|
94
103
|
}];
|
|
95
104
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useContext,
|
|
1
|
+
import { useCallback, useContext, useRef } from 'react';
|
|
2
2
|
import { AnalyticsReactContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
3
|
import { ANALYTICS_CHANNEL } from '../common/constants';
|
|
4
4
|
import { getAttributesFromContexts, getDefaultTrackEventConfig } from '../common/utils';
|
|
@@ -36,24 +36,26 @@ export let AgentCommonActions = /*#__PURE__*/function (AgentCommonActions) {
|
|
|
36
36
|
AgentCommonActions["UNVERIFY"] = "unverify";
|
|
37
37
|
return AgentCommonActions;
|
|
38
38
|
}({});
|
|
39
|
+
const globalEventConfig = getDefaultTrackEventConfig();
|
|
39
40
|
export const useRovoAgentActionAnalytics = commonAttributes => {
|
|
40
41
|
const analyticsContext = useContext(AnalyticsReactContext);
|
|
41
42
|
const {
|
|
42
43
|
createAnalyticsEvent
|
|
43
44
|
} = useAnalyticsEvents();
|
|
44
|
-
const
|
|
45
|
+
const commonAttributesRef = useRef(commonAttributes);
|
|
45
46
|
const fireAnalyticsEvent = useCallback(event => {
|
|
46
47
|
const attributes = {
|
|
47
48
|
...getAttributesFromContexts(analyticsContext.getAtlaskitAnalyticsContext()),
|
|
48
|
-
...
|
|
49
|
+
...commonAttributesRef.current,
|
|
49
50
|
...event.attributes
|
|
50
51
|
};
|
|
51
52
|
createAnalyticsEvent({
|
|
52
|
-
...
|
|
53
|
+
...globalEventConfig,
|
|
53
54
|
...event,
|
|
54
55
|
attributes
|
|
55
56
|
}).fire(ANALYTICS_CHANNEL);
|
|
56
|
-
}, [createAnalyticsEvent,
|
|
57
|
+
}, [createAnalyticsEvent, analyticsContext] // keep number of dependencies minimal to prevent re-rendering
|
|
58
|
+
);
|
|
57
59
|
const trackAgentAction = useCallback((action, attributes) => {
|
|
58
60
|
fireAnalyticsEvent({
|
|
59
61
|
actionSubject: 'rovoAgent',
|
|
@@ -24,6 +24,7 @@ export const useRovoAgentCSID = () => {
|
|
|
24
24
|
refresh: () => {
|
|
25
25
|
const newCSID = generateCSID();
|
|
26
26
|
setCSID(newCSID);
|
|
27
|
+
return newCSID;
|
|
27
28
|
},
|
|
28
29
|
clear: () => {
|
|
29
30
|
// remove CSID query parameter
|
|
@@ -33,6 +34,7 @@ export const useRovoAgentCSID = () => {
|
|
|
33
34
|
|
|
34
35
|
// reset state
|
|
35
36
|
setCSID(null);
|
|
37
|
+
return null;
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
40
|
}, []);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useCallback,
|
|
2
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
1
|
+
import { useCallback, useContext, useRef } from 'react';
|
|
2
|
+
import { AnalyticsReactContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
3
|
import { ANALYTICS_CHANNEL } from '../common/constants';
|
|
4
4
|
import { useRovoAgentCSID } from '../common/csid';
|
|
5
|
-
import { getDefaultTrackEventConfig } from '../common/utils';
|
|
5
|
+
import { getAttributesFromContexts, getDefaultTrackEventConfig } from '../common/utils';
|
|
6
6
|
export let AgentCreateActions = /*#__PURE__*/function (AgentCreateActions) {
|
|
7
7
|
/* Start create flow when user clicks on "Create agent" button - https://data-portal.internal.atlassian.com/analytics/registry/97089 */
|
|
8
8
|
AgentCreateActions["START"] = "createFlowStart";
|
|
@@ -20,29 +20,40 @@ export let AgentCreateActions = /*#__PURE__*/function (AgentCreateActions) {
|
|
|
20
20
|
AgentCreateActions["LAND"] = "createLandInStudio";
|
|
21
21
|
/* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
|
|
22
22
|
AgentCreateActions["DISCARD"] = "createDiscard";
|
|
23
|
+
/* Show no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97435 */
|
|
24
|
+
AgentCreateActions["SHOW_NO_SKILLS_MODAL"] = "showNoSkillsModal";
|
|
25
|
+
/* Browse click no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97436 */
|
|
26
|
+
AgentCreateActions["BROWSE_CLICK_NO_SKILLS_MODAL"] = "browseClickNoSkillsModal";
|
|
27
|
+
/* Discard no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97437 */
|
|
28
|
+
AgentCreateActions["DISCARD_NO_SKILLS_MODAL"] = "discardNoSkillsModal";
|
|
23
29
|
return AgentCreateActions;
|
|
24
30
|
}({});
|
|
31
|
+
const globalEventConfig = getDefaultTrackEventConfig();
|
|
25
32
|
export const useRovoAgentCreateAnalytics = commonAttributes => {
|
|
26
33
|
const [csid, {
|
|
27
34
|
refresh: refreshCSID
|
|
28
35
|
}] = useRovoAgentCSID();
|
|
36
|
+
const analyticsContext = useContext(AnalyticsReactContext);
|
|
29
37
|
const {
|
|
30
38
|
createAnalyticsEvent
|
|
31
39
|
} = useAnalyticsEvents();
|
|
32
|
-
const
|
|
40
|
+
const commonAttributesRef = useRef(commonAttributes);
|
|
33
41
|
const fireAnalyticsEvent = useCallback(event => {
|
|
34
42
|
const referrer = typeof window !== 'undefined' ? window.document.referrer : 'unknown';
|
|
43
|
+
const attributes = {
|
|
44
|
+
...getAttributesFromContexts(analyticsContext.getAtlaskitAnalyticsContext()),
|
|
45
|
+
...commonAttributesRef.current,
|
|
46
|
+
...event.attributes,
|
|
47
|
+
csid,
|
|
48
|
+
referrer
|
|
49
|
+
};
|
|
35
50
|
createAnalyticsEvent({
|
|
36
|
-
...
|
|
51
|
+
...globalEventConfig,
|
|
37
52
|
...event,
|
|
38
|
-
attributes
|
|
39
|
-
csid,
|
|
40
|
-
referrer,
|
|
41
|
-
...commonAttributes,
|
|
42
|
-
...event.attributes
|
|
43
|
-
}
|
|
53
|
+
attributes
|
|
44
54
|
}).fire(ANALYTICS_CHANNEL);
|
|
45
|
-
}, [createAnalyticsEvent,
|
|
55
|
+
}, [createAnalyticsEvent, csid, analyticsContext] // keep number of dependencies minimal to prevent re-rendering
|
|
56
|
+
);
|
|
46
57
|
|
|
47
58
|
/**
|
|
48
59
|
* This will fire analytics event for intermediate steps in the create agent flow funnel
|
|
@@ -82,6 +93,7 @@ export const useRovoAgentCreateAnalytics = commonAttributes => {
|
|
|
82
93
|
return [csid, {
|
|
83
94
|
trackCreateSession,
|
|
84
95
|
trackCreateSessionStart,
|
|
85
|
-
trackCreateSessionError
|
|
96
|
+
trackCreateSessionError,
|
|
97
|
+
refreshCSID
|
|
86
98
|
}];
|
|
87
99
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { useCallback, useContext,
|
|
4
|
+
import { useCallback, useContext, useRef } from 'react';
|
|
5
5
|
import { AnalyticsReactContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
6
|
import { ANALYTICS_CHANNEL } from '../common/constants';
|
|
7
7
|
import { getAttributesFromContexts, getDefaultTrackEventConfig } from '../common/utils';
|
|
@@ -39,19 +39,19 @@ export var AgentCommonActions = /*#__PURE__*/function (AgentCommonActions) {
|
|
|
39
39
|
AgentCommonActions["UNVERIFY"] = "unverify";
|
|
40
40
|
return AgentCommonActions;
|
|
41
41
|
}({});
|
|
42
|
+
var globalEventConfig = getDefaultTrackEventConfig();
|
|
42
43
|
export var useRovoAgentActionAnalytics = function useRovoAgentActionAnalytics(commonAttributes) {
|
|
43
44
|
var analyticsContext = useContext(AnalyticsReactContext);
|
|
44
45
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
45
46
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
46
|
-
var
|
|
47
|
-
return getDefaultTrackEventConfig();
|
|
48
|
-
}, []);
|
|
47
|
+
var commonAttributesRef = useRef(commonAttributes);
|
|
49
48
|
var fireAnalyticsEvent = useCallback(function (event) {
|
|
50
|
-
var attributes = _objectSpread(_objectSpread(_objectSpread({}, getAttributesFromContexts(analyticsContext.getAtlaskitAnalyticsContext())),
|
|
51
|
-
createAnalyticsEvent(_objectSpread(_objectSpread(_objectSpread({},
|
|
49
|
+
var attributes = _objectSpread(_objectSpread(_objectSpread({}, getAttributesFromContexts(analyticsContext.getAtlaskitAnalyticsContext())), commonAttributesRef.current), event.attributes);
|
|
50
|
+
createAnalyticsEvent(_objectSpread(_objectSpread(_objectSpread({}, globalEventConfig), event), {}, {
|
|
52
51
|
attributes: attributes
|
|
53
52
|
})).fire(ANALYTICS_CHANNEL);
|
|
54
|
-
}, [createAnalyticsEvent,
|
|
53
|
+
}, [createAnalyticsEvent, analyticsContext] // keep number of dependencies minimal to prevent re-rendering
|
|
54
|
+
);
|
|
55
55
|
var trackAgentAction = useCallback(function (action, attributes) {
|
|
56
56
|
fireAnalyticsEvent({
|
|
57
57
|
actionSubject: 'rovoAgent',
|
|
@@ -28,6 +28,7 @@ export var useRovoAgentCSID = function useRovoAgentCSID() {
|
|
|
28
28
|
refresh: function refresh() {
|
|
29
29
|
var newCSID = generateCSID();
|
|
30
30
|
setCSID(newCSID);
|
|
31
|
+
return newCSID;
|
|
31
32
|
},
|
|
32
33
|
clear: function clear() {
|
|
33
34
|
// remove CSID query parameter
|
|
@@ -37,6 +38,7 @@ export var useRovoAgentCSID = function useRovoAgentCSID() {
|
|
|
37
38
|
|
|
38
39
|
// reset state
|
|
39
40
|
setCSID(null);
|
|
41
|
+
return null;
|
|
40
42
|
}
|
|
41
43
|
};
|
|
42
44
|
}, []);
|
package/dist/esm/create/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import { useCallback,
|
|
6
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
|
+
import { useCallback, useContext, useRef } from 'react';
|
|
6
|
+
import { AnalyticsReactContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
7
|
import { ANALYTICS_CHANNEL } from '../common/constants';
|
|
8
8
|
import { useRovoAgentCSID } from '../common/csid';
|
|
9
|
-
import { getDefaultTrackEventConfig } from '../common/utils';
|
|
9
|
+
import { getAttributesFromContexts, getDefaultTrackEventConfig } from '../common/utils';
|
|
10
10
|
export var AgentCreateActions = /*#__PURE__*/function (AgentCreateActions) {
|
|
11
11
|
/* Start create flow when user clicks on "Create agent" button - https://data-portal.internal.atlassian.com/analytics/registry/97089 */
|
|
12
12
|
AgentCreateActions["START"] = "createFlowStart";
|
|
@@ -24,27 +24,35 @@ export var AgentCreateActions = /*#__PURE__*/function (AgentCreateActions) {
|
|
|
24
24
|
AgentCreateActions["LAND"] = "createLandInStudio";
|
|
25
25
|
/* Discard agent - https://data-portal.internal.atlassian.com/analytics/registry/97137 */
|
|
26
26
|
AgentCreateActions["DISCARD"] = "createDiscard";
|
|
27
|
+
/* Show no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97435 */
|
|
28
|
+
AgentCreateActions["SHOW_NO_SKILLS_MODAL"] = "showNoSkillsModal";
|
|
29
|
+
/* Browse click no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97436 */
|
|
30
|
+
AgentCreateActions["BROWSE_CLICK_NO_SKILLS_MODAL"] = "browseClickNoSkillsModal";
|
|
31
|
+
/* Discard no skills modal - https://data-portal.internal.atlassian.com/analytics/registry/97437 */
|
|
32
|
+
AgentCreateActions["DISCARD_NO_SKILLS_MODAL"] = "discardNoSkillsModal";
|
|
27
33
|
return AgentCreateActions;
|
|
28
34
|
}({});
|
|
35
|
+
var globalEventConfig = getDefaultTrackEventConfig();
|
|
29
36
|
export var useRovoAgentCreateAnalytics = function useRovoAgentCreateAnalytics(commonAttributes) {
|
|
30
37
|
var _useRovoAgentCSID = useRovoAgentCSID(),
|
|
31
38
|
_useRovoAgentCSID2 = _slicedToArray(_useRovoAgentCSID, 2),
|
|
32
39
|
csid = _useRovoAgentCSID2[0],
|
|
33
40
|
refreshCSID = _useRovoAgentCSID2[1].refresh;
|
|
41
|
+
var analyticsContext = useContext(AnalyticsReactContext);
|
|
34
42
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
35
43
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
36
|
-
var
|
|
37
|
-
return getDefaultTrackEventConfig();
|
|
38
|
-
}, []);
|
|
44
|
+
var commonAttributesRef = useRef(commonAttributes);
|
|
39
45
|
var fireAnalyticsEvent = useCallback(function (event) {
|
|
40
46
|
var referrer = typeof window !== 'undefined' ? window.document.referrer : 'unknown';
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
var attributes = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getAttributesFromContexts(analyticsContext.getAtlaskitAnalyticsContext())), commonAttributesRef.current), event.attributes), {}, {
|
|
48
|
+
csid: csid,
|
|
49
|
+
referrer: referrer
|
|
50
|
+
});
|
|
51
|
+
createAnalyticsEvent(_objectSpread(_objectSpread(_objectSpread({}, globalEventConfig), event), {}, {
|
|
52
|
+
attributes: attributes
|
|
46
53
|
})).fire(ANALYTICS_CHANNEL);
|
|
47
|
-
}, [createAnalyticsEvent,
|
|
54
|
+
}, [createAnalyticsEvent, csid, analyticsContext] // keep number of dependencies minimal to prevent re-rendering
|
|
55
|
+
);
|
|
48
56
|
|
|
49
57
|
/**
|
|
50
58
|
* This will fire analytics event for intermediate steps in the create agent flow funnel
|
|
@@ -83,6 +91,7 @@ export var useRovoAgentCreateAnalytics = function useRovoAgentCreateAnalytics(co
|
|
|
83
91
|
return [csid, {
|
|
84
92
|
trackCreateSession: trackCreateSession,
|
|
85
93
|
trackCreateSessionStart: trackCreateSessionStart,
|
|
86
|
-
trackCreateSessionError: trackCreateSessionError
|
|
94
|
+
trackCreateSessionError: trackCreateSessionError,
|
|
95
|
+
refreshCSID: refreshCSID
|
|
87
96
|
}];
|
|
88
97
|
};
|
|
@@ -38,7 +38,10 @@ type ActionAttributes = {
|
|
|
38
38
|
[AgentCommonActions.UNVERIFY]: CommonAnalyticsAttributes;
|
|
39
39
|
[AgentDebugActions.COPY_ALL]: EmptyAttributes;
|
|
40
40
|
[AgentDebugActions.COPY]: EmptyAttributes;
|
|
41
|
-
[AgentDebugActions.TOGGLE_SKILL_INFO]:
|
|
41
|
+
[AgentDebugActions.TOGGLE_SKILL_INFO]: {
|
|
42
|
+
toolId: string;
|
|
43
|
+
isExpanded: boolean;
|
|
44
|
+
};
|
|
42
45
|
[AgentDebugActions.VIEW]: EmptyAttributes;
|
|
43
46
|
};
|
|
44
47
|
export declare const useRovoAgentActionAnalytics: <T extends {}>(commonAttributes: T) => {
|
|
@@ -9,11 +9,15 @@ export declare enum AgentCreateActions {
|
|
|
9
9
|
RESTART = "createFlowRestart",
|
|
10
10
|
ERROR = "createFlowError",
|
|
11
11
|
LAND = "createLandInStudio",
|
|
12
|
-
DISCARD = "createDiscard"
|
|
12
|
+
DISCARD = "createDiscard",
|
|
13
|
+
SHOW_NO_SKILLS_MODAL = "showNoSkillsModal",
|
|
14
|
+
BROWSE_CLICK_NO_SKILLS_MODAL = "browseClickNoSkillsModal",
|
|
15
|
+
DISCARD_NO_SKILLS_MODAL = "discardNoSkillsModal"
|
|
13
16
|
}
|
|
14
17
|
export declare const useRovoAgentCreateAnalytics: (commonAttributes: CommonAnalyticsAttributes) => readonly [string | null, {
|
|
15
18
|
readonly trackCreateSession: (action: Omit<AgentCreateActions, AgentCreateActions.START>, attributes?: CommonAnalyticsAttributes) => void;
|
|
16
19
|
readonly trackCreateSessionStart: (attributes?: CommonAnalyticsAttributes) => void;
|
|
17
20
|
readonly trackCreateSessionError: (error: Error, attributes?: CommonAnalyticsAttributes) => void;
|
|
21
|
+
readonly refreshCSID: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
18
22
|
}];
|
|
19
23
|
export {};
|
|
@@ -38,7 +38,10 @@ type ActionAttributes = {
|
|
|
38
38
|
[AgentCommonActions.UNVERIFY]: CommonAnalyticsAttributes;
|
|
39
39
|
[AgentDebugActions.COPY_ALL]: EmptyAttributes;
|
|
40
40
|
[AgentDebugActions.COPY]: EmptyAttributes;
|
|
41
|
-
[AgentDebugActions.TOGGLE_SKILL_INFO]:
|
|
41
|
+
[AgentDebugActions.TOGGLE_SKILL_INFO]: {
|
|
42
|
+
toolId: string;
|
|
43
|
+
isExpanded: boolean;
|
|
44
|
+
};
|
|
42
45
|
[AgentDebugActions.VIEW]: EmptyAttributes;
|
|
43
46
|
};
|
|
44
47
|
export declare const useRovoAgentActionAnalytics: <T extends {}>(commonAttributes: T) => {
|
|
@@ -9,7 +9,10 @@ export declare enum AgentCreateActions {
|
|
|
9
9
|
RESTART = "createFlowRestart",
|
|
10
10
|
ERROR = "createFlowError",
|
|
11
11
|
LAND = "createLandInStudio",
|
|
12
|
-
DISCARD = "createDiscard"
|
|
12
|
+
DISCARD = "createDiscard",
|
|
13
|
+
SHOW_NO_SKILLS_MODAL = "showNoSkillsModal",
|
|
14
|
+
BROWSE_CLICK_NO_SKILLS_MODAL = "browseClickNoSkillsModal",
|
|
15
|
+
DISCARD_NO_SKILLS_MODAL = "discardNoSkillsModal"
|
|
13
16
|
}
|
|
14
17
|
export declare const useRovoAgentCreateAnalytics: (commonAttributes: CommonAnalyticsAttributes) => readonly [
|
|
15
18
|
string | null,
|
|
@@ -17,6 +20,7 @@ export declare const useRovoAgentCreateAnalytics: (commonAttributes: CommonAnaly
|
|
|
17
20
|
readonly trackCreateSession: (action: Omit<AgentCreateActions, AgentCreateActions.START>, attributes?: CommonAnalyticsAttributes) => void;
|
|
18
21
|
readonly trackCreateSessionStart: (attributes?: CommonAnalyticsAttributes) => void;
|
|
19
22
|
readonly trackCreateSessionError: (error: Error, attributes?: CommonAnalyticsAttributes) => void;
|
|
23
|
+
readonly refreshCSID: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
20
24
|
}
|
|
21
25
|
];
|
|
22
26
|
export {};
|