@atlaskit/profilecard 19.28.0 → 19.28.1

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,13 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 19.28.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#144303](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/144303)
8
+ [`5d72a8fdef7ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5d72a8fdef7ec) -
9
+ Disallow duplicate agent option for forge agents
10
+
3
11
  ## 19.28.0
4
12
 
5
13
  ### Minor Changes
@@ -57,7 +57,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
57
57
  headers.append('X-ExperimentalApi', 'teams-beta');
58
58
  headers.append('X-ExperimentalApi', 'team-members-beta');
59
59
  headers.append('atl-client-name', "@atlaskit/profilecard");
60
- headers.append('atl-client-version', "19.28.0");
60
+ headers.append('atl-client-version', "19.28.1");
61
61
  return headers;
62
62
  };
63
63
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -52,8 +52,12 @@ var actionsWrapperStyles = (0, _primitives.xcss)({
52
52
  });
53
53
  var buildAgentActions = function buildAgentActions(_ref) {
54
54
  var onDuplicateAgent = _ref.onDuplicateAgent,
55
- onCopyAgent = _ref.onCopyAgent;
56
- return [{
55
+ onCopyAgent = _ref.onCopyAgent,
56
+ isForgeAgent = _ref.isForgeAgent;
57
+ return isForgeAgent ? [{
58
+ text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.actionCopyLink),
59
+ onClick: onCopyAgent
60
+ }] : [{
57
61
  text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.actionDuplicate),
58
62
  onClick: onDuplicateAgent
59
63
  }, {
@@ -88,7 +92,8 @@ var AgentActions = exports.AgentActions = function AgentActions(_ref3) {
88
92
  setIsDeleteModalOpen = _useState2[1];
89
93
  var agentActions = buildAgentActions({
90
94
  onDuplicateAgent: onDuplicateAgent,
91
- onCopyAgent: onCopyAgent
95
+ onCopyAgent: onCopyAgent,
96
+ isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY'
92
97
  });
93
98
  var agentSetting = buildAgentSettings({
94
99
  onEditAgent: onEditAgent,
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
45
45
  actionSubjectId: actionSubjectId,
46
46
  attributes: _objectSpread(_objectSpread({
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "19.28.0"
48
+ packageVersion: "19.28.1"
49
49
  }, attributes), {}, {
50
50
  firedAt: Math.round((0, _performance.getPageTime)())
51
51
  })
@@ -67,7 +67,7 @@ export const addHeaders = headers => {
67
67
  headers.append('X-ExperimentalApi', 'teams-beta');
68
68
  headers.append('X-ExperimentalApi', 'team-members-beta');
69
69
  headers.append('atl-client-name', "@atlaskit/profilecard");
70
- headers.append('atl-client-version', "19.28.0");
70
+ headers.append('atl-client-version', "19.28.1");
71
71
  return headers;
72
72
  };
73
73
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -39,9 +39,13 @@ const actionsWrapperStyles = xcss({
39
39
  });
40
40
  const buildAgentActions = ({
41
41
  onDuplicateAgent,
42
- onCopyAgent
42
+ onCopyAgent,
43
+ isForgeAgent
43
44
  }) => {
44
- return [{
45
+ return isForgeAgent ? [{
46
+ text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionCopyLink),
47
+ onClick: onCopyAgent
48
+ }] : [{
45
49
  text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionDuplicate),
46
50
  onClick: onDuplicateAgent
47
51
  }, {
@@ -76,7 +80,8 @@ export const AgentActions = ({
76
80
  const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
77
81
  const agentActions = buildAgentActions({
78
82
  onDuplicateAgent,
79
- onCopyAgent
83
+ onCopyAgent,
84
+ isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY'
80
85
  });
81
86
  const agentSetting = buildAgentSettings({
82
87
  onEditAgent,
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
32
32
  actionSubjectId,
33
33
  attributes: {
34
34
  packageName: "@atlaskit/profilecard",
35
- packageVersion: "19.28.0",
35
+ packageVersion: "19.28.1",
36
36
  ...attributes,
37
37
  firedAt: Math.round(getPageTime())
38
38
  }
@@ -48,7 +48,7 @@ export var addHeaders = function addHeaders(headers) {
48
48
  headers.append('X-ExperimentalApi', 'teams-beta');
49
49
  headers.append('X-ExperimentalApi', 'team-members-beta');
50
50
  headers.append('atl-client-name', "@atlaskit/profilecard");
51
- headers.append('atl-client-version', "19.28.0");
51
+ headers.append('atl-client-version', "19.28.1");
52
52
  return headers;
53
53
  };
54
54
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -42,8 +42,12 @@ var actionsWrapperStyles = xcss({
42
42
  });
43
43
  var buildAgentActions = function buildAgentActions(_ref) {
44
44
  var onDuplicateAgent = _ref.onDuplicateAgent,
45
- onCopyAgent = _ref.onCopyAgent;
46
- return [{
45
+ onCopyAgent = _ref.onCopyAgent,
46
+ isForgeAgent = _ref.isForgeAgent;
47
+ return isForgeAgent ? [{
48
+ text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionCopyLink),
49
+ onClick: onCopyAgent
50
+ }] : [{
47
51
  text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionDuplicate),
48
52
  onClick: onDuplicateAgent
49
53
  }, {
@@ -78,7 +82,8 @@ export var AgentActions = function AgentActions(_ref3) {
78
82
  setIsDeleteModalOpen = _useState2[1];
79
83
  var agentActions = buildAgentActions({
80
84
  onDuplicateAgent: onDuplicateAgent,
81
- onCopyAgent: onCopyAgent
85
+ onCopyAgent: onCopyAgent,
86
+ isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY'
82
87
  });
83
88
  var agentSetting = buildAgentSettings({
84
89
  onEditAgent: onEditAgent,
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
39
39
  actionSubjectId: actionSubjectId,
40
40
  attributes: _objectSpread(_objectSpread({
41
41
  packageName: "@atlaskit/profilecard",
42
- packageVersion: "19.28.0"
42
+ packageVersion: "19.28.1"
43
43
  }, attributes), {}, {
44
44
  firedAt: Math.round(getPageTime())
45
45
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "19.28.0",
3
+ "version": "19.28.1",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"