@atlaskit/profilecard 24.49.4 → 24.49.6
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 +13 -0
- package/dist/cjs/client/RovoAgentCardClient.js +2 -1
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +20 -1
- package/dist/cjs/components/User/ProfileCardTrigger.js +16 -2
- package/dist/cjs/util/analytics.js +2 -2
- package/dist/es2019/client/RovoAgentCardClient.js +2 -1
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +20 -1
- package/dist/es2019/components/User/ProfileCardTrigger.js +16 -2
- package/dist/es2019/util/analytics.js +2 -2
- package/dist/esm/client/RovoAgentCardClient.js +2 -1
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +20 -1
- package/dist/esm/components/User/ProfileCardTrigger.js +16 -2
- package/dist/esm/util/analytics.js +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 24.49.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`04db4a4ad0487`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/04db4a4ad0487) -
|
|
8
|
+
fix the query
|
|
9
|
+
|
|
10
|
+
## 24.49.5
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 24.49.4
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -17,6 +17,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
18
|
var _analytics = require("../util/analytics");
|
|
19
19
|
var _performance = require("../util/performance");
|
|
20
|
+
var _rovoAgentUtils = require("../util/rovoAgentUtils");
|
|
20
21
|
var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
|
|
21
22
|
var _errorUtils = require("./errorUtils");
|
|
22
23
|
var _graphqlUtils = require("./graphqlUtils");
|
|
@@ -54,7 +55,7 @@ var buildRovoAgentQueryByAccountId = function buildRovoAgentQueryByAccountId(ide
|
|
|
54
55
|
return {
|
|
55
56
|
query: "\n\t\tquery RovoAgentProfileCard_AgentQueryByAccountId($id: ID!, $cloudId: String!) {\n\t\t\tagentStudio_agentByIdentityAccountId(cloudId: $cloudId, id: $id) @optIn(to: \"AgentStudio\") {\n\t\t\t __typename\n\t\t\t\t... on AgentStudioAssistant {\n\t\t\t\t\tauthoringTeam {\n\t\t\t\t\t\tdisplayName\n\t\t\t\t\t\tprofileUrl\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t... on QueryError {\n\t\t\t\t\tmessage\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t",
|
|
56
57
|
variables: {
|
|
57
|
-
id: identityAccountId,
|
|
58
|
+
id: identityAccountId.startsWith(_rovoAgentUtils.USER_ARI_PREFIX) ? identityAccountId : "".concat(_rovoAgentUtils.USER_ARI_PREFIX).concat(identityAccountId),
|
|
58
59
|
cloudId: cloudId
|
|
59
60
|
}
|
|
60
61
|
};
|
|
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
|
|
|
11
11
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
12
12
|
var addHeaders = function addHeaders(headers) {
|
|
13
13
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
14
|
-
headers.append('atl-client-version', "24.49.
|
|
14
|
+
headers.append('atl-client-version', "24.49.5");
|
|
15
15
|
return headers;
|
|
16
16
|
};
|
|
17
17
|
function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -66,7 +66,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
66
66
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
67
67
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
68
68
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
69
|
-
headers.append('atl-client-version', "24.49.
|
|
69
|
+
headers.append('atl-client-version', "24.49.5");
|
|
70
70
|
return headers;
|
|
71
71
|
};
|
|
72
72
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -27,7 +27,9 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
|
|
|
27
27
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
28
|
agentData = _useState2[0],
|
|
29
29
|
setAgentData = _useState2[1];
|
|
30
|
-
|
|
30
|
+
// Initialize as true when fix is enabled since we fetch immediately on mount,
|
|
31
|
+
// avoiding a brief error screen flash before the useEffect fires.
|
|
32
|
+
var _useState3 = (0, _react.useState)((0, _platformFeatureFlags.fg)('jira_ai_fix_agent_profile_card_flashing')),
|
|
31
33
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
32
34
|
isLoading = _useState4[0],
|
|
33
35
|
setIsLoading = _useState4[1];
|
|
@@ -135,7 +137,24 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
|
|
|
135
137
|
}
|
|
136
138
|
}, _callee2, null, [[1, 13, 16, 19]]);
|
|
137
139
|
})), [fireEvent, getCreator, props.accountId, props.resourceClient]);
|
|
140
|
+
|
|
141
|
+
// Depend on accountId rather than fetchData to avoid a re-fetch loop:
|
|
142
|
+
// agentData changes → creatorUserId → getCreator → fetchData ref changes → useEffect re-fires.
|
|
143
|
+
// Reset state on accountId change so stale data from the previous agent isn't briefly shown.
|
|
144
|
+
(0, _react.useEffect)(function () {
|
|
145
|
+
if (!(0, _platformFeatureFlags.fg)('jira_ai_fix_agent_profile_card_flashing')) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
setAgentData(undefined);
|
|
149
|
+
setError(undefined);
|
|
150
|
+
setIsLoading(true);
|
|
151
|
+
fetchData();
|
|
152
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
153
|
+
}, [props.accountId]);
|
|
138
154
|
(0, _react.useEffect)(function () {
|
|
155
|
+
if ((0, _platformFeatureFlags.fg)('jira_ai_fix_agent_profile_card_flashing')) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
139
158
|
fetchData();
|
|
140
159
|
}, [fetchData]);
|
|
141
160
|
if (error || !isLoading && !agentData) {
|
|
@@ -121,8 +121,22 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
121
121
|
var showTimer = (0, _react.useRef)(0);
|
|
122
122
|
var hideTimer = (0, _react.useRef)(0);
|
|
123
123
|
var isExternalControl = propsIsVisible !== undefined && propsIsVisible !== visible;
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
// Skip delay entirely for click triggers, or for externally controlled visibility
|
|
125
|
+
// when the flashing fix is not enabled (preserving the original 0ms behavior).
|
|
126
|
+
var shouldSkipDelay = trigger === 'click' || isExternalControl && !(0, _platformFeatureFlags.fg)('jira_ai_fix_agent_profile_card_flashing') && (0, _platformFeatureFlags.fg)('fix_profilecard_trigger_isvisible');
|
|
127
|
+
// When externally controlled with the flashing fix enabled, use a short debounce
|
|
128
|
+
// to absorb rapid focus changes from dropdown options settling after async load.
|
|
129
|
+
var REDUCED_DELAY_MS = 100;
|
|
130
|
+
var shouldReduceDelay = isExternalControl && (0, _platformFeatureFlags.fg)('jira_ai_fix_agent_profile_card_flashing');
|
|
131
|
+
var showDelay = customShowDelay !== null && customShowDelay !== void 0 ? customShowDelay : _config.DELAY_MS_SHOW;
|
|
132
|
+
var hideDelay = customHideDelay !== null && customHideDelay !== void 0 ? customHideDelay : _config.DELAY_MS_HIDE;
|
|
133
|
+
if (shouldSkipDelay) {
|
|
134
|
+
showDelay = 0;
|
|
135
|
+
hideDelay = 0;
|
|
136
|
+
} else if (shouldReduceDelay) {
|
|
137
|
+
showDelay = REDUCED_DELAY_MS;
|
|
138
|
+
hideDelay = REDUCED_DELAY_MS;
|
|
139
|
+
}
|
|
126
140
|
var _useState3 = (0, _react.useState)(undefined),
|
|
127
141
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
128
142
|
isLoading = _useState4[0],
|
|
@@ -12,7 +12,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
12
12
|
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) { (0, _defineProperty2.default)(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; }
|
|
13
13
|
var PACKAGE_META_DATA = exports.PACKAGE_META_DATA = {
|
|
14
14
|
packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
|
|
15
|
-
packageVersion: (_process$env$_PACKAGE2 = "24.49.
|
|
15
|
+
packageVersion: (_process$env$_PACKAGE2 = "24.49.5") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
|
|
16
16
|
};
|
|
17
17
|
var TEAM_SUBJECT = 'teamProfileCard';
|
|
18
18
|
var USER_SUBJECT = 'profilecard';
|
|
@@ -31,7 +31,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
31
31
|
actionSubjectId: actionSubjectId,
|
|
32
32
|
attributes: _objectSpread(_objectSpread({
|
|
33
33
|
packageName: "@atlaskit/profilecard",
|
|
34
|
-
packageVersion: "24.49.
|
|
34
|
+
packageVersion: "24.49.5"
|
|
35
35
|
}, attributes), {}, {
|
|
36
36
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
37
37
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import { PACKAGE_META_DATA } from '../util/analytics';
|
|
3
3
|
import { getPageTime } from '../util/performance';
|
|
4
|
+
import { USER_ARI_PREFIX } from '../util/rovoAgentUtils';
|
|
4
5
|
import CachingClient from './CachingClient';
|
|
5
6
|
import { getErrorAttributes } from './errorUtils';
|
|
6
7
|
import { AGGQuery } from './graphqlUtils';
|
|
@@ -79,7 +80,7 @@ const buildRovoAgentQueryByAccountId = (identityAccountId, cloudId) => ({
|
|
|
79
80
|
}
|
|
80
81
|
`,
|
|
81
82
|
variables: {
|
|
82
|
-
id: identityAccountId
|
|
83
|
+
id: identityAccountId.startsWith(USER_ARI_PREFIX) ? identityAccountId : `${USER_ARI_PREFIX}${identityAccountId}`,
|
|
83
84
|
cloudId
|
|
84
85
|
}
|
|
85
86
|
});
|
|
@@ -6,7 +6,7 @@ const ORG_ID_FROM_CLOUD_ID_QUERY = `query OrgIdFromCloudId($cloudId: ID!) {
|
|
|
6
6
|
}`;
|
|
7
7
|
const addHeaders = headers => {
|
|
8
8
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
9
|
-
headers.append('atl-client-version', "24.49.
|
|
9
|
+
headers.append('atl-client-version', "24.49.5");
|
|
10
10
|
return headers;
|
|
11
11
|
};
|
|
12
12
|
export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
|
|
@@ -78,7 +78,7 @@ export const addHeaders = headers => {
|
|
|
78
78
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
79
79
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
80
80
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
81
|
-
headers.append('atl-client-version', "24.49.
|
|
81
|
+
headers.append('atl-client-version', "24.49.5");
|
|
82
82
|
return headers;
|
|
83
83
|
};
|
|
84
84
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -9,7 +9,9 @@ import { AgentProfileCardWrapper } from './AgentProfileCardWrapper';
|
|
|
9
9
|
import { AgentProfileCardLazy } from './lazyAgentProfileCard';
|
|
10
10
|
export const AgentProfileCardResourced = props => {
|
|
11
11
|
const [agentData, setAgentData] = useState();
|
|
12
|
-
|
|
12
|
+
// Initialize as true when fix is enabled since we fetch immediately on mount,
|
|
13
|
+
// avoiding a brief error screen flash before the useEffect fires.
|
|
14
|
+
const [isLoading, setIsLoading] = useState(fg('jira_ai_fix_agent_profile_card_flashing'));
|
|
13
15
|
const [error, setError] = useState();
|
|
14
16
|
const {
|
|
15
17
|
fireEvent
|
|
@@ -77,7 +79,24 @@ export const AgentProfileCardResourced = props => {
|
|
|
77
79
|
setIsLoading(false);
|
|
78
80
|
}
|
|
79
81
|
}, [fireEvent, getCreator, props.accountId, props.resourceClient]);
|
|
82
|
+
|
|
83
|
+
// Depend on accountId rather than fetchData to avoid a re-fetch loop:
|
|
84
|
+
// agentData changes → creatorUserId → getCreator → fetchData ref changes → useEffect re-fires.
|
|
85
|
+
// Reset state on accountId change so stale data from the previous agent isn't briefly shown.
|
|
80
86
|
useEffect(() => {
|
|
87
|
+
if (!fg('jira_ai_fix_agent_profile_card_flashing')) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
setAgentData(undefined);
|
|
91
|
+
setError(undefined);
|
|
92
|
+
setIsLoading(true);
|
|
93
|
+
fetchData();
|
|
94
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
95
|
+
}, [props.accountId]);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (fg('jira_ai_fix_agent_profile_card_flashing')) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
81
100
|
fetchData();
|
|
82
101
|
}, [fetchData]);
|
|
83
102
|
if (error || !isLoading && !agentData) {
|
|
@@ -98,8 +98,22 @@ export default function ProfilecardTriggerNext({
|
|
|
98
98
|
const showTimer = useRef(0);
|
|
99
99
|
const hideTimer = useRef(0);
|
|
100
100
|
const isExternalControl = propsIsVisible !== undefined && propsIsVisible !== visible;
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
// Skip delay entirely for click triggers, or for externally controlled visibility
|
|
102
|
+
// when the flashing fix is not enabled (preserving the original 0ms behavior).
|
|
103
|
+
const shouldSkipDelay = trigger === 'click' || isExternalControl && !fg('jira_ai_fix_agent_profile_card_flashing') && fg('fix_profilecard_trigger_isvisible');
|
|
104
|
+
// When externally controlled with the flashing fix enabled, use a short debounce
|
|
105
|
+
// to absorb rapid focus changes from dropdown options settling after async load.
|
|
106
|
+
const REDUCED_DELAY_MS = 100;
|
|
107
|
+
const shouldReduceDelay = isExternalControl && fg('jira_ai_fix_agent_profile_card_flashing');
|
|
108
|
+
let showDelay = customShowDelay !== null && customShowDelay !== void 0 ? customShowDelay : DELAY_MS_SHOW;
|
|
109
|
+
let hideDelay = customHideDelay !== null && customHideDelay !== void 0 ? customHideDelay : DELAY_MS_HIDE;
|
|
110
|
+
if (shouldSkipDelay) {
|
|
111
|
+
showDelay = 0;
|
|
112
|
+
hideDelay = 0;
|
|
113
|
+
} else if (shouldReduceDelay) {
|
|
114
|
+
showDelay = REDUCED_DELAY_MS;
|
|
115
|
+
hideDelay = REDUCED_DELAY_MS;
|
|
116
|
+
}
|
|
103
117
|
const [isLoading, setIsLoading] = useState(undefined);
|
|
104
118
|
const [hasError, setHasError] = useState(false);
|
|
105
119
|
const [error, setError] = useState(null);
|
|
@@ -2,7 +2,7 @@ var _process$env$_PACKAGE, _process$env$_PACKAGE2;
|
|
|
2
2
|
import { getPageTime } from './performance';
|
|
3
3
|
export const PACKAGE_META_DATA = {
|
|
4
4
|
packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
|
|
5
|
-
packageVersion: (_process$env$_PACKAGE2 = "24.49.
|
|
5
|
+
packageVersion: (_process$env$_PACKAGE2 = "24.49.5") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
|
|
6
6
|
};
|
|
7
7
|
const TEAM_SUBJECT = 'teamProfileCard';
|
|
8
8
|
const USER_SUBJECT = 'profilecard';
|
|
@@ -19,7 +19,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
19
19
|
actionSubjectId,
|
|
20
20
|
attributes: {
|
|
21
21
|
packageName: "@atlaskit/profilecard",
|
|
22
|
-
packageVersion: "24.49.
|
|
22
|
+
packageVersion: "24.49.5",
|
|
23
23
|
...attributes,
|
|
24
24
|
firedAt: Math.round(getPageTime())
|
|
25
25
|
}
|
|
@@ -14,6 +14,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import { PACKAGE_META_DATA } from '../util/analytics';
|
|
16
16
|
import { getPageTime } from '../util/performance';
|
|
17
|
+
import { USER_ARI_PREFIX } from '../util/rovoAgentUtils';
|
|
17
18
|
import CachingClient from './CachingClient';
|
|
18
19
|
import { getErrorAttributes } from './errorUtils';
|
|
19
20
|
import { AGGQuery } from './graphqlUtils';
|
|
@@ -47,7 +48,7 @@ var buildRovoAgentQueryByAccountId = function buildRovoAgentQueryByAccountId(ide
|
|
|
47
48
|
return {
|
|
48
49
|
query: "\n\t\tquery RovoAgentProfileCard_AgentQueryByAccountId($id: ID!, $cloudId: String!) {\n\t\t\tagentStudio_agentByIdentityAccountId(cloudId: $cloudId, id: $id) @optIn(to: \"AgentStudio\") {\n\t\t\t __typename\n\t\t\t\t... on AgentStudioAssistant {\n\t\t\t\t\tauthoringTeam {\n\t\t\t\t\t\tdisplayName\n\t\t\t\t\t\tprofileUrl\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t... on QueryError {\n\t\t\t\t\tmessage\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t",
|
|
49
50
|
variables: {
|
|
50
|
-
id: identityAccountId,
|
|
51
|
+
id: identityAccountId.startsWith(USER_ARI_PREFIX) ? identityAccountId : "".concat(USER_ARI_PREFIX).concat(identityAccountId),
|
|
51
52
|
cloudId: cloudId
|
|
52
53
|
}
|
|
53
54
|
};
|
|
@@ -4,7 +4,7 @@ import { AGGQuery } from './graphqlUtils';
|
|
|
4
4
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
5
5
|
var addHeaders = function addHeaders(headers) {
|
|
6
6
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
7
|
-
headers.append('atl-client-version', "24.49.
|
|
7
|
+
headers.append('atl-client-version', "24.49.5");
|
|
8
8
|
return headers;
|
|
9
9
|
};
|
|
10
10
|
export function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -59,7 +59,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
59
59
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
60
60
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
61
61
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
62
|
-
headers.append('atl-client-version', "24.49.
|
|
62
|
+
headers.append('atl-client-version', "24.49.5");
|
|
63
63
|
return headers;
|
|
64
64
|
};
|
|
65
65
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -18,7 +18,9 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
|
|
|
18
18
|
_useState2 = _slicedToArray(_useState, 2),
|
|
19
19
|
agentData = _useState2[0],
|
|
20
20
|
setAgentData = _useState2[1];
|
|
21
|
-
|
|
21
|
+
// Initialize as true when fix is enabled since we fetch immediately on mount,
|
|
22
|
+
// avoiding a brief error screen flash before the useEffect fires.
|
|
23
|
+
var _useState3 = useState(fg('jira_ai_fix_agent_profile_card_flashing')),
|
|
22
24
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
25
|
isLoading = _useState4[0],
|
|
24
26
|
setIsLoading = _useState4[1];
|
|
@@ -126,7 +128,24 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
|
|
|
126
128
|
}
|
|
127
129
|
}, _callee2, null, [[1, 13, 16, 19]]);
|
|
128
130
|
})), [fireEvent, getCreator, props.accountId, props.resourceClient]);
|
|
131
|
+
|
|
132
|
+
// Depend on accountId rather than fetchData to avoid a re-fetch loop:
|
|
133
|
+
// agentData changes → creatorUserId → getCreator → fetchData ref changes → useEffect re-fires.
|
|
134
|
+
// Reset state on accountId change so stale data from the previous agent isn't briefly shown.
|
|
129
135
|
useEffect(function () {
|
|
136
|
+
if (!fg('jira_ai_fix_agent_profile_card_flashing')) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
setAgentData(undefined);
|
|
140
|
+
setError(undefined);
|
|
141
|
+
setIsLoading(true);
|
|
142
|
+
fetchData();
|
|
143
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
144
|
+
}, [props.accountId]);
|
|
145
|
+
useEffect(function () {
|
|
146
|
+
if (fg('jira_ai_fix_agent_profile_card_flashing')) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
130
149
|
fetchData();
|
|
131
150
|
}, [fetchData]);
|
|
132
151
|
if (error || !isLoading && !agentData) {
|
|
@@ -112,8 +112,22 @@ export default function ProfilecardTriggerNext(_ref2) {
|
|
|
112
112
|
var showTimer = useRef(0);
|
|
113
113
|
var hideTimer = useRef(0);
|
|
114
114
|
var isExternalControl = propsIsVisible !== undefined && propsIsVisible !== visible;
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
// Skip delay entirely for click triggers, or for externally controlled visibility
|
|
116
|
+
// when the flashing fix is not enabled (preserving the original 0ms behavior).
|
|
117
|
+
var shouldSkipDelay = trigger === 'click' || isExternalControl && !fg('jira_ai_fix_agent_profile_card_flashing') && fg('fix_profilecard_trigger_isvisible');
|
|
118
|
+
// When externally controlled with the flashing fix enabled, use a short debounce
|
|
119
|
+
// to absorb rapid focus changes from dropdown options settling after async load.
|
|
120
|
+
var REDUCED_DELAY_MS = 100;
|
|
121
|
+
var shouldReduceDelay = isExternalControl && fg('jira_ai_fix_agent_profile_card_flashing');
|
|
122
|
+
var showDelay = customShowDelay !== null && customShowDelay !== void 0 ? customShowDelay : DELAY_MS_SHOW;
|
|
123
|
+
var hideDelay = customHideDelay !== null && customHideDelay !== void 0 ? customHideDelay : DELAY_MS_HIDE;
|
|
124
|
+
if (shouldSkipDelay) {
|
|
125
|
+
showDelay = 0;
|
|
126
|
+
hideDelay = 0;
|
|
127
|
+
} else if (shouldReduceDelay) {
|
|
128
|
+
showDelay = REDUCED_DELAY_MS;
|
|
129
|
+
hideDelay = REDUCED_DELAY_MS;
|
|
130
|
+
}
|
|
117
131
|
var _useState3 = useState(undefined),
|
|
118
132
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
119
133
|
isLoading = _useState4[0],
|
|
@@ -5,7 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import { getPageTime } from './performance';
|
|
6
6
|
export var PACKAGE_META_DATA = {
|
|
7
7
|
packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
|
|
8
|
-
packageVersion: (_process$env$_PACKAGE2 = "24.49.
|
|
8
|
+
packageVersion: (_process$env$_PACKAGE2 = "24.49.5") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
|
|
9
9
|
};
|
|
10
10
|
var TEAM_SUBJECT = 'teamProfileCard';
|
|
11
11
|
var USER_SUBJECT = 'profilecard';
|
|
@@ -24,7 +24,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
24
24
|
actionSubjectId: actionSubjectId,
|
|
25
25
|
attributes: _objectSpread(_objectSpread({
|
|
26
26
|
packageName: "@atlaskit/profilecard",
|
|
27
|
-
packageVersion: "24.49.
|
|
27
|
+
packageVersion: "24.49.5"
|
|
28
28
|
}, attributes), {}, {
|
|
29
29
|
firedAt: Math.round(getPageTime())
|
|
30
30
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "24.49.
|
|
3
|
+
"version": "24.49.6",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/popup": "^4.16.0",
|
|
60
60
|
"@atlaskit/primitives": "^18.1.0",
|
|
61
61
|
"@atlaskit/rovo-agent-components": "^3.49.0",
|
|
62
|
-
"@atlaskit/rovo-triggers": "^5.
|
|
62
|
+
"@atlaskit/rovo-triggers": "^5.36.0",
|
|
63
63
|
"@atlaskit/spinner": "^19.1.0",
|
|
64
64
|
"@atlaskit/teams-app-config": "^1.12.0",
|
|
65
65
|
"@atlaskit/teams-app-internal-analytics": "^1.27.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@atlaskit/teams-avatar": "^2.4.0",
|
|
68
68
|
"@atlaskit/teams-public": "^0.74.0",
|
|
69
69
|
"@atlaskit/theme": "^23.0.0",
|
|
70
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
70
|
+
"@atlaskit/tmp-editor-statsig": "^58.0.0",
|
|
71
71
|
"@atlaskit/tokens": "^12.0.0",
|
|
72
72
|
"@atlaskit/tooltip": "^21.1.0",
|
|
73
73
|
"@babel/runtime": "^7.0.0",
|