@atlaskit/smart-card 44.16.4 → 44.16.6
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/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/cjs/extractors/action/extract-invoke-copy-link-action.js +1 -1
- package/dist/cjs/extractors/action/extract-invoke-download-action.js +1 -1
- package/dist/cjs/extractors/action/extract-invoke-preview-action.js +7 -7
- package/dist/cjs/extractors/action/extract-invoke-view-action.js +1 -1
- package/dist/cjs/state/actions/index.js +7 -7
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +46 -46
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/readStream.js +44 -44
- package/dist/cjs/state/hooks/use-incoming-outgoing-links/index.js +34 -34
- package/dist/cjs/state/hooks/use-invoke/index.js +4 -4
- package/dist/cjs/state/hooks/use-invoke-client-action/index.js +12 -12
- package/dist/cjs/state/hooks/use-resolve/index.js +4 -4
- package/dist/cjs/state/hooks/usePrefetch.js +14 -14
- package/dist/cjs/state/services/current-site-cloud-id/index.js +16 -16
- package/dist/cjs/state/services/personalization/index.js +23 -23
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +26 -25
- package/dist/cjs/utils/mocks.js +16 -16
- package/dist/cjs/view/EmbedModal/utils.js +4 -4
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +17 -17
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +8 -8
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +10 -10
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +31 -31
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +10 -10
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +4 -4
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +34 -34
- package/dist/cjs/view/InlineCard/common/action-button/index.compiled.css +1 -1
- package/dist/cjs/view/InlineCard/common/action-button/index.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RelatedLinksModal/index.js +41 -41
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/InlineCard/common/action-button/index.compiled.css +1 -1
- package/dist/es2019/view/InlineCard/common/action-button/index.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/esm/extractors/action/extract-invoke-copy-link-action.js +1 -1
- package/dist/esm/extractors/action/extract-invoke-download-action.js +1 -1
- package/dist/esm/extractors/action/extract-invoke-preview-action.js +7 -7
- package/dist/esm/extractors/action/extract-invoke-view-action.js +1 -1
- package/dist/esm/state/actions/index.js +7 -7
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +46 -46
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/readStream.js +44 -44
- package/dist/esm/state/hooks/use-incoming-outgoing-links/index.js +34 -34
- package/dist/esm/state/hooks/use-invoke/index.js +4 -4
- package/dist/esm/state/hooks/use-invoke-client-action/index.js +11 -11
- package/dist/esm/state/hooks/use-resolve/index.js +4 -4
- package/dist/esm/state/hooks/usePrefetch.js +14 -14
- package/dist/esm/state/services/current-site-cloud-id/index.js +16 -16
- package/dist/esm/state/services/personalization/index.js +23 -23
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +25 -24
- package/dist/esm/utils/mocks.js +16 -16
- package/dist/esm/view/EmbedModal/utils.js +4 -4
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +16 -16
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +8 -8
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +2 -2
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +10 -10
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +30 -30
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +10 -10
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +4 -4
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +33 -33
- package/dist/esm/view/InlineCard/common/action-button/index.compiled.css +1 -1
- package/dist/esm/view/InlineCard/common/action-button/index.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/index.js +40 -40
- package/package.json +9 -9
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "44.16.
|
|
7
|
+
packageVersion: "44.16.5" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -596,35 +596,36 @@ var _importWithRetry = /*#__PURE__*/function () {
|
|
|
596
596
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(importFn) {
|
|
597
597
|
var retries,
|
|
598
598
|
interval,
|
|
599
|
-
_args = arguments
|
|
600
|
-
|
|
599
|
+
_args = arguments,
|
|
600
|
+
_t;
|
|
601
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
601
602
|
while (1) switch (_context.prev = _context.next) {
|
|
602
603
|
case 0:
|
|
603
604
|
retries = _args.length > 1 && _args[1] !== undefined ? _args[1] : 2;
|
|
604
605
|
interval = _args.length > 2 && _args[2] !== undefined ? _args[2] : 500;
|
|
605
|
-
_context.prev =
|
|
606
|
-
_context.next =
|
|
606
|
+
_context.prev = 1;
|
|
607
|
+
_context.next = 2;
|
|
607
608
|
return importFn();
|
|
608
|
-
case
|
|
609
|
+
case 2:
|
|
609
610
|
return _context.abrupt("return", _context.sent);
|
|
610
|
-
case
|
|
611
|
-
_context.prev =
|
|
612
|
-
|
|
613
|
-
if (!(
|
|
614
|
-
_context.next =
|
|
611
|
+
case 3:
|
|
612
|
+
_context.prev = 3;
|
|
613
|
+
_t = _context["catch"](1);
|
|
614
|
+
if (!(_t.name === 'ChunkLoadError' && retries > 0)) {
|
|
615
|
+
_context.next = 5;
|
|
615
616
|
break;
|
|
616
617
|
}
|
|
617
|
-
_context.next =
|
|
618
|
+
_context.next = 4;
|
|
618
619
|
return sleep(interval);
|
|
619
|
-
case
|
|
620
|
+
case 4:
|
|
620
621
|
return _context.abrupt("return", _importWithRetry(importFn, retries - 1, interval));
|
|
621
|
-
case
|
|
622
|
-
throw
|
|
623
|
-
case
|
|
622
|
+
case 5:
|
|
623
|
+
throw _t;
|
|
624
|
+
case 6:
|
|
624
625
|
case "end":
|
|
625
626
|
return _context.stop();
|
|
626
627
|
}
|
|
627
|
-
}, _callee, null, [[
|
|
628
|
+
}, _callee, null, [[1, 3]]);
|
|
628
629
|
}));
|
|
629
630
|
return function importWithRetry(_x) {
|
|
630
631
|
return _ref5.apply(this, arguments);
|
|
@@ -634,15 +635,15 @@ export { _importWithRetry as importWithRetry };
|
|
|
634
635
|
export var downloadUrl = /*#__PURE__*/function () {
|
|
635
636
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url) {
|
|
636
637
|
var isIE11, isSafari, iframeName, link, iframe;
|
|
637
|
-
return _regeneratorRuntime.wrap(function
|
|
638
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
638
639
|
while (1) switch (_context2.prev = _context2.next) {
|
|
639
640
|
case 0:
|
|
640
641
|
if (url) {
|
|
641
|
-
_context2.next =
|
|
642
|
+
_context2.next = 1;
|
|
642
643
|
break;
|
|
643
644
|
}
|
|
644
645
|
return _context2.abrupt("return");
|
|
645
|
-
case
|
|
646
|
+
case 1:
|
|
646
647
|
isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
|
|
647
648
|
isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
648
649
|
iframeName = 'media-download-iframe';
|
|
@@ -661,7 +662,7 @@ export var downloadUrl = /*#__PURE__*/function () {
|
|
|
661
662
|
document.body.appendChild(link);
|
|
662
663
|
link.click();
|
|
663
664
|
document.body.removeChild(link);
|
|
664
|
-
case
|
|
665
|
+
case 2:
|
|
665
666
|
case "end":
|
|
666
667
|
return _context2.stop();
|
|
667
668
|
}
|
|
@@ -673,17 +674,17 @@ export var downloadUrl = /*#__PURE__*/function () {
|
|
|
673
674
|
}();
|
|
674
675
|
export var openUrl = /*#__PURE__*/function () {
|
|
675
676
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(url) {
|
|
676
|
-
return _regeneratorRuntime.wrap(function
|
|
677
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
677
678
|
while (1) switch (_context3.prev = _context3.next) {
|
|
678
679
|
case 0:
|
|
679
680
|
if (url) {
|
|
680
|
-
_context3.next =
|
|
681
|
+
_context3.next = 1;
|
|
681
682
|
break;
|
|
682
683
|
}
|
|
683
684
|
return _context3.abrupt("return");
|
|
684
|
-
case
|
|
685
|
+
case 1:
|
|
685
686
|
window.open(url, '_blank', 'noopener=yes');
|
|
686
|
-
case
|
|
687
|
+
case 2:
|
|
687
688
|
case "end":
|
|
688
689
|
return _context3.stop();
|
|
689
690
|
}
|
package/dist/esm/utils/mocks.js
CHANGED
|
@@ -252,14 +252,14 @@ export var fakeFactory = function fakeFactory(implementation, implementationPost
|
|
|
252
252
|
value: // @ts-ignore
|
|
253
253
|
function () {
|
|
254
254
|
var _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url) {
|
|
255
|
-
return _regeneratorRuntime.wrap(function
|
|
255
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
256
256
|
while (1) switch (_context.prev = _context.next) {
|
|
257
257
|
case 0:
|
|
258
|
-
_context.next =
|
|
258
|
+
_context.next = 1;
|
|
259
259
|
return implementation(url);
|
|
260
|
-
case
|
|
260
|
+
case 1:
|
|
261
261
|
return _context.abrupt("return", _context.sent);
|
|
262
|
-
case
|
|
262
|
+
case 2:
|
|
263
263
|
case "end":
|
|
264
264
|
return _context.stop();
|
|
265
265
|
}
|
|
@@ -274,14 +274,14 @@ export var fakeFactory = function fakeFactory(implementation, implementationPost
|
|
|
274
274
|
key: "postData",
|
|
275
275
|
value: function () {
|
|
276
276
|
var _postData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
277
|
-
return _regeneratorRuntime.wrap(function
|
|
277
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
278
278
|
while (1) switch (_context2.prev = _context2.next) {
|
|
279
279
|
case 0:
|
|
280
|
-
_context2.next =
|
|
280
|
+
_context2.next = 1;
|
|
281
281
|
return implementationPost();
|
|
282
|
-
case
|
|
282
|
+
case 1:
|
|
283
283
|
return _context2.abrupt("return", _context2.sent);
|
|
284
|
-
case
|
|
284
|
+
case 2:
|
|
285
285
|
case "end":
|
|
286
286
|
return _context2.stop();
|
|
287
287
|
}
|
|
@@ -296,14 +296,14 @@ export var fakeFactory = function fakeFactory(implementation, implementationPost
|
|
|
296
296
|
key: "prefetchData",
|
|
297
297
|
value: function () {
|
|
298
298
|
var _prefetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
299
|
-
return _regeneratorRuntime.wrap(function
|
|
299
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
300
300
|
while (1) switch (_context3.prev = _context3.next) {
|
|
301
301
|
case 0:
|
|
302
|
-
_context3.next =
|
|
302
|
+
_context3.next = 1;
|
|
303
303
|
return implementationPrefetch();
|
|
304
|
-
case
|
|
304
|
+
case 1:
|
|
305
305
|
return _context3.abrupt("return", _context3.sent);
|
|
306
|
-
case
|
|
306
|
+
case 2:
|
|
307
307
|
case "end":
|
|
308
308
|
return _context3.stop();
|
|
309
309
|
}
|
|
@@ -318,14 +318,14 @@ export var fakeFactory = function fakeFactory(implementation, implementationPost
|
|
|
318
318
|
key: "fetchDataAris",
|
|
319
319
|
value: function () {
|
|
320
320
|
var _fetchDataAris = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(aris) {
|
|
321
|
-
return _regeneratorRuntime.wrap(function
|
|
321
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
322
322
|
while (1) switch (_context4.prev = _context4.next) {
|
|
323
323
|
case 0:
|
|
324
|
-
_context4.next =
|
|
324
|
+
_context4.next = 1;
|
|
325
325
|
return implementationAri(aris);
|
|
326
|
-
case
|
|
326
|
+
case 1:
|
|
327
327
|
return _context4.abrupt("return", _context4.sent);
|
|
328
|
-
case
|
|
328
|
+
case 2:
|
|
329
329
|
case "end":
|
|
330
330
|
return _context4.stop();
|
|
331
331
|
}
|
|
@@ -34,7 +34,7 @@ function _openEmbedModal() {
|
|
|
34
34
|
popupMountPoint,
|
|
35
35
|
Modal,
|
|
36
36
|
_args = arguments;
|
|
37
|
-
return _regeneratorRuntime.wrap(function
|
|
37
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
38
38
|
while (1) switch (_context2.prev = _context2.next) {
|
|
39
39
|
case 0:
|
|
40
40
|
_ref = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
@@ -46,9 +46,9 @@ function _openEmbedModal() {
|
|
|
46
46
|
popupMountPoint.setAttribute('data-testid', 'preview-modal');
|
|
47
47
|
document.body.appendChild(popupMountPoint);
|
|
48
48
|
}
|
|
49
|
-
_context2.next =
|
|
49
|
+
_context2.next = 1;
|
|
50
50
|
return import('./index');
|
|
51
|
-
case
|
|
51
|
+
case 1:
|
|
52
52
|
Modal = _context2.sent;
|
|
53
53
|
ReactDOM.render( /*#__PURE__*/React.createElement(IntlProvider, {
|
|
54
54
|
locale: "en"
|
|
@@ -64,7 +64,7 @@ function _openEmbedModal() {
|
|
|
64
64
|
},
|
|
65
65
|
showModal: true
|
|
66
66
|
}))), popupMountPoint);
|
|
67
|
-
case
|
|
67
|
+
case 2:
|
|
68
68
|
case "end":
|
|
69
69
|
return _context2.stop();
|
|
70
70
|
}
|
|
@@ -25,16 +25,16 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
25
25
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
26
26
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
27
27
|
var handleClick = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
28
|
-
var _action$action, smartLinkActionType, request;
|
|
29
|
-
return _regeneratorRuntime.wrap(function
|
|
28
|
+
var _action$action, smartLinkActionType, request, _t;
|
|
29
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
30
30
|
while (1) switch (_context.prev = _context.next) {
|
|
31
31
|
case 0:
|
|
32
32
|
if (!action) {
|
|
33
|
-
_context.next =
|
|
33
|
+
_context.next = 5;
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
36
36
|
smartLinkActionType = (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.actionType;
|
|
37
|
-
_context.prev =
|
|
37
|
+
_context.prev = 1;
|
|
38
38
|
setIsLoading(true);
|
|
39
39
|
if (smartLinkActionType === 'FollowEntityAction' || smartLinkActionType === 'UnfollowEntityAction') {
|
|
40
40
|
fireEvent('ui.button.clicked.smartLinkFollowButton', {});
|
|
@@ -45,39 +45,39 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
45
45
|
smartLinkActionType: smartLinkActionType
|
|
46
46
|
});
|
|
47
47
|
request = createInvokeRequest(action);
|
|
48
|
-
_context.next =
|
|
48
|
+
_context.next = 2;
|
|
49
49
|
return invoke(request);
|
|
50
|
-
case
|
|
50
|
+
case 2:
|
|
51
51
|
fireEvent('track.smartLinkQuickAction.success', {
|
|
52
52
|
smartLinkActionType: smartLinkActionType
|
|
53
53
|
});
|
|
54
54
|
if (!(action.reload && action.reload.url)) {
|
|
55
|
-
_context.next =
|
|
55
|
+
_context.next = 3;
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
58
|
-
_context.next =
|
|
58
|
+
_context.next = 3;
|
|
59
59
|
return reload(action.reload.url, true, undefined, action.reload.id);
|
|
60
|
-
case
|
|
60
|
+
case 3:
|
|
61
61
|
setIsLoading(false);
|
|
62
62
|
if (onClick) {
|
|
63
63
|
onClick();
|
|
64
64
|
}
|
|
65
|
-
_context.next =
|
|
65
|
+
_context.next = 5;
|
|
66
66
|
break;
|
|
67
|
-
case
|
|
68
|
-
_context.prev =
|
|
69
|
-
|
|
67
|
+
case 4:
|
|
68
|
+
_context.prev = 4;
|
|
69
|
+
_t = _context["catch"](1);
|
|
70
70
|
setIsLoading(false);
|
|
71
71
|
fireEvent('track.smartLinkQuickAction.failed', {
|
|
72
72
|
smartLinkActionType: smartLinkActionType,
|
|
73
|
-
reason: getInvokeFailureReason(
|
|
73
|
+
reason: getInvokeFailureReason(_t)
|
|
74
74
|
});
|
|
75
75
|
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback();
|
|
76
|
-
case
|
|
76
|
+
case 5:
|
|
77
77
|
case "end":
|
|
78
78
|
return _context.stop();
|
|
79
79
|
}
|
|
80
|
-
}, _callee, null, [[
|
|
80
|
+
}, _callee, null, [[1, 4]]);
|
|
81
81
|
})), [action, invoke, onClick, onErrorCallback, reload, fireEvent]);
|
|
82
82
|
return /*#__PURE__*/React.createElement(Action, _extends({}, props, {
|
|
83
83
|
isLoading: isLoading,
|
package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js
CHANGED
|
@@ -24,16 +24,16 @@ export function CopySummaryAction(_ref) {
|
|
|
24
24
|
tooltipMessage = _useState2[0],
|
|
25
25
|
setTooltipMessage = _useState2[1];
|
|
26
26
|
var handleCopySummaryClick = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
27
|
-
return _regeneratorRuntime.wrap(function
|
|
27
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
30
30
|
fireEvent('ui.button.clicked.copySummary', {});
|
|
31
|
-
_context.next =
|
|
31
|
+
_context.next = 1;
|
|
32
32
|
return navigator.clipboard.writeText(content !== null && content !== void 0 ? content : '');
|
|
33
|
-
case
|
|
33
|
+
case 1:
|
|
34
34
|
setTooltipMessage(messages.copied_summary_action_description);
|
|
35
35
|
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
36
|
-
case
|
|
36
|
+
case 2:
|
|
37
37
|
case "end":
|
|
38
38
|
return _context.stop();
|
|
39
39
|
}
|
|
@@ -68,16 +68,16 @@ export function CopySummaryActionNew(_ref3) {
|
|
|
68
68
|
tooltipMessage = _useState4[0],
|
|
69
69
|
setTooltipMessage = _useState4[1];
|
|
70
70
|
var handleCopySummaryClick = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
71
|
-
return _regeneratorRuntime.wrap(function
|
|
71
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
72
72
|
while (1) switch (_context2.prev = _context2.next) {
|
|
73
73
|
case 0:
|
|
74
74
|
fireEvent('ui.button.clicked.copySummary', {});
|
|
75
|
-
_context2.next =
|
|
75
|
+
_context2.next = 1;
|
|
76
76
|
return navigator.clipboard.writeText(summary);
|
|
77
|
-
case
|
|
77
|
+
case 1:
|
|
78
78
|
setTooltipMessage(messages.copied_summary_action_description);
|
|
79
79
|
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
80
|
-
case
|
|
80
|
+
case 2:
|
|
81
81
|
case "end":
|
|
82
82
|
return _context2.stop();
|
|
83
83
|
}
|
|
@@ -26,7 +26,7 @@ export var createStubInvokeManuallyTriggeredRule = function createStubInvokeManu
|
|
|
26
26
|
return /*#__PURE__*/function () {
|
|
27
27
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_env, _site, _ruleId, objects, _inputs) {
|
|
28
28
|
var response;
|
|
29
|
-
return _regeneratorRuntime.wrap(function
|
|
29
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
30
30
|
while (1) switch (_context.prev = _context.next) {
|
|
31
31
|
case 0:
|
|
32
32
|
response = objects.reduce(function (acc, current) {
|
|
@@ -35,7 +35,7 @@ export var createStubInvokeManuallyTriggeredRule = function createStubInvokeManu
|
|
|
35
35
|
return _context.abrupt("return", responseDelay ? new Promise(function (resolve) {
|
|
36
36
|
return setTimeout(resolve, responseDelay);
|
|
37
37
|
}) : Promise.resolve(response));
|
|
38
|
-
case
|
|
38
|
+
case 1:
|
|
39
39
|
case "end":
|
|
40
40
|
return _context.stop();
|
|
41
41
|
}
|
|
@@ -47,14 +47,14 @@ export var extractCloudIdAndProductFromSite = function extractCloudIdAndProductF
|
|
|
47
47
|
export var getSearchUrl = /*#__PURE__*/function () {
|
|
48
48
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(site) {
|
|
49
49
|
var _extractCloudIdAndPro, product, cloudId;
|
|
50
|
-
return _regeneratorRuntime.wrap(function
|
|
50
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
51
51
|
while (1) switch (_context.prev = _context.next) {
|
|
52
52
|
case 0:
|
|
53
53
|
_extractCloudIdAndPro = extractCloudIdAndProductFromSite(site), product = _extractCloudIdAndPro.product, cloudId = _extractCloudIdAndPro.cloudId; // TODO in the unified API, GET requests as according to Atlassian API standards will destructure the whole query into
|
|
54
54
|
// query parameters as part of the URL. For now, this is considered a POST request instead and thus the query is used
|
|
55
55
|
// later on as the request body.
|
|
56
56
|
return _context.abrupt("return", "/gateway/api/automation/public/".concat(product, "/").concat(cloudId, "/rest/v1/rule/manual/search"));
|
|
57
|
-
case
|
|
57
|
+
case 1:
|
|
58
58
|
case "end":
|
|
59
59
|
return _context.stop();
|
|
60
60
|
}
|
|
@@ -67,12 +67,12 @@ export var getSearchUrl = /*#__PURE__*/function () {
|
|
|
67
67
|
export var getInvocationUrl = /*#__PURE__*/function () {
|
|
68
68
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(site, ruleId) {
|
|
69
69
|
var _extractCloudIdAndPro2, product, cloudId;
|
|
70
|
-
return _regeneratorRuntime.wrap(function
|
|
70
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
71
71
|
while (1) switch (_context2.prev = _context2.next) {
|
|
72
72
|
case 0:
|
|
73
73
|
_extractCloudIdAndPro2 = extractCloudIdAndProductFromSite(site), product = _extractCloudIdAndPro2.product, cloudId = _extractCloudIdAndPro2.cloudId;
|
|
74
74
|
return _context2.abrupt("return", "/gateway/api/automation/public/".concat(product, "/").concat(cloudId, "/rest/v1/rule/manual/").concat(ruleId, "/invocation"));
|
|
75
|
-
case
|
|
75
|
+
case 1:
|
|
76
76
|
case "end":
|
|
77
77
|
return _context2.stop();
|
|
78
78
|
}
|
|
@@ -88,19 +88,19 @@ var DEFAULT_HEADER = {
|
|
|
88
88
|
var _performRequest = /*#__PURE__*/function () {
|
|
89
89
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(url, method, options) {
|
|
90
90
|
var response;
|
|
91
|
-
return _regeneratorRuntime.wrap(function
|
|
91
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
92
92
|
while (1) switch (_context3.prev = _context3.next) {
|
|
93
93
|
case 0:
|
|
94
|
-
_context3.next =
|
|
94
|
+
_context3.next = 1;
|
|
95
95
|
return fetch(url, _objectSpread(_objectSpread({
|
|
96
96
|
headers: DEFAULT_HEADER
|
|
97
97
|
}, options), {}, {
|
|
98
98
|
method: method
|
|
99
99
|
}));
|
|
100
|
-
case
|
|
100
|
+
case 1:
|
|
101
101
|
response = _context3.sent;
|
|
102
102
|
return _context3.abrupt("return", response.json());
|
|
103
|
-
case
|
|
103
|
+
case 2:
|
|
104
104
|
case "end":
|
|
105
105
|
return _context3.stop();
|
|
106
106
|
}
|
|
@@ -112,7 +112,7 @@ var _performRequest = /*#__PURE__*/function () {
|
|
|
112
112
|
}();
|
|
113
113
|
export var performGetRequest = /*#__PURE__*/function () {
|
|
114
114
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(url, options) {
|
|
115
|
-
return _regeneratorRuntime.wrap(function
|
|
115
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
116
116
|
while (1) switch (_context4.prev = _context4.next) {
|
|
117
117
|
case 0:
|
|
118
118
|
return _context4.abrupt("return", _performRequest(url, 'GET', options));
|
|
@@ -128,7 +128,7 @@ export var performGetRequest = /*#__PURE__*/function () {
|
|
|
128
128
|
}();
|
|
129
129
|
export var performPostRequest = /*#__PURE__*/function () {
|
|
130
130
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url, options) {
|
|
131
|
-
return _regeneratorRuntime.wrap(function
|
|
131
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
132
132
|
while (1) switch (_context5.prev = _context5.next) {
|
|
133
133
|
case 0:
|
|
134
134
|
return _context5.abrupt("return", _performRequest(url, 'POST', options));
|
|
@@ -37,34 +37,34 @@ export var useManualRules = function useManualRules(site, query) {
|
|
|
37
37
|
};
|
|
38
38
|
var triggerFetch = /*#__PURE__*/function () {
|
|
39
39
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
40
|
-
var fetchedRules;
|
|
41
|
-
return _regeneratorRuntime.wrap(function
|
|
40
|
+
var fetchedRules, _t;
|
|
41
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
42
42
|
while (1) switch (_context.prev = _context.next) {
|
|
43
43
|
case 0:
|
|
44
44
|
setInitialised(false);
|
|
45
45
|
_context.prev = 1;
|
|
46
|
-
_context.next =
|
|
46
|
+
_context.next = 2;
|
|
47
47
|
return searchManuallyTriggeredRules(site, query);
|
|
48
|
-
case
|
|
48
|
+
case 2:
|
|
49
49
|
fetchedRules = _context.sent;
|
|
50
50
|
setError(null);
|
|
51
51
|
setRules(transformRules(fetchedRules));
|
|
52
|
-
_context.next =
|
|
52
|
+
_context.next = 4;
|
|
53
53
|
break;
|
|
54
|
-
case
|
|
55
|
-
_context.prev =
|
|
56
|
-
|
|
57
|
-
setError(
|
|
54
|
+
case 3:
|
|
55
|
+
_context.prev = 3;
|
|
56
|
+
_t = _context["catch"](1);
|
|
57
|
+
setError(_t);
|
|
58
58
|
setRules([]);
|
|
59
|
-
case
|
|
60
|
-
_context.prev =
|
|
59
|
+
case 4:
|
|
60
|
+
_context.prev = 4;
|
|
61
61
|
setInitialised(true);
|
|
62
|
-
return _context.finish(
|
|
63
|
-
case
|
|
62
|
+
return _context.finish(4);
|
|
63
|
+
case 5:
|
|
64
64
|
case "end":
|
|
65
65
|
return _context.stop();
|
|
66
66
|
}
|
|
67
|
-
}, _callee, null, [[1,
|
|
67
|
+
}, _callee, null, [[1, 3, 4, 5]]);
|
|
68
68
|
}));
|
|
69
69
|
return function triggerFetch() {
|
|
70
70
|
return _ref.apply(this, arguments);
|
|
@@ -152,23 +152,23 @@ export var ManualRulesContainer = function ManualRulesContainer(props) {
|
|
|
152
152
|
};
|
|
153
153
|
var invokeRule = /*#__PURE__*/function () {
|
|
154
154
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(ruleId, objects, userInputs) {
|
|
155
|
-
var rule, response, failedObjects, successfulObjects;
|
|
156
|
-
return _regeneratorRuntime.wrap(function
|
|
155
|
+
var rule, response, failedObjects, successfulObjects, _t2;
|
|
156
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
157
157
|
while (1) switch (_context2.prev = _context2.next) {
|
|
158
158
|
case 0:
|
|
159
159
|
rule = getRule(ruleId);
|
|
160
160
|
if (!rule) {
|
|
161
|
-
_context2.next =
|
|
161
|
+
_context2.next = 5;
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
164
|
setInvokingRuleId(ruleId);
|
|
165
|
-
_context2.prev =
|
|
165
|
+
_context2.prev = 1;
|
|
166
166
|
if (onRuleInvocationLifecycleStarted) {
|
|
167
167
|
onRuleInvocationLifecycleStarted(ruleId, objects, userInputs);
|
|
168
168
|
}
|
|
169
|
-
_context2.next =
|
|
169
|
+
_context2.next = 2;
|
|
170
170
|
return invokeManuallyTriggeredRule(site, ruleId, objects, userInputs);
|
|
171
|
-
case
|
|
171
|
+
case 2:
|
|
172
172
|
response = _context2.sent;
|
|
173
173
|
failedObjects = getFailedObjects(response);
|
|
174
174
|
setInvokingRuleId(null);
|
|
@@ -180,28 +180,28 @@ export var ManualRulesContainer = function ManualRulesContainer(props) {
|
|
|
180
180
|
successfulObjects = getSuccessfulObjects(response);
|
|
181
181
|
handleInvocationFailure(ruleId, successfulObjects, failedObjects);
|
|
182
182
|
}
|
|
183
|
-
_context2.next =
|
|
183
|
+
_context2.next = 4;
|
|
184
184
|
break;
|
|
185
|
-
case
|
|
186
|
-
_context2.prev =
|
|
187
|
-
|
|
185
|
+
case 3:
|
|
186
|
+
_context2.prev = 3;
|
|
187
|
+
_t2 = _context2["catch"](1);
|
|
188
188
|
handleInvocationFailure(ruleId, [], objects);
|
|
189
189
|
setInvokingRuleId(null);
|
|
190
|
-
case
|
|
191
|
-
_context2.next =
|
|
190
|
+
case 4:
|
|
191
|
+
_context2.next = 6;
|
|
192
192
|
break;
|
|
193
|
-
case
|
|
193
|
+
case 5:
|
|
194
194
|
handleInvocationFailure(ruleId, [], objects);
|
|
195
|
-
case
|
|
195
|
+
case 6:
|
|
196
196
|
clearSelectedRule();
|
|
197
197
|
if (onRuleInvocationLifecycleDone) {
|
|
198
198
|
onRuleInvocationLifecycleDone(ruleId, objects);
|
|
199
199
|
}
|
|
200
|
-
case
|
|
200
|
+
case 7:
|
|
201
201
|
case "end":
|
|
202
202
|
return _context2.stop();
|
|
203
203
|
}
|
|
204
|
-
}, _callee2, null, [[
|
|
204
|
+
}, _callee2, null, [[1, 3]]);
|
|
205
205
|
}));
|
|
206
206
|
return function invokeRule(_x, _x2, _x3) {
|
|
207
207
|
return _ref2.apply(this, arguments);
|
|
@@ -14,18 +14,18 @@ import { getInvocationUrl, getSearchUrl, performPostRequest } from '../common/ut
|
|
|
14
14
|
export var searchManuallyTriggeredRules = /*#__PURE__*/function () {
|
|
15
15
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(site, query) {
|
|
16
16
|
var url, response;
|
|
17
|
-
return _regeneratorRuntime.wrap(function
|
|
17
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
18
18
|
while (1) switch (_context.prev = _context.next) {
|
|
19
19
|
case 0:
|
|
20
|
-
_context.next =
|
|
20
|
+
_context.next = 1;
|
|
21
21
|
return getSearchUrl(site);
|
|
22
|
-
case
|
|
22
|
+
case 1:
|
|
23
23
|
url = _context.sent;
|
|
24
|
-
_context.next =
|
|
24
|
+
_context.next = 2;
|
|
25
25
|
return performPostRequest(url, {
|
|
26
26
|
body: JSON.stringify(query)
|
|
27
27
|
});
|
|
28
|
-
case
|
|
28
|
+
case 2:
|
|
29
29
|
response = _context.sent;
|
|
30
30
|
return _context.abrupt("return", response.data.reduce(function (acc, _ref2) {
|
|
31
31
|
var id = _ref2.id,
|
|
@@ -39,7 +39,7 @@ export var searchManuallyTriggeredRules = /*#__PURE__*/function () {
|
|
|
39
39
|
userInputPrompts: userInputs
|
|
40
40
|
}));
|
|
41
41
|
}, {}));
|
|
42
|
-
case
|
|
42
|
+
case 3:
|
|
43
43
|
case "end":
|
|
44
44
|
return _context.stop();
|
|
45
45
|
}
|
|
@@ -60,12 +60,12 @@ export var searchManuallyTriggeredRules = /*#__PURE__*/function () {
|
|
|
60
60
|
export var invokeManuallyTriggeredRule = /*#__PURE__*/function () {
|
|
61
61
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(site, ruleId, objects, userInputs) {
|
|
62
62
|
var url, bodyRaw;
|
|
63
|
-
return _regeneratorRuntime.wrap(function
|
|
63
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
64
64
|
while (1) switch (_context2.prev = _context2.next) {
|
|
65
65
|
case 0:
|
|
66
|
-
_context2.next =
|
|
66
|
+
_context2.next = 1;
|
|
67
67
|
return getInvocationUrl(site, ruleId);
|
|
68
|
-
case
|
|
68
|
+
case 1:
|
|
69
69
|
url = _context2.sent;
|
|
70
70
|
bodyRaw = {
|
|
71
71
|
objects: objects
|
|
@@ -76,7 +76,7 @@ export var invokeManuallyTriggeredRule = /*#__PURE__*/function () {
|
|
|
76
76
|
return _context2.abrupt("return", performPostRequest(url, {
|
|
77
77
|
body: JSON.stringify(bodyRaw)
|
|
78
78
|
}));
|
|
79
|
-
case
|
|
79
|
+
case 2:
|
|
80
80
|
case "end":
|
|
81
81
|
return _context2.stop();
|
|
82
82
|
}
|
|
@@ -36,14 +36,14 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
|
|
|
36
36
|
actionFn: function () {
|
|
37
37
|
var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
38
38
|
var _data$invokeAction;
|
|
39
|
-
return _regeneratorRuntime.wrap(function
|
|
39
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
40
40
|
while (1) switch (_context.prev = _context.next) {
|
|
41
41
|
case 0:
|
|
42
|
-
_context.next =
|
|
42
|
+
_context.next = 1;
|
|
43
43
|
return (_data$invokeAction = data.invokeAction) === null || _data$invokeAction === void 0 ? void 0 : _data$invokeAction.actionFn();
|
|
44
|
-
case
|
|
44
|
+
case 1:
|
|
45
45
|
setTooltipMessage(messages.copied_url_to_clipboard);
|
|
46
|
-
case
|
|
46
|
+
case 2:
|
|
47
47
|
case "end":
|
|
48
48
|
return _context.stop();
|
|
49
49
|
}
|
|
@@ -370,7 +370,7 @@ var RovoChatAction = function RovoChatAction(_ref2) {
|
|
|
370
370
|
invoke(_objectSpread(_objectSpread({}, data === null || data === void 0 ? void 0 : data.invokeAction), {}, {
|
|
371
371
|
actionFn: function () {
|
|
372
372
|
var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
373
|
-
return _regeneratorRuntime.wrap(function
|
|
373
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
374
374
|
while (1) switch (_context.prev = _context.next) {
|
|
375
375
|
case 0:
|
|
376
376
|
return _context.abrupt("return", sendPromptMessage(promptData));
|