@atlaskit/smart-card 26.34.0 → 26.34.2
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/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/mocks.js +6 -1
- package/dist/cjs/view/BlockCard/actions/flexible/ForbiddenAction.js +4 -5
- package/dist/cjs/view/BlockCard/index.js +5 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenView.js +43 -17
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +103 -0
- package/dist/cjs/view/BlockCard/views/flexible/styled.js +4 -3
- package/dist/cjs/view/EmbedCard/index.js +15 -1
- package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +4 -0
- package/dist/cjs/view/EmbedCard/views/forbidden-view/index.js +4 -4
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +100 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/types.js +5 -0
- package/dist/cjs/view/HoverCard/components/views/forbidden/index.js +2 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/mocks.js +5 -0
- package/dist/es2019/view/BlockCard/actions/flexible/ForbiddenAction.js +4 -5
- package/dist/es2019/view/BlockCard/index.js +5 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenView.js +44 -17
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +95 -0
- package/dist/es2019/view/BlockCard/views/flexible/styled.js +4 -1
- package/dist/es2019/view/EmbedCard/index.js +15 -1
- package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +4 -0
- package/dist/es2019/view/EmbedCard/views/forbidden-view/index.js +3 -3
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +88 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/types.js +1 -0
- package/dist/es2019/view/HoverCard/components/views/forbidden/index.js +2 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/mocks.js +5 -0
- package/dist/esm/view/BlockCard/actions/flexible/ForbiddenAction.js +4 -5
- package/dist/esm/view/BlockCard/index.js +5 -2
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenView.js +43 -17
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +94 -0
- package/dist/esm/view/BlockCard/views/flexible/styled.js +3 -2
- package/dist/esm/view/EmbedCard/index.js +15 -1
- package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +4 -0
- package/dist/esm/view/EmbedCard/views/forbidden-view/index.js +4 -4
- package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +90 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/types.js +1 -0
- package/dist/esm/view/HoverCard/components/views/forbidden/index.js +2 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/utils/mocks.d.ts +5 -0
- package/dist/types/view/BlockCard/actions/flexible/ForbiddenAction.d.ts +2 -1
- package/dist/types/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.d.ts +8 -0
- package/dist/types/view/BlockCard/views/flexible/styled.d.ts +1 -0
- package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +4 -0
- package/dist/types/view/EmbedCard/views/forbidden-view/types.d.ts +1 -1
- package/dist/types/view/EmbedCard/views/unauthorized-view/index.d.ts +4 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +9 -0
- package/dist/types/view/FlexibleCard/components/types.d.ts +2 -1
- package/dist/types-ts4.5/utils/mocks.d.ts +5 -0
- package/dist/types-ts4.5/view/BlockCard/actions/flexible/ForbiddenAction.d.ts +2 -1
- package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.d.ts +8 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/styled.d.ts +1 -0
- package/dist/types-ts4.5/view/EmbedCard/views/UnauthorisedView.d.ts +4 -0
- package/dist/types-ts4.5/view/EmbedCard/views/forbidden-view/types.d.ts +1 -1
- package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/index.d.ts +4 -0
- package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/types.d.ts +9 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/types.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import FlexibleCard from '../../../FlexibleCard';
|
|
5
|
+
import TitleBlock from '../../../FlexibleCard/components/blocks/title-block';
|
|
6
|
+
import { CustomBlock } from '../../../FlexibleCard/components/blocks';
|
|
7
|
+
import { R300 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { messages } from '../../../../messages';
|
|
9
|
+
import LockIcon from '@atlaskit/icon/glyph/lock-filled';
|
|
10
|
+
import BlockCardFooter from '../../components/flexible/footer';
|
|
11
|
+
import { ForbiddenAction } from '../../actions/flexible/ForbiddenAction';
|
|
12
|
+
import Text from '../../../FlexibleCard/components/elements/text';
|
|
13
|
+
import { getForbiddenJsonLd } from '../../../../utils/jsonld';
|
|
14
|
+
import { extractProvider } from '@atlaskit/link-extractors';
|
|
15
|
+
import { extractRequestAccessContext } from '../../../../extractors/common/context';
|
|
16
|
+
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
|
|
21
|
+
* @deprecated Replaced by FlexibleForbiddenView
|
|
22
|
+
*/
|
|
23
|
+
var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
|
|
24
|
+
var _details$meta;
|
|
25
|
+
var anchorTarget = _ref.anchorTarget,
|
|
26
|
+
cardState = _ref.cardState,
|
|
27
|
+
onAuthorize = _ref.onAuthorize,
|
|
28
|
+
onClick = _ref.onClick,
|
|
29
|
+
onError = _ref.onError,
|
|
30
|
+
_ref$testId = _ref.testId,
|
|
31
|
+
testId = _ref$testId === void 0 ? 'smart-block-forbidden-view' : _ref$testId,
|
|
32
|
+
url = _ref.url,
|
|
33
|
+
titleBlockProps = _ref.titleBlockProps;
|
|
34
|
+
var status = cardState.status;
|
|
35
|
+
var details = cardState === null || cardState === void 0 ? void 0 : cardState.details;
|
|
36
|
+
var cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : getForbiddenJsonLd().meta;
|
|
37
|
+
var provider = extractProvider(details === null || details === void 0 ? void 0 : details.data);
|
|
38
|
+
var providerName = (provider === null || provider === void 0 ? void 0 : provider.text) || '';
|
|
39
|
+
var requestAccessContext = extractRequestAccessContext({
|
|
40
|
+
jsonLd: cardMetadata,
|
|
41
|
+
url: url,
|
|
42
|
+
context: providerName
|
|
43
|
+
});
|
|
44
|
+
var descriptiveMessageKey = requestAccessContext && requestAccessContext.descriptiveMessageKey ? requestAccessContext.descriptiveMessageKey : 'invalid_permissions_description';
|
|
45
|
+
var actions = useMemo(function () {
|
|
46
|
+
var actionFromAccessContext = [];
|
|
47
|
+
var tryAnotherAccountAction = onAuthorize ? [ForbiddenAction(onAuthorize, 'try_another_account')] : [];
|
|
48
|
+
if (requestAccessContext) {
|
|
49
|
+
var action = requestAccessContext.action,
|
|
50
|
+
callToActionMessageKey = requestAccessContext.callToActionMessageKey;
|
|
51
|
+
actionFromAccessContext = action && callToActionMessageKey ? [ForbiddenAction(action.promise, callToActionMessageKey, {
|
|
52
|
+
context: providerName
|
|
53
|
+
})] : [];
|
|
54
|
+
}
|
|
55
|
+
return [].concat(tryAnotherAccountAction, _toConsumableArray(actionFromAccessContext));
|
|
56
|
+
}, [onAuthorize, requestAccessContext, providerName]);
|
|
57
|
+
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
58
|
+
appearance: "block",
|
|
59
|
+
cardState: cardState,
|
|
60
|
+
onAuthorize: onAuthorize,
|
|
61
|
+
onClick: onClick,
|
|
62
|
+
onError: onError,
|
|
63
|
+
testId: testId,
|
|
64
|
+
ui: {
|
|
65
|
+
hideElevation: true
|
|
66
|
+
},
|
|
67
|
+
url: url
|
|
68
|
+
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({
|
|
69
|
+
hideRetry: true,
|
|
70
|
+
anchorTarget: anchorTarget
|
|
71
|
+
}, titleBlockProps)), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(LockIcon, {
|
|
72
|
+
label: "forbidden-lock-icon",
|
|
73
|
+
size: "small",
|
|
74
|
+
primaryColor: "var(--ds-icon-danger, ".concat(R300, ")"),
|
|
75
|
+
testId: "".concat(testId, "-lock-icon")
|
|
76
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
77
|
+
message: {
|
|
78
|
+
descriptor: messages[descriptiveMessageKey],
|
|
79
|
+
values: {
|
|
80
|
+
context: providerName
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
})), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
|
|
84
|
+
actions: actions,
|
|
85
|
+
status: status
|
|
86
|
+
})));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @private
|
|
91
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
|
|
92
|
+
* @deprecated Replaced by FlexibleForbiddenView
|
|
93
|
+
*/
|
|
94
|
+
export default withFlexibleUIBlockCardStyle(FlexibleForbiddenView);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
3
3
|
import { tokens } from '../../../../utils/token';
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
5
|
import { N40 } from '@atlaskit/theme/colors';
|
|
@@ -11,4 +11,5 @@ export var titleBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTe
|
|
|
11
11
|
export var footerBlockCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 1.5rem;\n\n .actions-button-group {\n button,\n button:hover,\n button:focus,\n button:active {\n font-size: 0.875rem;\n }\n }\n"])));
|
|
12
12
|
var flexibleBlockCardElevationStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-radius: 1.5px;\n box-shadow: ", ";\n margin: ", ";\n"])), tokens.elevation, "var(--ds-space-025, 2px)");
|
|
13
13
|
var refreshedFlexibleBlockCardStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n & > div {\n border-radius: ", ";\n border: 1px solid ", ";\n }\n"])), "var(--ds-border-radius-200, 8px)", "var(--ds-border, ".concat(N40, ")"));
|
|
14
|
-
export var flexibleBlockCardStyle = getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? refreshedFlexibleBlockCardStyle : flexibleBlockCardElevationStyle;
|
|
14
|
+
export var flexibleBlockCardStyle = getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? refreshedFlexibleBlockCardStyle : flexibleBlockCardElevationStyle;
|
|
15
|
+
export var forbiddenViewTitleStyle = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-weight: 600;\n"])));
|
|
@@ -17,6 +17,7 @@ import { EmbedCardUnauthorisedView } from './views/UnauthorisedView';
|
|
|
17
17
|
import { EmbedCardErroredView } from './views/ErroredView';
|
|
18
18
|
import ForbiddenView from './views/forbidden-view';
|
|
19
19
|
import NotFoundView from './views/not-found-view';
|
|
20
|
+
import UnauthorizedView from './views/unauthorized-view';
|
|
20
21
|
export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
21
22
|
var _details$meta, _forbiddenViewProps$c3;
|
|
22
23
|
var url = _ref.url,
|
|
@@ -103,6 +104,19 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
var unauthorisedViewProps = extractEmbedProps(data, meta, platform);
|
|
107
|
+
if (getBooleanFF('platform.linking-platform.smart-card.cross-join')) {
|
|
108
|
+
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
109
|
+
analytics: analytics,
|
|
110
|
+
context: unauthorisedViewProps.context,
|
|
111
|
+
extensionKey: extensionKey,
|
|
112
|
+
inheritDimensions: inheritDimensions,
|
|
113
|
+
isSelected: isSelected,
|
|
114
|
+
onAuthorize: handleAuthorize,
|
|
115
|
+
onClick: handleFrameClick,
|
|
116
|
+
testId: testId,
|
|
117
|
+
url: unauthorisedViewProps.link
|
|
118
|
+
});
|
|
119
|
+
}
|
|
106
120
|
return /*#__PURE__*/React.createElement(EmbedCardUnauthorisedView, _extends({}, unauthorisedViewProps, {
|
|
107
121
|
isSelected: isSelected,
|
|
108
122
|
onAuthorise: handleAuthorize,
|
|
@@ -142,7 +156,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
142
156
|
context: forbiddenViewProps.context,
|
|
143
157
|
inheritDimensions: inheritDimensions,
|
|
144
158
|
isSelected: isSelected,
|
|
145
|
-
|
|
159
|
+
onAuthorize: handleAuthorize,
|
|
146
160
|
onClick: handleFrameClick,
|
|
147
161
|
accessContext: accessContext,
|
|
148
162
|
url: forbiddenViewProps.link
|
|
@@ -5,6 +5,10 @@ import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
|
5
5
|
import { ImageIcon } from '../components/ImageIcon';
|
|
6
6
|
import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
7
7
|
import { getUnresolvedEmbedCardImage } from '../utils';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
|
|
10
|
+
* @deprecated Replaced by unauthorized-view
|
|
11
|
+
*/
|
|
8
12
|
export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
|
|
9
13
|
var analytics = _ref.analytics,
|
|
10
14
|
link = _ref.link,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["context", "
|
|
3
|
+
var _excluded = ["context", "onAuthorize", "accessContext", "testId"];
|
|
4
4
|
import Button from '@atlaskit/button';
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -11,7 +11,7 @@ import UnresolvedView from '../unresolved-view';
|
|
|
11
11
|
import { getUnresolvedEmbedCardImage } from '../../utils';
|
|
12
12
|
var ForbiddenView = function ForbiddenView(_ref) {
|
|
13
13
|
var context = _ref.context,
|
|
14
|
-
|
|
14
|
+
onAuthorize = _ref.onAuthorize,
|
|
15
15
|
accessContext = _ref.accessContext,
|
|
16
16
|
_ref$testId = _ref.testId,
|
|
17
17
|
testId = _ref$testId === void 0 ? 'embed-card-forbidden-view' : _ref$testId,
|
|
@@ -45,7 +45,7 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
45
45
|
*/
|
|
46
46
|
var button = useMemo(function () {
|
|
47
47
|
var _action$promise;
|
|
48
|
-
var onEmbedCardClick = (_action$promise = action === null || action === void 0 ? void 0 : action.promise) !== null && _action$promise !== void 0 ? _action$promise :
|
|
48
|
+
var onEmbedCardClick = (_action$promise = action === null || action === void 0 ? void 0 : action.promise) !== null && _action$promise !== void 0 ? _action$promise : onAuthorize;
|
|
49
49
|
if (!onEmbedCardClick) {
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
@@ -57,7 +57,7 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
57
57
|
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, toMessage(messages.try_another_account, callToActionMessageKey), {
|
|
58
58
|
values: values
|
|
59
59
|
})));
|
|
60
|
-
}, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey,
|
|
60
|
+
}, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey, onAuthorize, values]);
|
|
61
61
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
|
|
62
62
|
icon: icon,
|
|
63
63
|
image: image !== null && image !== void 0 ? image : getUnresolvedEmbedCardImage('forbidden'),
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["analytics", "context", "extensionKey", "onAuthorize", "testId"];
|
|
4
|
+
import Button from '@atlaskit/button';
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
+
import { di } from 'react-magnetic-di';
|
|
8
|
+
import { messages } from '../../../../messages';
|
|
9
|
+
import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
|
|
10
|
+
import { getUnresolvedEmbedCardImage } from '../../utils';
|
|
11
|
+
import UnresolvedView from '../unresolved-view';
|
|
12
|
+
var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
13
|
+
var _context$image;
|
|
14
|
+
var analytics = _ref.analytics,
|
|
15
|
+
context = _ref.context,
|
|
16
|
+
extensionKey = _ref.extensionKey,
|
|
17
|
+
onAuthorize = _ref.onAuthorize,
|
|
18
|
+
_ref$testId = _ref.testId,
|
|
19
|
+
testId = _ref$testId === void 0 ? 'embed-card-unauthorized-view' : _ref$testId,
|
|
20
|
+
unresolvedViewProps = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var handleOnAuthorizeClick = useCallback(function () {
|
|
22
|
+
if (onAuthorize) {
|
|
23
|
+
analytics.track.appAccountAuthStarted({
|
|
24
|
+
extensionKey: extensionKey
|
|
25
|
+
});
|
|
26
|
+
onAuthorize();
|
|
27
|
+
}
|
|
28
|
+
}, [onAuthorize, analytics.track, extensionKey]);
|
|
29
|
+
var content = useMemo(function () {
|
|
30
|
+
if (onAuthorize) {
|
|
31
|
+
var _context$text;
|
|
32
|
+
// Our title and button messages always expect the product name to be present
|
|
33
|
+
// while the description support when product name is not present.
|
|
34
|
+
// To be looked at https://product-fabric.atlassian.net/browse/EDM-8173
|
|
35
|
+
var _values = {
|
|
36
|
+
context: (_context$text = context === null || context === void 0 ? void 0 : context.text) !== null && _context$text !== void 0 ? _context$text : ''
|
|
37
|
+
};
|
|
38
|
+
if (_values) {
|
|
39
|
+
// title: Connect your {context} account
|
|
40
|
+
// button: Connect to {context}
|
|
41
|
+
return {
|
|
42
|
+
title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_link_account_card_name, {
|
|
43
|
+
values: _values
|
|
44
|
+
})),
|
|
45
|
+
description: /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
46
|
+
analytics: analytics,
|
|
47
|
+
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
48
|
+
testId: testId
|
|
49
|
+
}),
|
|
50
|
+
button: /*#__PURE__*/React.createElement(Button, {
|
|
51
|
+
testId: "connect-account",
|
|
52
|
+
appearance: "primary",
|
|
53
|
+
onClick: handleOnAuthorizeClick
|
|
54
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
|
|
55
|
+
values: _values
|
|
56
|
+
})))
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
var values = context !== null && context !== void 0 && context.text ? {
|
|
61
|
+
context: context === null || context === void 0 ? void 0 : context.text
|
|
62
|
+
} : undefined;
|
|
63
|
+
if (values) {
|
|
64
|
+
// title: We can't display private pages from {context}
|
|
65
|
+
// description: You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.
|
|
66
|
+
return {
|
|
67
|
+
title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.unauthorised_account_name, {
|
|
68
|
+
values: values
|
|
69
|
+
})),
|
|
70
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.unauthorised_account_description, {
|
|
71
|
+
values: values
|
|
72
|
+
}))
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// title: We can't display private pages
|
|
77
|
+
// description: You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.
|
|
78
|
+
return {
|
|
79
|
+
title: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_name_no_provider),
|
|
80
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_description_no_provider)
|
|
81
|
+
};
|
|
82
|
+
}, [analytics, context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, onAuthorize, testId]);
|
|
83
|
+
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, content, {
|
|
84
|
+
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
85
|
+
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : getUnresolvedEmbedCardImage('unauthorized'),
|
|
86
|
+
testId: testId,
|
|
87
|
+
text: context === null || context === void 0 ? void 0 : context.text
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
90
|
+
export default UnauthorizedView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,7 @@ import { extractProvider } from '@atlaskit/link-extractors';
|
|
|
9
9
|
import { connectButtonStyles, mainTextStyles, titleBlockStyles } from './styled';
|
|
10
10
|
import { getPreviewBlockStyles } from '../../../styled';
|
|
11
11
|
import { extractRequestAccessContextImproved } from '../../../../../extractors/common/context/extractAccessContext';
|
|
12
|
+
import extractHostname from '../../../../../extractors/common/hostname/extractHostname';
|
|
12
13
|
var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
|
|
13
14
|
var _cardState$details, _cardState$details2, _extractProvider$text, _extractProvider, _extractRequestAccess;
|
|
14
15
|
var flexibleCardProps = _ref.flexibleCardProps,
|
|
@@ -19,7 +20,7 @@ var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
|
|
|
19
20
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
20
21
|
var meta = (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.meta;
|
|
21
22
|
var product = (_extractProvider$text = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text) !== null && _extractProvider$text !== void 0 ? _extractProvider$text : '';
|
|
22
|
-
var hostname = /*#__PURE__*/React.createElement("b", null,
|
|
23
|
+
var hostname = /*#__PURE__*/React.createElement("b", null, extractHostname(url));
|
|
23
24
|
var _ref2 = (_extractRequestAccess = extractRequestAccessContextImproved({
|
|
24
25
|
jsonLd: meta,
|
|
25
26
|
url: url,
|
|
@@ -11,7 +11,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
11
11
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
var PACKAGE_DATA = {
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "26.34.
|
|
14
|
+
packageVersion: "26.34.2",
|
|
15
15
|
componentName: 'linkUrl'
|
|
16
16
|
};
|
|
17
17
|
var Link = withLinkClickedEvent('a');
|
|
@@ -4,6 +4,11 @@ export declare const mockContext: {
|
|
|
4
4
|
readonly atlassian: "https://schema.atlassian.com/ns/vocabulary#";
|
|
5
5
|
readonly schema: "http://schema.org/";
|
|
6
6
|
};
|
|
7
|
+
export declare const mockGenerator: {
|
|
8
|
+
'@type': string;
|
|
9
|
+
'@id': string;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
7
12
|
export declare const mockByUrl: (url: string) => JsonLd.Response<JsonLd.Data.BaseData>;
|
|
8
13
|
export declare const mocks: {
|
|
9
14
|
success: JsonLd.Response<JsonLd.Data.BaseData>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { CustomActionItem } from '../../../FlexibleCard/components/blocks/types';
|
|
2
3
|
import { MessageKey, RequestAccessMessageKey } from '../../../../messages';
|
|
3
4
|
/**
|
|
@@ -8,4 +9,4 @@ import { MessageKey, RequestAccessMessageKey } from '../../../../messages';
|
|
|
8
9
|
* @param content is a message key for a message to be displayed in the action
|
|
9
10
|
* @param context is a variable for a message in case a message contains a placeholder
|
|
10
11
|
*/
|
|
11
|
-
export declare const ForbiddenAction: (onClick: () => void, content: RequestAccessMessageKey | MessageKey, context?: string) => CustomActionItem;
|
|
12
|
+
export declare const ForbiddenAction: (onClick: () => void, content: RequestAccessMessageKey | MessageKey, context?: Record<string, ReactNode>, isDisabled?: boolean) => CustomActionItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FlexibleBlockCardProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
|
|
5
|
+
* @deprecated Replaced by FlexibleForbiddenView
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: (props: FlexibleBlockCardProps) => import("@emotion/react").jsx.JSX.Element;
|
|
8
|
+
export default _default;
|
|
@@ -2,3 +2,4 @@ export declare const metadataBlockCss: import("@emotion/react").SerializedStyles
|
|
|
2
2
|
export declare const titleBlockCss: import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const footerBlockCss: import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const flexibleBlockCardStyle: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const forbiddenViewTitleStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -12,4 +12,8 @@ export interface EmbedCardUnauthorisedViewProps {
|
|
|
12
12
|
onClick?: (evt: React.MouseEvent) => void;
|
|
13
13
|
extensionKey?: string;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
|
|
17
|
+
* @deprecated Replaced by unauthorized-view
|
|
18
|
+
*/
|
|
15
19
|
export declare const EmbedCardUnauthorisedView: FC<EmbedCardUnauthorisedViewProps>;
|
|
@@ -3,6 +3,6 @@ import { ContextViewModel } from '../../types';
|
|
|
3
3
|
import { UnresolvedViewProps } from '../unresolved-view/types';
|
|
4
4
|
export type ForbiddenViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
|
|
5
5
|
context?: ContextViewModel;
|
|
6
|
-
|
|
6
|
+
onAuthorize?: () => void;
|
|
7
7
|
accessContext: RequestAccessContextProps;
|
|
8
8
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AnalyticsFacade } from '../../../../state/analytics';
|
|
2
|
+
import { ContextViewModel } from '../../types';
|
|
3
|
+
import { UnresolvedViewProps } from '../unresolved-view/types';
|
|
4
|
+
export type UnauthorizedViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
|
|
5
|
+
analytics: AnalyticsFacade;
|
|
6
|
+
context?: ContextViewModel;
|
|
7
|
+
extensionKey?: string;
|
|
8
|
+
onAuthorize?: () => void;
|
|
9
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
3
|
export type AnchorTarget = '_blank' | '_self' | '_top' | '_parent';
|
|
3
4
|
export type MessageProps = {
|
|
4
5
|
descriptor: MessageDescriptor;
|
|
5
|
-
values?: Record<string,
|
|
6
|
+
values?: Record<string, ReactNode>;
|
|
6
7
|
};
|
|
@@ -4,6 +4,11 @@ export declare const mockContext: {
|
|
|
4
4
|
readonly atlassian: "https://schema.atlassian.com/ns/vocabulary#";
|
|
5
5
|
readonly schema: "http://schema.org/";
|
|
6
6
|
};
|
|
7
|
+
export declare const mockGenerator: {
|
|
8
|
+
'@type': string;
|
|
9
|
+
'@id': string;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
7
12
|
export declare const mockByUrl: (url: string) => JsonLd.Response<JsonLd.Data.BaseData>;
|
|
8
13
|
export declare const mocks: {
|
|
9
14
|
success: JsonLd.Response<JsonLd.Data.BaseData>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { CustomActionItem } from '../../../FlexibleCard/components/blocks/types';
|
|
2
3
|
import { MessageKey, RequestAccessMessageKey } from '../../../../messages';
|
|
3
4
|
/**
|
|
@@ -8,4 +9,4 @@ import { MessageKey, RequestAccessMessageKey } from '../../../../messages';
|
|
|
8
9
|
* @param content is a message key for a message to be displayed in the action
|
|
9
10
|
* @param context is a variable for a message in case a message contains a placeholder
|
|
10
11
|
*/
|
|
11
|
-
export declare const ForbiddenAction: (onClick: () => void, content: RequestAccessMessageKey | MessageKey, context?: string) => CustomActionItem;
|
|
12
|
+
export declare const ForbiddenAction: (onClick: () => void, content: RequestAccessMessageKey | MessageKey, context?: Record<string, ReactNode>, isDisabled?: boolean) => CustomActionItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FlexibleBlockCardProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
|
|
5
|
+
* @deprecated Replaced by FlexibleForbiddenView
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: (props: FlexibleBlockCardProps) => import("@emotion/react").jsx.JSX.Element;
|
|
8
|
+
export default _default;
|
|
@@ -2,3 +2,4 @@ export declare const metadataBlockCss: import("@emotion/react").SerializedStyles
|
|
|
2
2
|
export declare const titleBlockCss: import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const footerBlockCss: import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const flexibleBlockCardStyle: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const forbiddenViewTitleStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -12,4 +12,8 @@ export interface EmbedCardUnauthorisedViewProps {
|
|
|
12
12
|
onClick?: (evt: React.MouseEvent) => void;
|
|
13
13
|
extensionKey?: string;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
|
|
17
|
+
* @deprecated Replaced by unauthorized-view
|
|
18
|
+
*/
|
|
15
19
|
export declare const EmbedCardUnauthorisedView: FC<EmbedCardUnauthorisedViewProps>;
|
|
@@ -3,6 +3,6 @@ import { ContextViewModel } from '../../types';
|
|
|
3
3
|
import { UnresolvedViewProps } from '../unresolved-view/types';
|
|
4
4
|
export type ForbiddenViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
|
|
5
5
|
context?: ContextViewModel;
|
|
6
|
-
|
|
6
|
+
onAuthorize?: () => void;
|
|
7
7
|
accessContext: RequestAccessContextProps;
|
|
8
8
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AnalyticsFacade } from '../../../../state/analytics';
|
|
2
|
+
import { ContextViewModel } from '../../types';
|
|
3
|
+
import { UnresolvedViewProps } from '../unresolved-view/types';
|
|
4
|
+
export type UnauthorizedViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
|
|
5
|
+
analytics: AnalyticsFacade;
|
|
6
|
+
context?: ContextViewModel;
|
|
7
|
+
extensionKey?: string;
|
|
8
|
+
onAuthorize?: () => void;
|
|
9
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
3
|
export type AnchorTarget = '_blank' | '_self' | '_top' | '_parent';
|
|
3
4
|
export type MessageProps = {
|
|
4
5
|
descriptor: MessageDescriptor;
|
|
5
|
-
values?: Record<string,
|
|
6
|
+
values?: Record<string, ReactNode>;
|
|
6
7
|
};
|