@atlaskit/smart-card 26.42.9 → 26.42.10
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 +7 -0
- package/dist/cjs/constants.js +2 -1
- package/dist/cjs/messages.js +7 -2
- package/dist/cjs/state/helpers.js +4 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +3 -1
- package/dist/cjs/view/EmbedCard/index.js +3 -0
- package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +4 -2
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +7 -16
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.js +33 -0
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/types.js +5 -0
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +3 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +4 -2
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/messages.js +7 -2
- package/dist/es2019/state/helpers.js +2 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +4 -2
- package/dist/es2019/view/EmbedCard/index.js +4 -1
- package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +4 -2
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +7 -11
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.js +21 -0
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/types.js +1 -0
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +3 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +5 -3
- package/dist/esm/constants.js +1 -0
- package/dist/esm/messages.js +7 -2
- package/dist/esm/state/helpers.js +3 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +4 -2
- package/dist/esm/view/EmbedCard/index.js +4 -1
- package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +4 -2
- package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +7 -13
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.js +25 -0
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/types.js +1 -0
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +3 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +5 -3
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/helpers.d.ts +1 -0
- package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +1 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/types.d.ts +7 -0
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +6 -1
- package/dist/types-ts4.5/constants.d.ts +1 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/helpers.d.ts +1 -0
- package/dist/types-ts4.5/view/EmbedCard/views/UnauthorisedView.d.ts +1 -0
- package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/types.d.ts +7 -0
- package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.42.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#57701](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57701) [`74bb477813d6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/74bb477813d6) - update VR tests for actions lozenge
|
|
8
|
+
- [#56913](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/56913) [`0dca4d0184d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0dca4d0184d5) - Show an alternative message for 3P unauthorized view when `hasScopeOverrides` flag is set in the `meta`. This is to accomodate authorization which affects more than smart links.
|
|
9
|
+
|
|
3
10
|
## 26.42.9
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SmartLinkWidth = exports.SmartLinkTheme = exports.SmartLinkStatus = exports.SmartLinkSize = exports.SmartLinkPosition = exports.SmartLinkInternalTheme = exports.SmartLinkDirection = exports.SmartLinkAlignment = exports.MediaType = exports.MediaPlacement = exports.IconType = exports.ElementName = exports.CardDisplay = exports.CONTENT_URL_SECURITY_AND_PERMISSIONS = exports.ActionName = void 0;
|
|
6
|
+
exports.SmartLinkWidth = exports.SmartLinkTheme = exports.SmartLinkStatus = exports.SmartLinkSize = exports.SmartLinkPosition = exports.SmartLinkInternalTheme = exports.SmartLinkDirection = exports.SmartLinkAlignment = exports.MediaType = exports.MediaPlacement = exports.IconType = exports.ElementName = exports.CardDisplay = exports.CONTENT_URL_SECURITY_AND_PERMISSIONS = exports.CONTENT_URL_3P_ACCOUNT_AUTH = exports.ActionName = void 0;
|
|
7
7
|
var CONTENT_URL_SECURITY_AND_PERMISSIONS = exports.CONTENT_URL_SECURITY_AND_PERMISSIONS = 'https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links';
|
|
8
|
+
var CONTENT_URL_3P_ACCOUNT_AUTH = exports.CONTENT_URL_3P_ACCOUNT_AUTH = 'https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* The alignment of Flexible UI component.
|
package/dist/cjs/messages.js
CHANGED
|
@@ -96,12 +96,12 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
96
96
|
},
|
|
97
97
|
connect_unauthorised_account_description: {
|
|
98
98
|
id: 'fabric.linking.connect_unauthorised_account_description',
|
|
99
|
-
defaultMessage: 'Connect {context}
|
|
99
|
+
defaultMessage: 'Connect your {context} account to collaborate on work across Atlassian products.',
|
|
100
100
|
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view.'
|
|
101
101
|
},
|
|
102
102
|
connect_unauthorised_account_description_no_provider: {
|
|
103
103
|
id: 'fabric.linking.connect_unauthorised_account_description_no_provider',
|
|
104
|
-
defaultMessage: 'Connect
|
|
104
|
+
defaultMessage: 'Connect your account to collaborate on work across Atlassian products.',
|
|
105
105
|
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view and we do not have the providers name.'
|
|
106
106
|
},
|
|
107
107
|
continue: {
|
|
@@ -184,6 +184,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
184
184
|
defaultMessage: 'Learn more about Smart Links.',
|
|
185
185
|
description: 'An anchor link to redirect user to a page about Smart Links.'
|
|
186
186
|
},
|
|
187
|
+
learn_more_about_connecting_account: {
|
|
188
|
+
id: 'fabric.linking.learn_more_about_connecting_account',
|
|
189
|
+
defaultMessage: 'Learn more about connecting your account to Atlassian products.',
|
|
190
|
+
description: 'An anchor link to redirect user to a page about authorization with 3rd party accounts.'
|
|
191
|
+
},
|
|
187
192
|
loading: {
|
|
188
193
|
id: 'fabric.linking.loading',
|
|
189
194
|
defaultMessage: 'Loading...',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isVisible = exports.isFinalState = exports.isAccessible = exports.hasResolved = exports.getSubproduct = exports.getStatusDetails = exports.getServices = exports.getResourceType = exports.getProduct = exports.getExtensionKey = exports.getDefinitionId = exports.getDatasources = exports.getClickUrl = exports.getCanBeDatasource = exports.getByDefinitionId = void 0;
|
|
6
|
+
exports.isVisible = exports.isFinalState = exports.isAccessible = exports.hasResolved = exports.hasAuthScopeOverrides = exports.getSubproduct = exports.getStatusDetails = exports.getServices = exports.getResourceType = exports.getProduct = exports.getExtensionKey = exports.getDefinitionId = exports.getDatasources = exports.getClickUrl = exports.getCanBeDatasource = exports.getByDefinitionId = void 0;
|
|
7
7
|
var _extractVisitUrl = require("../extractors/common/primitives/extractVisitUrl");
|
|
8
8
|
var getByDefinitionId = exports.getByDefinitionId = function getByDefinitionId(definitionId, store) {
|
|
9
9
|
var urls = Object.keys(store);
|
|
@@ -68,4 +68,7 @@ var getDatasources = exports.getDatasources = function getDatasources(details) {
|
|
|
68
68
|
var getCanBeDatasource = exports.getCanBeDatasource = function getCanBeDatasource(details) {
|
|
69
69
|
var datasources = getDatasources(details);
|
|
70
70
|
return !!datasources && datasources.length > 0;
|
|
71
|
+
};
|
|
72
|
+
var hasAuthScopeOverrides = exports.hasAuthScopeOverrides = function hasAuthScopeOverrides(details) {
|
|
73
|
+
return !!(details !== null && details !== void 0 && details.meta.hasScopeOverrides);
|
|
71
74
|
};
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.42.
|
|
25
|
+
packageVersion: "26.42.10"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -41,6 +41,7 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
41
41
|
var extensionKey = (_getExtensionKey = (0, _helpers.getExtensionKey)(cardState === null || cardState === void 0 ? void 0 : cardState.details)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
|
|
42
42
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
43
43
|
var providerName = (_extractProvider = (0, _linkExtractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
44
|
+
var isProductIntegrationSupported = (0, _helpers.hasAuthScopeOverrides)(cardState === null || cardState === void 0 ? void 0 : cardState.details);
|
|
44
45
|
var handleAuthorize = (0, _react2.useCallback)(function () {
|
|
45
46
|
if (onAuthorize) {
|
|
46
47
|
analytics === null || analytics === void 0 || analytics.track.appAccountAuthStarted({
|
|
@@ -52,6 +53,7 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
52
53
|
var content = (0, _react2.useMemo)(function () {
|
|
53
54
|
return onAuthorize ? (0, _react.jsx)(_UnauthorisedViewContent.default, {
|
|
54
55
|
providerName: providerName,
|
|
56
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
55
57
|
analytics: analytics,
|
|
56
58
|
testId: testId
|
|
57
59
|
}) : (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages[providerName ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider'], {
|
|
@@ -59,7 +61,7 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
59
61
|
context: providerName
|
|
60
62
|
}
|
|
61
63
|
}));
|
|
62
|
-
}, [analytics, onAuthorize, providerName, testId]);
|
|
64
|
+
}, [analytics, isProductIntegrationSupported, onAuthorize, providerName, testId]);
|
|
63
65
|
var actions = (0, _react2.useMemo)(function () {
|
|
64
66
|
return onAuthorize ? [(0, _AuthorizeAction.AuthorizeAction)(handleAuthorize, providerName)] : [];
|
|
65
67
|
}, [handleAuthorize, onAuthorize, providerName]);
|
|
@@ -54,6 +54,7 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
54
54
|
var data = details && details.data || (0, _jsonld.getEmptyJsonLd)();
|
|
55
55
|
var meta = details && details.meta;
|
|
56
56
|
var extensionKey = (0, _helpers.getExtensionKey)(details);
|
|
57
|
+
var isProductIntegrationSupported = (0, _helpers.hasAuthScopeOverrides)(details);
|
|
57
58
|
switch (status) {
|
|
58
59
|
case 'pending':
|
|
59
60
|
case 'resolving':
|
|
@@ -119,6 +120,7 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
119
120
|
analytics: analytics,
|
|
120
121
|
context: unauthorisedViewProps.context,
|
|
121
122
|
extensionKey: extensionKey,
|
|
123
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
122
124
|
inheritDimensions: inheritDimensions,
|
|
123
125
|
isSelected: isSelected,
|
|
124
126
|
onAuthorize: handleAuthorize,
|
|
@@ -134,6 +136,7 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
134
136
|
onClick: handleFrameClick,
|
|
135
137
|
analytics: analytics,
|
|
136
138
|
extensionKey: extensionKey,
|
|
139
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
137
140
|
testId: testId
|
|
138
141
|
}));
|
|
139
142
|
case 'forbidden':
|
|
@@ -29,7 +29,8 @@ var EmbedCardUnauthorisedView = exports.EmbedCardUnauthorisedView = function Emb
|
|
|
29
29
|
onAuthorise = _ref.onAuthorise,
|
|
30
30
|
inheritDimensions = _ref.inheritDimensions,
|
|
31
31
|
onClick = _ref.onClick,
|
|
32
|
-
extensionKey = _ref.extensionKey
|
|
32
|
+
extensionKey = _ref.extensionKey,
|
|
33
|
+
isProductIntegrationSupported = _ref.isProductIntegrationSupported;
|
|
33
34
|
var icon = context && context.icon && /*#__PURE__*/_react.default.createElement(_ImageIcon.ImageIcon, {
|
|
34
35
|
src: typeof context.icon === 'string' ? context.icon : undefined
|
|
35
36
|
});
|
|
@@ -60,6 +61,7 @@ var EmbedCardUnauthorisedView = exports.EmbedCardUnauthorisedView = function Emb
|
|
|
60
61
|
}, /*#__PURE__*/_react.default.createElement(_UnauthorisedViewContent.default, {
|
|
61
62
|
analytics: analytics,
|
|
62
63
|
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
64
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
63
65
|
testId: testId
|
|
64
66
|
}));
|
|
65
67
|
}
|
|
@@ -70,7 +72,7 @@ var EmbedCardUnauthorisedView = exports.EmbedCardUnauthorisedView = function Emb
|
|
|
70
72
|
testId: testId,
|
|
71
73
|
title: context !== null && context !== void 0 && context.text ? 'unauthorised_account_name' : 'unauthorised_account_name_no_provider'
|
|
72
74
|
});
|
|
73
|
-
}, [analytics, context, handleOnAuthorizeClick, onAuthorise, testId]);
|
|
75
|
+
}, [analytics, context, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorise, testId]);
|
|
74
76
|
return /*#__PURE__*/_react.default.createElement(_ExpandedFrame.ExpandedFrame, {
|
|
75
77
|
href: link,
|
|
76
78
|
icon: icon,
|
|
@@ -16,7 +16,7 @@ var _messages = require("../../../../messages");
|
|
|
16
16
|
var _UnauthorisedViewContent = _interopRequireDefault(require("../../../common/UnauthorisedViewContent"));
|
|
17
17
|
var _utils = require("../../utils");
|
|
18
18
|
var _unresolvedView = _interopRequireDefault(require("../unresolved-view"));
|
|
19
|
-
var _excluded = ["analytics", "context", "extensionKey", "onAuthorize", "testId"];
|
|
19
|
+
var _excluded = ["analytics", "context", "extensionKey", "isProductIntegrationSupported", "onAuthorize", "testId"];
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
22
|
var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
@@ -24,6 +24,7 @@ var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
24
24
|
var analytics = _ref.analytics,
|
|
25
25
|
context = _ref.context,
|
|
26
26
|
extensionKey = _ref.extensionKey,
|
|
27
|
+
isProductIntegrationSupported = _ref.isProductIntegrationSupported,
|
|
27
28
|
onAuthorize = _ref.onAuthorize,
|
|
28
29
|
_ref$testId = _ref.testId,
|
|
29
30
|
testId = _ref$testId === void 0 ? 'embed-card-unauthorized-view' : _ref$testId,
|
|
@@ -55,6 +56,7 @@ var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
55
56
|
description: /*#__PURE__*/_react.default.createElement(_UnauthorisedViewContent.default, {
|
|
56
57
|
analytics: analytics,
|
|
57
58
|
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
59
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
58
60
|
testId: testId
|
|
59
61
|
}),
|
|
60
62
|
button: /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
@@ -89,7 +91,7 @@ var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
89
91
|
title: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.unauthorised_account_name_no_provider),
|
|
90
92
|
description: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.unauthorised_account_description_no_provider)
|
|
91
93
|
};
|
|
92
|
-
}, [analytics, context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, onAuthorize, testId]);
|
|
94
|
+
}, [analytics, context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorize, testId]);
|
|
93
95
|
return /*#__PURE__*/_react.default.createElement(_unresolvedView.default, (0, _extends2.default)({}, unresolvedViewProps, content, {
|
|
94
96
|
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
95
97
|
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : (0, _utils.getUnresolvedEmbedCardImage)('unauthorized'),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -12,12 +11,10 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
12
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
12
|
var _react = require("@emotion/react");
|
|
14
13
|
var _react2 = require("react");
|
|
15
|
-
var _dropdownMenu =
|
|
16
|
-
var _lozengeActionItem = _interopRequireDefault(require("./lozenge-action-item"));
|
|
14
|
+
var _dropdownMenu = _interopRequireDefault(require("@atlaskit/dropdown-menu"));
|
|
17
15
|
var _lozengeActionTrigger = _interopRequireDefault(require("./lozenge-action-trigger"));
|
|
18
16
|
var _lozengeActionError = _interopRequireDefault(require("./lozenge-action-error"));
|
|
19
17
|
var _errorBoundary = _interopRequireDefault(require("./error-boundary"));
|
|
20
|
-
var _styled = require("./styled");
|
|
21
18
|
var _useInvoke = _interopRequireDefault(require("../../../../../../state/hooks/use-invoke"));
|
|
22
19
|
var _extractLozengeActionItems = _interopRequireDefault(require("../../../../../../extractors/action/extract-lozenge-action-items"));
|
|
23
20
|
var _createStatusUpdateRequest = _interopRequireDefault(require("../../../../../../utils/actions/create-status-update-request"));
|
|
@@ -27,8 +24,7 @@ var _utils = require("../../../../../../state/hooks/use-invoke/utils");
|
|
|
27
24
|
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
28
25
|
var _analytics = require("../../../../../../utils/analytics/analytics");
|
|
29
26
|
var _lozengeActionAnalytics = require("./lozenge-action-analytics");
|
|
30
|
-
|
|
31
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
var _lozengeActionItemsGroup = _interopRequireDefault(require("./lozenge-action-items-group"));
|
|
32
28
|
/** @jsx jsx */
|
|
33
29
|
|
|
34
30
|
var validateItems = function validateItems() {
|
|
@@ -224,16 +220,11 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
224
220
|
});
|
|
225
221
|
}
|
|
226
222
|
if (items && items.length > 0) {
|
|
227
|
-
return (0, _react.jsx)(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
key: idx,
|
|
233
|
-
onClick: handleItemClick,
|
|
234
|
-
testId: "".concat(testId, "-item-").concat(idx)
|
|
235
|
-
}));
|
|
236
|
-
})));
|
|
223
|
+
return (0, _react.jsx)(_lozengeActionItemsGroup.default, {
|
|
224
|
+
testId: testId,
|
|
225
|
+
items: items,
|
|
226
|
+
onClick: handleItemClick
|
|
227
|
+
});
|
|
237
228
|
}
|
|
238
229
|
}, [errorMessage, handleItemClick, items, previewData, testId, url]);
|
|
239
230
|
return (0, _react.jsx)(_dropdownMenu.default, {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _lozengeActionItem = _interopRequireDefault(require("../lozenge-action-item"));
|
|
11
|
+
var _styled = require("../styled");
|
|
12
|
+
var _dropdownMenu = require("@atlaskit/dropdown-menu");
|
|
13
|
+
/** @jsx jsx */
|
|
14
|
+
|
|
15
|
+
var LozengeActionItemsGroup = function LozengeActionItemsGroup(_ref) {
|
|
16
|
+
var items = _ref.items,
|
|
17
|
+
testId = _ref.testId,
|
|
18
|
+
onClick = _ref.onClick;
|
|
19
|
+
return (
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
21
|
+
(0, _react.jsx)("span", {
|
|
22
|
+
css: _styled.dropdownItemGroupStyles,
|
|
23
|
+
"data-testid": "".concat(testId, "-item-group")
|
|
24
|
+
}, (0, _react.jsx)(_dropdownMenu.DropdownItemGroup, null, items.map(function (item, idx) {
|
|
25
|
+
return (0, _react.jsx)(_lozengeActionItem.default, (0, _extends2.default)({}, item, {
|
|
26
|
+
key: idx,
|
|
27
|
+
onClick: onClick,
|
|
28
|
+
testId: "".concat(testId, "-item-").concat(idx)
|
|
29
|
+
}));
|
|
30
|
+
})))
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
var _default = exports.default = LozengeActionItemsGroup;
|
|
@@ -19,6 +19,7 @@ var _actionGroup = _interopRequireDefault(require("../../../../FlexibleCard/comp
|
|
|
19
19
|
var _elements = require("../../../../FlexibleCard/components/elements");
|
|
20
20
|
var _constants = require("../../../../../constants");
|
|
21
21
|
var _actions = require("../../../../../state/actions");
|
|
22
|
+
var _helpers = require("../../../../../state/helpers");
|
|
22
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
25
|
var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
@@ -34,6 +35,7 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
34
35
|
var cardState = flexibleCardProps.cardState;
|
|
35
36
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
36
37
|
var providerName = (_extractProvider = (0, _linkExtractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
38
|
+
var isProductIntegrationSupported = (0, _helpers.hasAuthScopeOverrides)(cardState.details);
|
|
37
39
|
var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
|
|
38
40
|
authorize = _useSmartCardActions.authorize;
|
|
39
41
|
var handleAuthorize = (0, _react.useCallback)(function () {
|
|
@@ -69,6 +71,7 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
69
71
|
testId: "".concat(testId, "-content")
|
|
70
72
|
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UnauthorisedViewContent.default, {
|
|
71
73
|
providerName: providerName,
|
|
74
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
72
75
|
analytics: analytics
|
|
73
76
|
}))), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, {
|
|
74
77
|
overrideCss: _styled.connectButtonStyles,
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "26.42.
|
|
20
|
+
packageVersion: "26.42.10",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -19,21 +19,23 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
19
19
|
*/
|
|
20
20
|
var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
21
21
|
var providerName = _ref.providerName,
|
|
22
|
+
isProductIntegrationSupported = _ref.isProductIntegrationSupported,
|
|
22
23
|
_ref$testId = _ref.testId,
|
|
23
24
|
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId,
|
|
24
25
|
analytics = _ref.analytics;
|
|
25
26
|
var handleLearnMoreClick = (0, _react.useCallback)(function () {
|
|
26
27
|
analytics === null || analytics === void 0 || analytics.ui.learnMoreClickedEvent();
|
|
27
28
|
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui]);
|
|
29
|
+
var learnMoreMessage = isProductIntegrationSupported ? _messages.messages.learn_more_about_connecting_account : _messages.messages.learn_more_about_smart_links;
|
|
28
30
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, providerName ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_unauthorised_account_description, {
|
|
29
31
|
values: {
|
|
30
32
|
context: providerName
|
|
31
33
|
}
|
|
32
34
|
})) : /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.connect_unauthorised_account_description_no_provider), ' ', /*#__PURE__*/_react.default.createElement("a", {
|
|
33
|
-
href: _constants.CONTENT_URL_SECURITY_AND_PERMISSIONS,
|
|
35
|
+
href: isProductIntegrationSupported ? _constants.CONTENT_URL_3P_ACCOUNT_AUTH : _constants.CONTENT_URL_SECURITY_AND_PERMISSIONS,
|
|
34
36
|
target: "_blank",
|
|
35
37
|
"data-testid": "".concat(testId, "-learn-more"),
|
|
36
38
|
onClick: handleLearnMoreClick
|
|
37
|
-
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage,
|
|
39
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, learnMoreMessage)));
|
|
38
40
|
};
|
|
39
41
|
var _default = exports.default = UnauthorisedViewContent;
|
package/dist/es2019/constants.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const CONTENT_URL_SECURITY_AND_PERMISSIONS = 'https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links';
|
|
2
|
+
export const CONTENT_URL_3P_ACCOUNT_AUTH = 'https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The alignment of Flexible UI component.
|
package/dist/es2019/messages.js
CHANGED
|
@@ -90,12 +90,12 @@ export const messages = defineMessages({
|
|
|
90
90
|
},
|
|
91
91
|
connect_unauthorised_account_description: {
|
|
92
92
|
id: 'fabric.linking.connect_unauthorised_account_description',
|
|
93
|
-
defaultMessage: 'Connect {context}
|
|
93
|
+
defaultMessage: 'Connect your {context} account to collaborate on work across Atlassian products.',
|
|
94
94
|
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view.'
|
|
95
95
|
},
|
|
96
96
|
connect_unauthorised_account_description_no_provider: {
|
|
97
97
|
id: 'fabric.linking.connect_unauthorised_account_description_no_provider',
|
|
98
|
-
defaultMessage: 'Connect
|
|
98
|
+
defaultMessage: 'Connect your account to collaborate on work across Atlassian products.',
|
|
99
99
|
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view and we do not have the providers name.'
|
|
100
100
|
},
|
|
101
101
|
continue: {
|
|
@@ -178,6 +178,11 @@ export const messages = defineMessages({
|
|
|
178
178
|
defaultMessage: 'Learn more about Smart Links.',
|
|
179
179
|
description: 'An anchor link to redirect user to a page about Smart Links.'
|
|
180
180
|
},
|
|
181
|
+
learn_more_about_connecting_account: {
|
|
182
|
+
id: 'fabric.linking.learn_more_about_connecting_account',
|
|
183
|
+
defaultMessage: 'Learn more about connecting your account to Atlassian products.',
|
|
184
|
+
description: 'An anchor link to redirect user to a page about authorization with 3rd party accounts.'
|
|
185
|
+
},
|
|
181
186
|
loading: {
|
|
182
187
|
id: 'fabric.linking.loading',
|
|
183
188
|
defaultMessage: 'Loading...',
|
|
@@ -60,4 +60,5 @@ export const getDatasources = details => details === null || details === void 0
|
|
|
60
60
|
export const getCanBeDatasource = details => {
|
|
61
61
|
const datasources = getDatasources(details);
|
|
62
62
|
return !!datasources && datasources.length > 0;
|
|
63
|
-
};
|
|
63
|
+
};
|
|
64
|
+
export const hasAuthScopeOverrides = details => !!(details !== null && details !== void 0 && details.meta.hasScopeOverrides);
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.42.
|
|
7
|
+
packageVersion: "26.42.10"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { useCallback, useMemo } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
-
import { getExtensionKey } from '../../../../state/helpers';
|
|
6
|
+
import { getExtensionKey, hasAuthScopeOverrides } from '../../../../state/helpers';
|
|
7
7
|
import { AuthorizeAction } from '../../actions/flexible/AuthorizeAction';
|
|
8
8
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
9
9
|
import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
|
|
@@ -36,6 +36,7 @@ const FlexibleUnauthorisedView = ({
|
|
|
36
36
|
const extensionKey = (_getExtensionKey = getExtensionKey(cardState === null || cardState === void 0 ? void 0 : cardState.details)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
|
|
37
37
|
const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
38
38
|
const providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
39
|
+
const isProductIntegrationSupported = hasAuthScopeOverrides(cardState === null || cardState === void 0 ? void 0 : cardState.details);
|
|
39
40
|
const handleAuthorize = useCallback(() => {
|
|
40
41
|
if (onAuthorize) {
|
|
41
42
|
analytics === null || analytics === void 0 ? void 0 : analytics.track.appAccountAuthStarted({
|
|
@@ -46,13 +47,14 @@ const FlexibleUnauthorisedView = ({
|
|
|
46
47
|
}, [onAuthorize, extensionKey, analytics === null || analytics === void 0 ? void 0 : analytics.track]);
|
|
47
48
|
const content = useMemo(() => onAuthorize ? jsx(UnauthorisedViewContent, {
|
|
48
49
|
providerName: providerName,
|
|
50
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
49
51
|
analytics: analytics,
|
|
50
52
|
testId: testId
|
|
51
53
|
}) : jsx(FormattedMessage, _extends({}, messages[providerName ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider'], {
|
|
52
54
|
values: {
|
|
53
55
|
context: providerName
|
|
54
56
|
}
|
|
55
|
-
})), [analytics, onAuthorize, providerName, testId]);
|
|
57
|
+
})), [analytics, isProductIntegrationSupported, onAuthorize, providerName, testId]);
|
|
56
58
|
const actions = useMemo(() => onAuthorize ? [AuthorizeAction(handleAuthorize, providerName)] : [], [handleAuthorize, onAuthorize, providerName]);
|
|
57
59
|
return jsx(UnresolvedView, _extends({}, props, {
|
|
58
60
|
actions: actions,
|
|
@@ -6,7 +6,7 @@ import { extractEmbedProps } from '../../extractors/embed';
|
|
|
6
6
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
7
7
|
import { extractInlineProps } from '../../extractors/inline';
|
|
8
8
|
import { extractBlockProps } from '../../extractors/block';
|
|
9
|
-
import { getExtensionKey } from '../../state/helpers';
|
|
9
|
+
import { getExtensionKey, hasAuthScopeOverrides } from '../../state/helpers';
|
|
10
10
|
import { extractRequestAccessContext } from '../../extractors/common/context';
|
|
11
11
|
import { BlockCardResolvedView, BlockCardResolvingView } from '../BlockCard';
|
|
12
12
|
import { InlineCardResolvedView } from '../RedesignedInlineCard/ResolvedView';
|
|
@@ -50,6 +50,7 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
50
50
|
const data = details && details.data || getEmptyJsonLd();
|
|
51
51
|
const meta = details && details.meta;
|
|
52
52
|
const extensionKey = getExtensionKey(details);
|
|
53
|
+
const isProductIntegrationSupported = hasAuthScopeOverrides(details);
|
|
53
54
|
switch (status) {
|
|
54
55
|
case 'pending':
|
|
55
56
|
case 'resolving':
|
|
@@ -115,6 +116,7 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
115
116
|
analytics: analytics,
|
|
116
117
|
context: unauthorisedViewProps.context,
|
|
117
118
|
extensionKey: extensionKey,
|
|
119
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
118
120
|
inheritDimensions: inheritDimensions,
|
|
119
121
|
isSelected: isSelected,
|
|
120
122
|
onAuthorize: handleAuthorize,
|
|
@@ -130,6 +132,7 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
130
132
|
onClick: handleFrameClick,
|
|
131
133
|
analytics: analytics,
|
|
132
134
|
extensionKey: extensionKey,
|
|
135
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
133
136
|
testId: testId
|
|
134
137
|
}));
|
|
135
138
|
case 'forbidden':
|
|
@@ -18,7 +18,8 @@ export const EmbedCardUnauthorisedView = ({
|
|
|
18
18
|
onAuthorise,
|
|
19
19
|
inheritDimensions,
|
|
20
20
|
onClick,
|
|
21
|
-
extensionKey
|
|
21
|
+
extensionKey,
|
|
22
|
+
isProductIntegrationSupported
|
|
22
23
|
}) => {
|
|
23
24
|
const icon = context && context.icon && /*#__PURE__*/React.createElement(ImageIcon, {
|
|
24
25
|
src: typeof context.icon === 'string' ? context.icon : undefined
|
|
@@ -50,6 +51,7 @@ export const EmbedCardUnauthorisedView = ({
|
|
|
50
51
|
}, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
51
52
|
analytics: analytics,
|
|
52
53
|
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
54
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
53
55
|
testId: testId
|
|
54
56
|
}));
|
|
55
57
|
}
|
|
@@ -60,7 +62,7 @@ export const EmbedCardUnauthorisedView = ({
|
|
|
60
62
|
testId: testId,
|
|
61
63
|
title: context !== null && context !== void 0 && context.text ? 'unauthorised_account_name' : 'unauthorised_account_name_no_provider'
|
|
62
64
|
});
|
|
63
|
-
}, [analytics, context, handleOnAuthorizeClick, onAuthorise, testId]);
|
|
65
|
+
}, [analytics, context, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorise, testId]);
|
|
64
66
|
return /*#__PURE__*/React.createElement(ExpandedFrame, {
|
|
65
67
|
href: link,
|
|
66
68
|
icon: icon,
|
|
@@ -11,6 +11,7 @@ const UnauthorizedView = ({
|
|
|
11
11
|
analytics,
|
|
12
12
|
context,
|
|
13
13
|
extensionKey,
|
|
14
|
+
isProductIntegrationSupported,
|
|
14
15
|
onAuthorize,
|
|
15
16
|
testId = 'embed-card-unauthorized-view',
|
|
16
17
|
...unresolvedViewProps
|
|
@@ -43,6 +44,7 @@ const UnauthorizedView = ({
|
|
|
43
44
|
description: /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
44
45
|
analytics: analytics,
|
|
45
46
|
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
47
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
46
48
|
testId: testId
|
|
47
49
|
}),
|
|
48
50
|
button: /*#__PURE__*/React.createElement(Button, {
|
|
@@ -77,7 +79,7 @@ const UnauthorizedView = ({
|
|
|
77
79
|
title: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_name_no_provider),
|
|
78
80
|
description: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_description_no_provider)
|
|
79
81
|
};
|
|
80
|
-
}, [analytics, context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, onAuthorize, testId]);
|
|
82
|
+
}, [analytics, context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorize, testId]);
|
|
81
83
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, content, {
|
|
82
84
|
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
83
85
|
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : getUnresolvedEmbedCardImage('unauthorized'),
|
|
@@ -2,12 +2,10 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
|
-
import DropdownMenu
|
|
6
|
-
import LozengeActionItem from './lozenge-action-item';
|
|
5
|
+
import DropdownMenu from '@atlaskit/dropdown-menu';
|
|
7
6
|
import LozengeActionTrigger from './lozenge-action-trigger';
|
|
8
7
|
import LozengeActionError from './lozenge-action-error';
|
|
9
8
|
import withErrorBoundary from './error-boundary';
|
|
10
|
-
import { dropdownItemGroupStyles } from './styled';
|
|
11
9
|
import useInvoke from '../../../../../../state/hooks/use-invoke';
|
|
12
10
|
import extractLozengeActionItems from '../../../../../../extractors/action/extract-lozenge-action-items';
|
|
13
11
|
import createStatusUpdateRequest from '../../../../../../utils/actions/create-status-update-request';
|
|
@@ -17,6 +15,7 @@ import { isInvokeCustomError } from '../../../../../../state/hooks/use-invoke/ut
|
|
|
17
15
|
import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
|
|
18
16
|
import { TrackQuickActionType } from '../../../../../../utils/analytics/analytics';
|
|
19
17
|
import { permissionLoadErrorAnalyticsPayload, unknownLoadErrorAnalyticsPayload, unknownUpdateErrorAnalyticsPayload, validationUpdateErrorAnalyticsPayload } from './lozenge-action-analytics';
|
|
18
|
+
import LozengeActionItemsGroup from './lozenge-action-items-group';
|
|
20
19
|
const validateItems = (items = [], text) => {
|
|
21
20
|
return items.filter(item => item.text !== text);
|
|
22
21
|
};
|
|
@@ -135,14 +134,11 @@ const LozengeAction = ({
|
|
|
135
134
|
});
|
|
136
135
|
}
|
|
137
136
|
if (items && items.length > 0) {
|
|
138
|
-
return jsx(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
onClick: handleItemClick,
|
|
144
|
-
testId: `${testId}-item-${idx}`
|
|
145
|
-
})))));
|
|
137
|
+
return jsx(LozengeActionItemsGroup, {
|
|
138
|
+
testId: testId,
|
|
139
|
+
items: items,
|
|
140
|
+
onClick: handleItemClick
|
|
141
|
+
});
|
|
146
142
|
}
|
|
147
143
|
}, [errorMessage, handleItemClick, items, previewData, testId, url]);
|
|
148
144
|
return jsx(DropdownMenu, {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import LozengeActionItem from '../lozenge-action-item';
|
|
5
|
+
import { dropdownItemGroupStyles } from '../styled';
|
|
6
|
+
import { DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
7
|
+
const LozengeActionItemsGroup = ({
|
|
8
|
+
items,
|
|
9
|
+
testId,
|
|
10
|
+
onClick
|
|
11
|
+
}) =>
|
|
12
|
+
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
13
|
+
jsx("span", {
|
|
14
|
+
css: dropdownItemGroupStyles,
|
|
15
|
+
"data-testid": `${testId}-item-group`
|
|
16
|
+
}, jsx(DropdownItemGroup, null, items.map((item, idx) => jsx(LozengeActionItem, _extends({}, item, {
|
|
17
|
+
key: idx,
|
|
18
|
+
onClick: onClick,
|
|
19
|
+
testId: `${testId}-item-${idx}`
|
|
20
|
+
})))));
|
|
21
|
+
export default LozengeActionItemsGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,6 +11,7 @@ import ActionGroup from '../../../../FlexibleCard/components/blocks/action-group
|
|
|
11
11
|
import { LinkIcon } from '../../../../FlexibleCard/components/elements';
|
|
12
12
|
import { ActionName, CardDisplay } from '../../../../../constants';
|
|
13
13
|
import { useSmartCardActions } from '../../../../../state/actions';
|
|
14
|
+
import { hasAuthScopeOverrides } from '../../../../../state/helpers';
|
|
14
15
|
const HoverCardUnauthorisedView = ({
|
|
15
16
|
analytics,
|
|
16
17
|
extensionKey,
|
|
@@ -25,6 +26,7 @@ const HoverCardUnauthorisedView = ({
|
|
|
25
26
|
} = flexibleCardProps;
|
|
26
27
|
const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
27
28
|
const providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
29
|
+
const isProductIntegrationSupported = hasAuthScopeOverrides(cardState.details);
|
|
28
30
|
const {
|
|
29
31
|
authorize
|
|
30
32
|
} = useSmartCardActions(id, url, analytics);
|
|
@@ -59,6 +61,7 @@ const HoverCardUnauthorisedView = ({
|
|
|
59
61
|
testId: `${testId}-content`
|
|
60
62
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
61
63
|
providerName: providerName,
|
|
64
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
62
65
|
analytics: analytics
|
|
63
66
|
}))), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
64
67
|
overrideCss: connectButtonStyles,
|