@atlaskit/profilecard 25.1.1 → 25.1.3

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,18 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 25.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 25.1.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`d95f2529148e8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d95f2529148e8) -
14
+ Fix for creator data mismatch in agent profile cards
15
+
3
16
  ## 25.1.1
4
17
 
5
18
  ### Patch 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', "25.1.0");
14
+ headers.append('atl-client-version', "25.1.2");
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', "25.1.0");
69
+ headers.append('atl-client-version', "25.1.2");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -42,31 +42,41 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
42
42
  var creatorUserId = (0, _react.useMemo)(function () {
43
43
  return (agentData === null || agentData === void 0 ? void 0 : agentData.creator_type) === 'CUSTOMER' && agentData.creator ? (0, _rovoAgentUtils.getAAIDFromARI)(agentData.creator) : '';
44
44
  }, [agentData === null || agentData === void 0 ? void 0 : agentData.creator_type, agentData === null || agentData === void 0 ? void 0 : agentData.creator]);
45
- var _navigateToTeamsApp = (0, _navigation.navigateToTeamsApp)({
46
- type: 'USER',
47
- payload: {
48
- userId: creatorUserId || ''
49
- },
50
- cloudId: props.cloudId
51
- }),
52
- profileHref = _navigateToTeamsApp.href;
45
+ var navResult = (0, _navigation.navigateToTeamsApp)({
46
+ type: 'USER',
47
+ payload: {
48
+ userId: creatorUserId || ''
49
+ },
50
+ cloudId: props.cloudId
51
+ });
52
+ var profileHref = navResult.href;
53
53
  var getCreator = (0, _react.useCallback)( /*#__PURE__*/function () {
54
54
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
55
- var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
55
+ var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, currentCreatorUserId, creatorInfo;
56
56
  return _regenerator.default.wrap(function _callee$(_context) {
57
57
  while (1) switch (_context.prev = _context.next) {
58
58
  case 0:
59
59
  creator_type = _ref.creator_type, creator = _ref.creator, authoringTeam = _ref.authoringTeam;
60
60
  _context.prev = 1;
61
- if (!(creatorUserId && props.cloudId)) {
62
- _context.next = 6;
61
+ currentCreatorUserId = (0, _platformFeatureFlags.fg)('jira_ai_fix_agent_profile_card_flashing') ? creator_type === 'CUSTOMER' && creator ? (0, _rovoAgentUtils.getAAIDFromARI)(creator) : undefined : creatorUserId;
62
+ if (!(currentCreatorUserId && props.cloudId)) {
63
+ _context.next = 8;
63
64
  break;
64
65
  }
65
- _context.next = 5;
66
- return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
67
- case 5:
68
- userCreatorInfo = _context.sent;
66
+ _context.next = 6;
67
+ return props.resourceClient.getProfile(props.cloudId, currentCreatorUserId, fireEvent);
69
68
  case 6:
69
+ userCreatorInfo = _context.sent;
70
+ if ((0, _platformFeatureFlags.fg)('jira_ai_fix_agent_profile_card_flashing')) {
71
+ profileHref = (0, _navigation.navigateToTeamsApp)({
72
+ type: 'USER',
73
+ payload: {
74
+ userId: currentCreatorUserId
75
+ },
76
+ cloudId: props.cloudId
77
+ }).href;
78
+ }
79
+ case 8:
70
80
  creatorInfo = (0, _AgentProfileInfo.getAgentCreator)({
71
81
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
72
82
  authoringTeam: authoringTeam ? {
@@ -75,20 +85,20 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
75
85
  } : undefined,
76
86
  userCreator: userCreatorInfo ? {
77
87
  name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
78
- profileLink: (0, _platformFeatureFlags.fg)('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(creatorUserId)
88
+ profileLink: (0, _platformFeatureFlags.fg)('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(currentCreatorUserId)
79
89
  } : undefined,
80
90
  forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
81
91
  });
82
92
  return _context.abrupt("return", creatorInfo);
83
- case 10:
84
- _context.prev = 10;
93
+ case 12:
94
+ _context.prev = 12;
85
95
  _context.t0 = _context["catch"](1);
86
96
  return _context.abrupt("return", undefined);
87
- case 13:
97
+ case 15:
88
98
  case "end":
89
99
  return _context.stop();
90
100
  }
91
- }, _callee, null, [[1, 10]]);
101
+ }, _callee, null, [[1, 12]]);
92
102
  }));
93
103
  return function (_x) {
94
104
  return _ref2.apply(this, arguments);
@@ -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 = "25.1.0") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
15
+ packageVersion: (_process$env$_PACKAGE2 = "25.1.2") !== 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: "25.1.0"
34
+ packageVersion: "25.1.2"
35
35
  }, attributes), {}, {
36
36
  firedAt: Math.round((0, _performance.getPageTime)())
37
37
  })
@@ -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', "25.1.0");
9
+ headers.append('atl-client-version', "25.1.2");
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', "25.1.0");
81
+ headers.append('atl-client-version', "25.1.2");
82
82
  return headers;
83
83
  };
84
84
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -17,15 +17,14 @@ export const AgentProfileCardResourced = props => {
17
17
  fireEvent
18
18
  } = useAnalyticsEventsNext();
19
19
  const creatorUserId = useMemo(() => (agentData === null || agentData === void 0 ? void 0 : agentData.creator_type) === 'CUSTOMER' && agentData.creator ? getAAIDFromARI(agentData.creator) : '', [agentData === null || agentData === void 0 ? void 0 : agentData.creator_type, agentData === null || agentData === void 0 ? void 0 : agentData.creator]);
20
- const {
21
- href: profileHref
22
- } = navigateToTeamsApp({
20
+ const navResult = navigateToTeamsApp({
23
21
  type: 'USER',
24
22
  payload: {
25
23
  userId: creatorUserId || ''
26
24
  },
27
25
  cloudId: props.cloudId
28
26
  });
27
+ let profileHref = navResult.href;
29
28
  const getCreator = useCallback(async ({
30
29
  creator_type,
31
30
  creator,
@@ -34,8 +33,18 @@ export const AgentProfileCardResourced = props => {
34
33
  try {
35
34
  var _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full;
36
35
  let userCreatorInfo;
37
- if (creatorUserId && props.cloudId) {
38
- userCreatorInfo = await props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
36
+ const currentCreatorUserId = fg('jira_ai_fix_agent_profile_card_flashing') ? creator_type === 'CUSTOMER' && creator ? getAAIDFromARI(creator) : undefined : creatorUserId;
37
+ if (currentCreatorUserId && props.cloudId) {
38
+ userCreatorInfo = await props.resourceClient.getProfile(props.cloudId, currentCreatorUserId, fireEvent);
39
+ if (fg('jira_ai_fix_agent_profile_card_flashing')) {
40
+ profileHref = navigateToTeamsApp({
41
+ type: 'USER',
42
+ payload: {
43
+ userId: currentCreatorUserId
44
+ },
45
+ cloudId: props.cloudId
46
+ }).href;
47
+ }
39
48
  }
40
49
  const creatorInfo = getAgentCreator({
41
50
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
@@ -45,7 +54,7 @@ export const AgentProfileCardResourced = props => {
45
54
  } : undefined,
46
55
  userCreator: userCreatorInfo ? {
47
56
  name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
48
- profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : `/people/${creatorUserId}`
57
+ profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : `/people/${currentCreatorUserId}`
49
58
  } : undefined,
50
59
  forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
51
60
  });
@@ -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 = "25.1.0") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
5
+ packageVersion: (_process$env$_PACKAGE2 = "25.1.2") !== 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: "25.1.0",
22
+ packageVersion: "25.1.2",
23
23
  ...attributes,
24
24
  firedAt: Math.round(getPageTime())
25
25
  }
@@ -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', "25.1.0");
7
+ headers.append('atl-client-version', "25.1.2");
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', "25.1.0");
62
+ headers.append('atl-client-version', "25.1.2");
63
63
  return headers;
64
64
  };
65
65
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -33,31 +33,41 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
33
33
  var creatorUserId = useMemo(function () {
34
34
  return (agentData === null || agentData === void 0 ? void 0 : agentData.creator_type) === 'CUSTOMER' && agentData.creator ? getAAIDFromARI(agentData.creator) : '';
35
35
  }, [agentData === null || agentData === void 0 ? void 0 : agentData.creator_type, agentData === null || agentData === void 0 ? void 0 : agentData.creator]);
36
- var _navigateToTeamsApp = navigateToTeamsApp({
37
- type: 'USER',
38
- payload: {
39
- userId: creatorUserId || ''
40
- },
41
- cloudId: props.cloudId
42
- }),
43
- profileHref = _navigateToTeamsApp.href;
36
+ var navResult = navigateToTeamsApp({
37
+ type: 'USER',
38
+ payload: {
39
+ userId: creatorUserId || ''
40
+ },
41
+ cloudId: props.cloudId
42
+ });
43
+ var profileHref = navResult.href;
44
44
  var getCreator = useCallback( /*#__PURE__*/function () {
45
45
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
46
- var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
46
+ var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, currentCreatorUserId, creatorInfo;
47
47
  return _regeneratorRuntime.wrap(function _callee$(_context) {
48
48
  while (1) switch (_context.prev = _context.next) {
49
49
  case 0:
50
50
  creator_type = _ref.creator_type, creator = _ref.creator, authoringTeam = _ref.authoringTeam;
51
51
  _context.prev = 1;
52
- if (!(creatorUserId && props.cloudId)) {
53
- _context.next = 6;
52
+ currentCreatorUserId = fg('jira_ai_fix_agent_profile_card_flashing') ? creator_type === 'CUSTOMER' && creator ? getAAIDFromARI(creator) : undefined : creatorUserId;
53
+ if (!(currentCreatorUserId && props.cloudId)) {
54
+ _context.next = 8;
54
55
  break;
55
56
  }
56
- _context.next = 5;
57
- return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
58
- case 5:
59
- userCreatorInfo = _context.sent;
57
+ _context.next = 6;
58
+ return props.resourceClient.getProfile(props.cloudId, currentCreatorUserId, fireEvent);
60
59
  case 6:
60
+ userCreatorInfo = _context.sent;
61
+ if (fg('jira_ai_fix_agent_profile_card_flashing')) {
62
+ profileHref = navigateToTeamsApp({
63
+ type: 'USER',
64
+ payload: {
65
+ userId: currentCreatorUserId
66
+ },
67
+ cloudId: props.cloudId
68
+ }).href;
69
+ }
70
+ case 8:
61
71
  creatorInfo = getAgentCreator({
62
72
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
63
73
  authoringTeam: authoringTeam ? {
@@ -66,20 +76,20 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
66
76
  } : undefined,
67
77
  userCreator: userCreatorInfo ? {
68
78
  name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
69
- profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(creatorUserId)
79
+ profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(currentCreatorUserId)
70
80
  } : undefined,
71
81
  forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
72
82
  });
73
83
  return _context.abrupt("return", creatorInfo);
74
- case 10:
75
- _context.prev = 10;
84
+ case 12:
85
+ _context.prev = 12;
76
86
  _context.t0 = _context["catch"](1);
77
87
  return _context.abrupt("return", undefined);
78
- case 13:
88
+ case 15:
79
89
  case "end":
80
90
  return _context.stop();
81
91
  }
82
- }, _callee, null, [[1, 10]]);
92
+ }, _callee, null, [[1, 12]]);
83
93
  }));
84
94
  return function (_x) {
85
95
  return _ref2.apply(this, arguments);
@@ -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 = "25.1.0") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
8
+ packageVersion: (_process$env$_PACKAGE2 = "25.1.2") !== 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: "25.1.0"
27
+ packageVersion: "25.1.2"
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": "25.1.1",
3
+ "version": "25.1.3",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "@atlaskit/afm-i18n-platform-people-and-teams-profilecard": "2.39.0",
50
50
  "@atlaskit/atlassian-context": "^0.8.0",
51
- "@atlaskit/avatar": "^25.11.0",
51
+ "@atlaskit/avatar": "^25.12.0",
52
52
  "@atlaskit/avatar-group": "^12.7.0",
53
53
  "@atlaskit/button": "^23.11.0",
54
54
  "@atlaskit/css": "^0.19.0",
@@ -60,13 +60,13 @@
60
60
  "@atlaskit/link": "3.4.2",
61
61
  "@atlaskit/lozenge": "^13.7.0",
62
62
  "@atlaskit/menu": "^8.5.0",
63
- "@atlaskit/modal-dialog": "^14.15.0",
63
+ "@atlaskit/modal-dialog": "^14.16.0",
64
64
  "@atlaskit/people-teams-ui-public": "^4.0.0",
65
65
  "@atlaskit/platform-feature-flags": "^1.1.0",
66
66
  "@atlaskit/popup": "^4.16.0",
67
67
  "@atlaskit/primitives": "^19.0.0",
68
68
  "@atlaskit/rovo-agent-components": "^4.2.0",
69
- "@atlaskit/rovo-triggers": "^5.41.0",
69
+ "@atlaskit/rovo-triggers": "^5.42.0",
70
70
  "@atlaskit/spinner": "^19.1.0",
71
71
  "@atlaskit/teams-app-config": "^1.12.0",
72
72
  "@atlaskit/teams-app-internal-analytics": "^1.27.0",
@@ -74,7 +74,7 @@
74
74
  "@atlaskit/teams-avatar": "^2.6.0",
75
75
  "@atlaskit/teams-public": "^1.1.0",
76
76
  "@atlaskit/theme": "^23.1.0",
77
- "@atlaskit/tmp-editor-statsig": "^63.0.0",
77
+ "@atlaskit/tmp-editor-statsig": "^64.0.0",
78
78
  "@atlaskit/tokens": "^13.0.0",
79
79
  "@atlaskit/tooltip": "^21.1.0",
80
80
  "@babel/runtime": "^7.0.0",