@atlaskit/profilecard 24.34.0 → 24.34.2

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 24.34.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`daa158d9edf95`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/daa158d9edf95) -
8
+ Updated test due to change in team containers text
9
+ - Updated dependencies
10
+
11
+ ## 24.34.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`02b328ec2dc7c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/02b328ec2dc7c) -
16
+ [ux] Bug fix for showing creator information on agent profile cards.
17
+ - Updated dependencies
18
+
3
19
  ## 24.34.0
4
20
 
5
21
  ### Minor Changes
@@ -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.33.0");
14
+ headers.append('atl-client-version', "24.34.1");
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.33.0");
69
+ headers.append('atl-client-version', "24.34.1");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -12,6 +12,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ var _rovoAgentComponents = require("@atlaskit/rovo-agent-components");
15
16
  var _navigation = require("@atlaskit/teams-app-config/navigation");
16
17
  var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
17
18
  var _rovoAgentUtils = require("../../util/rovoAgentUtils");
@@ -52,7 +53,7 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
52
53
  * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
53
54
  * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
54
55
  */
55
- var getCreator = (0, _react.useCallback)( /*#__PURE__*/function () {
56
+ var getCreatorDeprecated = (0, _react.useCallback)( /*#__PURE__*/function () {
56
57
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
57
58
  var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, creatorInfo;
58
59
  return _regenerator.default.wrap(function _callee$(_context) {
@@ -121,48 +122,108 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
121
122
  return _ref2.apply(this, arguments);
122
123
  };
123
124
  }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
124
- var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
125
- var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, agentCreatorInfo;
126
- return _regenerator.default.wrap(function _callee2$(_context2) {
127
- while (1) switch (_context2.prev = _context2.next) {
125
+ var getCreator = (0, _react.useCallback)( /*#__PURE__*/function () {
126
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref3) {
127
+ var creator_type, creator, authoringTeam, _authoringTeam$displa2, _authoringTeam$profil2, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
128
+ return _regenerator.default.wrap(function _callee2$(_context2) {
129
+ while (1) switch (_context2.prev = _context2.next) {
130
+ case 0:
131
+ creator_type = _ref3.creator_type, creator = _ref3.creator, authoringTeam = _ref3.authoringTeam;
132
+ _context2.prev = 1;
133
+ if (!(creatorUserId && props.cloudId)) {
134
+ _context2.next = 6;
135
+ break;
136
+ }
137
+ _context2.next = 5;
138
+ return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
139
+ case 5:
140
+ userCreatorInfo = _context2.sent;
141
+ case 6:
142
+ creatorInfo = (0, _rovoAgentComponents.getAgentCreator)({
143
+ creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
144
+ authoringTeam: authoringTeam ? {
145
+ displayName: (_authoringTeam$displa2 = authoringTeam.displayName) !== null && _authoringTeam$displa2 !== void 0 ? _authoringTeam$displa2 : '',
146
+ profileLink: (_authoringTeam$profil2 = authoringTeam.profileUrl) !== null && _authoringTeam$profil2 !== void 0 ? _authoringTeam$profil2 : undefined
147
+ } : undefined,
148
+ userCreator: userCreatorInfo ? {
149
+ name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
150
+ profileLink: (0, _platformFeatureFlags.fg)('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(creatorUserId)
151
+ } : undefined,
152
+ forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
153
+ });
154
+ return _context2.abrupt("return", creatorInfo);
155
+ case 10:
156
+ _context2.prev = 10;
157
+ _context2.t0 = _context2["catch"](1);
158
+ return _context2.abrupt("return", undefined);
159
+ case 13:
160
+ case "end":
161
+ return _context2.stop();
162
+ }
163
+ }, _callee2, null, [[1, 10]]);
164
+ }));
165
+ return function (_x2) {
166
+ return _ref4.apply(this, arguments);
167
+ };
168
+ }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
169
+ var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
170
+ var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo, agentCreatorInfoDeprecated;
171
+ return _regenerator.default.wrap(function _callee3$(_context3) {
172
+ while (1) switch (_context3.prev = _context3.next) {
128
173
  case 0:
129
174
  setIsLoading(true);
130
- _context2.prev = 1;
131
- _context2.next = 4;
175
+ _context3.prev = 1;
176
+ _context3.next = 4;
132
177
  return props.resourceClient.getRovoAgentProfile({
133
178
  type: 'identity',
134
179
  value: props.accountId
135
180
  }, fireEvent);
136
181
  case 4:
137
- profileResult = _context2.sent;
182
+ profileResult = _context3.sent;
138
183
  profileData = profileResult.restData;
139
- _context2.next = 8;
140
- return getCreator({
184
+ creatorInfoProps = {
141
185
  creator_type: profileData === null || profileData === void 0 ? void 0 : profileData.creator_type,
142
186
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
143
187
  authoringTeam: (_profileResult$aggDat = (_profileResult$aggDat2 = profileResult.aggData) === null || _profileResult$aggDat2 === void 0 ? void 0 : _profileResult$aggDat2.authoringTeam) !== null && _profileResult$aggDat !== void 0 ? _profileResult$aggDat : undefined
144
- });
145
- case 8:
146
- agentCreatorInfo = _context2.sent;
188
+ };
189
+ if (!(0, _platformFeatureFlags.fg)('rovo_agent_show_creator_on_profile_card_fix')) {
190
+ _context3.next = 14;
191
+ break;
192
+ }
193
+ _context3.next = 10;
194
+ return getCreator(creatorInfoProps);
195
+ case 10:
196
+ agentCreatorInfo = _context3.sent;
147
197
  setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
148
198
  creatorInfo: agentCreatorInfo
149
199
  }));
150
- _context2.next = 15;
200
+ _context3.next = 18;
151
201
  break;
152
- case 12:
153
- _context2.prev = 12;
154
- _context2.t0 = _context2["catch"](1);
155
- setError(_context2.t0);
156
- case 15:
157
- _context2.prev = 15;
158
- setIsLoading(false);
159
- return _context2.finish(15);
202
+ case 14:
203
+ _context3.next = 16;
204
+ return getCreatorDeprecated(creatorInfoProps);
205
+ case 16:
206
+ agentCreatorInfoDeprecated = _context3.sent;
207
+ setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
208
+ creatorInfo: agentCreatorInfoDeprecated
209
+ }));
160
210
  case 18:
211
+ _context3.next = 23;
212
+ break;
213
+ case 20:
214
+ _context3.prev = 20;
215
+ _context3.t0 = _context3["catch"](1);
216
+ setError(_context3.t0);
217
+ case 23:
218
+ _context3.prev = 23;
219
+ setIsLoading(false);
220
+ return _context3.finish(23);
221
+ case 26:
161
222
  case "end":
162
- return _context2.stop();
223
+ return _context3.stop();
163
224
  }
164
- }, _callee2, null, [[1, 12, 15, 18]]);
165
- })), [fireEvent, getCreator, props.accountId, props.resourceClient]);
225
+ }, _callee3, null, [[1, 20, 23, 26]]);
226
+ })), [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
166
227
  (0, _react.useEffect)(function () {
167
228
  fetchData();
168
229
  }, [fetchData]);
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  var ANALYTICS_CHANNEL = 'peopleTeams';
14
14
  var PACKAGE_META_DATA = exports.PACKAGE_META_DATA = {
15
15
  packageName: "@atlaskit/profilecard",
16
- packageVersion: "24.33.0"
16
+ packageVersion: "24.34.1"
17
17
  };
18
18
  var runItLater = function runItLater(cb) {
19
19
  var requestIdleCallback = window.requestIdleCallback;
@@ -58,7 +58,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
58
58
  actionSubjectId: actionSubjectId,
59
59
  attributes: _objectSpread(_objectSpread({
60
60
  packageName: "@atlaskit/profilecard",
61
- packageVersion: "24.33.0"
61
+ packageVersion: "24.34.1"
62
62
  }, attributes), {}, {
63
63
  firedAt: Math.round((0, _performance.getPageTime)())
64
64
  })
@@ -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.33.0");
9
+ headers.append('atl-client-version', "24.34.1");
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.33.0");
81
+ headers.append('atl-client-version', "24.34.1");
82
82
  return headers;
83
83
  };
84
84
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -1,5 +1,6 @@
1
1
  import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { getAgentCreator } from '@atlaskit/rovo-agent-components';
3
4
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
4
5
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
5
6
  import { getAAIDFromARI } from '../../util/rovoAgentUtils';
@@ -28,7 +29,7 @@ export const AgentProfileCardResourced = props => {
28
29
  * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
29
30
  * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
30
31
  */
31
- const getCreator = useCallback(async ({
32
+ const getCreatorDeprecated = useCallback(async ({
32
33
  creator_type,
33
34
  creator,
34
35
  authoringTeam
@@ -73,6 +74,34 @@ export const AgentProfileCardResourced = props => {
73
74
  return undefined;
74
75
  }
75
76
  }, [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
77
+ const getCreator = useCallback(async ({
78
+ creator_type,
79
+ creator,
80
+ authoringTeam
81
+ }) => {
82
+ try {
83
+ var _authoringTeam$displa2, _authoringTeam$profil2, _userCreatorInfo$full;
84
+ let userCreatorInfo;
85
+ if (creatorUserId && props.cloudId) {
86
+ userCreatorInfo = await props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
87
+ }
88
+ const creatorInfo = getAgentCreator({
89
+ creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
90
+ authoringTeam: authoringTeam ? {
91
+ displayName: (_authoringTeam$displa2 = authoringTeam.displayName) !== null && _authoringTeam$displa2 !== void 0 ? _authoringTeam$displa2 : '',
92
+ profileLink: (_authoringTeam$profil2 = authoringTeam.profileUrl) !== null && _authoringTeam$profil2 !== void 0 ? _authoringTeam$profil2 : undefined
93
+ } : undefined,
94
+ userCreator: userCreatorInfo ? {
95
+ name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
96
+ profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : `/people/${creatorUserId}`
97
+ } : undefined,
98
+ forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
99
+ });
100
+ return creatorInfo;
101
+ } catch {
102
+ return undefined;
103
+ }
104
+ }, [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
76
105
  const fetchData = useCallback(async () => {
77
106
  setIsLoading(true);
78
107
  try {
@@ -82,21 +111,30 @@ export const AgentProfileCardResourced = props => {
82
111
  value: props.accountId
83
112
  }, fireEvent);
84
113
  const profileData = profileResult.restData;
85
- const agentCreatorInfo = await getCreator({
114
+ const creatorInfoProps = {
86
115
  creator_type: profileData === null || profileData === void 0 ? void 0 : profileData.creator_type,
87
116
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
88
117
  authoringTeam: (_profileResult$aggDat = (_profileResult$aggDat2 = profileResult.aggData) === null || _profileResult$aggDat2 === void 0 ? void 0 : _profileResult$aggDat2.authoringTeam) !== null && _profileResult$aggDat !== void 0 ? _profileResult$aggDat : undefined
89
- });
90
- setAgentData({
91
- ...profileData,
92
- creatorInfo: agentCreatorInfo
93
- });
118
+ };
119
+ if (fg('rovo_agent_show_creator_on_profile_card_fix')) {
120
+ const agentCreatorInfo = await getCreator(creatorInfoProps);
121
+ setAgentData({
122
+ ...profileData,
123
+ creatorInfo: agentCreatorInfo
124
+ });
125
+ } else {
126
+ const agentCreatorInfoDeprecated = await getCreatorDeprecated(creatorInfoProps);
127
+ setAgentData({
128
+ ...profileData,
129
+ creatorInfo: agentCreatorInfoDeprecated
130
+ });
131
+ }
94
132
  } catch (err) {
95
133
  setError(err);
96
134
  } finally {
97
135
  setIsLoading(false);
98
136
  }
99
- }, [fireEvent, getCreator, props.accountId, props.resourceClient]);
137
+ }, [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
100
138
  useEffect(() => {
101
139
  fetchData();
102
140
  }, [fetchData]);
@@ -4,7 +4,7 @@ import { getPageTime } from './performance';
4
4
  const ANALYTICS_CHANNEL = 'peopleTeams';
5
5
  export const PACKAGE_META_DATA = {
6
6
  packageName: "@atlaskit/profilecard",
7
- packageVersion: "24.33.0"
7
+ packageVersion: "24.34.1"
8
8
  };
9
9
  const runItLater = cb => {
10
10
  const requestIdleCallback = window.requestIdleCallback;
@@ -45,7 +45,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
45
45
  actionSubjectId,
46
46
  attributes: {
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "24.33.0",
48
+ packageVersion: "24.34.1",
49
49
  ...attributes,
50
50
  firedAt: Math.round(getPageTime())
51
51
  }
@@ -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.33.0");
7
+ headers.append('atl-client-version', "24.34.1");
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.33.0");
62
+ headers.append('atl-client-version', "24.34.1");
63
63
  return headers;
64
64
  };
65
65
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -6,6 +6,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
6
6
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
7
  import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { getAgentCreator } from '@atlaskit/rovo-agent-components';
9
10
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
10
11
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
11
12
  import { getAAIDFromARI } from '../../util/rovoAgentUtils';
@@ -43,7 +44,7 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
43
44
  * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
44
45
  * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
45
46
  */
46
- var getCreator = useCallback( /*#__PURE__*/function () {
47
+ var getCreatorDeprecated = useCallback( /*#__PURE__*/function () {
47
48
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
48
49
  var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, creatorInfo;
49
50
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -112,48 +113,108 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
112
113
  return _ref2.apply(this, arguments);
113
114
  };
114
115
  }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
115
- var fetchData = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
116
- var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, agentCreatorInfo;
117
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
118
- while (1) switch (_context2.prev = _context2.next) {
116
+ var getCreator = useCallback( /*#__PURE__*/function () {
117
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
118
+ var creator_type, creator, authoringTeam, _authoringTeam$displa2, _authoringTeam$profil2, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
119
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
120
+ while (1) switch (_context2.prev = _context2.next) {
121
+ case 0:
122
+ creator_type = _ref3.creator_type, creator = _ref3.creator, authoringTeam = _ref3.authoringTeam;
123
+ _context2.prev = 1;
124
+ if (!(creatorUserId && props.cloudId)) {
125
+ _context2.next = 6;
126
+ break;
127
+ }
128
+ _context2.next = 5;
129
+ return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
130
+ case 5:
131
+ userCreatorInfo = _context2.sent;
132
+ case 6:
133
+ creatorInfo = getAgentCreator({
134
+ creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
135
+ authoringTeam: authoringTeam ? {
136
+ displayName: (_authoringTeam$displa2 = authoringTeam.displayName) !== null && _authoringTeam$displa2 !== void 0 ? _authoringTeam$displa2 : '',
137
+ profileLink: (_authoringTeam$profil2 = authoringTeam.profileUrl) !== null && _authoringTeam$profil2 !== void 0 ? _authoringTeam$profil2 : undefined
138
+ } : undefined,
139
+ userCreator: userCreatorInfo ? {
140
+ name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
141
+ profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(creatorUserId)
142
+ } : undefined,
143
+ forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
144
+ });
145
+ return _context2.abrupt("return", creatorInfo);
146
+ case 10:
147
+ _context2.prev = 10;
148
+ _context2.t0 = _context2["catch"](1);
149
+ return _context2.abrupt("return", undefined);
150
+ case 13:
151
+ case "end":
152
+ return _context2.stop();
153
+ }
154
+ }, _callee2, null, [[1, 10]]);
155
+ }));
156
+ return function (_x2) {
157
+ return _ref4.apply(this, arguments);
158
+ };
159
+ }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
160
+ var fetchData = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
161
+ var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo, agentCreatorInfoDeprecated;
162
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
163
+ while (1) switch (_context3.prev = _context3.next) {
119
164
  case 0:
120
165
  setIsLoading(true);
121
- _context2.prev = 1;
122
- _context2.next = 4;
166
+ _context3.prev = 1;
167
+ _context3.next = 4;
123
168
  return props.resourceClient.getRovoAgentProfile({
124
169
  type: 'identity',
125
170
  value: props.accountId
126
171
  }, fireEvent);
127
172
  case 4:
128
- profileResult = _context2.sent;
173
+ profileResult = _context3.sent;
129
174
  profileData = profileResult.restData;
130
- _context2.next = 8;
131
- return getCreator({
175
+ creatorInfoProps = {
132
176
  creator_type: profileData === null || profileData === void 0 ? void 0 : profileData.creator_type,
133
177
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
134
178
  authoringTeam: (_profileResult$aggDat = (_profileResult$aggDat2 = profileResult.aggData) === null || _profileResult$aggDat2 === void 0 ? void 0 : _profileResult$aggDat2.authoringTeam) !== null && _profileResult$aggDat !== void 0 ? _profileResult$aggDat : undefined
135
- });
136
- case 8:
137
- agentCreatorInfo = _context2.sent;
179
+ };
180
+ if (!fg('rovo_agent_show_creator_on_profile_card_fix')) {
181
+ _context3.next = 14;
182
+ break;
183
+ }
184
+ _context3.next = 10;
185
+ return getCreator(creatorInfoProps);
186
+ case 10:
187
+ agentCreatorInfo = _context3.sent;
138
188
  setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
139
189
  creatorInfo: agentCreatorInfo
140
190
  }));
141
- _context2.next = 15;
191
+ _context3.next = 18;
142
192
  break;
143
- case 12:
144
- _context2.prev = 12;
145
- _context2.t0 = _context2["catch"](1);
146
- setError(_context2.t0);
147
- case 15:
148
- _context2.prev = 15;
149
- setIsLoading(false);
150
- return _context2.finish(15);
193
+ case 14:
194
+ _context3.next = 16;
195
+ return getCreatorDeprecated(creatorInfoProps);
196
+ case 16:
197
+ agentCreatorInfoDeprecated = _context3.sent;
198
+ setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
199
+ creatorInfo: agentCreatorInfoDeprecated
200
+ }));
151
201
  case 18:
202
+ _context3.next = 23;
203
+ break;
204
+ case 20:
205
+ _context3.prev = 20;
206
+ _context3.t0 = _context3["catch"](1);
207
+ setError(_context3.t0);
208
+ case 23:
209
+ _context3.prev = 23;
210
+ setIsLoading(false);
211
+ return _context3.finish(23);
212
+ case 26:
152
213
  case "end":
153
- return _context2.stop();
214
+ return _context3.stop();
154
215
  }
155
- }, _callee2, null, [[1, 12, 15, 18]]);
156
- })), [fireEvent, getCreator, props.accountId, props.resourceClient]);
216
+ }, _callee3, null, [[1, 20, 23, 26]]);
217
+ })), [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
157
218
  useEffect(function () {
158
219
  fetchData();
159
220
  }, [fetchData]);
@@ -7,7 +7,7 @@ import { getPageTime } from './performance';
7
7
  var ANALYTICS_CHANNEL = 'peopleTeams';
8
8
  export var PACKAGE_META_DATA = {
9
9
  packageName: "@atlaskit/profilecard",
10
- packageVersion: "24.33.0"
10
+ packageVersion: "24.34.1"
11
11
  };
12
12
  var runItLater = function runItLater(cb) {
13
13
  var requestIdleCallback = window.requestIdleCallback;
@@ -52,7 +52,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
52
52
  actionSubjectId: actionSubjectId,
53
53
  attributes: _objectSpread(_objectSpread({
54
54
  packageName: "@atlaskit/profilecard",
55
- packageVersion: "24.33.0"
55
+ packageVersion: "24.34.1"
56
56
  }, attributes), {}, {
57
57
  firedAt: Math.round(getPageTime())
58
58
  })
@@ -92,7 +92,7 @@ export type RovoAgentCardClientResult = {
92
92
  aggData: RovoAgentAgg | null | undefined;
93
93
  };
94
94
  export interface RovoAgentCreatorInfo {
95
- type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE';
95
+ type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE' | 'OOTB';
96
96
  name?: string;
97
97
  profileLink?: string;
98
98
  id?: string;
@@ -92,7 +92,7 @@ export type RovoAgentCardClientResult = {
92
92
  aggData: RovoAgentAgg | null | undefined;
93
93
  };
94
94
  export interface RovoAgentCreatorInfo {
95
- type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE';
95
+ type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE' | 'OOTB';
96
96
  name?: string;
97
97
  profileLink?: string;
98
98
  id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "24.34.0",
3
+ "version": "24.34.2",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -61,13 +61,13 @@
61
61
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
62
62
  "@atlaskit/popup": "^4.13.0",
63
63
  "@atlaskit/primitives": "^17.1.0",
64
- "@atlaskit/rovo-agent-components": "^3.23.0",
64
+ "@atlaskit/rovo-agent-components": "^3.25.0",
65
65
  "@atlaskit/rovo-triggers": "^5.6.0",
66
66
  "@atlaskit/spinner": "^19.0.0",
67
67
  "@atlaskit/teams-app-config": "^1.12.0",
68
68
  "@atlaskit/teams-app-internal-analytics": "^1.23.0",
69
69
  "@atlaskit/teams-avatar": "^2.4.0",
70
- "@atlaskit/teams-public": "^0.67.0",
70
+ "@atlaskit/teams-public": "^0.68.0",
71
71
  "@atlaskit/theme": "^21.0.0",
72
72
  "@atlaskit/tokens": "^10.1.0",
73
73
  "@atlaskit/tooltip": "^20.14.0",
@@ -177,6 +177,9 @@
177
177
  },
178
178
  "rovo_display_ai_disclaimer_on_agent_profile_card": {
179
179
  "type": "boolean"
180
+ },
181
+ "rovo_agent_show_creator_on_profile_card_fix": {
182
+ "type": "boolean"
180
183
  }
181
184
  },
182
185
  "sideEffects": [