@atlaskit/rovo-agent-components 3.29.0 → 3.30.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/rovo-agent-components
2
2
 
3
+ ## 3.30.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ab19c61b46546`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ab19c61b46546) -
8
+ pass onVerificationSuccess to verification dropdown in browse agent to handle relay connection
9
+ update
10
+
3
11
  ## 3.29.0
4
12
 
5
13
  ### Minor Changes
@@ -56,7 +56,6 @@ var ChatToAgentButton = exports.ChatToAgentButton = function ChatToAgentButton(_
56
56
  };
57
57
  var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
58
58
  var isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
59
- agentId = _ref2.agentId,
60
59
  onEditAgent = _ref2.onEditAgent,
61
60
  onCopyAgent = _ref2.onCopyAgent,
62
61
  onDuplicateAgent = _ref2.onDuplicateAgent,
@@ -77,7 +76,8 @@ var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_
77
76
  shouldTriggerStopPropagation = _ref2.shouldTriggerStopPropagation,
78
77
  agentName = _ref2.agentName,
79
78
  agentRef = _ref2.agentRef,
80
- userPermissionsRef = _ref2.userPermissionsRef;
79
+ userPermissionsRef = _ref2.userPermissionsRef,
80
+ onVerificationSuccess = _ref2.onVerificationSuccess;
81
81
  var _useState = (0, _react.useState)(false),
82
82
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
83
83
  isLoading = _useState2[0],
@@ -200,6 +200,7 @@ var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_
200
200
  }, formatMessage(hasBeenCopied ? _messages.default.linkedCopiedToProfile : _messages.default.copyLinkToProfile)), agentRef && userPermissionsRef && (0, _platformFeatureFlags.fg)('rovo_agents_agent_verification') && /*#__PURE__*/_react.default.createElement(_agentVerificationDropdownItem.AgentVerificationDropdownItem, {
201
201
  agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
202
202
  userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
203
+ onVerificationSuccess: onVerificationSuccess,
203
204
  testId: "agent-actions-menu-verification"
204
205
  })), renderEditDelete());
205
206
  };
@@ -30,6 +30,7 @@ var AgentVerificationDropdownItem = exports.AgentVerificationDropdownItem = func
30
30
  var agentRef = _ref.agentRef,
31
31
  userPermissionsRef = _ref.userPermissionsRef,
32
32
  onClick = _ref.onClick,
33
+ onVerificationSuccess = _ref.onVerificationSuccess,
33
34
  testId = _ref.testId;
34
35
  var _useIntl = (0, _reactIntlNext.useIntl)(),
35
36
  formatMessage = _useIntl.formatMessage;
@@ -76,6 +77,7 @@ var AgentVerificationDropdownItem = exports.AgentVerificationDropdownItem = func
76
77
  onCompleted: function onCompleted(response) {
77
78
  var payload = response === null || response === void 0 ? void 0 : response.agentStudio_updateAgentVerification;
78
79
  if (payload !== null && payload !== void 0 && payload.success) {
80
+ onVerificationSuccess === null || onVerificationSuccess === void 0 || onVerificationSuccess(verified);
79
81
  trackAgentAction(verified ? _actions.AgentActions.VERIFY : _actions.AgentActions.UNVERIFY, {});
80
82
  showFlag({
81
83
  title: formatMessage(verified ? _messages.default.verifySuccessTitle : _messages.default.unverifySuccessTitle),
@@ -104,7 +106,7 @@ var AgentVerificationDropdownItem = exports.AgentVerificationDropdownItem = func
104
106
  handleError(verified, error.message);
105
107
  }
106
108
  });
107
- }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, showFlag, trackAgentAction, trackAgentActionError]);
109
+ }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, onVerificationSuccess, showFlag, trackAgentAction, trackAgentActionError]);
108
110
  if (
109
111
  // Don't render if agent ID is not available
110
112
  !agentId ||
@@ -44,7 +44,6 @@ export const ChatToAgentButton = ({
44
44
  };
45
45
  export const AgentDropdownMenu = ({
46
46
  isAutodevTemplateAgent,
47
- agentId,
48
47
  onEditAgent,
49
48
  onCopyAgent,
50
49
  onDuplicateAgent,
@@ -64,7 +63,8 @@ export const AgentDropdownMenu = ({
64
63
  shouldTriggerStopPropagation,
65
64
  agentName,
66
65
  agentRef,
67
- userPermissionsRef
66
+ userPermissionsRef,
67
+ onVerificationSuccess
68
68
  }) => {
69
69
  const [isLoading, setIsLoading] = useState(false);
70
70
  const {
@@ -160,6 +160,7 @@ export const AgentDropdownMenu = ({
160
160
  }, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
161
161
  agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
162
162
  userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
163
+ onVerificationSuccess: onVerificationSuccess,
163
164
  testId: "agent-actions-menu-verification"
164
165
  })), renderEditDelete());
165
166
  };
@@ -19,6 +19,7 @@ export const AgentVerificationDropdownItem = ({
19
19
  agentRef,
20
20
  userPermissionsRef,
21
21
  onClick,
22
+ onVerificationSuccess,
22
23
  testId
23
24
  }) => {
24
25
  var _userPermissions$isAb, _agentData$isVerified;
@@ -68,6 +69,7 @@ export const AgentVerificationDropdownItem = ({
68
69
  onCompleted: response => {
69
70
  const payload = response === null || response === void 0 ? void 0 : response.agentStudio_updateAgentVerification;
70
71
  if (payload !== null && payload !== void 0 && payload.success) {
72
+ onVerificationSuccess === null || onVerificationSuccess === void 0 ? void 0 : onVerificationSuccess(verified);
71
73
  trackAgentAction(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, {});
72
74
  showFlag({
73
75
  title: formatMessage(verified ? messages.verifySuccessTitle : messages.unverifySuccessTitle),
@@ -96,7 +98,7 @@ export const AgentVerificationDropdownItem = ({
96
98
  handleError(verified, error.message);
97
99
  }
98
100
  });
99
- }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, showFlag, trackAgentAction, trackAgentActionError]);
101
+ }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, onVerificationSuccess, showFlag, trackAgentAction, trackAgentActionError]);
100
102
  if (
101
103
  // Don't render if agent ID is not available
102
104
  !agentId ||
@@ -47,7 +47,6 @@ export var ChatToAgentButton = function ChatToAgentButton(_ref) {
47
47
  };
48
48
  export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
49
49
  var isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
50
- agentId = _ref2.agentId,
51
50
  onEditAgent = _ref2.onEditAgent,
52
51
  onCopyAgent = _ref2.onCopyAgent,
53
52
  onDuplicateAgent = _ref2.onDuplicateAgent,
@@ -68,7 +67,8 @@ export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
68
67
  shouldTriggerStopPropagation = _ref2.shouldTriggerStopPropagation,
69
68
  agentName = _ref2.agentName,
70
69
  agentRef = _ref2.agentRef,
71
- userPermissionsRef = _ref2.userPermissionsRef;
70
+ userPermissionsRef = _ref2.userPermissionsRef,
71
+ onVerificationSuccess = _ref2.onVerificationSuccess;
72
72
  var _useState = useState(false),
73
73
  _useState2 = _slicedToArray(_useState, 2),
74
74
  isLoading = _useState2[0],
@@ -191,6 +191,7 @@ export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
191
191
  }, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
192
192
  agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
193
193
  userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
194
+ onVerificationSuccess: onVerificationSuccess,
194
195
  testId: "agent-actions-menu-verification"
195
196
  })), renderEditDelete());
196
197
  };
@@ -21,6 +21,7 @@ export var AgentVerificationDropdownItem = function AgentVerificationDropdownIte
21
21
  var agentRef = _ref.agentRef,
22
22
  userPermissionsRef = _ref.userPermissionsRef,
23
23
  onClick = _ref.onClick,
24
+ onVerificationSuccess = _ref.onVerificationSuccess,
24
25
  testId = _ref.testId;
25
26
  var _useIntl = useIntl(),
26
27
  formatMessage = _useIntl.formatMessage;
@@ -67,6 +68,7 @@ export var AgentVerificationDropdownItem = function AgentVerificationDropdownIte
67
68
  onCompleted: function onCompleted(response) {
68
69
  var payload = response === null || response === void 0 ? void 0 : response.agentStudio_updateAgentVerification;
69
70
  if (payload !== null && payload !== void 0 && payload.success) {
71
+ onVerificationSuccess === null || onVerificationSuccess === void 0 || onVerificationSuccess(verified);
70
72
  trackAgentAction(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, {});
71
73
  showFlag({
72
74
  title: formatMessage(verified ? messages.verifySuccessTitle : messages.unverifySuccessTitle),
@@ -95,7 +97,7 @@ export var AgentVerificationDropdownItem = function AgentVerificationDropdownIte
95
97
  handleError(verified, error.message);
96
98
  }
97
99
  });
98
- }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, showFlag, trackAgentAction, trackAgentActionError]);
100
+ }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, onVerificationSuccess, showFlag, trackAgentAction, trackAgentActionError]);
99
101
  if (
100
102
  // Don't render if agent ID is not available
101
103
  !agentId ||
@@ -46,6 +46,6 @@ type AgentDropdownMenuProps = {
46
46
  isEditEnabled: boolean;
47
47
  isDeleteEnabled: boolean;
48
48
  }>;
49
- } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef'>>;
50
- export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, agentId, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, }: AgentDropdownMenuProps) => JSX.Element;
49
+ } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef' | 'onVerificationSuccess'>>;
50
+ export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, onVerificationSuccess, }: AgentDropdownMenuProps) => JSX.Element;
51
51
  export {};
@@ -8,6 +8,11 @@ export type AgentVerificationDropdownItemProps = {
8
8
  * Optional callback fired when the dropdown item is clicked, before the mutation is executed.
9
9
  */
10
10
  onClick?: () => void;
11
+ /**
12
+ * Optional callback fired when verification mutation succeeds.
13
+ * Called with the new verified state.
14
+ */
15
+ onVerificationSuccess?: (verified: boolean) => void;
11
16
  /**
12
17
  * Test ID for the dropdown item.
13
18
  */
@@ -18,4 +23,4 @@ export type AgentVerificationDropdownItemProps = {
18
23
  * Renders "Verify agent" if the agent is not verified, or "Unverify agent" if it is.
19
24
  * Returns null if the user doesn't have permission to govern agents or the feature flag is off.
20
25
  */
21
- export declare const AgentVerificationDropdownItem: ({ agentRef, userPermissionsRef, onClick, testId, }: AgentVerificationDropdownItemProps) => React.JSX.Element | null;
26
+ export declare const AgentVerificationDropdownItem: ({ agentRef, userPermissionsRef, onClick, onVerificationSuccess, testId, }: AgentVerificationDropdownItemProps) => React.JSX.Element | null;
@@ -46,6 +46,6 @@ type AgentDropdownMenuProps = {
46
46
  isEditEnabled: boolean;
47
47
  isDeleteEnabled: boolean;
48
48
  }>;
49
- } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef'>>;
50
- export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, agentId, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, }: AgentDropdownMenuProps) => JSX.Element;
49
+ } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef' | 'onVerificationSuccess'>>;
50
+ export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, onVerificationSuccess, }: AgentDropdownMenuProps) => JSX.Element;
51
51
  export {};
@@ -8,6 +8,11 @@ export type AgentVerificationDropdownItemProps = {
8
8
  * Optional callback fired when the dropdown item is clicked, before the mutation is executed.
9
9
  */
10
10
  onClick?: () => void;
11
+ /**
12
+ * Optional callback fired when verification mutation succeeds.
13
+ * Called with the new verified state.
14
+ */
15
+ onVerificationSuccess?: (verified: boolean) => void;
11
16
  /**
12
17
  * Test ID for the dropdown item.
13
18
  */
@@ -18,4 +23,4 @@ export type AgentVerificationDropdownItemProps = {
18
23
  * Renders "Verify agent" if the agent is not verified, or "Unverify agent" if it is.
19
24
  * Returns null if the user doesn't have permission to govern agents or the feature flag is off.
20
25
  */
21
- export declare const AgentVerificationDropdownItem: ({ agentRef, userPermissionsRef, onClick, testId, }: AgentVerificationDropdownItemProps) => React.JSX.Element | null;
26
+ export declare const AgentVerificationDropdownItem: ({ agentRef, userPermissionsRef, onClick, onVerificationSuccess, testId, }: AgentVerificationDropdownItemProps) => React.JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-agent-components",
3
- "version": "3.29.0",
3
+ "version": "3.30.0",
4
4
  "description": "This package host public components related to rovo agents, the components here are needed for other public atlaskit packages",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/css": "^0.19.0",
40
40
  "@atlaskit/dropdown-menu": "^16.4.0",
41
41
  "@atlaskit/flag": "^17.8.0",
42
- "@atlaskit/heading": "^5.2.0",
42
+ "@atlaskit/heading": "^5.3.0",
43
43
  "@atlaskit/icon": "^30.0.0",
44
44
  "@atlaskit/link": "^3.3.0",
45
45
  "@atlaskit/logo": "^19.10.0",