@atlaskit/smart-card 26.33.0 → 26.33.1
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 +6 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedCard/utils.js +17 -0
- package/dist/cjs/view/EmbedCard/views/ForbiddenView.js +3 -2
- package/dist/cjs/view/EmbedCard/views/NotFoundView.js +3 -2
- package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +4 -3
- package/dist/cjs/view/EmbedCard/views/forbidden-view/index.js +3 -2
- package/dist/cjs/view/EmbedCard/views/not-found-view/index.js +3 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedCard/utils.js +11 -0
- package/dist/es2019/view/EmbedCard/views/ForbiddenView.js +3 -2
- package/dist/es2019/view/EmbedCard/views/NotFoundView.js +3 -2
- package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +4 -3
- package/dist/es2019/view/EmbedCard/views/forbidden-view/index.js +3 -2
- package/dist/es2019/view/EmbedCard/views/not-found-view/index.js +3 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedCard/utils.js +11 -0
- package/dist/esm/view/EmbedCard/views/ForbiddenView.js +3 -2
- package/dist/esm/view/EmbedCard/views/NotFoundView.js +3 -2
- package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +4 -3
- package/dist/esm/view/EmbedCard/views/forbidden-view/index.js +3 -2
- package/dist/esm/view/EmbedCard/views/not-found-view/index.js +3 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/EmbedCard/utils.d.ts +1 -0
- package/dist/types-ts4.5/view/EmbedCard/utils.d.ts +1 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.33.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#40937](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40937) [`6c144f0cff6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c144f0cff6) - Unskipped embed card VR tests
|
|
8
|
+
|
|
3
9
|
## 26.33.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -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.33.
|
|
25
|
+
packageVersion: "26.33.1"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getUnresolvedEmbedCardImage = void 0;
|
|
7
|
+
var _constants = require("./constants");
|
|
8
|
+
var getUnresolvedEmbedCardImage = exports.getUnresolvedEmbedCardImage = function getUnresolvedEmbedCardImage(status) {
|
|
9
|
+
switch (status) {
|
|
10
|
+
case 'forbidden':
|
|
11
|
+
return _constants.LockImage;
|
|
12
|
+
case 'unauthorized':
|
|
13
|
+
return _constants.UnauthorisedImage;
|
|
14
|
+
case 'notFound':
|
|
15
|
+
return _constants.NotFoundImage;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -7,9 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.EmbedCardForbiddenView = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _UnresolvedView = require("./UnresolvedView");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
10
|
var _ExpandedFrame = require("../components/ExpandedFrame");
|
|
12
11
|
var _ImageIcon = require("../components/ImageIcon");
|
|
12
|
+
var _utils = require("../utils");
|
|
13
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
13
14
|
/**
|
|
14
15
|
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
|
|
15
16
|
* @deprecated Replaced by forbidden-view
|
|
@@ -63,7 +64,7 @@ var EmbedCardForbiddenView = exports.EmbedCardForbiddenView = function EmbedCard
|
|
|
63
64
|
testId: testId,
|
|
64
65
|
allowScrollBar: true
|
|
65
66
|
}, /*#__PURE__*/_react.default.createElement(_UnresolvedView.EmbedCardUnresolvedView, {
|
|
66
|
-
image:
|
|
67
|
+
image: (0, _utils.getUnresolvedEmbedCardImage)('forbidden'),
|
|
67
68
|
title: "invalid_permissions",
|
|
68
69
|
description: descriptionKey,
|
|
69
70
|
context: context && context.text,
|
|
@@ -7,9 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.EmbedCardNotFoundView = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _UnresolvedView = require("./UnresolvedView");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
10
|
var _ExpandedFrame = require("../components/ExpandedFrame");
|
|
12
11
|
var _ImageIcon = require("../components/ImageIcon");
|
|
12
|
+
var _utils = require("../utils");
|
|
13
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
13
14
|
/**
|
|
14
15
|
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
|
|
15
16
|
* @deprecated Replaced by not-found-view
|
|
@@ -36,7 +37,7 @@ var EmbedCardNotFoundView = exports.EmbedCardNotFoundView = function EmbedCardNo
|
|
|
36
37
|
testId: testId,
|
|
37
38
|
allowScrollBar: true
|
|
38
39
|
}, /*#__PURE__*/_react.default.createElement(_UnresolvedView.EmbedCardUnresolvedView, {
|
|
39
|
-
image:
|
|
40
|
+
image: (0, _utils.getUnresolvedEmbedCardImage)('notFound'),
|
|
40
41
|
title: "not_found_title",
|
|
41
42
|
description: "not_found_description",
|
|
42
43
|
context: context && context.text,
|
|
@@ -7,11 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.EmbedCardUnauthorisedView = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
10
11
|
var _UnresolvedView = require("./UnresolvedView");
|
|
11
|
-
var _constants = require("../constants");
|
|
12
12
|
var _ExpandedFrame = require("../components/ExpandedFrame");
|
|
13
13
|
var _ImageIcon = require("../components/ImageIcon");
|
|
14
14
|
var _UnauthorisedViewContent = _interopRequireDefault(require("../../common/UnauthorisedViewContent"));
|
|
15
|
+
var _utils = require("../utils");
|
|
15
16
|
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); }
|
|
16
17
|
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; }
|
|
17
18
|
var EmbedCardUnauthorisedView = exports.EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
|
|
@@ -48,7 +49,7 @@ var EmbedCardUnauthorisedView = exports.EmbedCardUnauthorisedView = function Emb
|
|
|
48
49
|
},
|
|
49
50
|
context: context && context.text,
|
|
50
51
|
description: "connect_unauthorised_account_description",
|
|
51
|
-
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image :
|
|
52
|
+
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : (0, _utils.getUnresolvedEmbedCardImage)('unauthorized'),
|
|
52
53
|
onClick: handleOnAuthorizeClick,
|
|
53
54
|
testId: testId,
|
|
54
55
|
title: "connect_link_account_card_name"
|
|
@@ -60,7 +61,7 @@ var EmbedCardUnauthorisedView = exports.EmbedCardUnauthorisedView = function Emb
|
|
|
60
61
|
}
|
|
61
62
|
return /*#__PURE__*/_react.default.createElement(_UnresolvedView.EmbedCardUnresolvedView, {
|
|
62
63
|
description: context !== null && context !== void 0 && context.text ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider',
|
|
63
|
-
image: (_context$image2 = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image2 !== void 0 ? _context$image2 :
|
|
64
|
+
image: (_context$image2 = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image2 !== void 0 ? _context$image2 : (0, _utils.getUnresolvedEmbedCardImage)('forbidden'),
|
|
64
65
|
context: context === null || context === void 0 ? void 0 : context.text,
|
|
65
66
|
testId: testId,
|
|
66
67
|
title: context !== null && context !== void 0 && context.text ? 'unauthorised_account_name' : 'unauthorised_account_name_no_provider'
|
|
@@ -11,10 +11,11 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _reactIntlNext = require("react-intl-next");
|
|
14
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
14
15
|
var _messages = require("../../../../messages");
|
|
15
16
|
var _intlUtils = require("../../../../utils/intl-utils");
|
|
16
|
-
var _constants = require("../../constants");
|
|
17
17
|
var _unresolvedView = _interopRequireDefault(require("../unresolved-view"));
|
|
18
|
+
var _utils = require("../../utils");
|
|
18
19
|
var _excluded = ["context", "onAuthorise", "accessContext", "testId"];
|
|
19
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); }
|
|
20
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; }
|
|
@@ -69,7 +70,7 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
69
70
|
}, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey, onAuthorise, values]);
|
|
70
71
|
return /*#__PURE__*/_react.default.createElement(_unresolvedView.default, (0, _extends2.default)({}, unresolvedViewProps, {
|
|
71
72
|
icon: icon,
|
|
72
|
-
image: image !== null && image !== void 0 ? image :
|
|
73
|
+
image: image !== null && image !== void 0 ? image : (0, _utils.getUnresolvedEmbedCardImage)('forbidden'),
|
|
73
74
|
testId: testId,
|
|
74
75
|
text: text,
|
|
75
76
|
title: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, (0, _intlUtils.toMessage)(_messages.messages.invalid_permissions, titleMessageKey), {
|
|
@@ -10,10 +10,11 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactIntlNext = require("react-intl-next");
|
|
13
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
13
14
|
var _messages = require("../../../../messages");
|
|
14
15
|
var _intlUtils = require("../../../../utils/intl-utils");
|
|
15
|
-
var _constants = require("../../constants");
|
|
16
16
|
var _unresolvedView = _interopRequireDefault(require("../unresolved-view"));
|
|
17
|
+
var _utils = require("../../utils");
|
|
17
18
|
var _excluded = ["context", "accessContext", "testId"];
|
|
18
19
|
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); }
|
|
19
20
|
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; }
|
|
@@ -38,7 +39,7 @@ var NotFoundView = function NotFoundView(_ref) {
|
|
|
38
39
|
}, [text]);
|
|
39
40
|
return /*#__PURE__*/_react.default.createElement(_unresolvedView.default, (0, _extends2.default)({}, unresolvedViewProps, {
|
|
40
41
|
icon: icon,
|
|
41
|
-
image: image !== null && image !== void 0 ? image :
|
|
42
|
+
image: image !== null && image !== void 0 ? image : (0, _utils.getUnresolvedEmbedCardImage)('notFound'),
|
|
42
43
|
testId: testId,
|
|
43
44
|
text: text,
|
|
44
45
|
title: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, (0, _intlUtils.toMessage)(_messages.messages.not_found_title, titleMessageKey), {
|
|
@@ -18,7 +18,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
18
18
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
19
19
|
var PACKAGE_DATA = {
|
|
20
20
|
packageName: "@atlaskit/smart-card",
|
|
21
|
-
packageVersion: "26.33.
|
|
21
|
+
packageVersion: "26.33.1",
|
|
22
22
|
componentName: 'linkUrl'
|
|
23
23
|
};
|
|
24
24
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -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.33.
|
|
7
|
+
packageVersion: "26.33.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LockImage, NotFoundImage, UnauthorisedImage } from './constants';
|
|
2
|
+
export const getUnresolvedEmbedCardImage = status => {
|
|
3
|
+
switch (status) {
|
|
4
|
+
case 'forbidden':
|
|
5
|
+
return LockImage;
|
|
6
|
+
case 'unauthorized':
|
|
7
|
+
return UnauthorisedImage;
|
|
8
|
+
case 'notFound':
|
|
9
|
+
return NotFoundImage;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EmbedCardUnresolvedView } from './UnresolvedView';
|
|
3
|
-
import { LockImage } from '../constants';
|
|
4
3
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
5
4
|
import { ImageIcon } from '../components/ImageIcon';
|
|
5
|
+
import { getUnresolvedEmbedCardImage } from '../utils';
|
|
6
|
+
import { di } from 'react-magnetic-di';
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
|
|
8
9
|
* @deprecated Replaced by forbidden-view
|
|
@@ -57,7 +58,7 @@ export const EmbedCardForbiddenView = ({
|
|
|
57
58
|
testId: testId,
|
|
58
59
|
allowScrollBar: true
|
|
59
60
|
}, /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
|
|
60
|
-
image:
|
|
61
|
+
image: getUnresolvedEmbedCardImage('forbidden'),
|
|
61
62
|
title: "invalid_permissions",
|
|
62
63
|
description: descriptionKey,
|
|
63
64
|
context: context && context.text,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EmbedCardUnresolvedView } from './UnresolvedView';
|
|
3
|
-
import { NotFoundImage } from '../constants';
|
|
4
3
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
5
4
|
import { ImageIcon } from '../components/ImageIcon';
|
|
5
|
+
import { getUnresolvedEmbedCardImage } from '../utils';
|
|
6
|
+
import { di } from 'react-magnetic-di';
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
|
|
8
9
|
* @deprecated Replaced by not-found-view
|
|
@@ -29,7 +30,7 @@ export const EmbedCardNotFoundView = ({
|
|
|
29
30
|
testId: testId,
|
|
30
31
|
allowScrollBar: true
|
|
31
32
|
}, /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
|
|
32
|
-
image:
|
|
33
|
+
image: getUnresolvedEmbedCardImage('notFound'),
|
|
33
34
|
title: "not_found_title",
|
|
34
35
|
description: "not_found_description",
|
|
35
36
|
context: context && context.text,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { di } from 'react-magnetic-di';
|
|
2
3
|
import { EmbedCardUnresolvedView } from './UnresolvedView';
|
|
3
|
-
import { LockImage, UnauthorisedImage } from '../constants';
|
|
4
4
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
5
5
|
import { ImageIcon } from '../components/ImageIcon';
|
|
6
6
|
import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
7
|
+
import { getUnresolvedEmbedCardImage } from '../utils';
|
|
7
8
|
export const EmbedCardUnauthorisedView = ({
|
|
8
9
|
analytics,
|
|
9
10
|
link,
|
|
@@ -38,7 +39,7 @@ export const EmbedCardUnauthorisedView = ({
|
|
|
38
39
|
},
|
|
39
40
|
context: context && context.text,
|
|
40
41
|
description: "connect_unauthorised_account_description",
|
|
41
|
-
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image :
|
|
42
|
+
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : getUnresolvedEmbedCardImage('unauthorized'),
|
|
42
43
|
onClick: handleOnAuthorizeClick,
|
|
43
44
|
testId: testId,
|
|
44
45
|
title: "connect_link_account_card_name"
|
|
@@ -50,7 +51,7 @@ export const EmbedCardUnauthorisedView = ({
|
|
|
50
51
|
}
|
|
51
52
|
return /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
|
|
52
53
|
description: context !== null && context !== void 0 && context.text ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider',
|
|
53
|
-
image: (_context$image2 = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image2 !== void 0 ? _context$image2 :
|
|
54
|
+
image: (_context$image2 = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image2 !== void 0 ? _context$image2 : getUnresolvedEmbedCardImage('forbidden'),
|
|
54
55
|
context: context === null || context === void 0 ? void 0 : context.text,
|
|
55
56
|
testId: testId,
|
|
56
57
|
title: context !== null && context !== void 0 && context.text ? 'unauthorised_account_name' : 'unauthorised_account_name_no_provider'
|
|
@@ -2,10 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import Button from '@atlaskit/button';
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
|
+
import { di } from 'react-magnetic-di';
|
|
5
6
|
import { messages } from '../../../../messages';
|
|
6
7
|
import { toMessage } from '../../../../utils/intl-utils';
|
|
7
|
-
import { LockImage } from '../../constants';
|
|
8
8
|
import UnresolvedView from '../unresolved-view';
|
|
9
|
+
import { getUnresolvedEmbedCardImage } from '../../utils';
|
|
9
10
|
const ForbiddenView = ({
|
|
10
11
|
context,
|
|
11
12
|
onAuthorise,
|
|
@@ -58,7 +59,7 @@ const ForbiddenView = ({
|
|
|
58
59
|
}, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey, onAuthorise, values]);
|
|
59
60
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
|
|
60
61
|
icon: icon,
|
|
61
|
-
image: image !== null && image !== void 0 ? image :
|
|
62
|
+
image: image !== null && image !== void 0 ? image : getUnresolvedEmbedCardImage('forbidden'),
|
|
62
63
|
testId: testId,
|
|
63
64
|
text: text,
|
|
64
65
|
title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, toMessage(messages.invalid_permissions, titleMessageKey), {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
+
import { di } from 'react-magnetic-di';
|
|
4
5
|
import { messages } from '../../../../messages';
|
|
5
6
|
import { toMessage } from '../../../../utils/intl-utils';
|
|
6
|
-
import { NotFoundImage } from '../../constants';
|
|
7
7
|
import UnresolvedView from '../unresolved-view';
|
|
8
|
+
import { getUnresolvedEmbedCardImage } from '../../utils';
|
|
8
9
|
const NotFoundView = ({
|
|
9
10
|
context,
|
|
10
11
|
accessContext,
|
|
@@ -25,7 +26,7 @@ const NotFoundView = ({
|
|
|
25
26
|
}), [text]);
|
|
26
27
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
|
|
27
28
|
icon: icon,
|
|
28
|
-
image: image !== null && image !== void 0 ? image :
|
|
29
|
+
image: image !== null && image !== void 0 ? image : getUnresolvedEmbedCardImage('notFound'),
|
|
29
30
|
testId: testId,
|
|
30
31
|
text: text,
|
|
31
32
|
title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, toMessage(messages.not_found_title, titleMessageKey), {
|
|
@@ -8,7 +8,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
8
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
const PACKAGE_DATA = {
|
|
10
10
|
packageName: "@atlaskit/smart-card",
|
|
11
|
-
packageVersion: "26.33.
|
|
11
|
+
packageVersion: "26.33.1",
|
|
12
12
|
componentName: 'linkUrl'
|
|
13
13
|
};
|
|
14
14
|
const Link = withLinkClickedEvent('a');
|
|
@@ -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.33.
|
|
18
|
+
packageVersion: "26.33.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LockImage, NotFoundImage, UnauthorisedImage } from './constants';
|
|
2
|
+
export var getUnresolvedEmbedCardImage = function getUnresolvedEmbedCardImage(status) {
|
|
3
|
+
switch (status) {
|
|
4
|
+
case 'forbidden':
|
|
5
|
+
return LockImage;
|
|
6
|
+
case 'unauthorized':
|
|
7
|
+
return UnauthorisedImage;
|
|
8
|
+
case 'notFound':
|
|
9
|
+
return NotFoundImage;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EmbedCardUnresolvedView } from './UnresolvedView';
|
|
3
|
-
import { LockImage } from '../constants';
|
|
4
3
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
5
4
|
import { ImageIcon } from '../components/ImageIcon';
|
|
5
|
+
import { getUnresolvedEmbedCardImage } from '../utils';
|
|
6
|
+
import { di } from 'react-magnetic-di';
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
|
|
8
9
|
* @deprecated Replaced by forbidden-view
|
|
@@ -56,7 +57,7 @@ export var EmbedCardForbiddenView = function EmbedCardForbiddenView(_ref) {
|
|
|
56
57
|
testId: testId,
|
|
57
58
|
allowScrollBar: true
|
|
58
59
|
}, /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
|
|
59
|
-
image:
|
|
60
|
+
image: getUnresolvedEmbedCardImage('forbidden'),
|
|
60
61
|
title: "invalid_permissions",
|
|
61
62
|
description: descriptionKey,
|
|
62
63
|
context: context && context.text,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EmbedCardUnresolvedView } from './UnresolvedView';
|
|
3
|
-
import { NotFoundImage } from '../constants';
|
|
4
3
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
5
4
|
import { ImageIcon } from '../components/ImageIcon';
|
|
5
|
+
import { getUnresolvedEmbedCardImage } from '../utils';
|
|
6
|
+
import { di } from 'react-magnetic-di';
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
|
|
8
9
|
* @deprecated Replaced by not-found-view
|
|
@@ -29,7 +30,7 @@ export var EmbedCardNotFoundView = function EmbedCardNotFoundView(_ref) {
|
|
|
29
30
|
testId: testId,
|
|
30
31
|
allowScrollBar: true
|
|
31
32
|
}, /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
|
|
32
|
-
image:
|
|
33
|
+
image: getUnresolvedEmbedCardImage('notFound'),
|
|
33
34
|
title: "not_found_title",
|
|
34
35
|
description: "not_found_description",
|
|
35
36
|
context: context && context.text,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { di } from 'react-magnetic-di';
|
|
2
3
|
import { EmbedCardUnresolvedView } from './UnresolvedView';
|
|
3
|
-
import { LockImage, UnauthorisedImage } from '../constants';
|
|
4
4
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
5
5
|
import { ImageIcon } from '../components/ImageIcon';
|
|
6
6
|
import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
7
|
+
import { getUnresolvedEmbedCardImage } from '../utils';
|
|
7
8
|
export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
|
|
8
9
|
var analytics = _ref.analytics,
|
|
9
10
|
link = _ref.link,
|
|
@@ -38,7 +39,7 @@ export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref)
|
|
|
38
39
|
},
|
|
39
40
|
context: context && context.text,
|
|
40
41
|
description: "connect_unauthorised_account_description",
|
|
41
|
-
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image :
|
|
42
|
+
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : getUnresolvedEmbedCardImage('unauthorized'),
|
|
42
43
|
onClick: handleOnAuthorizeClick,
|
|
43
44
|
testId: testId,
|
|
44
45
|
title: "connect_link_account_card_name"
|
|
@@ -50,7 +51,7 @@ export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref)
|
|
|
50
51
|
}
|
|
51
52
|
return /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
|
|
52
53
|
description: context !== null && context !== void 0 && context.text ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider',
|
|
53
|
-
image: (_context$image2 = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image2 !== void 0 ? _context$image2 :
|
|
54
|
+
image: (_context$image2 = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image2 !== void 0 ? _context$image2 : getUnresolvedEmbedCardImage('forbidden'),
|
|
54
55
|
context: context === null || context === void 0 ? void 0 : context.text,
|
|
55
56
|
testId: testId,
|
|
56
57
|
title: context !== null && context !== void 0 && context.text ? 'unauthorised_account_name' : 'unauthorised_account_name_no_provider'
|
|
@@ -4,10 +4,11 @@ var _excluded = ["context", "onAuthorise", "accessContext", "testId"];
|
|
|
4
4
|
import Button from '@atlaskit/button';
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
+
import { di } from 'react-magnetic-di';
|
|
7
8
|
import { messages } from '../../../../messages';
|
|
8
9
|
import { toMessage } from '../../../../utils/intl-utils';
|
|
9
|
-
import { LockImage } from '../../constants';
|
|
10
10
|
import UnresolvedView from '../unresolved-view';
|
|
11
|
+
import { getUnresolvedEmbedCardImage } from '../../utils';
|
|
11
12
|
var ForbiddenView = function ForbiddenView(_ref) {
|
|
12
13
|
var context = _ref.context,
|
|
13
14
|
onAuthorise = _ref.onAuthorise,
|
|
@@ -59,7 +60,7 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
59
60
|
}, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey, onAuthorise, values]);
|
|
60
61
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
|
|
61
62
|
icon: icon,
|
|
62
|
-
image: image !== null && image !== void 0 ? image :
|
|
63
|
+
image: image !== null && image !== void 0 ? image : getUnresolvedEmbedCardImage('forbidden'),
|
|
63
64
|
testId: testId,
|
|
64
65
|
text: text,
|
|
65
66
|
title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, toMessage(messages.invalid_permissions, titleMessageKey), {
|
|
@@ -3,10 +3,11 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["context", "accessContext", "testId"];
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import { di } from 'react-magnetic-di';
|
|
6
7
|
import { messages } from '../../../../messages';
|
|
7
8
|
import { toMessage } from '../../../../utils/intl-utils';
|
|
8
|
-
import { NotFoundImage } from '../../constants';
|
|
9
9
|
import UnresolvedView from '../unresolved-view';
|
|
10
|
+
import { getUnresolvedEmbedCardImage } from '../../utils';
|
|
10
11
|
var NotFoundView = function NotFoundView(_ref) {
|
|
11
12
|
var context = _ref.context,
|
|
12
13
|
accessContext = _ref.accessContext,
|
|
@@ -28,7 +29,7 @@ var NotFoundView = function NotFoundView(_ref) {
|
|
|
28
29
|
}, [text]);
|
|
29
30
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
|
|
30
31
|
icon: icon,
|
|
31
|
-
image: image !== null && image !== void 0 ? image :
|
|
32
|
+
image: image !== null && image !== void 0 ? image : getUnresolvedEmbedCardImage('notFound'),
|
|
32
33
|
testId: testId,
|
|
33
34
|
text: text,
|
|
34
35
|
title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, toMessage(messages.not_found_title, titleMessageKey), {
|
|
@@ -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.33.
|
|
14
|
+
packageVersion: "26.33.1",
|
|
15
15
|
componentName: 'linkUrl'
|
|
16
16
|
};
|
|
17
17
|
var Link = withLinkClickedEvent('a');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getUnresolvedEmbedCardImage: (status: 'forbidden' | 'unauthorized' | 'notFound') => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getUnresolvedEmbedCardImage: (status: 'forbidden' | 'unauthorized' | 'notFound') => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.33.
|
|
3
|
+
"version": "26.33.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
39
39
|
"@atlaskit/link-client-extension": "^1.7.0",
|
|
40
40
|
"@atlaskit/link-extractors": "^1.2.0",
|
|
41
|
-
"@atlaskit/linking-common": "^4.
|
|
41
|
+
"@atlaskit/linking-common": "^4.11.0",
|
|
42
42
|
"@atlaskit/linking-types": "^8.4.0",
|
|
43
43
|
"@atlaskit/logo": "^13.14.0",
|
|
44
44
|
"@atlaskit/lozenge": "^11.4.0",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"react-error-boundary": "^3.1.3",
|
|
61
61
|
"react-lazily-render": "^1.2.0",
|
|
62
62
|
"react-loadable": "^5.1.0",
|
|
63
|
+
"react-magnetic-di": "^2.2.6",
|
|
63
64
|
"react-render-image": "^1.1.3",
|
|
64
65
|
"use-sync-external-store": "^1.2.0",
|
|
65
66
|
"uuid": "^3.1.0"
|