@atlaskit/smart-card 26.65.0 → 26.67.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/CONTRIBUTING.md +3 -0
  3. package/dist/cjs/constants.js +1 -0
  4. package/dist/cjs/extractors/flexible/actions/extract-automation-action.js +53 -0
  5. package/dist/cjs/extractors/flexible/actions/index.js +2 -1
  6. package/dist/cjs/messages.js +50 -0
  7. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
  8. package/dist/cjs/state/hooks/use-ai-summary/index.js +3 -2
  9. package/dist/cjs/utils/ai-summary.js +4 -0
  10. package/dist/cjs/utils/analytics/analytics.js +1 -1
  11. package/dist/cjs/view/Card/types.js +1 -0
  12. package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +7 -5
  13. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +56 -0
  14. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.js +31 -0
  15. package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +29 -9
  16. package/dist/cjs/view/FlexibleCard/components/actions/follow-action/utils.js +24 -0
  17. package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -1
  18. package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +10 -1
  19. package/dist/cjs/view/LinkUrl/index.js +1 -1
  20. package/dist/es2019/constants.js +1 -0
  21. package/dist/es2019/extractors/flexible/actions/extract-automation-action.js +48 -0
  22. package/dist/es2019/extractors/flexible/actions/index.js +2 -0
  23. package/dist/es2019/messages.js +50 -0
  24. package/dist/es2019/state/flexible-ui-context/types.js +3 -1
  25. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
  26. package/dist/es2019/state/hooks/use-ai-summary/index.js +3 -2
  27. package/dist/es2019/utils/ai-summary.js +4 -0
  28. package/dist/es2019/utils/analytics/analytics.js +1 -1
  29. package/dist/es2019/view/Card/types.js +1 -0
  30. package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +3 -1
  31. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +41 -0
  32. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.js +23 -0
  33. package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +29 -6
  34. package/dist/es2019/view/FlexibleCard/components/actions/follow-action/utils.js +16 -0
  35. package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
  36. package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +10 -1
  37. package/dist/es2019/view/LinkUrl/index.js +1 -1
  38. package/dist/esm/constants.js +1 -0
  39. package/dist/esm/extractors/flexible/actions/extract-automation-action.js +46 -0
  40. package/dist/esm/extractors/flexible/actions/index.js +2 -1
  41. package/dist/esm/messages.js +50 -0
  42. package/dist/esm/state/flexible-ui-context/types.js +3 -1
  43. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
  44. package/dist/esm/state/hooks/use-ai-summary/index.js +3 -2
  45. package/dist/esm/utils/ai-summary.js +4 -0
  46. package/dist/esm/utils/analytics/analytics.js +1 -1
  47. package/dist/esm/view/Card/types.js +1 -0
  48. package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +7 -5
  49. package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +46 -0
  50. package/dist/esm/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.js +24 -0
  51. package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +29 -9
  52. package/dist/esm/view/FlexibleCard/components/actions/follow-action/utils.js +18 -0
  53. package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
  54. package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +10 -1
  55. package/dist/esm/view/LinkUrl/index.js +1 -1
  56. package/dist/types/constants.d.ts +1 -0
  57. package/dist/types/extractors/flexible/actions/extract-automation-action.d.ts +3 -0
  58. package/dist/types/extractors/flexible/actions/index.d.ts +1 -1
  59. package/dist/types/messages.d.ts +1 -1
  60. package/dist/types/state/flexible-ui-context/types.d.ts +12 -0
  61. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +1 -1
  62. package/dist/types/view/Card/types.d.ts +2 -1
  63. package/dist/types/view/FlexibleCard/components/actions/action/server-action/index.d.ts +3 -3
  64. package/dist/types/view/FlexibleCard/components/actions/action/server-action/types.d.ts +4 -3
  65. package/dist/types/view/FlexibleCard/components/actions/automation-action/index.d.ts +4 -0
  66. package/dist/types/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.d.ts +5 -0
  67. package/dist/types/view/FlexibleCard/components/actions/follow-action/index.d.ts +3 -3
  68. package/dist/types/view/FlexibleCard/components/actions/follow-action/utils.d.ts +2 -0
  69. package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
  70. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -1
  71. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +5 -5
  72. package/dist/types-ts4.5/constants.d.ts +1 -0
  73. package/dist/types-ts4.5/extractors/flexible/actions/extract-automation-action.d.ts +3 -0
  74. package/dist/types-ts4.5/extractors/flexible/actions/index.d.ts +1 -1
  75. package/dist/types-ts4.5/messages.d.ts +1 -1
  76. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +12 -0
  77. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +2 -1
  78. package/dist/types-ts4.5/view/Card/types.d.ts +2 -1
  79. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/server-action/index.d.ts +3 -3
  80. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/server-action/types.d.ts +4 -3
  81. package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/index.d.ts +4 -0
  82. package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.d.ts +5 -0
  83. package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/index.d.ts +3 -3
  84. package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/utils.d.ts +2 -0
  85. package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
  86. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -1
  87. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +5 -5
  88. package/package.json +9 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.67.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#100076](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100076)
8
+ [`bf4a097d8971`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bf4a097d8971) -
9
+ Add error callback to follow server action
10
+
11
+ ### Patch Changes
12
+
13
+ - [#100061](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100061)
14
+ [`e9808a59c4a0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e9808a59c4a0) -
15
+ Add error message for content exceeds length when summarizing a smart link
16
+ - Updated dependencies
17
+
18
+ ## 26.66.0
19
+
20
+ ### Minor Changes
21
+
22
+ - [#99093](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99093)
23
+ [`8e779e5c048b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8e779e5c048b) -
24
+ [ux] Update PreviewAction and FollowAction to use new icons under FF
25
+
3
26
  ## 26.65.0
4
27
 
5
28
  ### Minor Changes
@@ -0,0 +1,3 @@
1
+ # Contribute to Linking Platform
2
+
3
+ https://go.atlassian.com/lp-contribute
@@ -148,6 +148,7 @@ var ActionName = exports.ActionName = /*#__PURE__*/function (ActionName) {
148
148
  ActionName["EditAction"] = "EditAction";
149
149
  ActionName["FollowAction"] = "FollowAction";
150
150
  ActionName["PreviewAction"] = "PreviewAction";
151
+ ActionName["AutomationAction"] = "AutomationAction";
151
152
  ActionName["ViewAction"] = "ViewAction";
152
153
  ActionName["DownloadAction"] = "DownloadAction";
153
154
  ActionName["CustomAction"] = "CustomAction";
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.extractAutomationAction = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
+ var _messages = require("../../../messages");
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
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
+ // This action will not be enabled by default for smart cards, which is opposite of the default behavior for actions.
14
+ // The AutomationAction will only appear if product/resourceType combination is handled by this function.
15
+ var getProductData = function getProductData(meta) {
16
+ var _ProductData$product;
17
+ var tenantId = meta.tenantId;
18
+ var product = meta.product;
19
+ var resourceType = meta.resourceType;
20
+ var ProductData = {
21
+ 'confluence': {
22
+ 'page': {
23
+ //TODO extract to server
24
+ siteAri: "ari:cloud:confluence::site/".concat(tenantId),
25
+ //TODO Move to AutomationAction
26
+ modalTitle: _messages.messages.automation_action_confluence_page_modal_title,
27
+ modalDescription: _messages.messages.automation_action_confluence_page_modal_description
28
+ }
29
+ }
30
+ };
31
+ return ProductData === null || ProductData === void 0 || (_ProductData$product = ProductData[product]) === null || _ProductData$product === void 0 ? void 0 : _ProductData$product[resourceType];
32
+ };
33
+ var extractAutomationAction = exports.extractAutomationAction = function extractAutomationAction(response) {
34
+ if (!(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platfom.smart-card.confluence.page.automation-action') || !response.data) {
35
+ return undefined;
36
+ }
37
+ var data = response.data;
38
+ var meta = response.meta;
39
+ var name = data.name,
40
+ objectAri = data["atlassian:ari"];
41
+ var productData = getProductData(meta);
42
+ if (!productData) {
43
+ return undefined;
44
+ }
45
+ return _objectSpread(_objectSpread({}, productData), {}, {
46
+ objectName: name,
47
+ objectAri: objectAri,
48
+ // TODO: The admin experience will be a follow up
49
+ canManageAutomation: false,
50
+ baseAutomationUrl: '',
51
+ analyticsSource: 'smartCard'
52
+ });
53
+ };
@@ -12,10 +12,11 @@ var _extractPreviewAction = require("./extract-preview-action");
12
12
  var _extractAiSummaryAction = require("./extract-ai-summary-action");
13
13
  var _extractFollowAction = _interopRequireDefault(require("./extract-follow-action"));
14
14
  var _extractCopyLinkAction = require("./extract-copy-link-action");
15
+ var _extractAutomationAction = require("./extract-automation-action");
15
16
  var extractActions = function extractActions(response, url, actionOptions, id, aiSummaryConfig) {
16
17
  var _action;
17
18
  var data = response.data;
18
- var action = (_action = {}, (0, _defineProperty2.default)(_action, _constants.ActionName.CopyLinkAction, (0, _extractCopyLinkAction.extractCopyLinkAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.DownloadAction, (0, _extractDownloadAction.extractDownloadAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.FollowAction, (0, _extractFollowAction.default)(response, actionOptions, id)), (0, _defineProperty2.default)(_action, _constants.ActionName.PreviewAction, (0, _extractPreviewAction.extractPreviewAction)(response, actionOptions)), (0, _defineProperty2.default)(_action, _constants.InternalActionName.AISummaryAction, (0, _extractAiSummaryAction.extractAISummaryAction)(response, url, actionOptions, aiSummaryConfig)), _action);
19
+ var action = (_action = {}, (0, _defineProperty2.default)(_action, _constants.ActionName.CopyLinkAction, (0, _extractCopyLinkAction.extractCopyLinkAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.DownloadAction, (0, _extractDownloadAction.extractDownloadAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.FollowAction, (0, _extractFollowAction.default)(response, actionOptions, id)), (0, _defineProperty2.default)(_action, _constants.ActionName.PreviewAction, (0, _extractPreviewAction.extractPreviewAction)(response, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.AutomationAction, (0, _extractAutomationAction.extractAutomationAction)(response)), (0, _defineProperty2.default)(_action, _constants.InternalActionName.AISummaryAction, (0, _extractAiSummaryAction.extractAISummaryAction)(response, url, actionOptions, aiSummaryConfig)), _action);
19
20
  return Object.values(action).some(function (value) {
20
21
  return Boolean(value);
21
22
  }) ? action : undefined;
@@ -61,11 +61,41 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
61
61
  defaultMessage: 'Atlassian Intelligence was unable to process your request as your content contains links to HIPAA restricted content.',
62
62
  description: 'Shown when the AI summary is summarising the link resource content and the content contains HIPAA restricted content.'
63
63
  },
64
+ ai_summary_error_exceeding_context_length_error: {
65
+ id: 'fabric.linking.ai_summary_error_exceeding_context_length_error',
66
+ defaultMessage: "Atlassian Intelligence can't generate a summary for you right now as there is too much content to summarize.",
67
+ description: 'Shown when the AI summary is summarising the link resource content and the content is too large to summarize.'
68
+ },
64
69
  assigned_to: {
65
70
  id: 'fabric.linking.assigned_to',
66
71
  defaultMessage: 'Assigned to {context}',
67
72
  description: 'Indicates the person or entity that the resource is assigned to.'
68
73
  },
74
+ automation_action_title: {
75
+ id: 'fabric.linking.automation-action.title',
76
+ defaultMessage: 'Run automation...',
77
+ description: 'The title of the button in a hover card to open an automation menu for a given SmartLink.'
78
+ },
79
+ automation_action_icon_label: {
80
+ id: 'fabric.linking.automation-action.icon.label',
81
+ defaultMessage: 'Automation icon',
82
+ description: 'The label for the automation icon inside of the button opening the automation menu.'
83
+ },
84
+ automation_action_tooltip: {
85
+ id: 'fabric.linking.automation-action.tooltip',
86
+ defaultMessage: 'Open an automation modal',
87
+ description: 'The tooltip for the automation action indicating that a button will open an automation modal.'
88
+ },
89
+ automation_action_confluence_page_modal_title: {
90
+ id: 'fabric.linking.automation-action.confluence.page.modal.title',
91
+ defaultMessage: 'Page automations',
92
+ description: 'The title of the automation modal when the SmartLink is a Confluence page'
93
+ },
94
+ automation_action_confluence_page_modal_description: {
95
+ id: 'fabric.linking.automation-action.confluence.page.modal.description',
96
+ defaultMessage: 'Apply an automation to <b>{name}</b>.{br}The available selections are controlled by Confluence and space administrators.',
97
+ description: 'The description in the automation modal when the SmartLink is a Confluence page. Indicating which page the automation will apply to, and who controls the available automations.'
98
+ },
69
99
  cancel: {
70
100
  id: 'fabric.linking.cancel',
71
101
  defaultMessage: 'Cancel',
@@ -251,6 +281,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
251
281
  defaultMessage: 'Follow project',
252
282
  description: 'Click to follow a project.'
253
283
  },
284
+ follow_project_error: {
285
+ id: 'fabric.linking.follow_project_error.nonfinal',
286
+ defaultMessage: 'We encountered an error while trying to follow the project. Check your connection or refresh the page and try again.',
287
+ description: 'Shown when an unknown error occurs when following an Atlas project'
288
+ },
254
289
  follow_goal_description: {
255
290
  id: 'fabric.linking.follow_goal_description.nonfinal',
256
291
  defaultMessage: 'Follow this goal to get notifications on updates',
@@ -261,6 +296,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
261
296
  defaultMessage: 'Follow goal',
262
297
  description: 'Click to follow a project.'
263
298
  },
299
+ follow_goal_error: {
300
+ id: 'fabric.linking.follow_goal_error.nonfinal',
301
+ defaultMessage: 'We encountered an error while trying to follow the goal. Check your connection or refresh the page and try again.',
302
+ description: 'Shown when an unknown error occurs when following an Atlas goal'
303
+ },
264
304
  go_back: {
265
305
  id: 'fabric.linking.go_back',
266
306
  defaultMessage: 'Go back',
@@ -531,6 +571,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
531
571
  defaultMessage: 'Unfollow project',
532
572
  description: 'Click to unfollow a project.'
533
573
  },
574
+ unfollow_project_error: {
575
+ id: 'fabric.linking.unfollow_project_error.nonfinal',
576
+ defaultMessage: 'We encountered an error while trying to unfollow the project. Check your connection or refresh the page and try again.',
577
+ description: 'Shown when an unknown error occurs when unfollowing an Atlas project'
578
+ },
534
579
  unfollow_goal_description: {
535
580
  id: 'fabric.linking.unfollow_goal_description.nonfinal',
536
581
  defaultMessage: 'Unfollow to stop receiving notifications for this goal',
@@ -541,6 +586,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
541
586
  defaultMessage: 'Unfollow goal',
542
587
  description: 'Click to unfollow a project.'
543
588
  },
589
+ unfollow_goal_error: {
590
+ id: 'fabric.linking.unfollow_goal_error.nonfinal',
591
+ defaultMessage: 'We encountered an error while trying to unfollow the goal. Check your connection or refresh the page and try again.',
592
+ description: 'Shown when an unknown error occurs when unfollowing an Atlas goal'
593
+ },
544
594
  unlink_account: {
545
595
  id: 'fabric.linking.unlink_account',
546
596
  defaultMessage: 'Unlink Account',
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.errorMessages = void 0;
7
- var errorMessages = exports.errorMessages = ['NETWORK_ERROR', 'NO_ANSWER', 'RATE_LIMIT', 'NO_AGENT', 'PLUGIN_ERRORED', 'OPENAI_RATE_LIMIT_USER_ABUSE', 'ACCEPTABLE_USE_VIOLATIONS', 'AI_DISABLED', 'UNEXPECTED', 'HIPAA_CONTENT_DETECTED'];
7
+ var errorMessages = exports.errorMessages = ['NETWORK_ERROR', 'NO_ANSWER', 'RATE_LIMIT', 'NO_AGENT', 'PLUGIN_ERRORED', 'OPENAI_RATE_LIMIT_USER_ABUSE', 'ACCEPTABLE_USE_VIOLATIONS', 'AI_DISABLED', 'UNEXPECTED', 'HIPAA_CONTENT_DETECTED', 'EXCEEDING_CONTEXT_LENGTH_ERROR'];
@@ -39,9 +39,10 @@ var useAISummary = exports.useAISummary = function useAISummary(props) {
39
39
  var onError = (0, _react.useCallback)(function (id, reason) {
40
40
  /**
41
41
  * Errors should only be counted to the SLO if they are not due to acceptable use violations
42
- * or HIPAA content detected.
42
+ * HIPAA content detected or exceeding context length.
43
43
  */
44
- var isSloError = reason !== "ACCEPTABLE_USE_VIOLATIONS" && reason !== "HIPAA_CONTENT_DETECTED";
44
+
45
+ var isSloError = reason === undefined ? true : !['ACCEPTABLE_USE_VIOLATIONS', 'HIPAA_CONTENT_DETECTED', 'EXCEEDING_CONTEXT_LENGTH_ERROR'].includes(reason);
45
46
  fireEvent('operational.summary.failed', {
46
47
  reason: reason || null,
47
48
  isSloError: isSloError
@@ -24,6 +24,10 @@ var getAISummaryErrorMessage = exports.getAISummaryErrorMessage = function getAI
24
24
  return {
25
25
  message: _messages.messages.ai_summary_error_hipaa_content_detected
26
26
  };
27
+ case 'EXCEEDING_CONTEXT_LENGTH_ERROR':
28
+ return {
29
+ message: _messages.messages.ai_summary_error_exceeding_context_length_error
30
+ };
27
31
  default:
28
32
  return {
29
33
  message: _messages.messages.ai_summary_error_generic,
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
22
22
  var context = exports.context = {
23
23
  componentName: 'smart-cards',
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "26.65.0"
25
+ packageVersion: "26.67.0"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -12,5 +12,6 @@ var CardAction = exports.CardAction = /*#__PURE__*/function (CardAction) {
12
12
  CardAction["FollowAction"] = "FollowAction";
13
13
  CardAction["CopyLinkAction"] = "CopyLinkAction";
14
14
  CardAction["AISummaryAction"] = "AISummaryAction";
15
+ CardAction["AutomationAction"] = "AutomationAction";
15
16
  return CardAction;
16
17
  }({});
@@ -18,12 +18,13 @@ var _useResolve = _interopRequireDefault(require("../../../../../../state/hooks/
18
18
  var _createInvokeRequest = _interopRequireDefault(require("../../../../../../utils/actions/create-invoke-request"));
19
19
  var _index = _interopRequireDefault(require("../index"));
20
20
  var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
21
- var _excluded = ["action", "onClick"];
21
+ var _excluded = ["action", "onClick", "onError"];
22
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
24
  var ServerAction = function ServerAction(_ref) {
25
25
  var action = _ref.action,
26
26
  onClick = _ref.onClick,
27
+ onErrorCallback = _ref.onError,
27
28
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
28
29
  var _useState = (0, _react.useState)(false),
29
30
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -38,7 +39,7 @@ var ServerAction = function ServerAction(_ref) {
38
39
  while (1) switch (_context.prev = _context.next) {
39
40
  case 0:
40
41
  if (!action) {
41
- _context.next = 21;
42
+ _context.next = 22;
42
43
  break;
43
44
  }
44
45
  smartLinkActionType = (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.actionType;
@@ -68,7 +69,7 @@ var ServerAction = function ServerAction(_ref) {
68
69
  if (onClick) {
69
70
  onClick();
70
71
  }
71
- _context.next = 21;
72
+ _context.next = 22;
72
73
  break;
73
74
  case 17:
74
75
  _context.prev = 17;
@@ -78,12 +79,13 @@ var ServerAction = function ServerAction(_ref) {
78
79
  smartLinkActionType: smartLinkActionType,
79
80
  reason: (0, _utils.getInvokeFailureReason)(_context.t0)
80
81
  });
81
- case 21:
82
+ onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback();
83
+ case 22:
82
84
  case "end":
83
85
  return _context.stop();
84
86
  }
85
87
  }, _callee, null, [[2, 17]]);
86
- })), [action, analytics === null || analytics === void 0 ? void 0 : analytics.track, analytics === null || analytics === void 0 ? void 0 : analytics.ui, invoke, onClick, reload]);
88
+ })), [action, analytics === null || analytics === void 0 ? void 0 : analytics.track, analytics === null || analytics === void 0 ? void 0 : analytics.ui, invoke, onClick, onErrorCallback, reload]);
87
89
  return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({}, props, {
88
90
  isLoading: isLoading,
89
91
  onClick: handleClick
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _reactIntlNext = require("react-intl-next");
13
+ var _manaulTriggersIcon = _interopRequireDefault(require("./manaul-triggers-icon"));
14
+ var _action = _interopRequireDefault(require("../action"));
15
+ var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
16
+ var _constants = require("../../../../../constants");
17
+ var _messages = require("../../../../../messages");
18
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ // import { useSmartLinkContext } from '../../../../../../../link-provider/src';
21
+
22
+ var handleAutomateActionClick = function handleAutomateActionClick(setIsModalOpen) {
23
+ setIsModalOpen(true);
24
+ };
25
+ var AutomationAction = function AutomationAction(props) {
26
+ var _context$actions;
27
+ var _useState = (0, _react.useState)(false),
28
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
29
+ _isModalOpen = _useState2[0],
30
+ setIsModalOpen = _useState2[1];
31
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
32
+ formatMessage = _useIntl.formatMessage;
33
+ // const { connections } = useSmartLinkContext();
34
+
35
+ // const env = connections.client.envKey ?? 'prod';
36
+ var context = (0, _flexibleUiContext.useFlexibleUiContext)();
37
+ var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.AutomationAction];
38
+ if (!data) {
39
+ return null;
40
+ }
41
+ var automationActionTitle = /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.automation_action_title);
42
+ var automationActionTooltip = /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.automation_action_tooltip);
43
+ var automationActionIconLabel = formatMessage(_messages.messages.automation_action_icon_label);
44
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({}, data, props, {
45
+ content: automationActionTitle,
46
+ icon: /*#__PURE__*/_react.default.createElement(_manaulTriggersIcon.default, {
47
+ label: automationActionIconLabel
48
+ }),
49
+ onClick: function onClick() {
50
+ return handleAutomateActionClick(setIsModalOpen);
51
+ },
52
+ testId: "smart-action-automation-action",
53
+ tooltipMessage: automationActionTooltip
54
+ })));
55
+ };
56
+ var _default = exports.default = AutomationAction;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var AutomationManualTriggersGlyph = function AutomationManualTriggersGlyph(_ref) {
10
+ var label = _ref.label;
11
+ return /*#__PURE__*/_react.default.createElement("svg", {
12
+ "aria-label": label,
13
+ width: "24",
14
+ height: "24",
15
+ viewBox: "0 0 24 24",
16
+ fill: "none",
17
+ xmlns: "http://www.w3.org/2000/svg"
18
+ }, /*#__PURE__*/_react.default.createElement("path", {
19
+ d: "M14 5L10 19",
20
+ stroke: "currentColor",
21
+ strokeWidth: "2",
22
+ strokeLinecap: "round"
23
+ }), /*#__PURE__*/_react.default.createElement("path", {
24
+ d: "M14 5L7 12H17L10 19",
25
+ stroke: "currentColor",
26
+ strokeWidth: "2",
27
+ strokeLinecap: "round",
28
+ strokeLinejoin: "round"
29
+ }));
30
+ };
31
+ var _default = exports.default = AutomationManualTriggersGlyph;
@@ -9,6 +9,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _inviteTeam = _interopRequireDefault(require("@atlaskit/icon/glyph/invite-team"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _react = _interopRequireDefault(require("react"));
13
14
  var _reactIntlNext = require("react-intl-next");
14
15
  var _constants = require("../../../../../constants");
@@ -17,7 +18,8 @@ var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
17
18
  var _serverAction = _interopRequireDefault(require("../action/server-action"));
18
19
  var _unfollowIcon = _interopRequireDefault(require("./unfollow-icon"));
19
20
  var _utils = require("../../utils");
20
- var _excluded = ["value"];
21
+ var _utils2 = require("./utils");
22
+ var _excluded = ["value", "isProject"];
21
23
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
24
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
23
25
  var importIconMapper = {
@@ -49,17 +51,25 @@ var getIcon = function getIcon(stackIconType) {
49
51
  }
50
52
  return (0, _utils.importIcon)(importFn);
51
53
  };
54
+ var getIconFF = function getIconFF(iconFFEnabled, defaultIcon) {
55
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-action-redesign')) {
56
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.action-icon-redesign')) {
57
+ return iconFFEnabled;
58
+ }
59
+ }
60
+ return defaultIcon;
61
+ };
52
62
  var FollowAction = function FollowAction(props) {
53
- var _context$actions, _context$actions2;
63
+ var _context$actions;
54
64
  var context = (0, _flexibleUiContext.useFlexibleUiContext)();
55
- if (!context || !(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[_constants.ActionName.FollowAction])) {
65
+ var actionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.FollowAction];
66
+ if (!context || !actionData) {
56
67
  return null;
57
68
  }
58
- var _context$actions$Acti = context === null || context === void 0 || (_context$actions2 = context.actions) === null || _context$actions2 === void 0 ? void 0 : _context$actions2[_constants.ActionName.FollowAction],
59
- value = _context$actions$Acti.value,
60
- data = (0, _objectWithoutProperties2.default)(_context$actions$Acti, _excluded);
69
+ var value = actionData.value,
70
+ isProject = actionData.isProject,
71
+ data = (0, _objectWithoutProperties2.default)(actionData, _excluded);
61
72
  var isStackItem = props.as === 'stack-item';
62
- var isProject = data.isProject;
63
73
  var message = value ? _messages.messages.follow : _messages.messages.unfollow;
64
74
  var projectMessage = value ? _messages.messages.follow_project : _messages.messages.unfollow_project;
65
75
  var goalMessage = value ? _messages.messages.follow_goal : _messages.messages.unfollow_goal;
@@ -80,12 +90,22 @@ var FollowAction = function FollowAction(props) {
80
90
  label: "Follow",
81
91
  testId: "smart-action-follow-action-".concat(stackIconType, "-icon")
82
92
  });
83
- var followIcon = isStackItem ? stackIcon : icon;
93
+ var followIcon = isStackItem ? stackIcon : getIconFF(stackIcon, icon);
94
+ var handleError = function handleError() {
95
+ var onErrorCallback = props.onError;
96
+ var errorMessage = (0, _utils2.getFollowActionErrorMessage)(isProject, value);
97
+ onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback({
98
+ title: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, errorMessage),
99
+ appearance: 'error'
100
+ });
101
+ };
84
102
  return /*#__PURE__*/_react.default.createElement(_serverAction.default, (0, _extends2.default)({
85
103
  content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, label),
86
104
  icon: followIcon,
87
105
  testId: "smart-action-follow-action",
88
106
  tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, tooltipMessage)
89
- }, data, props));
107
+ }, data, props, {
108
+ onError: handleError
109
+ }));
90
110
  };
91
111
  var _default = exports.default = FollowAction;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getFollowActionErrorMessage = void 0;
7
+ var _messages = require("../../../../../messages");
8
+ var getFollowActionErrorMessage = exports.getFollowActionErrorMessage = function getFollowActionErrorMessage() {
9
+ var isProject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
10
+ var isFollow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
11
+ if (isProject && isFollow) {
12
+ return _messages.messages.follow_project_error;
13
+ }
14
+ if (isProject && !isFollow) {
15
+ return _messages.messages.unfollow_project_error;
16
+ }
17
+ if (!isProject && isFollow) {
18
+ return _messages.messages.follow_goal_error;
19
+ }
20
+ if (!isProject && !isFollow) {
21
+ return _messages.messages.unfollow_goal_error;
22
+ }
23
+ return _messages.messages.generic_error_message;
24
+ };
@@ -10,6 +10,12 @@ Object.defineProperty(exports, "AISummaryAction", {
10
10
  return _aiSummaryAction.default;
11
11
  }
12
12
  });
13
+ Object.defineProperty(exports, "AutomationAction", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _automationAction.default;
17
+ }
18
+ });
13
19
  Object.defineProperty(exports, "CopyLinkAction", {
14
20
  enumerable: true,
15
21
  get: function get() {
@@ -59,4 +65,5 @@ var _downloadAction = _interopRequireDefault(require("./download-action"));
59
65
  var _followAction = _interopRequireDefault(require("./follow-action"));
60
66
  var _previewAction = _interopRequireDefault(require("./preview-action"));
61
67
  var _copyLinkAction = _interopRequireDefault(require("./copy-link-action"));
62
- var _aiSummaryAction = _interopRequireDefault(require("./ai-summary-action"));
68
+ var _aiSummaryAction = _interopRequireDefault(require("./ai-summary-action"));
69
+ var _automationAction = _interopRequireDefault(require("./automation-action"));
@@ -13,6 +13,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
13
13
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
14
14
  var _vidFullScreenOn = _interopRequireDefault(require("@atlaskit/icon/glyph/vid-full-screen-on"));
15
15
  var _actualSize = _interopRequireDefault(require("@atlaskit/icon/glyph/media-services/actual-size"));
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _react = _interopRequireWildcard(require("react"));
17
18
  var _reactIntlNext = require("react-intl-next");
18
19
  var _constants = require("../../../../../constants");
@@ -26,6 +27,14 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
26
27
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
27
28
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
28
29
  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; }
30
+ var getIconFF = function getIconFF() {
31
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-action-redesign')) {
32
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.action-icon-redesign')) {
33
+ return _actualSize.default;
34
+ }
35
+ }
36
+ return _vidFullScreenOn.default;
37
+ };
29
38
  var PreviewAction = function PreviewAction(_ref) {
30
39
  var _context$actions;
31
40
  var onClickCallback = _ref.onClick,
@@ -72,7 +81,7 @@ var PreviewAction = function PreviewAction(_ref) {
72
81
  }
73
82
  }, [analytics, data, invoke, onClickCallback]);
74
83
  var isStackItem = props.as === 'stack-item';
75
- var Icon = isStackItem ? _actualSize.default : _vidFullScreenOn.default;
84
+ var Icon = isStackItem ? _actualSize.default : getIconFF();
76
85
  var tooltipMessage = isStackItem ? _messages.messages.preview_description : _messages.messages.preview_improved;
77
86
  return data ? /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
78
87
  content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.preview_improved),
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
17
17
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
18
18
  var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/smart-card",
20
- packageVersion: "26.65.0",
20
+ packageVersion: "26.67.0",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -150,6 +150,7 @@ export let ActionName = /*#__PURE__*/function (ActionName) {
150
150
  ActionName["EditAction"] = "EditAction";
151
151
  ActionName["FollowAction"] = "FollowAction";
152
152
  ActionName["PreviewAction"] = "PreviewAction";
153
+ ActionName["AutomationAction"] = "AutomationAction";
153
154
  ActionName["ViewAction"] = "ViewAction";
154
155
  ActionName["DownloadAction"] = "DownloadAction";
155
156
  ActionName["CustomAction"] = "CustomAction";
@@ -0,0 +1,48 @@
1
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
+ import { messages } from '../../../messages';
3
+ // This action will not be enabled by default for smart cards, which is opposite of the default behavior for actions.
4
+ // The AutomationAction will only appear if product/resourceType combination is handled by this function.
5
+ const getProductData = meta => {
6
+ var _ProductData$product;
7
+ const {
8
+ tenantId
9
+ } = meta;
10
+ const product = meta.product;
11
+ const resourceType = meta.resourceType;
12
+ const ProductData = {
13
+ 'confluence': {
14
+ 'page': {
15
+ //TODO extract to server
16
+ siteAri: `ari:cloud:confluence::site/${tenantId}`,
17
+ //TODO Move to AutomationAction
18
+ modalTitle: messages.automation_action_confluence_page_modal_title,
19
+ modalDescription: messages.automation_action_confluence_page_modal_description
20
+ }
21
+ }
22
+ };
23
+ return ProductData === null || ProductData === void 0 ? void 0 : (_ProductData$product = ProductData[product]) === null || _ProductData$product === void 0 ? void 0 : _ProductData$product[resourceType];
24
+ };
25
+ export const extractAutomationAction = response => {
26
+ if (!getBooleanFF('platform.linking-platfom.smart-card.confluence.page.automation-action') || !response.data) {
27
+ return undefined;
28
+ }
29
+ const data = response.data;
30
+ const meta = response.meta;
31
+ const {
32
+ name,
33
+ "atlassian:ari": objectAri
34
+ } = data;
35
+ const productData = getProductData(meta);
36
+ if (!productData) {
37
+ return undefined;
38
+ }
39
+ return {
40
+ ...productData,
41
+ objectName: name,
42
+ objectAri: objectAri,
43
+ // TODO: The admin experience will be a follow up
44
+ canManageAutomation: false,
45
+ baseAutomationUrl: '',
46
+ analyticsSource: 'smartCard'
47
+ };
48
+ };
@@ -4,6 +4,7 @@ import { extractPreviewAction } from './extract-preview-action';
4
4
  import { extractAISummaryAction } from './extract-ai-summary-action';
5
5
  import extractFollowAction from './extract-follow-action';
6
6
  import { extractCopyLinkAction } from './extract-copy-link-action';
7
+ import { extractAutomationAction } from './extract-automation-action';
7
8
  const extractActions = (response, url, actionOptions, id, aiSummaryConfig) => {
8
9
  const data = response.data;
9
10
  const action = {
@@ -11,6 +12,7 @@ const extractActions = (response, url, actionOptions, id, aiSummaryConfig) => {
11
12
  [ActionName.DownloadAction]: extractDownloadAction(data, actionOptions),
12
13
  [ActionName.FollowAction]: extractFollowAction(response, actionOptions, id),
13
14
  [ActionName.PreviewAction]: extractPreviewAction(response, actionOptions),
15
+ [ActionName.AutomationAction]: extractAutomationAction(response),
14
16
  [InternalActionName.AISummaryAction]: extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)
15
17
  };
16
18
  return Object.values(action).some(value => Boolean(value)) ? action : undefined;