@atlaskit/profilecard 24.30.2 → 24.31.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 +12 -0
- package/afm-jira/tsconfig.json +1 -1
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/AgentProfileCard.js +7 -3
- package/dist/cjs/components/User/ProfileCardResourced.js +2 -1
- package/dist/cjs/util/analytics.js +2 -2
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/AgentProfileCard.js +7 -3
- package/dist/es2019/components/User/ProfileCardResourced.js +2 -1
- package/dist/es2019/util/analytics.js +2 -2
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/AgentProfileCard.js +7 -3
- package/dist/esm/components/User/ProfileCardResourced.js +2 -1
- package/dist/esm/util/analytics.js +2 -2
- package/dist/types/components/User/ProfileCardResourced.d.ts +10 -10
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/components/User/ProfileCardResourced.d.ts +10 -10
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/package.json +10 -3
- package/stories/agent-profilecard.stories.tsx +112 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 24.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`04077f2897e0e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/04077f2897e0e) -
|
|
8
|
+
[ux] Changing the UI for the user identity profile card when the user is the Rovo Dev agent.
|
|
9
|
+
Change is feature gated.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 24.30.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -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', "
|
|
14
|
+
headers.append('atl-client-version', "24.30.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', "
|
|
69
|
+
headers.append('atl-client-version', "24.30.2");
|
|
70
70
|
return headers;
|
|
71
71
|
};
|
|
72
72
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -188,13 +188,15 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
188
188
|
fireAnalytics: fireAnalytics
|
|
189
189
|
}));
|
|
190
190
|
}
|
|
191
|
+
var isRovoDev = agent.creator_type === 'ROVO_DEV';
|
|
191
192
|
return /*#__PURE__*/_react.default.createElement(_AgentProfileCardWrapper.AgentProfileCardWrapper, null, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
192
193
|
xcss: styles.cardContainerStyles
|
|
193
194
|
}, /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentBanner, {
|
|
194
195
|
agentId: agent.id,
|
|
195
196
|
agentNamedId: (_agent$external_confi = agent.external_config_reference) !== null && _agent$external_confi !== void 0 ? _agent$external_confi : agent.named_id,
|
|
196
197
|
height: (0, _platformFeatureFlags.fg)('rovo_agent_empty_state_refresh') ? 48 : 96,
|
|
197
|
-
agentIdentityAccountId: agent.identity_account_id
|
|
198
|
+
agentIdentityAccountId: agent.identity_account_id,
|
|
199
|
+
isRovoDev: isRovoDev && (0, _platformFeatureFlags.fg)('rovo_dev_themed_identity_card')
|
|
198
200
|
}), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
199
201
|
xcss: styles.avatarStyles
|
|
200
202
|
}, /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentAvatar, {
|
|
@@ -202,6 +204,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
202
204
|
agentNamedId: (_agent$external_confi2 = agent.external_config_reference) !== null && _agent$external_confi2 !== void 0 ? _agent$external_confi2 : agent.named_id,
|
|
203
205
|
agentIdentityAccountId: agent.identity_account_id,
|
|
204
206
|
size: (0, _platformFeatureFlags.fg)('rovo_agent_empty_state_refresh') ? 'large' : 'xlarge',
|
|
207
|
+
isRovoDev: isRovoDev && (0, _platformFeatureFlags.fg)('rovo_dev_themed_identity_card'),
|
|
205
208
|
isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY',
|
|
206
209
|
forgeAgentIconUrl: agent.icon
|
|
207
210
|
})), /*#__PURE__*/_react.default.createElement(_compiled.Stack, {
|
|
@@ -213,6 +216,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
213
216
|
agentName: agent.name,
|
|
214
217
|
isStarred: isStarred,
|
|
215
218
|
onStarToggle: handleSetFavourite,
|
|
219
|
+
showStarButton: !(isRovoDev && (0, _platformFeatureFlags.fg)('rovo_dev_themed_identity_card')),
|
|
216
220
|
isHidden: agent.visibility === 'PRIVATE',
|
|
217
221
|
creatorRender: ((_agent$creatorInfo = agent.creatorInfo) === null || _agent$creatorInfo === void 0 ? void 0 : _agent$creatorInfo.type) && /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentProfileCreator, {
|
|
218
222
|
creator: {
|
|
@@ -228,7 +232,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
228
232
|
isLoading: false
|
|
229
233
|
}),
|
|
230
234
|
agentDescription: agent.description
|
|
231
|
-
})), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
235
|
+
})), !(isRovoDev && (0, _platformFeatureFlags.fg)('rovo_dev_themed_identity_card')) && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
232
236
|
xcss: (0, _platformFeatureFlags.fg)('rovo_agent_empty_state_refresh') ? styles.conversationStartersWrapper : null
|
|
233
237
|
}, /*#__PURE__*/_react.default.createElement(_ConversationStarters.ConversationStarters, {
|
|
234
238
|
isAgentDefault: agent.is_default,
|
|
@@ -239,7 +243,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
239
243
|
prompt: conversationStarter.message
|
|
240
244
|
});
|
|
241
245
|
}
|
|
242
|
-
}))), /*#__PURE__*/_react.default.createElement(_Actions.AgentActions, {
|
|
246
|
+
}))), !(isRovoDev && (0, _platformFeatureFlags.fg)('rovo_dev_themed_identity_card')) && /*#__PURE__*/_react.default.createElement(_Actions.AgentActions, {
|
|
243
247
|
agent: agent,
|
|
244
248
|
onEditAgent: function onEditAgent() {
|
|
245
249
|
return _onEditAgent(agent.id);
|
|
@@ -243,4 +243,5 @@ var ProfileCardResourcedWithAnalytics = function ProfileCardResourcedWithAnalyti
|
|
|
243
243
|
fireEvent: fireEvent
|
|
244
244
|
}, props));
|
|
245
245
|
};
|
|
246
|
-
var
|
|
246
|
+
var _default_1 = (0, _platformFeatureFlagsReact.componentWithFG)('ptc-enable-profile-card-analytics-refactor', ProfileCardResourcedWithAnalytics, (0, _analyticsNext.withAnalyticsEvents)()(ProfileCardResourced));
|
|
247
|
+
var _default = exports.default = _default_1;
|
|
@@ -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: "
|
|
16
|
+
packageVersion: "24.30.2"
|
|
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: "
|
|
61
|
+
packageVersion: "24.30.2"
|
|
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', "
|
|
9
|
+
headers.append('atl-client-version', "24.30.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', "
|
|
81
|
+
headers.append('atl-client-version', "24.30.2");
|
|
82
82
|
return headers;
|
|
83
83
|
};
|
|
84
84
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -143,13 +143,15 @@ const AgentProfileCard = ({
|
|
|
143
143
|
fireAnalytics: fireAnalytics
|
|
144
144
|
}));
|
|
145
145
|
}
|
|
146
|
+
const isRovoDev = agent.creator_type === 'ROVO_DEV';
|
|
146
147
|
return /*#__PURE__*/React.createElement(AgentProfileCardWrapper, null, /*#__PURE__*/React.createElement(Box, {
|
|
147
148
|
xcss: styles.cardContainerStyles
|
|
148
149
|
}, /*#__PURE__*/React.createElement(AgentBanner, {
|
|
149
150
|
agentId: agent.id,
|
|
150
151
|
agentNamedId: (_agent$external_confi = agent.external_config_reference) !== null && _agent$external_confi !== void 0 ? _agent$external_confi : agent.named_id,
|
|
151
152
|
height: fg('rovo_agent_empty_state_refresh') ? 48 : 96,
|
|
152
|
-
agentIdentityAccountId: agent.identity_account_id
|
|
153
|
+
agentIdentityAccountId: agent.identity_account_id,
|
|
154
|
+
isRovoDev: isRovoDev && fg('rovo_dev_themed_identity_card')
|
|
153
155
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
154
156
|
xcss: styles.avatarStyles
|
|
155
157
|
}, /*#__PURE__*/React.createElement(AgentAvatar, {
|
|
@@ -157,6 +159,7 @@ const AgentProfileCard = ({
|
|
|
157
159
|
agentNamedId: (_agent$external_confi2 = agent.external_config_reference) !== null && _agent$external_confi2 !== void 0 ? _agent$external_confi2 : agent.named_id,
|
|
158
160
|
agentIdentityAccountId: agent.identity_account_id,
|
|
159
161
|
size: fg('rovo_agent_empty_state_refresh') ? 'large' : 'xlarge',
|
|
162
|
+
isRovoDev: isRovoDev && fg('rovo_dev_themed_identity_card'),
|
|
160
163
|
isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY',
|
|
161
164
|
forgeAgentIconUrl: agent.icon
|
|
162
165
|
})), /*#__PURE__*/React.createElement(Stack, {
|
|
@@ -168,6 +171,7 @@ const AgentProfileCard = ({
|
|
|
168
171
|
agentName: agent.name,
|
|
169
172
|
isStarred: isStarred,
|
|
170
173
|
onStarToggle: handleSetFavourite,
|
|
174
|
+
showStarButton: !(isRovoDev && fg('rovo_dev_themed_identity_card')),
|
|
171
175
|
isHidden: agent.visibility === 'PRIVATE',
|
|
172
176
|
creatorRender: ((_agent$creatorInfo = agent.creatorInfo) === null || _agent$creatorInfo === void 0 ? void 0 : _agent$creatorInfo.type) && /*#__PURE__*/React.createElement(AgentProfileCreator, {
|
|
173
177
|
creator: {
|
|
@@ -183,7 +187,7 @@ const AgentProfileCard = ({
|
|
|
183
187
|
isLoading: false
|
|
184
188
|
}),
|
|
185
189
|
agentDescription: agent.description
|
|
186
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
190
|
+
})), !(isRovoDev && fg('rovo_dev_themed_identity_card')) && /*#__PURE__*/React.createElement(Box, {
|
|
187
191
|
xcss: fg('rovo_agent_empty_state_refresh') ? styles.conversationStartersWrapper : null
|
|
188
192
|
}, /*#__PURE__*/React.createElement(ConversationStarters, {
|
|
189
193
|
isAgentDefault: agent.is_default,
|
|
@@ -194,7 +198,7 @@ const AgentProfileCard = ({
|
|
|
194
198
|
prompt: conversationStarter.message
|
|
195
199
|
});
|
|
196
200
|
}
|
|
197
|
-
}))), /*#__PURE__*/React.createElement(AgentActions, {
|
|
201
|
+
}))), !(isRovoDev && fg('rovo_dev_themed_identity_card')) && /*#__PURE__*/React.createElement(AgentActions, {
|
|
198
202
|
agent: agent,
|
|
199
203
|
onEditAgent: () => onEditAgent(agent.id),
|
|
200
204
|
onCopyAgent: () => onCopyAgent(agent.id),
|
|
@@ -198,4 +198,5 @@ const ProfileCardResourcedWithAnalytics = props => {
|
|
|
198
198
|
fireEvent: fireEvent
|
|
199
199
|
}, props));
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
const _default_1 = componentWithFG('ptc-enable-profile-card-analytics-refactor', ProfileCardResourcedWithAnalytics, withAnalyticsEvents()(ProfileCardResourced));
|
|
202
|
+
export default _default_1;
|
|
@@ -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: "
|
|
7
|
+
packageVersion: "24.30.2"
|
|
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: "
|
|
48
|
+
packageVersion: "24.30.2",
|
|
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', "
|
|
7
|
+
headers.append('atl-client-version', "24.30.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', "
|
|
62
|
+
headers.append('atl-client-version', "24.30.2");
|
|
63
63
|
return headers;
|
|
64
64
|
};
|
|
65
65
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -179,13 +179,15 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
179
179
|
fireAnalytics: fireAnalytics
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
|
+
var isRovoDev = agent.creator_type === 'ROVO_DEV';
|
|
182
183
|
return /*#__PURE__*/React.createElement(AgentProfileCardWrapper, null, /*#__PURE__*/React.createElement(Box, {
|
|
183
184
|
xcss: styles.cardContainerStyles
|
|
184
185
|
}, /*#__PURE__*/React.createElement(AgentBanner, {
|
|
185
186
|
agentId: agent.id,
|
|
186
187
|
agentNamedId: (_agent$external_confi = agent.external_config_reference) !== null && _agent$external_confi !== void 0 ? _agent$external_confi : agent.named_id,
|
|
187
188
|
height: fg('rovo_agent_empty_state_refresh') ? 48 : 96,
|
|
188
|
-
agentIdentityAccountId: agent.identity_account_id
|
|
189
|
+
agentIdentityAccountId: agent.identity_account_id,
|
|
190
|
+
isRovoDev: isRovoDev && fg('rovo_dev_themed_identity_card')
|
|
189
191
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
190
192
|
xcss: styles.avatarStyles
|
|
191
193
|
}, /*#__PURE__*/React.createElement(AgentAvatar, {
|
|
@@ -193,6 +195,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
193
195
|
agentNamedId: (_agent$external_confi2 = agent.external_config_reference) !== null && _agent$external_confi2 !== void 0 ? _agent$external_confi2 : agent.named_id,
|
|
194
196
|
agentIdentityAccountId: agent.identity_account_id,
|
|
195
197
|
size: fg('rovo_agent_empty_state_refresh') ? 'large' : 'xlarge',
|
|
198
|
+
isRovoDev: isRovoDev && fg('rovo_dev_themed_identity_card'),
|
|
196
199
|
isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY',
|
|
197
200
|
forgeAgentIconUrl: agent.icon
|
|
198
201
|
})), /*#__PURE__*/React.createElement(Stack, {
|
|
@@ -204,6 +207,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
204
207
|
agentName: agent.name,
|
|
205
208
|
isStarred: isStarred,
|
|
206
209
|
onStarToggle: handleSetFavourite,
|
|
210
|
+
showStarButton: !(isRovoDev && fg('rovo_dev_themed_identity_card')),
|
|
207
211
|
isHidden: agent.visibility === 'PRIVATE',
|
|
208
212
|
creatorRender: ((_agent$creatorInfo = agent.creatorInfo) === null || _agent$creatorInfo === void 0 ? void 0 : _agent$creatorInfo.type) && /*#__PURE__*/React.createElement(AgentProfileCreator, {
|
|
209
213
|
creator: {
|
|
@@ -219,7 +223,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
219
223
|
isLoading: false
|
|
220
224
|
}),
|
|
221
225
|
agentDescription: agent.description
|
|
222
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
226
|
+
})), !(isRovoDev && fg('rovo_dev_themed_identity_card')) && /*#__PURE__*/React.createElement(Box, {
|
|
223
227
|
xcss: fg('rovo_agent_empty_state_refresh') ? styles.conversationStartersWrapper : null
|
|
224
228
|
}, /*#__PURE__*/React.createElement(ConversationStarters, {
|
|
225
229
|
isAgentDefault: agent.is_default,
|
|
@@ -230,7 +234,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
230
234
|
prompt: conversationStarter.message
|
|
231
235
|
});
|
|
232
236
|
}
|
|
233
|
-
}))), /*#__PURE__*/React.createElement(AgentActions, {
|
|
237
|
+
}))), !(isRovoDev && fg('rovo_dev_themed_identity_card')) && /*#__PURE__*/React.createElement(AgentActions, {
|
|
234
238
|
agent: agent,
|
|
235
239
|
onEditAgent: function onEditAgent() {
|
|
236
240
|
return _onEditAgent(agent.id);
|
|
@@ -234,4 +234,5 @@ var ProfileCardResourcedWithAnalytics = function ProfileCardResourcedWithAnalyti
|
|
|
234
234
|
fireEvent: fireEvent
|
|
235
235
|
}, props));
|
|
236
236
|
};
|
|
237
|
-
|
|
237
|
+
var _default_1 = componentWithFG('ptc-enable-profile-card-analytics-refactor', ProfileCardResourcedWithAnalytics, withAnalyticsEvents()(ProfileCardResourced));
|
|
238
|
+
export default _default_1;
|
|
@@ -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: "
|
|
10
|
+
packageVersion: "24.30.2"
|
|
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: "
|
|
55
|
+
packageVersion: "24.30.2"
|
|
56
56
|
}, attributes), {}, {
|
|
57
57
|
firedAt: Math.round(getPageTime())
|
|
58
58
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
+
import { type AnalyticsEventPayload, type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import { type FireEventType } from '@atlaskit/teams-app-internal-analytics';
|
|
4
|
-
import { type AnalyticsProps, type ProfileCardAction, type ProfileCardClientData, type ProfileCardResourcedProps, type ProfileCardResourcedState, type TeamCentralReportingLinesData } from '../../types';
|
|
4
|
+
import { type AnalyticsProps, type ProfileCardAction, type ProfileCardClientData, type ProfileCardResourcedProps, type ProfileCardResourcedState, type ProfilecardTriggerPosition, type ProfileClient, type ReportingLinesUser, type TeamCentralReportingLinesData, type TriggerType } from '../../types';
|
|
5
5
|
declare class ProfileCardResourced extends React.PureComponent<ProfileCardResourcedProps & AnalyticsProps, ProfileCardResourcedState> {
|
|
6
6
|
static defaultProps: Partial<ProfileCardResourcedProps>;
|
|
7
7
|
_isMounted: boolean;
|
|
@@ -20,16 +20,16 @@ declare class ProfileCardResourced extends React.PureComponent<ProfileCardResour
|
|
|
20
20
|
render(): React.ReactNode;
|
|
21
21
|
}
|
|
22
22
|
export declare const ProfileCardResourcedInternal: typeof ProfileCardResourced;
|
|
23
|
-
declare const
|
|
23
|
+
declare const _default_1: React.FC<ProfileCardResourcedProps & Omit<Pick<Omit<ProfileCardResourcedProps, keyof WithAnalyticsEventsProps>, never> & {
|
|
24
|
+
userId?: string | undefined;
|
|
24
25
|
cloudId?: string | undefined;
|
|
25
|
-
resourceClient?:
|
|
26
|
+
resourceClient?: ProfileClient | undefined;
|
|
26
27
|
actions?: ProfileCardAction[] | undefined;
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
reportingLinesProfileUrl?: string | undefined;
|
|
29
|
+
onReportingLinesClick?: ((user: ReportingLinesUser) => void) | undefined;
|
|
30
|
+
position?: ProfilecardTriggerPosition | undefined;
|
|
31
|
+
trigger?: TriggerType | undefined;
|
|
29
32
|
children?: React.ReactNode;
|
|
30
33
|
addFlag?: ((flag: any) => void) | undefined;
|
|
31
|
-
userId?: string | undefined;
|
|
32
|
-
reportingLinesProfileUrl?: string | undefined;
|
|
33
|
-
onReportingLinesClick?: ((user: import("../../types").ReportingLinesUser) => void) | undefined;
|
|
34
34
|
} & {} & React.RefAttributes<any>, "ref"> & React.RefAttributes<any>>;
|
|
35
|
-
export default
|
|
35
|
+
export default _default_1;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export interface RovoAgent {
|
|
|
67
67
|
name: string;
|
|
68
68
|
description: string | null;
|
|
69
69
|
system_prompt_template?: string | null;
|
|
70
|
-
creator_type: 'SYSTEM' | 'CUSTOMER' | 'THIRD_PARTY' | 'FORGE';
|
|
70
|
+
creator_type: 'SYSTEM' | 'CUSTOMER' | 'THIRD_PARTY' | 'FORGE' | 'ROVO_DEV';
|
|
71
71
|
creator?: string | null;
|
|
72
72
|
visibility?: 'PUBLIC' | 'PRIVATE' | null;
|
|
73
73
|
is_default: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
+
import { type AnalyticsEventPayload, type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import { type FireEventType } from '@atlaskit/teams-app-internal-analytics';
|
|
4
|
-
import { type AnalyticsProps, type ProfileCardAction, type ProfileCardClientData, type ProfileCardResourcedProps, type ProfileCardResourcedState, type TeamCentralReportingLinesData } from '../../types';
|
|
4
|
+
import { type AnalyticsProps, type ProfileCardAction, type ProfileCardClientData, type ProfileCardResourcedProps, type ProfileCardResourcedState, type ProfilecardTriggerPosition, type ProfileClient, type ReportingLinesUser, type TeamCentralReportingLinesData, type TriggerType } from '../../types';
|
|
5
5
|
declare class ProfileCardResourced extends React.PureComponent<ProfileCardResourcedProps & AnalyticsProps, ProfileCardResourcedState> {
|
|
6
6
|
static defaultProps: Partial<ProfileCardResourcedProps>;
|
|
7
7
|
_isMounted: boolean;
|
|
@@ -20,16 +20,16 @@ declare class ProfileCardResourced extends React.PureComponent<ProfileCardResour
|
|
|
20
20
|
render(): React.ReactNode;
|
|
21
21
|
}
|
|
22
22
|
export declare const ProfileCardResourcedInternal: typeof ProfileCardResourced;
|
|
23
|
-
declare const
|
|
23
|
+
declare const _default_1: React.FC<ProfileCardResourcedProps & Omit<Pick<Omit<ProfileCardResourcedProps, keyof WithAnalyticsEventsProps>, never> & {
|
|
24
|
+
userId?: string | undefined;
|
|
24
25
|
cloudId?: string | undefined;
|
|
25
|
-
resourceClient?:
|
|
26
|
+
resourceClient?: ProfileClient | undefined;
|
|
26
27
|
actions?: ProfileCardAction[] | undefined;
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
reportingLinesProfileUrl?: string | undefined;
|
|
29
|
+
onReportingLinesClick?: ((user: ReportingLinesUser) => void) | undefined;
|
|
30
|
+
position?: ProfilecardTriggerPosition | undefined;
|
|
31
|
+
trigger?: TriggerType | undefined;
|
|
29
32
|
children?: React.ReactNode;
|
|
30
33
|
addFlag?: ((flag: any) => void) | undefined;
|
|
31
|
-
userId?: string | undefined;
|
|
32
|
-
reportingLinesProfileUrl?: string | undefined;
|
|
33
|
-
onReportingLinesClick?: ((user: import("../../types").ReportingLinesUser) => void) | undefined;
|
|
34
34
|
} & {} & React.RefAttributes<any>, "ref"> & React.RefAttributes<any>>;
|
|
35
|
-
export default
|
|
35
|
+
export default _default_1;
|
|
@@ -67,7 +67,7 @@ export interface RovoAgent {
|
|
|
67
67
|
name: string;
|
|
68
68
|
description: string | null;
|
|
69
69
|
system_prompt_template?: string | null;
|
|
70
|
-
creator_type: 'SYSTEM' | 'CUSTOMER' | 'THIRD_PARTY' | 'FORGE';
|
|
70
|
+
creator_type: 'SYSTEM' | 'CUSTOMER' | 'THIRD_PARTY' | 'FORGE' | 'ROVO_DEV';
|
|
71
71
|
creator?: string | null;
|
|
72
72
|
visibility?: 'PUBLIC' | 'PRIVATE' | null;
|
|
73
73
|
is_default: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.31.0",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
61
61
|
"@atlaskit/popup": "^4.13.0",
|
|
62
62
|
"@atlaskit/primitives": "^17.1.0",
|
|
63
|
-
"@atlaskit/rovo-agent-components": "^3.
|
|
63
|
+
"@atlaskit/rovo-agent-components": "^3.22.0",
|
|
64
64
|
"@atlaskit/rovo-triggers": "^5.6.0",
|
|
65
65
|
"@atlaskit/spinner": "^19.0.0",
|
|
66
66
|
"@atlaskit/teams-app-config": "^1.12.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@atlaskit/teams-avatar": "^2.4.0",
|
|
69
69
|
"@atlaskit/teams-public": "^0.65.0",
|
|
70
70
|
"@atlaskit/theme": "^21.0.0",
|
|
71
|
-
"@atlaskit/tokens": "^10.
|
|
71
|
+
"@atlaskit/tokens": "^10.1.0",
|
|
72
72
|
"@atlaskit/tooltip": "^20.14.0",
|
|
73
73
|
"@babel/runtime": "^7.0.0",
|
|
74
74
|
"@compiled/react": "^0.18.6",
|
|
@@ -86,8 +86,12 @@
|
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@af/visual-regression": "workspace:^",
|
|
89
|
+
"@atlassian/feature-flags-storybook-utils": "^0.3.0",
|
|
89
90
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
91
|
+
"@atlassian/platform-storybook-helpers": "^0.1.0",
|
|
90
92
|
"@atlassian/ptc-test-utils": "^0.11.0",
|
|
93
|
+
"@storybook/addon-actions": "^8.6.14",
|
|
94
|
+
"@storybook/test": "^8.6.14",
|
|
91
95
|
"@testing-library/react": "^16.3.0",
|
|
92
96
|
"@testing-library/user-event": "^14.4.3",
|
|
93
97
|
"enzyme": "^3.10.0",
|
|
@@ -157,6 +161,9 @@
|
|
|
157
161
|
"rovo_agent_empty_state_refresh": {
|
|
158
162
|
"type": "boolean"
|
|
159
163
|
},
|
|
164
|
+
"rovo_dev_themed_identity_card": {
|
|
165
|
+
"type": "boolean"
|
|
166
|
+
},
|
|
160
167
|
"enable_profilecard_text_truncation_tooltip": {
|
|
161
168
|
"type": "boolean"
|
|
162
169
|
},
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import { IntlProvider } from 'react-intl-next';
|
|
5
|
+
|
|
6
|
+
import { withPlatformFeatureGates } from '@atlassian/feature-flags-storybook-utils';
|
|
7
|
+
import {
|
|
8
|
+
withAnalyticsLogger,
|
|
9
|
+
withMaxWidth,
|
|
10
|
+
withStorybookLinkHarness,
|
|
11
|
+
} from '@atlassian/platform-storybook-helpers';
|
|
12
|
+
|
|
13
|
+
import { AgentProfileCard } from '../src';
|
|
14
|
+
import { simpleProfileClient } from '../src/mocks';
|
|
15
|
+
import type { AgentProfileCardProps, RovoAgentProfileCardInfo } from '../src/types';
|
|
16
|
+
|
|
17
|
+
type StoryArgs = AgentProfileCardProps;
|
|
18
|
+
|
|
19
|
+
const agent: RovoAgentProfileCardInfo = {
|
|
20
|
+
id: '965df475-d134-43ac-8ec4-f4aafd0025c6',
|
|
21
|
+
name: 'Rovo Dev',
|
|
22
|
+
description:
|
|
23
|
+
'Get help writing a user manual page that you can use to share your preferred ways of working with your team.',
|
|
24
|
+
system_prompt_template: '',
|
|
25
|
+
visibility: 'PUBLIC',
|
|
26
|
+
user_defined_conversation_starters: [
|
|
27
|
+
'Help me make my first User Manual.',
|
|
28
|
+
'Help with my goals',
|
|
29
|
+
'This is a very long conversation starter to test the overflow',
|
|
30
|
+
],
|
|
31
|
+
named_id: '965df475-d134-43ac-8ec4-f4aafd0025c6',
|
|
32
|
+
creator: 'ari:cloud:identity::user/62321fb55b6d710070a1ce85',
|
|
33
|
+
creator_type: 'CUSTOMER',
|
|
34
|
+
// Toggle this to 'ROVO_DEV' in Storybook controls to simulate Rovo Dev UI.
|
|
35
|
+
favourite: true,
|
|
36
|
+
is_default: false,
|
|
37
|
+
deactivated: false,
|
|
38
|
+
identity_account_id: 'ari:cloud:identity::user/712020:b719aaa1-2485-4dad-93d3-abc3c93862c6',
|
|
39
|
+
creatorInfo: {
|
|
40
|
+
type: 'CUSTOMER',
|
|
41
|
+
name: 'John Doe',
|
|
42
|
+
profileLink: 'https://example.com/profile',
|
|
43
|
+
},
|
|
44
|
+
actor_type: 'AGENT',
|
|
45
|
+
favourite_count: 1234,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const meta: Meta<StoryArgs> = {
|
|
49
|
+
component: AgentProfileCard,
|
|
50
|
+
args: {
|
|
51
|
+
resourceClient: simpleProfileClient,
|
|
52
|
+
agent,
|
|
53
|
+
// Avoid network calls for permissions in Storybook.
|
|
54
|
+
hideMoreActions: true,
|
|
55
|
+
},
|
|
56
|
+
argTypes: {
|
|
57
|
+
hideMoreActions: { control: { type: 'boolean' } },
|
|
58
|
+
agent: {
|
|
59
|
+
control: { type: 'object' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
decorators: [
|
|
64
|
+
withAnalyticsLogger,
|
|
65
|
+
withMaxWidth('420px'),
|
|
66
|
+
withStorybookLinkHarness({ centered: false }),
|
|
67
|
+
(Story) => (
|
|
68
|
+
<IntlProvider locale="en">
|
|
69
|
+
<Story />
|
|
70
|
+
</IntlProvider>
|
|
71
|
+
),
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default meta;
|
|
76
|
+
|
|
77
|
+
type Story = StoryObj<StoryArgs>;
|
|
78
|
+
|
|
79
|
+
const baseFeatureGates = {
|
|
80
|
+
rovo_agent_empty_state_refresh: false,
|
|
81
|
+
jira_ai_force_rovo_dev_avatar: false,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Standard: Story = {
|
|
85
|
+
name: 'Standard (non-Rovo Dev)',
|
|
86
|
+
decorators: [withPlatformFeatureGates({ ...baseFeatureGates, rovo_dev_themed_identity_card: false })],
|
|
87
|
+
render: (props) => <AgentProfileCard {...props} />,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const RovoDevGateOff: Story = {
|
|
91
|
+
name: 'Rovo Dev (gate OFF)',
|
|
92
|
+
args: {
|
|
93
|
+
agent: {
|
|
94
|
+
...agent,
|
|
95
|
+
creator_type: 'ROVO_DEV',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
decorators: [withPlatformFeatureGates({ ...baseFeatureGates, rovo_dev_themed_identity_card: false })],
|
|
99
|
+
render: (props) => <AgentProfileCard {...props} />,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const RovoDevGateOn: Story = {
|
|
103
|
+
name: 'Rovo Dev (gate ON)',
|
|
104
|
+
args: {
|
|
105
|
+
agent: {
|
|
106
|
+
...agent,
|
|
107
|
+
creator_type: 'ROVO_DEV',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
decorators: [withPlatformFeatureGates({ ...baseFeatureGates, rovo_dev_themed_identity_card: true })],
|
|
111
|
+
render: (props) => <AgentProfileCard {...props} />,
|
|
112
|
+
};
|