@atlaskit/rovo-agent-components 3.21.0 → 3.23.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 +19 -0
- package/agent-verification-dropdown-item/package.json +17 -0
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/ui/agent-avatar/generated-avatars/index.js +14 -0
- package/dist/cjs/ui/agent-avatar/index.js +2 -0
- package/dist/cjs/ui/agent-profile-info/agent-profile-info.stories.js +35 -0
- package/dist/cjs/ui/agent-profile-info/index.js +9 -3
- package/dist/cjs/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef.graphql.js +29 -0
- package/dist/cjs/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation.graphql.js +122 -0
- package/dist/cjs/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef.graphql.js +29 -0
- package/dist/cjs/ui/agent-verification-dropdown-item/__generated__/testAgentVerificationDropdownItemQuery.graphql.js +186 -0
- package/dist/cjs/ui/agent-verification-dropdown-item/index.js +112 -0
- package/dist/cjs/ui/agent-verification-dropdown-item/messages.js +44 -0
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/ui/agent-avatar/generated-avatars/index.js +14 -0
- package/dist/es2019/ui/agent-avatar/index.js +2 -0
- package/dist/es2019/ui/agent-profile-info/agent-profile-info.stories.js +24 -0
- package/dist/es2019/ui/agent-profile-info/index.js +8 -3
- package/dist/es2019/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef.graphql.js +23 -0
- package/dist/es2019/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation.graphql.js +116 -0
- package/dist/es2019/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef.graphql.js +23 -0
- package/dist/es2019/ui/agent-verification-dropdown-item/__generated__/testAgentVerificationDropdownItemQuery.graphql.js +180 -0
- package/dist/es2019/ui/agent-verification-dropdown-item/index.js +102 -0
- package/dist/es2019/ui/agent-verification-dropdown-item/messages.js +38 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/ui/agent-avatar/generated-avatars/index.js +14 -0
- package/dist/esm/ui/agent-avatar/index.js +2 -0
- package/dist/esm/ui/agent-profile-info/agent-profile-info.stories.js +28 -0
- package/dist/esm/ui/agent-profile-info/index.js +9 -3
- package/dist/esm/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef.graphql.js +23 -0
- package/dist/esm/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation.graphql.js +116 -0
- package/dist/esm/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef.graphql.js +23 -0
- package/dist/esm/ui/agent-verification-dropdown-item/__generated__/testAgentVerificationDropdownItemQuery.graphql.js +180 -0
- package/dist/esm/ui/agent-verification-dropdown-item/index.js +103 -0
- package/dist/esm/ui/agent-verification-dropdown-item/messages.js +38 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/ui/agent-avatar/generated-avatars/index.d.ts +2 -1
- package/dist/types/ui/agent-avatar/index.d.ts +2 -1
- package/dist/types/ui/agent-profile-info/index.d.ts +3 -1
- package/dist/types/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef.graphql.d.ts +18 -0
- package/dist/types/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation.graphql.d.ts +30 -0
- package/dist/types/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef.graphql.d.ts +18 -0
- package/dist/types/ui/agent-verification-dropdown-item/__generated__/testAgentVerificationDropdownItemQuery.graphql.d.ts +26 -0
- package/dist/types/ui/agent-verification-dropdown-item/index.d.ts +22 -0
- package/dist/types/ui/agent-verification-dropdown-item/messages.d.ts +38 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/agent-avatar/generated-avatars/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/agent-avatar/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/agent-profile-info/index.d.ts +3 -1
- package/dist/types-ts4.5/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef.graphql.d.ts +18 -0
- package/dist/types-ts4.5/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation.graphql.d.ts +30 -0
- package/dist/types-ts4.5/ui/agent-verification-dropdown-item/__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef.graphql.d.ts +18 -0
- package/dist/types-ts4.5/ui/agent-verification-dropdown-item/__generated__/testAgentVerificationDropdownItemQuery.graphql.d.ts +26 -0
- package/dist/types-ts4.5/ui/agent-verification-dropdown-item/index.d.ts +22 -0
- package/dist/types-ts4.5/ui/agent-verification-dropdown-item/messages.d.ts +38 -0
- package/package.json +9 -2
|
@@ -316,7 +316,19 @@ var getAvatarRender = function getAvatarRender(_ref3) {
|
|
|
316
316
|
var agentNamedId = _ref3.agentNamedId,
|
|
317
317
|
agentId = _ref3.agentId,
|
|
318
318
|
agentIdentityAccountId = _ref3.agentIdentityAccountId,
|
|
319
|
+
isRovoDev = _ref3.isRovoDev,
|
|
319
320
|
size = _ref3.size;
|
|
321
|
+
if (isRovoDev && fg('rovo_dev_themed_identity_card')) {
|
|
322
|
+
return {
|
|
323
|
+
render: /*#__PURE__*/React.createElement(RovoDevAvatar, {
|
|
324
|
+
size: AVATAR_SIZES[size],
|
|
325
|
+
primaryColor: "",
|
|
326
|
+
secondaryColor: ""
|
|
327
|
+
}),
|
|
328
|
+
color: greenColor
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
320
332
|
//@TODO CRCS-3129: Remove Rovo Dev hardcoded icon after TeamEU demos
|
|
321
333
|
// Handle Rovo Dev agent avatar for TeamEU Demo
|
|
322
334
|
if (agentId === ROVO_DEV_AGENT_ID && fg('jira_ai_force_rovo_dev_avatar')) {
|
|
@@ -374,12 +386,14 @@ export var AgentBanner = function AgentBanner(_ref4) {
|
|
|
374
386
|
var agentNamedId = _ref4.agentNamedId,
|
|
375
387
|
agentId = _ref4.agentId,
|
|
376
388
|
agentIdentityAccountId = _ref4.agentIdentityAccountId,
|
|
389
|
+
isRovoDev = _ref4.isRovoDev,
|
|
377
390
|
height = _ref4.height,
|
|
378
391
|
fillSpace = _ref4.fillSpace;
|
|
379
392
|
var _getAvatarRender = getAvatarRender({
|
|
380
393
|
agentNamedId: agentNamedId,
|
|
381
394
|
agentId: agentId,
|
|
382
395
|
agentIdentityAccountId: agentIdentityAccountId,
|
|
396
|
+
isRovoDev: isRovoDev,
|
|
383
397
|
size: 'medium'
|
|
384
398
|
}),
|
|
385
399
|
color = _getAvatarRender.color;
|
|
@@ -38,6 +38,7 @@ export var AgentAvatar = function AgentAvatar(_ref) {
|
|
|
38
38
|
agentNamedId = _ref.agentNamedId,
|
|
39
39
|
_ref$showBorder = _ref.showBorder,
|
|
40
40
|
showBorder = _ref$showBorder === void 0 ? true : _ref$showBorder,
|
|
41
|
+
isRovoDev = _ref.isRovoDev,
|
|
41
42
|
isForgeAgent = _ref.isForgeAgent,
|
|
42
43
|
forgeAgentIconUrl = _ref.forgeAgentIconUrl;
|
|
43
44
|
var _useIntl = useIntl(),
|
|
@@ -72,6 +73,7 @@ export var AgentAvatar = function AgentAvatar(_ref) {
|
|
|
72
73
|
agentId: agentId,
|
|
73
74
|
agentNamedId: agentNamedId,
|
|
74
75
|
agentIdentityAccountId: agentIdentityAccountId,
|
|
76
|
+
isRovoDev: isRovoDev,
|
|
75
77
|
size: size
|
|
76
78
|
}))));
|
|
77
79
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { injectable } from 'react-magnetic-di';
|
|
3
|
+
import { useFragment } from 'react-relay';
|
|
4
|
+
import { withDi, withUseIntl } from '@atlassian/agent-studio-test-utils/storybook-decorators';
|
|
5
|
+
import { AgentProfileInfo } from './index';
|
|
6
|
+
var commonDeps = [injectable(useFragment, function () {
|
|
7
|
+
return {
|
|
8
|
+
isVerified: true
|
|
9
|
+
};
|
|
10
|
+
})];
|
|
11
|
+
var meta = {
|
|
12
|
+
decorators: [withUseIntl(), withDi(commonDeps)]
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export var Default = {
|
|
16
|
+
render: function render() {
|
|
17
|
+
return /*#__PURE__*/React.createElement(AgentProfileInfo, {
|
|
18
|
+
agentName: "Code Documentation Writer",
|
|
19
|
+
agentDescription: "Create or modify documentation files in your codebase to ensure that they are up to date",
|
|
20
|
+
creatorRender: /*#__PURE__*/React.createElement("div", null, "Creator Render"),
|
|
21
|
+
starCountRender: /*#__PURE__*/React.createElement("div", null, "Star Count Render"),
|
|
22
|
+
headingRender: /*#__PURE__*/React.createElement("div", null, "Heading Render"),
|
|
23
|
+
isStarred: true,
|
|
24
|
+
isHidden: false,
|
|
25
|
+
onStarToggle: function onStarToggle() {}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -20,7 +20,8 @@ var styles = {
|
|
|
20
20
|
descriptionRefresh: "_1mouze3t _1i4qfg65 _1nmz1hna",
|
|
21
21
|
wrapper: "_otyru2gc",
|
|
22
22
|
tooltipWrapper: "_195gu2gc _1e0c116y _kqswh2mm _94n5v77o",
|
|
23
|
-
headingWrapper: "_kqswh2mm"
|
|
23
|
+
headingWrapper: "_kqswh2mm",
|
|
24
|
+
headingContentWrapper: "_195gu2gc"
|
|
24
25
|
};
|
|
25
26
|
export var getAgentCreator = function getAgentCreator(_ref) {
|
|
26
27
|
var creatorType = _ref.creatorType,
|
|
@@ -141,9 +142,12 @@ export var AgentProfileInfo = function AgentProfileInfo(_ref3) {
|
|
|
141
142
|
agentDescription = _ref3.agentDescription,
|
|
142
143
|
creatorRender = _ref3.creatorRender,
|
|
143
144
|
starCountRender = _ref3.starCountRender,
|
|
145
|
+
headingRender = _ref3.headingRender,
|
|
144
146
|
isStarred = _ref3.isStarred,
|
|
145
147
|
isHidden = _ref3.isHidden,
|
|
146
|
-
onStarToggle = _ref3.onStarToggle
|
|
148
|
+
onStarToggle = _ref3.onStarToggle,
|
|
149
|
+
_ref3$showStarButton = _ref3.showStarButton,
|
|
150
|
+
showStarButton = _ref3$showStarButton === void 0 ? true : _ref3$showStarButton;
|
|
147
151
|
var _useIntl2 = useIntl(),
|
|
148
152
|
formatMessage = _useIntl2.formatMessage;
|
|
149
153
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
@@ -166,7 +170,9 @@ export var AgentProfileInfo = function AgentProfileInfo(_ref3) {
|
|
|
166
170
|
position: "top"
|
|
167
171
|
}, /*#__PURE__*/React.createElement(HiddenIcon, {
|
|
168
172
|
label: formatMessage(messages.hiddenIcon)
|
|
169
|
-
})))
|
|
173
|
+
}))), headingRender && /*#__PURE__*/React.createElement(Box, {
|
|
174
|
+
xcss: styles.headingContentWrapper
|
|
175
|
+
}, headingRender)), showStarButton && /*#__PURE__*/React.createElement(StarIconButton, {
|
|
170
176
|
isStarred: isStarred,
|
|
171
177
|
handleToggle: onStarToggle
|
|
172
178
|
})), creatorRender, !!agentDescription && /*#__PURE__*/React.createElement(Box, {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<9817b3677a18810cda2656cb77948845>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
* @codegen-command: yarn relay
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* tslint:disable */
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
// @ts-nocheck
|
|
11
|
+
|
|
12
|
+
var node = {
|
|
13
|
+
"argumentDefinitions": [],
|
|
14
|
+
"kind": "Fragment",
|
|
15
|
+
"name": "agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef",
|
|
16
|
+
"selections": [{
|
|
17
|
+
"kind": "ScalarField",
|
|
18
|
+
"name": "isVerified"
|
|
19
|
+
}],
|
|
20
|
+
"type": "AgentStudioAssistant"
|
|
21
|
+
};
|
|
22
|
+
node.hash = "1635a55a6ff272864bba57326c99a315";
|
|
23
|
+
export default node;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<e119306497999ac48bfef5821a96f2eb>>
|
|
3
|
+
* @relayHash 426410e11638597e4a12069dd5a8be16
|
|
4
|
+
* @lightSyntaxTransform
|
|
5
|
+
* @nogrep
|
|
6
|
+
* @codegen-command: yarn relay
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/* tslint:disable */
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
// @ts-nocheck
|
|
12
|
+
|
|
13
|
+
// @relayRequestID e3ee432c0fc33e7c2f8bfeac0ba4eaedbab44694541de64c5219ab207398f3c0
|
|
14
|
+
|
|
15
|
+
var node = function () {
|
|
16
|
+
var v0 = [{
|
|
17
|
+
"defaultValue": null,
|
|
18
|
+
"kind": "LocalArgument",
|
|
19
|
+
"name": "id"
|
|
20
|
+
}, {
|
|
21
|
+
"defaultValue": null,
|
|
22
|
+
"kind": "LocalArgument",
|
|
23
|
+
"name": "verified"
|
|
24
|
+
}],
|
|
25
|
+
v1 = [{
|
|
26
|
+
"kind": "Variable",
|
|
27
|
+
"name": "id",
|
|
28
|
+
"variableName": "id"
|
|
29
|
+
}, {
|
|
30
|
+
"kind": "Variable",
|
|
31
|
+
"name": "verified",
|
|
32
|
+
"variableName": "verified"
|
|
33
|
+
}],
|
|
34
|
+
v2 = {
|
|
35
|
+
"kind": "ScalarField",
|
|
36
|
+
"name": "success"
|
|
37
|
+
},
|
|
38
|
+
v3 = {
|
|
39
|
+
"concreteType": "MutationError",
|
|
40
|
+
"kind": "LinkedField",
|
|
41
|
+
"name": "errors",
|
|
42
|
+
"plural": true,
|
|
43
|
+
"selections": [{
|
|
44
|
+
"kind": "ScalarField",
|
|
45
|
+
"name": "message"
|
|
46
|
+
}]
|
|
47
|
+
},
|
|
48
|
+
v4 = {
|
|
49
|
+
"kind": "ScalarField",
|
|
50
|
+
"name": "id"
|
|
51
|
+
},
|
|
52
|
+
v5 = {
|
|
53
|
+
"kind": "ScalarField",
|
|
54
|
+
"name": "isVerified"
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
"fragment": {
|
|
58
|
+
"argumentDefinitions": v0 /*: any*/,
|
|
59
|
+
"kind": "Fragment",
|
|
60
|
+
"name": "agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation",
|
|
61
|
+
"selections": [{
|
|
62
|
+
"args": v1 /*: any*/,
|
|
63
|
+
"concreteType": "AgentStudioUpdateAgentVerificationPayload",
|
|
64
|
+
"kind": "LinkedField",
|
|
65
|
+
"name": "agentStudio_updateAgentVerification",
|
|
66
|
+
"plural": false,
|
|
67
|
+
"selections": [v2 /*: any*/, v3 /*: any*/, {
|
|
68
|
+
"kind": "LinkedField",
|
|
69
|
+
"name": "agent",
|
|
70
|
+
"plural": false,
|
|
71
|
+
"selections": [{
|
|
72
|
+
"kind": "InlineFragment",
|
|
73
|
+
"selections": [v4 /*: any*/, v5 /*: any*/],
|
|
74
|
+
"type": "AgentStudioAssistant"
|
|
75
|
+
}]
|
|
76
|
+
}]
|
|
77
|
+
}],
|
|
78
|
+
"type": "Mutation"
|
|
79
|
+
},
|
|
80
|
+
"kind": "Request",
|
|
81
|
+
"operation": {
|
|
82
|
+
"argumentDefinitions": v0 /*: any*/,
|
|
83
|
+
"kind": "Operation",
|
|
84
|
+
"name": "agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation",
|
|
85
|
+
"selections": [{
|
|
86
|
+
"args": v1 /*: any*/,
|
|
87
|
+
"concreteType": "AgentStudioUpdateAgentVerificationPayload",
|
|
88
|
+
"kind": "LinkedField",
|
|
89
|
+
"name": "agentStudio_updateAgentVerification",
|
|
90
|
+
"plural": false,
|
|
91
|
+
"selections": [v2 /*: any*/, v3 /*: any*/, {
|
|
92
|
+
"kind": "LinkedField",
|
|
93
|
+
"name": "agent",
|
|
94
|
+
"plural": false,
|
|
95
|
+
"selections": [{
|
|
96
|
+
"kind": "ScalarField",
|
|
97
|
+
"name": "__typename"
|
|
98
|
+
}, v4 /*: any*/, {
|
|
99
|
+
"kind": "InlineFragment",
|
|
100
|
+
"selections": [v5 /*: any*/],
|
|
101
|
+
"type": "AgentStudioAssistant"
|
|
102
|
+
}]
|
|
103
|
+
}]
|
|
104
|
+
}]
|
|
105
|
+
},
|
|
106
|
+
"params": {
|
|
107
|
+
"id": "e3ee432c0fc33e7c2f8bfeac0ba4eaedbab44694541de64c5219ab207398f3c0",
|
|
108
|
+
"metadata": {},
|
|
109
|
+
"name": "agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation",
|
|
110
|
+
"operationKind": "mutation",
|
|
111
|
+
"text": null
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}();
|
|
115
|
+
node.hash = "215d57ba82c69595cbed5235ec1fec93";
|
|
116
|
+
export default node;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<3ba8bcbc18cbb9766a1547794c6c98af>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
* @codegen-command: yarn relay
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* tslint:disable */
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
// @ts-nocheck
|
|
11
|
+
|
|
12
|
+
var node = {
|
|
13
|
+
"argumentDefinitions": [],
|
|
14
|
+
"kind": "Fragment",
|
|
15
|
+
"name": "agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef",
|
|
16
|
+
"selections": [{
|
|
17
|
+
"kind": "ScalarField",
|
|
18
|
+
"name": "isAbleToGovernAgents"
|
|
19
|
+
}],
|
|
20
|
+
"type": "AtlassianStudioUserProductPermissions"
|
|
21
|
+
};
|
|
22
|
+
node.hash = "5addff9015092fd6e1870a9f51056493";
|
|
23
|
+
export default node;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<251e7c171e33da0a0b2e0e8041d77493>>
|
|
3
|
+
* @relayHash 79a628a32ef254ccf6142a38adf8ecca
|
|
4
|
+
* @lightSyntaxTransform
|
|
5
|
+
* @nogrep
|
|
6
|
+
* @codegen-command: yarn relay
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/* tslint:disable */
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
// @ts-nocheck
|
|
12
|
+
|
|
13
|
+
// @relayRequestID 790e12806b8a31f23c8834d4c00327ae778a10fab62bf682c07e39e2b2349465
|
|
14
|
+
|
|
15
|
+
var node = function () {
|
|
16
|
+
var v0 = [{
|
|
17
|
+
"kind": "Literal",
|
|
18
|
+
"name": "id",
|
|
19
|
+
"value": "test-agent-id"
|
|
20
|
+
}],
|
|
21
|
+
v1 = [{
|
|
22
|
+
"kind": "Literal",
|
|
23
|
+
"name": "cloudId",
|
|
24
|
+
"value": "test-cloud-id"
|
|
25
|
+
}],
|
|
26
|
+
v2 = {
|
|
27
|
+
"kind": "ScalarField",
|
|
28
|
+
"name": "__typename"
|
|
29
|
+
},
|
|
30
|
+
v3 = {
|
|
31
|
+
"enumValues": null,
|
|
32
|
+
"nullable": false,
|
|
33
|
+
"plural": false,
|
|
34
|
+
"type": "String"
|
|
35
|
+
},
|
|
36
|
+
v4 = {
|
|
37
|
+
"enumValues": null,
|
|
38
|
+
"nullable": true,
|
|
39
|
+
"plural": false,
|
|
40
|
+
"type": "Boolean"
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
"fragment": {
|
|
44
|
+
"argumentDefinitions": [],
|
|
45
|
+
"kind": "Fragment",
|
|
46
|
+
"name": "testAgentVerificationDropdownItemQuery",
|
|
47
|
+
"selections": [{
|
|
48
|
+
"kind": "RequiredField",
|
|
49
|
+
"field": {
|
|
50
|
+
"args": v0 /*: any*/,
|
|
51
|
+
"kind": "LinkedField",
|
|
52
|
+
"name": "agentStudio_agentById",
|
|
53
|
+
"plural": false,
|
|
54
|
+
"selections": [{
|
|
55
|
+
"kind": "InlineFragment",
|
|
56
|
+
"selections": [{
|
|
57
|
+
"kind": "FragmentSpread",
|
|
58
|
+
"name": "agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef"
|
|
59
|
+
}],
|
|
60
|
+
"type": "AgentStudioAssistant"
|
|
61
|
+
}],
|
|
62
|
+
"storageKey": "agentStudio_agentById(id:\"test-agent-id\")"
|
|
63
|
+
},
|
|
64
|
+
"action": "THROW",
|
|
65
|
+
"path": "agentStudio_agentById"
|
|
66
|
+
}, {
|
|
67
|
+
"args": v1 /*: any*/,
|
|
68
|
+
"kind": "LinkedField",
|
|
69
|
+
"name": "atlassianStudio_userSiteContext",
|
|
70
|
+
"plural": false,
|
|
71
|
+
"selections": [{
|
|
72
|
+
"kind": "InlineFragment",
|
|
73
|
+
"selections": [{
|
|
74
|
+
"concreteType": "AtlassianStudioUserProductPermissions",
|
|
75
|
+
"kind": "LinkedField",
|
|
76
|
+
"name": "userPermissions",
|
|
77
|
+
"plural": false,
|
|
78
|
+
"selections": [{
|
|
79
|
+
"kind": "FragmentSpread",
|
|
80
|
+
"name": "agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef"
|
|
81
|
+
}]
|
|
82
|
+
}],
|
|
83
|
+
"type": "AtlassianStudioUserSiteContextOutput"
|
|
84
|
+
}],
|
|
85
|
+
"storageKey": "atlassianStudio_userSiteContext(cloudId:\"test-cloud-id\")"
|
|
86
|
+
}],
|
|
87
|
+
"type": "Query"
|
|
88
|
+
},
|
|
89
|
+
"kind": "Request",
|
|
90
|
+
"operation": {
|
|
91
|
+
"argumentDefinitions": [],
|
|
92
|
+
"kind": "Operation",
|
|
93
|
+
"name": "testAgentVerificationDropdownItemQuery",
|
|
94
|
+
"selections": [{
|
|
95
|
+
"args": v0 /*: any*/,
|
|
96
|
+
"kind": "LinkedField",
|
|
97
|
+
"name": "agentStudio_agentById",
|
|
98
|
+
"plural": false,
|
|
99
|
+
"selections": [v2 /*: any*/, {
|
|
100
|
+
"kind": "InlineFragment",
|
|
101
|
+
"selections": [{
|
|
102
|
+
"kind": "ScalarField",
|
|
103
|
+
"name": "isVerified"
|
|
104
|
+
}],
|
|
105
|
+
"type": "AgentStudioAssistant"
|
|
106
|
+
}, {
|
|
107
|
+
"kind": "InlineFragment",
|
|
108
|
+
"selections": [{
|
|
109
|
+
"kind": "ScalarField",
|
|
110
|
+
"name": "id"
|
|
111
|
+
}],
|
|
112
|
+
"type": "Node",
|
|
113
|
+
"abstractKey": "__isNode"
|
|
114
|
+
}],
|
|
115
|
+
"storageKey": "agentStudio_agentById(id:\"test-agent-id\")"
|
|
116
|
+
}, {
|
|
117
|
+
"args": v1 /*: any*/,
|
|
118
|
+
"kind": "LinkedField",
|
|
119
|
+
"name": "atlassianStudio_userSiteContext",
|
|
120
|
+
"plural": false,
|
|
121
|
+
"selections": [v2 /*: any*/, {
|
|
122
|
+
"kind": "InlineFragment",
|
|
123
|
+
"selections": [{
|
|
124
|
+
"concreteType": "AtlassianStudioUserProductPermissions",
|
|
125
|
+
"kind": "LinkedField",
|
|
126
|
+
"name": "userPermissions",
|
|
127
|
+
"plural": false,
|
|
128
|
+
"selections": [{
|
|
129
|
+
"kind": "ScalarField",
|
|
130
|
+
"name": "isAbleToGovernAgents"
|
|
131
|
+
}]
|
|
132
|
+
}],
|
|
133
|
+
"type": "AtlassianStudioUserSiteContextOutput"
|
|
134
|
+
}],
|
|
135
|
+
"storageKey": "atlassianStudio_userSiteContext(cloudId:\"test-cloud-id\")"
|
|
136
|
+
}]
|
|
137
|
+
},
|
|
138
|
+
"params": {
|
|
139
|
+
"id": "790e12806b8a31f23c8834d4c00327ae778a10fab62bf682c07e39e2b2349465",
|
|
140
|
+
"metadata": {
|
|
141
|
+
"relayTestingSelectionTypeInfo": {
|
|
142
|
+
"agentStudio_agentById": {
|
|
143
|
+
"enumValues": null,
|
|
144
|
+
"nullable": true,
|
|
145
|
+
"plural": false,
|
|
146
|
+
"type": "AgentStudioAgentResult"
|
|
147
|
+
},
|
|
148
|
+
"agentStudio_agentById.__isNode": v3 /*: any*/,
|
|
149
|
+
"agentStudio_agentById.__typename": v3 /*: any*/,
|
|
150
|
+
"agentStudio_agentById.id": {
|
|
151
|
+
"enumValues": null,
|
|
152
|
+
"nullable": false,
|
|
153
|
+
"plural": false,
|
|
154
|
+
"type": "ID"
|
|
155
|
+
},
|
|
156
|
+
"agentStudio_agentById.isVerified": v4 /*: any*/,
|
|
157
|
+
"atlassianStudio_userSiteContext": {
|
|
158
|
+
"enumValues": null,
|
|
159
|
+
"nullable": true,
|
|
160
|
+
"plural": false,
|
|
161
|
+
"type": "AtlassianStudioUserSiteContextResult"
|
|
162
|
+
},
|
|
163
|
+
"atlassianStudio_userSiteContext.__typename": v3 /*: any*/,
|
|
164
|
+
"atlassianStudio_userSiteContext.userPermissions": {
|
|
165
|
+
"enumValues": null,
|
|
166
|
+
"nullable": true,
|
|
167
|
+
"plural": false,
|
|
168
|
+
"type": "AtlassianStudioUserProductPermissions"
|
|
169
|
+
},
|
|
170
|
+
"atlassianStudio_userSiteContext.userPermissions.isAbleToGovernAgents": v4 /*: any*/
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"name": "testAgentVerificationDropdownItemQuery",
|
|
174
|
+
"operationKind": "query",
|
|
175
|
+
"text": null
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}();
|
|
179
|
+
node.hash = "19dfd01b36565c5a9ddf6cfed9c3594f";
|
|
180
|
+
export default node;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation from "./__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation.graphql";
|
|
3
|
+
import _agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef from "./__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef.graphql";
|
|
4
|
+
import _agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef from "./__generated__/agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef.graphql";
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
import { useIntl } from 'react-intl-next';
|
|
7
|
+
import { graphql, useFragment, useMutation } from 'react-relay';
|
|
8
|
+
import { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
9
|
+
import { useFlags } from '@atlaskit/flag';
|
|
10
|
+
import ErrorIcon from '@atlaskit/icon/core/status-error';
|
|
11
|
+
import SuccessIcon from '@atlaskit/icon/core/status-success';
|
|
12
|
+
import { AgentActions, useRovoAgentActionAnalytics } from '@atlaskit/rovo-agent-analytics/actions';
|
|
13
|
+
import messages from './messages';
|
|
14
|
+
/**
|
|
15
|
+
* A dropdown item for verifying or unverifying an agent.
|
|
16
|
+
* Renders "Verify agent" if the agent is not verified, or "Unverify agent" if it is.
|
|
17
|
+
* Returns null if the user doesn't have permission to govern agents or the feature flag is off.
|
|
18
|
+
*/
|
|
19
|
+
export var AgentVerificationDropdownItem = function AgentVerificationDropdownItem(_ref) {
|
|
20
|
+
var _userPermissions$isAb, _agentData$isVerified;
|
|
21
|
+
var agentId = _ref.agentId,
|
|
22
|
+
agentRef = _ref.agentRef,
|
|
23
|
+
userPermissionsRef = _ref.userPermissionsRef,
|
|
24
|
+
onClick = _ref.onClick,
|
|
25
|
+
testId = _ref.testId;
|
|
26
|
+
var _useIntl = useIntl(),
|
|
27
|
+
formatMessage = _useIntl.formatMessage;
|
|
28
|
+
var _useFlags = useFlags(),
|
|
29
|
+
showFlag = _useFlags.showFlag;
|
|
30
|
+
var agentData = useFragment(_agentVerificationDropdownItem_AtlaskitRovoAgentComponents_agentRef, agentRef);
|
|
31
|
+
var userPermissions = useFragment(_agentVerificationDropdownItem_AtlaskitRovoAgentComponents_userPermissionsRef, userPermissionsRef);
|
|
32
|
+
var isAbleToGovernAgents = (_userPermissions$isAb = userPermissions === null || userPermissions === void 0 ? void 0 : userPermissions.isAbleToGovernAgents) !== null && _userPermissions$isAb !== void 0 ? _userPermissions$isAb : false;
|
|
33
|
+
var isVerified = (_agentData$isVerified = agentData === null || agentData === void 0 ? void 0 : agentData.isVerified) !== null && _agentData$isVerified !== void 0 ? _agentData$isVerified : false;
|
|
34
|
+
var _useRovoAgentActionAn = useRovoAgentActionAnalytics({
|
|
35
|
+
touchPoint: 'agent-verification-dropdown-item',
|
|
36
|
+
agentId: agentId,
|
|
37
|
+
isAbleToGovernAgents: isAbleToGovernAgents
|
|
38
|
+
}),
|
|
39
|
+
trackAgentAction = _useRovoAgentActionAn.trackAgentAction,
|
|
40
|
+
trackAgentActionError = _useRovoAgentActionAn.trackAgentActionError;
|
|
41
|
+
var _useMutation = useMutation(_agentVerificationDropdownItem_AtlaskitRovoAgentComponents_updateAgentVerificationMutation),
|
|
42
|
+
_useMutation2 = _slicedToArray(_useMutation, 1),
|
|
43
|
+
commitUpdateVerification = _useMutation2[0];
|
|
44
|
+
var handleError = useCallback(function (verified, errorMessage) {
|
|
45
|
+
showFlag({
|
|
46
|
+
title: formatMessage(verified ? messages.verifyErrorTitle : messages.unverifyErrorTitle),
|
|
47
|
+
description: formatMessage(messages.errorDescription, {
|
|
48
|
+
errorMessage: errorMessage
|
|
49
|
+
}),
|
|
50
|
+
appearance: 'error',
|
|
51
|
+
icon: /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
52
|
+
spacing: "spacious",
|
|
53
|
+
label: ""
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}, [formatMessage, showFlag]);
|
|
57
|
+
var handleUpdateVerification = useCallback(function (verified) {
|
|
58
|
+
onClick === null || onClick === void 0 || onClick();
|
|
59
|
+
commitUpdateVerification({
|
|
60
|
+
variables: {
|
|
61
|
+
id: agentId,
|
|
62
|
+
verified: verified
|
|
63
|
+
},
|
|
64
|
+
onCompleted: function onCompleted(_, errors) {
|
|
65
|
+
if (errors && errors.length > 0) {
|
|
66
|
+
var errorMessage = errors[0].message;
|
|
67
|
+
trackAgentActionError(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, new Error(errorMessage), {
|
|
68
|
+
agentId: agentId
|
|
69
|
+
});
|
|
70
|
+
handleError(verified, errorMessage);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
trackAgentAction(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, {});
|
|
74
|
+
showFlag({
|
|
75
|
+
title: formatMessage(verified ? messages.verifySuccessTitle : messages.unverifySuccessTitle),
|
|
76
|
+
appearance: 'success',
|
|
77
|
+
isAutoDismiss: true,
|
|
78
|
+
icon: /*#__PURE__*/React.createElement(SuccessIcon, {
|
|
79
|
+
spacing: "spacious",
|
|
80
|
+
label: ""
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
onError: function onError(error) {
|
|
85
|
+
trackAgentActionError(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, error, {
|
|
86
|
+
agentId: agentId
|
|
87
|
+
});
|
|
88
|
+
handleError(verified, error.message);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, showFlag, trackAgentAction, trackAgentActionError]);
|
|
92
|
+
|
|
93
|
+
// Don't render if user doesn't have permission
|
|
94
|
+
if (!isAbleToGovernAgents) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
98
|
+
testId: testId,
|
|
99
|
+
onClick: function onClick() {
|
|
100
|
+
return handleUpdateVerification(!isVerified);
|
|
101
|
+
}
|
|
102
|
+
}, formatMessage(isVerified ? messages.unverifyAgentLabel : messages.verifyAgentLabel));
|
|
103
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export default defineMessages({
|
|
3
|
+
verifyAgentLabel: {
|
|
4
|
+
id: 'rovo-agent-components.agent-verification-dropdown-item.verify-agent',
|
|
5
|
+
defaultMessage: 'Verify agent',
|
|
6
|
+
description: 'Label for verify agent dropdown menu item'
|
|
7
|
+
},
|
|
8
|
+
unverifyAgentLabel: {
|
|
9
|
+
id: 'rovo-agent-components.agent-verification-dropdown-item.unverify-agent',
|
|
10
|
+
defaultMessage: 'Unverify agent',
|
|
11
|
+
description: 'Label for unverify agent dropdown menu item'
|
|
12
|
+
},
|
|
13
|
+
verifySuccessTitle: {
|
|
14
|
+
id: 'rovo-agent-components.agent-verification-dropdown-item.verify-success-title',
|
|
15
|
+
defaultMessage: 'Agent verified',
|
|
16
|
+
description: 'Title for success flag when agent is verified'
|
|
17
|
+
},
|
|
18
|
+
unverifySuccessTitle: {
|
|
19
|
+
id: 'rovo-agent-components.agent-verification-dropdown-item.unverify-success-title',
|
|
20
|
+
defaultMessage: 'Agent unverified',
|
|
21
|
+
description: 'Title for success flag when agent is unverified'
|
|
22
|
+
},
|
|
23
|
+
verifyErrorTitle: {
|
|
24
|
+
id: 'rovo-agent-components.agent-verification-dropdown-item.verify-error-title',
|
|
25
|
+
defaultMessage: 'Failed to verify agent',
|
|
26
|
+
description: 'Title for error flag when verifying agent fails'
|
|
27
|
+
},
|
|
28
|
+
unverifyErrorTitle: {
|
|
29
|
+
id: 'rovo-agent-components.agent-verification-dropdown-item.unverify-error-title',
|
|
30
|
+
defaultMessage: 'Failed to unverify agent',
|
|
31
|
+
description: 'Title for error flag when unverifying agent fails'
|
|
32
|
+
},
|
|
33
|
+
errorDescription: {
|
|
34
|
+
id: 'rovo-agent-components.agent-verification-dropdown-item.error-description',
|
|
35
|
+
defaultMessage: 'An error occurred while updating agent verification status: {errorMessage}',
|
|
36
|
+
description: 'Description for error flag showing the error message'
|
|
37
|
+
}
|
|
38
|
+
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export { AgentAvatar } from './ui/agent-avatar';
|
|
|
11
11
|
export { AgentBanner, GeneratedAvatar } from './ui/agent-avatar/generated-avatars';
|
|
12
12
|
export { AgentDropdownMenu } from './ui/agent-dropdown-menu';
|
|
13
13
|
export { AgentMenuItemSkeleton } from './ui/agent-menu-item-skeleton';
|
|
14
|
+
export { AgentVerificationDropdownItem, type AgentVerificationDropdownItemProps, } from './ui/agent-verification-dropdown-item';
|
|
@@ -20,6 +20,7 @@ type GeneratedAvatarProps = {
|
|
|
20
20
|
agentNamedId?: string;
|
|
21
21
|
agentId?: string;
|
|
22
22
|
agentIdentityAccountId?: string | null | undefined;
|
|
23
|
+
isRovoDev?: boolean;
|
|
23
24
|
size: SizeType;
|
|
24
25
|
onLoad?: () => void;
|
|
25
26
|
};
|
|
@@ -32,7 +33,7 @@ type GeneratedAvatarProps = {
|
|
|
32
33
|
* cd002f25-46e4-4023-80ff-32e4d90849b4
|
|
33
34
|
*/
|
|
34
35
|
export declare const getNumberIdForAvatar: ({ agentIdentityAccountId, agentId, }: Pick<GeneratedAvatarProps, "agentIdentityAccountId" | "agentId">) => number | null;
|
|
35
|
-
export declare const AgentBanner: ({ agentNamedId, agentId, agentIdentityAccountId, height, fillSpace, }: Pick<GeneratedAvatarProps, "agentId" | "agentNamedId" | "agentIdentityAccountId"> & {
|
|
36
|
+
export declare const AgentBanner: ({ agentNamedId, agentId, agentIdentityAccountId, isRovoDev, height, fillSpace, }: Pick<GeneratedAvatarProps, "agentId" | "agentNamedId" | "agentIdentityAccountId" | "isRovoDev"> & {
|
|
36
37
|
height?: number;
|
|
37
38
|
fillSpace?: boolean;
|
|
38
39
|
}) => JSX.Element;
|
|
@@ -9,6 +9,7 @@ type AgentAvatarProps = {
|
|
|
9
9
|
agentIdentityAccountId?: string | null | undefined;
|
|
10
10
|
agentNamedId?: string;
|
|
11
11
|
agentId?: string;
|
|
12
|
+
isRovoDev?: boolean;
|
|
12
13
|
isForgeAgent?: boolean;
|
|
13
14
|
forgeAgentIconUrl?: string | null;
|
|
14
15
|
};
|
|
@@ -19,5 +20,5 @@ type AgentAvatarProps = {
|
|
|
19
20
|
* @param agentIdentityAccountId - This is Atlassian identity account ID for the agent(aaid). This id is prioritised to generate random avatar for non OOTB agents
|
|
20
21
|
* @param agentId - This is agent.id
|
|
21
22
|
*/
|
|
22
|
-
export declare const AgentAvatar: ({ imageUrl, size, label, name, agentId, agentIdentityAccountId, agentNamedId, showBorder, isForgeAgent, forgeAgentIconUrl, }: AgentAvatarProps) => JSX.Element;
|
|
23
|
+
export declare const AgentAvatar: ({ imageUrl, size, label, name, agentId, agentIdentityAccountId, agentNamedId, showBorder, isRovoDev, isForgeAgent, forgeAgentIconUrl, }: AgentAvatarProps) => JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -37,13 +37,15 @@ export declare const AgentProfileCreator: ({ creator, onCreatorLinkClick, isLoad
|
|
|
37
37
|
isLoading: boolean;
|
|
38
38
|
onCreatorLinkClick: () => void;
|
|
39
39
|
}) => JSX.Element | null;
|
|
40
|
-
export declare const AgentProfileInfo: ({ agentName, agentDescription, creatorRender, starCountRender, isStarred, isHidden, onStarToggle, }: {
|
|
40
|
+
export declare const AgentProfileInfo: ({ agentName, agentDescription, creatorRender, starCountRender, headingRender, isStarred, isHidden, onStarToggle, showStarButton, }: {
|
|
41
41
|
agentName: string;
|
|
42
42
|
agentDescription?: string | null;
|
|
43
43
|
creatorRender: React.ReactNode;
|
|
44
44
|
starCountRender: React.ReactNode;
|
|
45
|
+
headingRender?: React.ReactNode;
|
|
45
46
|
isStarred: boolean;
|
|
46
47
|
isHidden: boolean;
|
|
47
48
|
onStarToggle: () => void;
|
|
49
|
+
showStarButton?: boolean;
|
|
48
50
|
}) => JSX.Element;
|
|
49
51
|
export {};
|