@atlaskit/smart-card 26.50.15 → 26.52.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 +23 -0
- package/dist/cjs/extractors/common/context/extractAccessContext.js +28 -67
- package/dist/cjs/extractors/common/context/index.js +2 -2
- package/dist/cjs/extractors/flexible/actions/index.js +5 -2
- package/dist/cjs/extractors/flexible/index.js +1 -5
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/index.js +7 -3
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +3 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +0 -1
- package/dist/cjs/view/FlexibleCard/components/actions/download-action/index.js +76 -0
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +8 -9
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +9 -8
- package/dist/cjs/view/FlexibleCard/components/actions/utils.js +0 -13
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +41 -26
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +0 -8
- package/dist/cjs/view/FlexibleCard/components/elements/snippet-element/index.js +7 -3
- package/dist/cjs/view/FlexibleCard/utils.js +4 -4
- package/dist/cjs/view/HoverCard/components/ContentContainer.js +1 -0
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/ai-summary/index.js +5 -1
- package/dist/es2019/extractors/common/context/extractAccessContext.js +26 -68
- package/dist/es2019/extractors/common/context/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/index.js +6 -2
- package/dist/es2019/extractors/flexible/index.js +1 -5
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/index.js +9 -4
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +3 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +0 -1
- package/dist/es2019/view/FlexibleCard/components/actions/download-action/index.js +47 -0
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +7 -5
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +1 -7
- package/dist/es2019/view/FlexibleCard/components/actions/utils.js +0 -14
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +43 -22
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +0 -8
- package/dist/es2019/view/FlexibleCard/components/elements/snippet-element/index.js +7 -4
- package/dist/es2019/view/FlexibleCard/utils.js +5 -5
- package/dist/es2019/view/HoverCard/components/ContentContainer.js +1 -0
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +1 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-summary/index.js +5 -1
- package/dist/esm/extractors/common/context/extractAccessContext.js +27 -66
- package/dist/esm/extractors/common/context/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/index.js +5 -2
- package/dist/esm/extractors/flexible/index.js +1 -5
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/index.js +8 -4
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +3 -2
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +0 -1
- package/dist/esm/view/FlexibleCard/components/actions/download-action/index.js +66 -0
- package/dist/esm/view/FlexibleCard/components/actions/download-action/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +9 -7
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/index.js +1 -7
- package/dist/esm/view/FlexibleCard/components/actions/utils.js +0 -13
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +41 -26
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +0 -8
- package/dist/esm/view/FlexibleCard/components/elements/snippet-element/index.js +7 -3
- package/dist/esm/view/FlexibleCard/utils.js +5 -5
- package/dist/esm/view/HoverCard/components/ContentContainer.js +1 -0
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +1 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/ai-summary/index.js +5 -1
- package/dist/types/__fixtures__/dropbox-file.d.ts +3 -0
- package/dist/types/extractors/common/context/extractAccessContext.d.ts +1 -6
- package/dist/types/extractors/common/context/index.d.ts +1 -1
- package/dist/types/extractors/flexible/actions/index.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +2 -12
- package/dist/types/view/FlexibleCard/components/actions/download-action/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/download-action/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/follow-action/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/actions/follow-action/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -7
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +11 -2
- package/dist/types-ts4.5/__fixtures__/dropbox-file.d.ts +3 -0
- package/dist/types-ts4.5/extractors/common/context/extractAccessContext.d.ts +1 -6
- package/dist/types-ts4.5/extractors/common/context/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +2 -12
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/download-action/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/download-action/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/index.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -7
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +11 -2
- package/package.json +4 -4
- package/dist/cjs/view/FlexibleCard/components/actions/action/download-action/index.js +0 -72
- package/dist/es2019/view/FlexibleCard/components/actions/action/download-action/index.js +0 -47
- package/dist/esm/view/FlexibleCard/components/actions/action/download-action/index.js +0 -65
- package/dist/types/view/FlexibleCard/components/actions/action/download-action/index.d.ts +0 -4
- package/dist/types/view/FlexibleCard/components/actions/action/download-action/types.d.ts +0 -5
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/download-action/index.d.ts +0 -4
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/download-action/types.d.ts +0 -5
- /package/dist/cjs/view/FlexibleCard/components/actions/{action/download-action → download-action}/types.js +0 -0
- /package/dist/es2019/view/FlexibleCard/components/actions/{action/download-action → download-action}/types.js +0 -0
- /package/dist/{esm/view/FlexibleCard/components/actions/action/download-action → es2019/view/FlexibleCard/components/actions/follow-action}/types.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SmartLinkStatus } from '../../constants';
|
|
2
2
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
3
|
-
import {
|
|
3
|
+
import { extractRequestAccessContextImproved } from '../../extractors/common/context';
|
|
4
4
|
import { messages } from '../../messages';
|
|
5
5
|
import extractFlexibleUiContext from '../../extractors/flexible';
|
|
6
6
|
import { extractErrorIcon } from '../../extractors/flexible/icon';
|
|
@@ -60,7 +60,7 @@ const getForbiddenMessageKey = meta => {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
export const getRetryOptions = (url, status, response, onAuthorize) => {
|
|
63
|
-
var _response$meta, _access$action;
|
|
63
|
+
var _response$meta, _access$action, _access$buttonDisable;
|
|
64
64
|
const data = response && response.data || getEmptyJsonLd();
|
|
65
65
|
const provider = extractProvider(data);
|
|
66
66
|
const context = provider === null || provider === void 0 ? void 0 : provider.text;
|
|
@@ -70,15 +70,15 @@ export const getRetryOptions = (url, status, response, onAuthorize) => {
|
|
|
70
70
|
switch (status) {
|
|
71
71
|
case SmartLinkStatus.Forbidden:
|
|
72
72
|
const meta = (_response$meta = response === null || response === void 0 ? void 0 : response.meta) !== null && _response$meta !== void 0 ? _response$meta : getForbiddenJsonLd().meta;
|
|
73
|
-
const access =
|
|
73
|
+
const access = extractRequestAccessContextImproved({
|
|
74
74
|
jsonLd: meta,
|
|
75
75
|
url,
|
|
76
|
-
product: context
|
|
76
|
+
product: context !== null && context !== void 0 ? context : ''
|
|
77
77
|
});
|
|
78
78
|
const messageKey = getForbiddenMessageKey(meta);
|
|
79
79
|
const descriptor = messages[messageKey];
|
|
80
80
|
const retry = onAuthorize || (access === null || access === void 0 ? void 0 : (_access$action = access.action) === null || _access$action === void 0 ? void 0 : _access$action.promise);
|
|
81
|
-
const onClick = retry ? handleOnClick(retry) : undefined;
|
|
81
|
+
const onClick = retry && !((_access$buttonDisable = access === null || access === void 0 ? void 0 : access.buttonDisabled) !== null && _access$buttonDisable !== void 0 ? _access$buttonDisable : false) ? handleOnClick(retry) : undefined;
|
|
82
82
|
return {
|
|
83
83
|
descriptor,
|
|
84
84
|
onClick,
|
|
@@ -9,6 +9,7 @@ import { hoverCardClassName } from './HoverCardContent';
|
|
|
9
9
|
import { useAISummary } from '../../../state/hooks/use-ai-summary';
|
|
10
10
|
import { useSmartCardState } from '../../../state/store';
|
|
11
11
|
import { extractAri, extractLink } from '@atlaskit/link-extractors';
|
|
12
|
+
import { di } from 'react-magnetic-di';
|
|
12
13
|
const ConnectedAIPrismContainer = ({
|
|
13
14
|
children,
|
|
14
15
|
isAIEnabled = false,
|
|
@@ -14,6 +14,7 @@ import { getCanBeDatasource } from '../../../../../state/helpers';
|
|
|
14
14
|
import { useAISummary } from '../../../../../state/hooks/use-ai-summary';
|
|
15
15
|
import { extractAri, extractLink } from '@atlaskit/link-extractors';
|
|
16
16
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
17
|
+
import { di } from 'react-magnetic-di';
|
|
17
18
|
export const toFooterActions = (cardActions, onActionClick) => {
|
|
18
19
|
const followAction = {
|
|
19
20
|
hideIcon: true,
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.
|
|
10
|
+
packageVersion: "26.52.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -13,7 +13,11 @@ const AISummaryCSSStyles = css({
|
|
|
13
13
|
fontSize: '0.75rem',
|
|
14
14
|
lineHeight: '1rem',
|
|
15
15
|
wordWrap: 'break-word',
|
|
16
|
-
whiteSpace: 'normal'
|
|
16
|
+
whiteSpace: 'normal',
|
|
17
|
+
WebkitUserSelect: 'text',
|
|
18
|
+
MozUserSelect: 'text',
|
|
19
|
+
MsUserSelect: 'text',
|
|
20
|
+
userSelect: 'text'
|
|
17
21
|
});
|
|
18
22
|
/**
|
|
19
23
|
* A component to render a response from AI in markdown text.
|
|
@@ -5,73 +5,30 @@ import { messages } from '../../../messages';
|
|
|
5
5
|
import { ForbiddenAction } from '../../../view/BlockCard/actions/ForbiddenAction';
|
|
6
6
|
import extractHostname from '../hostname/extractHostname';
|
|
7
7
|
import { ANALYTICS_CHANNEL } from '../../../utils/analytics';
|
|
8
|
-
export var
|
|
8
|
+
export var extractRequestAccessContextImproved = function extractRequestAccessContextImproved(_ref) {
|
|
9
9
|
var _jsonLd$requestAccess;
|
|
10
10
|
var jsonLd = _ref.jsonLd,
|
|
11
11
|
url = _ref.url,
|
|
12
|
-
product = _ref.product
|
|
12
|
+
product = _ref.product,
|
|
13
|
+
createAnalyticsEvent = _ref.createAnalyticsEvent;
|
|
13
14
|
var requestAccess = jsonLd !== null && jsonLd !== void 0 && jsonLd.requestAccess ? _objectSpread(_objectSpread({}, jsonLd === null || jsonLd === void 0 ? void 0 : jsonLd.requestAccess), {}, {
|
|
14
15
|
hostname: extractHostname(url)
|
|
15
16
|
}) : undefined;
|
|
16
17
|
switch (jsonLd === null || jsonLd === void 0 || (_jsonLd$requestAccess = jsonLd.requestAccess) === null || _jsonLd$requestAccess === void 0 ? void 0 : _jsonLd$requestAccess.accessType) {
|
|
17
|
-
case 'DIRECT_ACCESS':
|
|
18
|
-
return _objectSpread(_objectSpread({}, requestAccess), {}, {
|
|
19
|
-
callToActionMessageKey: 'click_to_join',
|
|
20
|
-
descriptiveMessageKey: 'click_to_join_description',
|
|
21
|
-
action: ForbiddenAction(function () {
|
|
22
|
-
return window.open(url);
|
|
23
|
-
}, 'click_to_join', messages.click_to_join, {
|
|
24
|
-
context: product
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
case 'REQUEST_ACCESS':
|
|
28
|
-
return _objectSpread(_objectSpread({}, requestAccess), {}, {
|
|
29
|
-
callToActionMessageKey: 'request_access',
|
|
30
|
-
descriptiveMessageKey: 'request_access_description',
|
|
31
|
-
action: ForbiddenAction(function () {
|
|
32
|
-
return window.open(url);
|
|
33
|
-
}, 'request_access', messages.request_access, {
|
|
34
|
-
product: product
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
case 'PENDING_REQUEST_EXISTS':
|
|
38
|
-
return _objectSpread(_objectSpread({}, requestAccess), {}, {
|
|
39
|
-
descriptiveMessageKey: 'request_access_pending_description'
|
|
40
|
-
});
|
|
41
|
-
case 'FORBIDDEN':
|
|
42
|
-
return _objectSpread(_objectSpread({}, requestAccess), {}, {
|
|
43
|
-
descriptiveMessageKey: 'forbidden_description'
|
|
44
|
-
});
|
|
45
|
-
case 'DENIED_REQUEST_EXISTS':
|
|
46
|
-
return _objectSpread(_objectSpread({}, requestAccess), {}, {
|
|
47
|
-
descriptiveMessageKey: 'request_denied_description'
|
|
48
|
-
});
|
|
49
|
-
default:
|
|
50
|
-
return requestAccess;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
export var extractRequestAccessContextImproved = function extractRequestAccessContextImproved(_ref2) {
|
|
54
|
-
var _jsonLd$requestAccess2;
|
|
55
|
-
var jsonLd = _ref2.jsonLd,
|
|
56
|
-
url = _ref2.url,
|
|
57
|
-
product = _ref2.product,
|
|
58
|
-
createAnalyticsEvent = _ref2.createAnalyticsEvent;
|
|
59
|
-
var requestAccess = jsonLd !== null && jsonLd !== void 0 && jsonLd.requestAccess ? _objectSpread(_objectSpread({}, jsonLd === null || jsonLd === void 0 ? void 0 : jsonLd.requestAccess), {}, {
|
|
60
|
-
hostname: extractHostname(url)
|
|
61
|
-
}) : undefined;
|
|
62
|
-
switch (jsonLd === null || jsonLd === void 0 || (_jsonLd$requestAccess2 = jsonLd.requestAccess) === null || _jsonLd$requestAccess2 === void 0 ? void 0 : _jsonLd$requestAccess2.accessType) {
|
|
63
18
|
case 'DIRECT_ACCESS':
|
|
64
19
|
return _objectSpread(_objectSpread({}, requestAccess), {}, {
|
|
65
20
|
titleMessageKey: 'direct_access_title',
|
|
66
21
|
descriptiveMessageKey: 'direct_access_description',
|
|
67
22
|
callToActionMessageKey: 'direct_access',
|
|
68
23
|
action: ForbiddenAction(function () {
|
|
69
|
-
createAnalyticsEvent
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
24
|
+
if (createAnalyticsEvent !== undefined) {
|
|
25
|
+
createAnalyticsEvent({
|
|
26
|
+
action: 'clicked',
|
|
27
|
+
actionSubject: 'button',
|
|
28
|
+
actionSubjectId: 'crossJoin',
|
|
29
|
+
eventType: 'ui'
|
|
30
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
31
|
+
}
|
|
75
32
|
window.open(url);
|
|
76
33
|
}, 'direct_access', messages.direct_access, {
|
|
77
34
|
product: product
|
|
@@ -83,12 +40,14 @@ export var extractRequestAccessContextImproved = function extractRequestAccessCo
|
|
|
83
40
|
descriptiveMessageKey: 'request_access_description',
|
|
84
41
|
callToActionMessageKey: 'request_access',
|
|
85
42
|
action: ForbiddenAction(function () {
|
|
86
|
-
createAnalyticsEvent
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
43
|
+
if (createAnalyticsEvent !== undefined) {
|
|
44
|
+
createAnalyticsEvent({
|
|
45
|
+
action: 'clicked',
|
|
46
|
+
actionSubject: 'button',
|
|
47
|
+
actionSubjectId: 'requestAccess',
|
|
48
|
+
eventType: 'ui'
|
|
49
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
50
|
+
}
|
|
92
51
|
window.open(url);
|
|
93
52
|
}, 'request_access', messages.request_access)
|
|
94
53
|
});
|
|
@@ -119,12 +78,14 @@ export var extractRequestAccessContextImproved = function extractRequestAccessCo
|
|
|
119
78
|
descriptiveMessageKey: 'access_exists_description',
|
|
120
79
|
callToActionMessageKey: 'request_access',
|
|
121
80
|
action: ForbiddenAction(function () {
|
|
122
|
-
createAnalyticsEvent
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
81
|
+
if (createAnalyticsEvent !== undefined) {
|
|
82
|
+
createAnalyticsEvent({
|
|
83
|
+
action: 'clicked',
|
|
84
|
+
actionSubject: 'button',
|
|
85
|
+
actionSubjectId: 'requestAccess',
|
|
86
|
+
eventType: 'ui'
|
|
87
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
88
|
+
}
|
|
128
89
|
window.open(url);
|
|
129
90
|
}, 'access_exists', messages.request_access)
|
|
130
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { extractRequestAccessContextImproved } from './extractAccessContext';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { ActionName } from '../../../constants';
|
|
3
|
+
import { extractDownloadAction } from './extract-download-action';
|
|
3
4
|
import { extractPreviewAction } from './extract-preview-action';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import extractFollowAction from './extract-follow-action';
|
|
6
|
+
var extractActions = function extractActions(response, data, actionOptions, id) {
|
|
7
|
+
var _action;
|
|
8
|
+
var action = (_action = {}, _defineProperty(_action, ActionName.PreviewAction, extractPreviewAction(response, actionOptions)), _defineProperty(_action, ActionName.DownloadAction, extractDownloadAction(data, actionOptions)), _defineProperty(_action, ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), _action);
|
|
6
9
|
return Object.values(action).some(function (value) {
|
|
7
10
|
return Boolean(value);
|
|
8
11
|
}) ? action : undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { extractSummary } from '../common/primitives';
|
|
2
2
|
import extractActions from './actions';
|
|
3
|
-
import extractFollowAction from './actions/extract-follow-action';
|
|
4
3
|
import { extractLinkIcon } from './icon';
|
|
5
4
|
import { extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn, extractLocation, extractOwnedBy, extractAssignedTo, extractSubTasksProgress, extractStoryPoints, extractReadTime, extractSentOn, extractPersonAssignedToAsArray } from './utils';
|
|
6
5
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
@@ -10,7 +9,6 @@ import extractProviderIcon from './icon/extract-provider-icon';
|
|
|
10
9
|
import extractPreview from './extract-preview';
|
|
11
10
|
import extractState from './extract-state';
|
|
12
11
|
import { extractLatestCommit } from './latest-commit';
|
|
13
|
-
import { extractDownloadAction } from './actions/extract-download-action';
|
|
14
12
|
import { extractViewAction } from './actions/extract-view-action';
|
|
15
13
|
var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
16
14
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
@@ -24,7 +22,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
24
22
|
var data = response.data;
|
|
25
23
|
var url = extractLink(data);
|
|
26
24
|
return {
|
|
27
|
-
actions: extractActions(response, actionOptions),
|
|
25
|
+
actions: extractActions(response, data, actionOptions, id),
|
|
28
26
|
assignedToGroup: extractPersonAssignedToAsArray(data),
|
|
29
27
|
attachmentCount: extractAttachmentCount(data),
|
|
30
28
|
authorGroup: extractPersonCreatedBy(data),
|
|
@@ -40,9 +38,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
40
38
|
assignedTo: extractAssignedTo(data),
|
|
41
39
|
createdOn: extractDateCreated(data),
|
|
42
40
|
dueOn: extractDueOn(data),
|
|
43
|
-
followAction: extractFollowAction(response, actionOptions, id),
|
|
44
41
|
viewAction: extractViewAction(data, actionOptions),
|
|
45
|
-
downloadAction: extractDownloadAction(data, actionOptions),
|
|
46
42
|
latestCommit: extractLatestCommit(data),
|
|
47
43
|
linkIcon: extractLinkIcon(response, renderers),
|
|
48
44
|
location: extractLocation(data),
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.
|
|
18
|
+
packageVersion: "26.52.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
|
|
4
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
5
|
import { getExtensionKey } from '../../state/helpers';
|
|
5
6
|
import { extractBlockProps } from '../../extractors/block';
|
|
6
7
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
7
|
-
import {
|
|
8
|
+
import { extractRequestAccessContextImproved } from '../../extractors/common/context';
|
|
8
9
|
import { CardLinkView } from '../LinkView';
|
|
9
10
|
import { AuthorizeAction } from './actions/AuthorizeAction';
|
|
10
11
|
import { ForbiddenAction } from './actions/ForbiddenAction';
|
|
@@ -24,7 +25,7 @@ import { handleClickCommon } from './utils/handlers';
|
|
|
24
25
|
export { default as PreviewAction } from './actions/PreviewAction';
|
|
25
26
|
export { ForbiddenAction, AuthorizeAction, BlockCardResolvedView, BlockCardResolvingView, BlockCardUnauthorisedView, BlockCardForbiddenView, BlockCardErroredView, BlockCardNotFoundView };
|
|
26
27
|
export var BlockCard = function BlockCard(_ref) {
|
|
27
|
-
var _details$meta, _forbiddenViewProps$c;
|
|
28
|
+
var _details$meta, _forbiddenViewProps$c, _forbiddenViewProps$c2;
|
|
28
29
|
var id = _ref.id,
|
|
29
30
|
url = _ref.url,
|
|
30
31
|
cardState = _ref.cardState,
|
|
@@ -42,6 +43,8 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
42
43
|
analytics = _ref.analytics,
|
|
43
44
|
enableFlexibleBlockCard = _ref.enableFlexibleBlockCard,
|
|
44
45
|
actionOptions = _ref.actionOptions;
|
|
46
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
47
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
45
48
|
var status = cardState.status,
|
|
46
49
|
details = cardState.details;
|
|
47
50
|
var data = details && details.data || getEmptyJsonLd();
|
|
@@ -155,10 +158,11 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
155
158
|
}
|
|
156
159
|
var forbiddenViewProps = extractBlockProps(data, meta, extractorOpts);
|
|
157
160
|
var cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : getForbiddenJsonLd().meta;
|
|
158
|
-
var requestAccessContext =
|
|
161
|
+
var requestAccessContext = extractRequestAccessContextImproved({
|
|
159
162
|
jsonLd: cardMetadata,
|
|
160
163
|
url: url,
|
|
161
|
-
product: (_forbiddenViewProps$c = forbiddenViewProps.context) === null || _forbiddenViewProps$
|
|
164
|
+
product: (_forbiddenViewProps$c = (_forbiddenViewProps$c2 = forbiddenViewProps.context) === null || _forbiddenViewProps$c2 === void 0 ? void 0 : _forbiddenViewProps$c2.text) !== null && _forbiddenViewProps$c !== void 0 ? _forbiddenViewProps$c : '',
|
|
165
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
162
166
|
});
|
|
163
167
|
return jsx(BlockCardForbiddenView, _extends({}, forbiddenViewProps, {
|
|
164
168
|
isSelected: isSelected,
|
|
@@ -56,8 +56,9 @@ export var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
56
56
|
_requestAccessContext = requestAccessContext.descriptiveMessageKey,
|
|
57
57
|
descriptiveMessageKey = _requestAccessContext === void 0 ? 'invalid_permissions_description' : _requestAccessContext,
|
|
58
58
|
_requestAccessContext2 = requestAccessContext.hostname,
|
|
59
|
-
hostname = _requestAccessContext2 === void 0 ? '' : _requestAccessContext2
|
|
60
|
-
|
|
59
|
+
hostname = _requestAccessContext2 === void 0 ? '' : _requestAccessContext2,
|
|
60
|
+
buttonDisabled = requestAccessContext.buttonDisabled;
|
|
61
|
+
var items = action !== undefined && !(buttonDisabled !== null && buttonDisabled !== void 0 ? buttonDisabled : false) ? [].concat(_toConsumableArray(actions), [action]) : actions;
|
|
61
62
|
return jsx(Frame, {
|
|
62
63
|
isSelected: isSelected,
|
|
63
64
|
testId: testId,
|
|
@@ -40,7 +40,6 @@ var FlexibleNotFoundView = function FlexibleNotFoundView(_ref) {
|
|
|
40
40
|
};
|
|
41
41
|
}, []);
|
|
42
42
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
|
|
43
|
-
showPreview: true,
|
|
44
43
|
testId: testId,
|
|
45
44
|
title: title
|
|
46
45
|
}), /*#__PURE__*/React.createElement(LockIcon, {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["onClick"];
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
+
import React, { useCallback } from 'react';
|
|
7
|
+
import { downloadUrl as download } from '../../../../../utils';
|
|
8
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
9
|
+
import { ActionName } from '../../../../../constants';
|
|
10
|
+
import { messages } from '../../../../../messages';
|
|
11
|
+
import Action from '../action';
|
|
12
|
+
import { useFlexibleUiAnalyticsContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
13
|
+
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
14
|
+
import DownloadIcon from '@atlaskit/icon/glyph/download';
|
|
15
|
+
var DownloadAction = function DownloadAction(_ref) {
|
|
16
|
+
var _context$actions;
|
|
17
|
+
var onClickCallback = _ref.onClick,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var context = useFlexibleUiContext();
|
|
20
|
+
var analytics = useFlexibleUiAnalyticsContext();
|
|
21
|
+
var invoke = useInvokeClientAction({
|
|
22
|
+
analytics: analytics
|
|
23
|
+
});
|
|
24
|
+
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.DownloadAction];
|
|
25
|
+
var onClick = useCallback(function () {
|
|
26
|
+
if (data !== null && data !== void 0 && data.downloadUrl) {
|
|
27
|
+
invoke({
|
|
28
|
+
actionType: ActionName.DownloadAction,
|
|
29
|
+
actionFn: function () {
|
|
30
|
+
var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
31
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
return _context.abrupt("return", download(data === null || data === void 0 ? void 0 : data.downloadUrl));
|
|
35
|
+
case 1:
|
|
36
|
+
case "end":
|
|
37
|
+
return _context.stop();
|
|
38
|
+
}
|
|
39
|
+
}, _callee);
|
|
40
|
+
}));
|
|
41
|
+
function actionFn() {
|
|
42
|
+
return _actionFn.apply(this, arguments);
|
|
43
|
+
}
|
|
44
|
+
return actionFn;
|
|
45
|
+
}(),
|
|
46
|
+
// These values have already been set in analytics context.
|
|
47
|
+
// We only pass these here for ufo experience.
|
|
48
|
+
display: analytics === null || analytics === void 0 ? void 0 : analytics.display,
|
|
49
|
+
extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey
|
|
50
|
+
});
|
|
51
|
+
if (onClickCallback) {
|
|
52
|
+
onClickCallback();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}, [analytics, data === null || data === void 0 ? void 0 : data.downloadUrl, invoke, onClickCallback]);
|
|
56
|
+
return data ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
57
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
|
|
58
|
+
icon: /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
59
|
+
label: "Download"
|
|
60
|
+
}),
|
|
61
|
+
onClick: onClick,
|
|
62
|
+
testId: "smart-action-download-action",
|
|
63
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.download)
|
|
64
|
+
}, data, props)) : null;
|
|
65
|
+
};
|
|
66
|
+
export default DownloadAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,20 +2,22 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["value"];
|
|
4
4
|
import InviteTeamIcon from '@atlaskit/icon/glyph/invite-team';
|
|
5
|
-
import React
|
|
5
|
+
import React from 'react';
|
|
6
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
+
import { ActionName } from '../../../../../constants';
|
|
7
8
|
import { messages } from '../../../../../messages';
|
|
8
|
-
import {
|
|
9
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
9
10
|
import ServerAction from '../action/server-action';
|
|
10
11
|
import UnfollowIcon from './unfollow-icon';
|
|
11
12
|
var FollowAction = function FollowAction(props) {
|
|
12
|
-
var
|
|
13
|
-
|
|
13
|
+
var _context$actions, _context$actions2;
|
|
14
|
+
var context = useFlexibleUiContext();
|
|
15
|
+
if (!context || !(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[ActionName.FollowAction])) {
|
|
14
16
|
return null;
|
|
15
17
|
}
|
|
16
|
-
var _context$
|
|
17
|
-
value = _context$
|
|
18
|
-
data = _objectWithoutProperties(_context$
|
|
18
|
+
var _context$actions$Acti = context === null || context === void 0 || (_context$actions2 = context.actions) === null || _context$actions2 === void 0 ? void 0 : _context$actions2[ActionName.FollowAction],
|
|
19
|
+
value = _context$actions$Acti.value,
|
|
20
|
+
data = _objectWithoutProperties(_context$actions$Acti, _excluded);
|
|
19
21
|
var message = value ? messages.follow : messages.unfollow;
|
|
20
22
|
var icon = value ? /*#__PURE__*/React.createElement(InviteTeamIcon, {
|
|
21
23
|
label: "Follow"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { ActionName } from '../../../../constants';
|
|
|
2
2
|
import { createDataAction, createUIAction } from './utils';
|
|
3
3
|
export { default as FollowAction } from './follow-action';
|
|
4
4
|
export { default as PreviewAction } from './preview-action';
|
|
5
|
+
export { default as DownloadAction } from './download-action';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Creates a DeleteAction component. Accepts default ActionProps, but defaults
|
|
@@ -23,13 +24,6 @@ export var EditAction = createUIAction(ActionName.EditAction);
|
|
|
23
24
|
*/
|
|
24
25
|
export var ViewAction = createDataAction(ActionName.ViewAction);
|
|
25
26
|
|
|
26
|
-
/**
|
|
27
|
-
* Creates a DownloadAction component. Accepts default DownloadActionProps, and defaults
|
|
28
|
-
* to the text 'Download' inside the button.
|
|
29
|
-
* @see Action
|
|
30
|
-
*/
|
|
31
|
-
export var DownloadAction = createDataAction(ActionName.DownloadAction);
|
|
32
|
-
|
|
33
27
|
/**
|
|
34
28
|
* Creates a CustomAction component. Accepts default ActionProps. Required to provide
|
|
35
29
|
* your own icon or text.
|
|
@@ -14,8 +14,6 @@ import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
|
14
14
|
import EditIcon from '@atlaskit/icon/glyph/edit';
|
|
15
15
|
import ViewAction from './action/view-action';
|
|
16
16
|
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
17
|
-
import DownloadAction from './action/download-action';
|
|
18
|
-
import DownloadIcon from '@atlaskit/icon/glyph/download';
|
|
19
17
|
var actionMappings = (_actionMappings = {}, _defineProperty(_actionMappings, ActionName.CustomAction, {
|
|
20
18
|
component: Action,
|
|
21
19
|
props: {}
|
|
@@ -49,16 +47,6 @@ var actionMappings = (_actionMappings = {}, _defineProperty(_actionMappings, Act
|
|
|
49
47
|
}),
|
|
50
48
|
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.view)
|
|
51
49
|
}
|
|
52
|
-
}), _defineProperty(_actionMappings, ActionName.DownloadAction, {
|
|
53
|
-
component: DownloadAction,
|
|
54
|
-
props: {
|
|
55
|
-
testId: 'smart-action-download-action',
|
|
56
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
|
|
57
|
-
icon: /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
58
|
-
label: "Download"
|
|
59
|
-
}),
|
|
60
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.download)
|
|
61
|
-
}
|
|
62
50
|
}), _actionMappings);
|
|
63
51
|
var getContextKey = function getContextKey(name) {
|
|
64
52
|
// Attempt to predict context prop name in advance to reduce the amount of
|
|
@@ -72,7 +60,6 @@ var getActionData = function getActionData(actionName, contextKey, context) {
|
|
|
72
60
|
var data = context[contextKey];
|
|
73
61
|
switch (actionName) {
|
|
74
62
|
case ActionName.ViewAction:
|
|
75
|
-
case ActionName.DownloadAction:
|
|
76
63
|
return data;
|
|
77
64
|
default:
|
|
78
65
|
return undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import
|
|
4
|
-
import React, { useCallback, useMemo, useRef, useState, useEffect } from 'react';
|
|
3
|
+
import React, { useCallback, useMemo, useRef, useEffect } from 'react';
|
|
5
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
5
|
import { Box, Inline } from '@atlaskit/primitives';
|
|
7
6
|
import { ActionName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
@@ -18,16 +17,44 @@ import AISummary from '../../../../../common/ai-summary';
|
|
|
18
17
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
19
18
|
import AIEventSummaryViewed from '../ai-event-summary-viewed';
|
|
20
19
|
import AIEventErrorViewed from '../ai-event-error-viewed';
|
|
20
|
+
import { di } from 'react-magnetic-di';
|
|
21
|
+
export var AISummaryBlockErrorIndicator = function AISummaryBlockErrorIndicator(_ref) {
|
|
22
|
+
var showErrorIndicator = _ref.showErrorIndicator,
|
|
23
|
+
error = _ref.error,
|
|
24
|
+
testId = _ref.testId;
|
|
25
|
+
return showErrorIndicator ? /*#__PURE__*/React.createElement(Inline, {
|
|
26
|
+
grow: "fill"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(AIEventErrorViewed, {
|
|
28
|
+
reason: error
|
|
29
|
+
}), /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
30
|
+
error: error,
|
|
31
|
+
state: 'error',
|
|
32
|
+
testId: testId
|
|
33
|
+
})) : null;
|
|
34
|
+
};
|
|
35
|
+
export var AISummaryBlockStatusIndicator = function AISummaryBlockStatusIndicator(_ref2) {
|
|
36
|
+
var showStatusIndicator = _ref2.showStatusIndicator,
|
|
37
|
+
metadata = _ref2.metadata,
|
|
38
|
+
status = _ref2.status,
|
|
39
|
+
testId = _ref2.testId;
|
|
40
|
+
var metadataElements = renderElementItems(metadata);
|
|
41
|
+
return showStatusIndicator ? /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
42
|
+
state: status,
|
|
43
|
+
testId: "".concat(testId, "-state-indicator")
|
|
44
|
+
}) : /*#__PURE__*/React.createElement(ElementGroup, {
|
|
45
|
+
width: SmartLinkWidth.FitToContent,
|
|
46
|
+
testId: "".concat(testId, "-metadata-group")
|
|
47
|
+
}, metadataElements);
|
|
48
|
+
};
|
|
21
49
|
var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
22
50
|
var _props$actions = props.actions,
|
|
23
51
|
actions = _props$actions === void 0 ? [] : _props$actions,
|
|
24
|
-
metadata = props.metadata,
|
|
25
52
|
onActionMenuOpenChange = props.onActionMenuOpenChange,
|
|
26
53
|
_props$size = props.size,
|
|
27
54
|
size = _props$size === void 0 ? SmartLinkSize.Medium : _props$size,
|
|
28
55
|
testId = props.testId,
|
|
29
|
-
aiSummaryMinHeight = props.aiSummaryMinHeight
|
|
30
|
-
|
|
56
|
+
aiSummaryMinHeight = props.aiSummaryMinHeight,
|
|
57
|
+
metadata = props.metadata;
|
|
31
58
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
32
59
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
33
60
|
var context = useFlexibleUiContext();
|
|
@@ -47,18 +74,11 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
47
74
|
status === 'loading' && !!content;
|
|
48
75
|
var isSummarisedOnMountRef = useRef(status === 'done');
|
|
49
76
|
var isErroredOnMountRef = useRef(status === 'error');
|
|
50
|
-
var _useState = useState(false),
|
|
51
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
-
showAISummaryErrorMessage = _useState2[0],
|
|
53
|
-
setShowAISummaryErrorMessage = _useState2[1];
|
|
54
77
|
useEffect(function () {
|
|
55
78
|
// if the error was apparent on mount and the status is changed to loading we can
|
|
56
79
|
// clear the initial error on mount state
|
|
57
80
|
if (isErroredOnMountRef.current && status === 'loading') {
|
|
58
81
|
isErroredOnMountRef.current = false;
|
|
59
|
-
} else {
|
|
60
|
-
// if a new error occurs and it was not an apparent error on mount, we can show the error message
|
|
61
|
-
setShowAISummaryErrorMessage(!isErroredOnMountRef.current && status === 'error');
|
|
62
82
|
}
|
|
63
83
|
}, [status]);
|
|
64
84
|
var combinedActions = useMemo(function () {
|
|
@@ -101,25 +121,20 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
101
121
|
alignInline: "end",
|
|
102
122
|
grow: "fill",
|
|
103
123
|
spread: "space-between"
|
|
104
|
-
}, /*#__PURE__*/React.createElement(Box, null,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, metadataElements)), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(ActionGroup, {
|
|
124
|
+
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(AISummaryBlockStatusIndicator, {
|
|
125
|
+
metadata: metadata,
|
|
126
|
+
showStatusIndicator: !isSummarisedOnMountRef.current && (status === 'loading' || status === 'done'),
|
|
127
|
+
status: status,
|
|
128
|
+
testId: testId
|
|
129
|
+
})), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(ActionGroup, {
|
|
111
130
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
112
131
|
items: combinedActions,
|
|
113
132
|
appearance: "default",
|
|
114
133
|
size: size
|
|
115
|
-
}))),
|
|
116
|
-
|
|
117
|
-
}, /*#__PURE__*/React.createElement(AIEventErrorViewed, {
|
|
118
|
-
reason: error
|
|
119
|
-
}), /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
134
|
+
}))), /*#__PURE__*/React.createElement(AISummaryBlockErrorIndicator, {
|
|
135
|
+
showErrorIndicator: !isErroredOnMountRef.current && status === 'error',
|
|
120
136
|
error: error,
|
|
121
|
-
state: status,
|
|
122
137
|
testId: testId
|
|
123
|
-
}))
|
|
138
|
+
}));
|
|
124
139
|
};
|
|
125
140
|
export default AISummaryBlockResolvedView;
|
|
@@ -99,14 +99,6 @@ export var filterActionItems = function filterActionItems() {
|
|
|
99
99
|
case ActionName.CustomAction:
|
|
100
100
|
// Named and custom actions that user defines.
|
|
101
101
|
return Boolean(ActionName[item.name]);
|
|
102
|
-
case ActionName.DownloadAction:
|
|
103
|
-
// Remove once DownloadAction is refactored to context.action
|
|
104
|
-
// https://product-fabric.atlassian.net/browse/EDM-9545
|
|
105
|
-
return Boolean(context === null || context === void 0 ? void 0 : context.downloadAction);
|
|
106
|
-
// Remove once FollowAction is refactored to context.action
|
|
107
|
-
// https://product-fabric.atlassian.net/browse/EDM-9559
|
|
108
|
-
case ActionName.FollowAction:
|
|
109
|
-
return Boolean(context === null || context === void 0 ? void 0 : context.followAction);
|
|
110
102
|
// Remove once ViewAction is retired
|
|
111
103
|
// https://product-fabric.atlassian.net/browse/EDM-9547
|
|
112
104
|
case ActionName.ViewAction:
|