@atlaskit/smart-card 23.6.7 → 23.7.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 +12 -0
- package/dist/cjs/constants.js +2 -0
- package/dist/cjs/extractors/flexible/index.js +1 -0
- package/dist/cjs/extractors/flexible/utils.js +9 -2
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/flexible/AuthorizeAction.js +10 -3
- package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +4 -2
- package/dist/cjs/view/BlockCard/components/flexible/footer/types.js +5 -0
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +31 -21
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +4 -0
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +9 -2
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +6 -0
- package/dist/cjs/view/HoverCard/utils.js +1 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +2 -2
- package/dist/es2019/constants.js +2 -0
- package/dist/es2019/extractors/flexible/index.js +2 -1
- package/dist/es2019/extractors/flexible/utils.js +5 -1
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/actions/flexible/AuthorizeAction.js +9 -3
- package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +3 -2
- package/dist/es2019/view/BlockCard/components/flexible/footer/types.js +1 -0
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +25 -17
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +6 -0
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +7 -0
- package/dist/es2019/view/HoverCard/utils.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +2 -2
- package/dist/esm/constants.js +2 -0
- package/dist/esm/extractors/flexible/index.js +2 -1
- package/dist/esm/extractors/flexible/utils.js +4 -0
- package/dist/esm/messages.js +5 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/flexible/AuthorizeAction.js +9 -3
- package/dist/esm/view/BlockCard/components/flexible/footer/index.js +4 -2
- package/dist/esm/view/BlockCard/components/flexible/footer/types.js +1 -0
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +26 -19
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +4 -0
- package/dist/esm/view/FlexibleCard/components/elements/index.js +6 -0
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +6 -0
- package/dist/esm/view/HoverCard/utils.js +1 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +2 -2
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/extractors/flexible/utils.d.ts +1 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +5 -0
- package/dist/types/view/BlockCard/actions/flexible/AuthorizeAction.d.ts +3 -2
- package/dist/types/view/BlockCard/components/flexible/footer/index.d.ts +2 -2
- package/dist/types/view/BlockCard/components/flexible/footer/types.d.ts +5 -0
- package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +8 -1
- package/dist/types/view/FlexibleCard/components/elements/index.d.ts +5 -0
- package/package.json +1 -1
- package/report.api.md +8 -0
- package/tmp/api-report-tmp.d.ts +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 23.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`33e0b942925`](https://bitbucket.org/atlassian/atlassian-frontend/commits/33e0b942925) - [ux] Flexible Card: Update unauthorised view text messages and connect button
|
|
8
|
+
|
|
9
|
+
## 23.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`3cae92db2b6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3cae92db2b6) - [ux] Introduces ChecklistProgress element, adds to Trello Hover Cards
|
|
14
|
+
|
|
3
15
|
## 23.6.7
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -133,6 +133,7 @@ exports.ElementName = ElementName;
|
|
|
133
133
|
(function (ElementName) {
|
|
134
134
|
ElementName["AttachmentCount"] = "AttachmentCount";
|
|
135
135
|
ElementName["AuthorGroup"] = "AuthorGroup";
|
|
136
|
+
ElementName["ChecklistProgress"] = "ChecklistProgress";
|
|
136
137
|
ElementName["CollaboratorGroup"] = "CollaboratorGroup";
|
|
137
138
|
ElementName["CommentCount"] = "CommentCount";
|
|
138
139
|
ElementName["CreatedBy"] = "CreatedBy";
|
|
@@ -225,6 +226,7 @@ exports.IconType = IconType;
|
|
|
225
226
|
IconType["Error"] = "Default:Error";
|
|
226
227
|
IconType["Forbidden"] = "Default:Forbidden";
|
|
227
228
|
IconType["Attachment"] = "Badge:Attachment";
|
|
229
|
+
IconType["CheckItem"] = "Badge:Task";
|
|
228
230
|
IconType["Comment"] = "Badge:Comment";
|
|
229
231
|
IconType["View"] = "Badge:View";
|
|
230
232
|
IconType["React"] = "Badge:React";
|
|
@@ -48,6 +48,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext(response, rende
|
|
|
48
48
|
viewCount: (0, _utils.extractViewCount)(data),
|
|
49
49
|
reactCount: (0, _utils.extractReactCount)(data),
|
|
50
50
|
voteCount: (0, _utils.extractVoteCount)(data),
|
|
51
|
+
checklistProgress: (0, _utils.extractChecklistProgress)(data),
|
|
51
52
|
createdBy: (0, _utils.extractCreatedBy)(data),
|
|
52
53
|
createdOn: (0, _extractors.extractDateCreated)(data),
|
|
53
54
|
dueOn: (0, _utils.extractDueOn)(data),
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.extractVoteCount = exports.extractViewCount = exports.extractTargetBranch = exports.extractSubscriberCount = exports.extractSourceBranch = exports.extractReactCount = exports.extractProgrammingLanguage = exports.extractModifiedBy = exports.extractDueOn = exports.extractCreatedBy = exports.extractCommentCount = exports.extractAttachmentCount = void 0;
|
|
8
|
+
exports.extractVoteCount = exports.extractViewCount = exports.extractTargetBranch = exports.extractSubscriberCount = exports.extractSourceBranch = exports.extractReactCount = exports.extractProgrammingLanguage = exports.extractModifiedBy = exports.extractDueOn = exports.extractCreatedBy = exports.extractCommentCount = exports.extractChecklistProgress = exports.extractAttachmentCount = void 0;
|
|
9
9
|
|
|
10
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
11
|
|
|
@@ -99,4 +99,11 @@ var extractTargetBranch = function extractTargetBranch(data) {
|
|
|
99
99
|
return extractLinkName(data['atlassian:mergeDestination']);
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
exports.extractTargetBranch = extractTargetBranch;
|
|
102
|
+
exports.extractTargetBranch = extractTargetBranch;
|
|
103
|
+
|
|
104
|
+
var extractChecklistProgress = function extractChecklistProgress(data) {
|
|
105
|
+
var checkItemsObj = extractValue(data, 'atlassian:checkItems');
|
|
106
|
+
return checkItemsObj ? "".concat(checkItemsObj.checkedItems, "/").concat(checkItemsObj.totalItems) : undefined;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
exports.extractChecklistProgress = extractChecklistProgress;
|
package/dist/cjs/messages.js
CHANGED
|
@@ -88,6 +88,11 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
88
88
|
defaultMessage: 'Connect {context} to Atlassian to view more details from your work and collaboration from one place.',
|
|
89
89
|
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.'
|
|
90
90
|
},
|
|
91
|
+
connect_unauthorised_account_description_no_provider: {
|
|
92
|
+
id: 'fabric.linking.connect_unauthorised_account_description',
|
|
93
|
+
defaultMessage: 'Connect to Atlassian to view more details from your work and collaboration from one place.',
|
|
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 and we do not have the providers name.'
|
|
95
|
+
},
|
|
91
96
|
could_not_load_link: {
|
|
92
97
|
id: 'fabric.linking.couldnt_load_link',
|
|
93
98
|
defaultMessage: "We couldn't load this link for an unknown reason.",
|
package/dist/cjs/version.json
CHANGED
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.AuthorizeAction = void 0;
|
|
9
9
|
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
|
11
13
|
|
|
12
14
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -16,15 +18,20 @@ var _constants = require("../../../../constants");
|
|
|
16
18
|
var _messages = require("../../../../messages");
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
|
-
* Returns a CustomActionItem with a "Connect"
|
|
21
|
+
* Returns a CustomActionItem with a "Connect to <providerName>" message
|
|
20
22
|
*
|
|
21
23
|
* @see CustomActionItem
|
|
22
24
|
* @param onAuthorize a function that will be called on the click of the button
|
|
25
|
+
* @param providerName a string which is inserted into the message of the button
|
|
23
26
|
*/
|
|
24
|
-
var AuthorizeAction = function AuthorizeAction(onAuthorize) {
|
|
27
|
+
var AuthorizeAction = function AuthorizeAction(onAuthorize, providerName) {
|
|
25
28
|
return {
|
|
26
29
|
name: _constants.ActionName.CustomAction,
|
|
27
|
-
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.
|
|
30
|
+
content: providerName ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_unauthorised_account_action, {
|
|
31
|
+
values: {
|
|
32
|
+
context: providerName
|
|
33
|
+
}
|
|
34
|
+
})) : /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.connect_link_account_card),
|
|
28
35
|
onClick: onAuthorize
|
|
29
36
|
};
|
|
30
37
|
};
|
|
@@ -47,7 +47,9 @@ var BlockCardFooter = function BlockCardFooter(props) {
|
|
|
47
47
|
_props$size = props.size,
|
|
48
48
|
size = _props$size === void 0 ? _constants.SmartLinkSize.Medium : _props$size,
|
|
49
49
|
_props$testId = props.testId,
|
|
50
|
-
testId = _props$testId === void 0 ? 'smart-block-card-footer' : _props$testId
|
|
50
|
+
testId = _props$testId === void 0 ? 'smart-block-card-footer' : _props$testId,
|
|
51
|
+
_props$actionGroupApp = props.actionGroupAppearance,
|
|
52
|
+
actionGroupAppearance = _props$actionGroupApp === void 0 ? 'default' : _props$actionGroupApp;
|
|
51
53
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_elements.Provider, {
|
|
52
54
|
testId: "".concat(testId, "-provider"),
|
|
53
55
|
overrideCss: providerStyles
|
|
@@ -59,7 +61,7 @@ var BlockCardFooter = function BlockCardFooter(props) {
|
|
|
59
61
|
width: _constants.SmartLinkWidth.Flexible
|
|
60
62
|
}, /*#__PURE__*/_react.default.createElement(_actionGroup.default, {
|
|
61
63
|
items: actions,
|
|
62
|
-
appearance:
|
|
64
|
+
appearance: actionGroupAppearance
|
|
63
65
|
})) : null);
|
|
64
66
|
};
|
|
65
67
|
|
|
@@ -9,26 +9,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
11
|
|
|
12
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
+
|
|
12
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
|
|
14
16
|
var _FlexibleCard = _interopRequireDefault(require("../../../FlexibleCard"));
|
|
15
17
|
|
|
16
|
-
var _titleBlock = _interopRequireDefault(require("../../../FlexibleCard/components/blocks/title-block"));
|
|
17
|
-
|
|
18
|
-
var _messages = require("../../../../messages");
|
|
19
|
-
|
|
20
|
-
var _text = _interopRequireDefault(require("../../../FlexibleCard/components/elements/text"));
|
|
21
|
-
|
|
22
18
|
var _AuthorizeAction = require("../../actions/flexible/AuthorizeAction");
|
|
23
19
|
|
|
24
20
|
var _footer = _interopRequireDefault(require("../../components/flexible/footer"));
|
|
25
21
|
|
|
26
22
|
var _blocks = require("../../../FlexibleCard/components/blocks");
|
|
27
23
|
|
|
24
|
+
var _constants = require("../../../../constants");
|
|
25
|
+
|
|
26
|
+
var _extractors = require("@atlaskit/linking-common/extractors");
|
|
27
|
+
|
|
28
|
+
var _UnauthorisedViewContent = _interopRequireDefault(require("../../../common/UnauthorisedViewContent"));
|
|
29
|
+
|
|
30
|
+
var _react2 = require("@emotion/react");
|
|
31
|
+
|
|
32
|
+
var _token = require("../../../../utils/token");
|
|
33
|
+
|
|
34
|
+
var _templateObject;
|
|
35
|
+
|
|
28
36
|
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); }
|
|
29
37
|
|
|
30
38
|
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; }
|
|
31
39
|
|
|
40
|
+
var contentStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n margin-top: 0.5rem;\n font-size: 0.75rem;\n"])), _token.tokens.text);
|
|
32
41
|
/**
|
|
33
42
|
* This view represents a Block card that has an 'Unauthorized' status .
|
|
34
43
|
* It should have a "Connect" button that will allow a user to connect their account and view the block card.
|
|
@@ -36,10 +45,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
36
45
|
* @see SmartLinkStatus
|
|
37
46
|
* @see FlexibleCardProps
|
|
38
47
|
*/
|
|
48
|
+
|
|
39
49
|
var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
50
|
+
var _cardState$details, _extractProvider;
|
|
51
|
+
|
|
40
52
|
var cardState = _ref.cardState,
|
|
41
|
-
_ref$providerName = _ref.providerName,
|
|
42
|
-
providerName = _ref$providerName === void 0 ? '' : _ref$providerName,
|
|
43
53
|
onAuthorize = _ref.onAuthorize,
|
|
44
54
|
onClick = _ref.onClick,
|
|
45
55
|
onError = _ref.onError,
|
|
@@ -47,10 +57,11 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
47
57
|
testId = _ref$testId === void 0 ? 'smart-block-unauthorized-view' : _ref$testId,
|
|
48
58
|
ui = _ref.ui,
|
|
49
59
|
url = _ref.url;
|
|
50
|
-
var
|
|
60
|
+
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
61
|
+
var providerName = (_extractProvider = (0, _extractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
51
62
|
var actions = (0, _react.useMemo)(function () {
|
|
52
|
-
return onAuthorize ? [(0, _AuthorizeAction.AuthorizeAction)(onAuthorize)] : [];
|
|
53
|
-
}, [onAuthorize]);
|
|
63
|
+
return onAuthorize ? [(0, _AuthorizeAction.AuthorizeAction)(onAuthorize, providerName)] : [];
|
|
64
|
+
}, [onAuthorize, providerName]);
|
|
54
65
|
return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, {
|
|
55
66
|
appearance: "block",
|
|
56
67
|
cardState: cardState,
|
|
@@ -60,18 +71,17 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
60
71
|
testId: testId,
|
|
61
72
|
ui: ui,
|
|
62
73
|
url: url
|
|
63
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, {
|
|
64
75
|
hideRetry: true
|
|
65
|
-
}), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
})), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, null, /*#__PURE__*/_react.default.createElement(_footer.default, {
|
|
76
|
+
}), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, {
|
|
77
|
+
overrideCss: contentStyles,
|
|
78
|
+
testId: "".concat(testId, "-content")
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UnauthorisedViewContent.default, {
|
|
80
|
+
providerName: providerName
|
|
81
|
+
}))), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, null, /*#__PURE__*/_react.default.createElement(_footer.default, {
|
|
73
82
|
actions: actions,
|
|
74
|
-
status:
|
|
83
|
+
status: _constants.SmartLinkStatus.Unauthorized,
|
|
84
|
+
actionGroupAppearance: "primary"
|
|
75
85
|
})));
|
|
76
86
|
};
|
|
77
87
|
|
|
@@ -48,7 +48,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
48
48
|
|
|
49
49
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
50
50
|
|
|
51
|
-
var ElementDisplaySchema = (_ElementDisplaySchema = {}, (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AttachmentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AuthorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CollaboratorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CommentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ViewCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ReactCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.VoteCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.DueOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LatestCommit, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LinkIcon, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Preview, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Priority, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ProgrammingLanguage, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Provider, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Snippet, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SourceBranch, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.State, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubscriberCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.TargetBranch, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Title, ['inline']), _ElementDisplaySchema);
|
|
51
|
+
var ElementDisplaySchema = (_ElementDisplaySchema = {}, (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AttachmentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AuthorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ChecklistProgress, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CollaboratorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CommentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ViewCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ReactCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.VoteCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.DueOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LatestCommit, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LinkIcon, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Preview, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Priority, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ProgrammingLanguage, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Provider, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Snippet, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SourceBranch, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.State, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubscriberCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.TargetBranch, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Title, ['inline']), _ElementDisplaySchema);
|
|
52
52
|
exports.ElementDisplaySchema = ElementDisplaySchema;
|
|
53
53
|
|
|
54
54
|
var getDirectionStyles = function getDirectionStyles(direction) {
|
|
@@ -210,6 +210,10 @@ var importIconMapper = (_importIconMapper = {}, (0, _defineProperty2.default)(_i
|
|
|
210
210
|
return Promise.resolve().then(function () {
|
|
211
211
|
return _interopRequireWildcard(require('@atlaskit/icon/glyph/attachment'));
|
|
212
212
|
});
|
|
213
|
+
}), (0, _defineProperty2.default)(_importIconMapper, _constants.IconType.CheckItem, function () {
|
|
214
|
+
return Promise.resolve().then(function () {
|
|
215
|
+
return _interopRequireWildcard(require('@atlaskit/icon/glyph/task'));
|
|
216
|
+
});
|
|
213
217
|
}), (0, _defineProperty2.default)(_importIconMapper, _constants.IconType.Comment, function () {
|
|
214
218
|
return Promise.resolve().then(function () {
|
|
215
219
|
return _interopRequireWildcard(require('@atlaskit/icon/glyph/comment'));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VoteCount = exports.ViewCount = exports.Title = exports.TargetBranch = exports.SubscriberCount = exports.State = exports.SourceBranch = exports.Snippet = exports.ReactCount = exports.Provider = exports.ProgrammingLanguage = exports.Priority = exports.Preview = exports.ModifiedOn = exports.ModifiedBy = exports.LinkIcon = exports.LatestCommit = exports.DueOn = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.AuthorGroup = exports.AttachmentCount = void 0;
|
|
6
|
+
exports.VoteCount = exports.ViewCount = exports.Title = exports.TargetBranch = exports.SubscriberCount = exports.State = exports.SourceBranch = exports.Snippet = exports.ReactCount = exports.Provider = exports.ProgrammingLanguage = exports.Priority = exports.Preview = exports.ModifiedOn = exports.ModifiedBy = exports.LinkIcon = exports.LatestCommit = exports.DueOn = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.ChecklistProgress = exports.AuthorGroup = exports.AttachmentCount = void 0;
|
|
7
7
|
|
|
8
8
|
var _utils = require("./utils");
|
|
9
9
|
|
|
@@ -25,12 +25,19 @@ var AttachmentCount = (0, _utils.createElement)(_constants.ElementName.Attachmen
|
|
|
25
25
|
|
|
26
26
|
exports.AttachmentCount = AttachmentCount;
|
|
27
27
|
var AuthorGroup = (0, _utils.createElement)(_constants.ElementName.AuthorGroup);
|
|
28
|
+
/**
|
|
29
|
+
* Creates a Checklist Badge element using the data from ChecklistProgress in the Flexible UI Context.
|
|
30
|
+
* @see Badge
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
exports.AuthorGroup = AuthorGroup;
|
|
34
|
+
var ChecklistProgress = (0, _utils.createElement)(_constants.ElementName.ChecklistProgress);
|
|
28
35
|
/**
|
|
29
36
|
* An AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
|
|
30
37
|
* @see AvatarGroup
|
|
31
38
|
*/
|
|
32
39
|
|
|
33
|
-
exports.
|
|
40
|
+
exports.ChecklistProgress = ChecklistProgress;
|
|
34
41
|
var CollaboratorGroup = (0, _utils.createElement)(_constants.ElementName.CollaboratorGroup);
|
|
35
42
|
/**
|
|
36
43
|
* Creates a CommentCount Badge element using the data from CommentCount in the Flexible UI Context.
|
|
@@ -59,6 +59,11 @@ var elementMappings = (_elementMappings = {}, (0, _defineProperty2.default)(_ele
|
|
|
59
59
|
}
|
|
60
60
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.AuthorGroup, {
|
|
61
61
|
component: _avatarGroup.default
|
|
62
|
+
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.ChecklistProgress, {
|
|
63
|
+
component: _badge.default,
|
|
64
|
+
props: {
|
|
65
|
+
icon: _constants.IconType.CheckItem
|
|
66
|
+
}
|
|
62
67
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.CollaboratorGroup, {
|
|
63
68
|
component: _avatarGroup.default
|
|
64
69
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.CommentCount, {
|
|
@@ -149,6 +154,7 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
149
154
|
return toAvatarGroupProps(data);
|
|
150
155
|
|
|
151
156
|
case _constants.ElementName.AttachmentCount:
|
|
157
|
+
case _constants.ElementName.ChecklistProgress:
|
|
152
158
|
case _constants.ElementName.CommentCount:
|
|
153
159
|
case _constants.ElementName.ViewCount:
|
|
154
160
|
case _constants.ElementName.ReactCount:
|
|
@@ -65,7 +65,7 @@ var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
65
65
|
return {
|
|
66
66
|
metadata: {
|
|
67
67
|
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.State, _constants.ElementName.DueOn],
|
|
68
|
-
secondary: [_constants.ElementName.ReactCount, _constants.ElementName.CommentCount, _constants.ElementName.AttachmentCount],
|
|
68
|
+
secondary: [_constants.ElementName.ReactCount, _constants.ElementName.CommentCount, _constants.ElementName.AttachmentCount, _constants.ElementName.ChecklistProgress],
|
|
69
69
|
subtitle: []
|
|
70
70
|
}
|
|
71
71
|
};
|
|
@@ -25,11 +25,11 @@ var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
|
25
25
|
var providerName = _ref.providerName,
|
|
26
26
|
_ref$testId = _ref.testId,
|
|
27
27
|
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId;
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_unauthorised_account_description, {
|
|
28
|
+
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
29
|
values: {
|
|
30
30
|
context: providerName
|
|
31
31
|
}
|
|
32
|
-
})), ' ', /*#__PURE__*/_react.default.createElement("a", {
|
|
32
|
+
})) : /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.connect_unauthorised_account_description_no_provider), ' ', /*#__PURE__*/_react.default.createElement("a", {
|
|
33
33
|
href: _constants.CONTENT_URL_SECURITY_AND_PERMISSIONS,
|
|
34
34
|
target: "_blank",
|
|
35
35
|
"data-testid": "".concat(testId, "-learn-more")
|
package/dist/es2019/constants.js
CHANGED
|
@@ -110,6 +110,7 @@ export let ElementName;
|
|
|
110
110
|
(function (ElementName) {
|
|
111
111
|
ElementName["AttachmentCount"] = "AttachmentCount";
|
|
112
112
|
ElementName["AuthorGroup"] = "AuthorGroup";
|
|
113
|
+
ElementName["ChecklistProgress"] = "ChecklistProgress";
|
|
113
114
|
ElementName["CollaboratorGroup"] = "CollaboratorGroup";
|
|
114
115
|
ElementName["CommentCount"] = "CommentCount";
|
|
115
116
|
ElementName["CreatedBy"] = "CreatedBy";
|
|
@@ -198,6 +199,7 @@ export let IconType;
|
|
|
198
199
|
IconType["Error"] = "Default:Error";
|
|
199
200
|
IconType["Forbidden"] = "Default:Forbidden";
|
|
200
201
|
IconType["Attachment"] = "Badge:Attachment";
|
|
202
|
+
IconType["CheckItem"] = "Badge:Task";
|
|
201
203
|
IconType["Comment"] = "Badge:Comment";
|
|
202
204
|
IconType["View"] = "Badge:View";
|
|
203
205
|
IconType["React"] = "Badge:React";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractSummary } from '../common/primitives';
|
|
2
2
|
import { extractLozenge } from '../common/lozenge';
|
|
3
3
|
import { extractLinkIcon } from './icon';
|
|
4
|
-
import { extractAttachmentCount, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn } from './utils';
|
|
4
|
+
import { extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn } from './utils';
|
|
5
5
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
6
6
|
import { extractPersonCreatedBy, extractTitle, extractDateUpdated, extractDateCreated, extractLink } from '@atlaskit/linking-common/extractors';
|
|
7
7
|
import extractPriority from './extract-priority';
|
|
@@ -27,6 +27,7 @@ const extractFlexibleUiContext = (response, renderers) => {
|
|
|
27
27
|
viewCount: extractViewCount(data),
|
|
28
28
|
reactCount: extractReactCount(data),
|
|
29
29
|
voteCount: extractVoteCount(data),
|
|
30
|
+
checklistProgress: extractChecklistProgress(data),
|
|
30
31
|
createdBy: extractCreatedBy(data),
|
|
31
32
|
createdOn: extractDateCreated(data),
|
|
32
33
|
dueOn: extractDueOn(data),
|
|
@@ -33,4 +33,8 @@ export const extractProgrammingLanguage = data => extractValue(data, 'schema:pro
|
|
|
33
33
|
export const extractSourceBranch = data => extractLinkName(data['atlassian:mergeSource']);
|
|
34
34
|
export const extractSubscriberCount = data => extractValue(data, 'atlassian:subscriberCount');
|
|
35
35
|
export const extractAttachmentCount = data => extractValue(data, 'atlassian:attachmentCount');
|
|
36
|
-
export const extractTargetBranch = data => extractLinkName(data['atlassian:mergeDestination']);
|
|
36
|
+
export const extractTargetBranch = data => extractLinkName(data['atlassian:mergeDestination']);
|
|
37
|
+
export const extractChecklistProgress = data => {
|
|
38
|
+
const checkItemsObj = extractValue(data, 'atlassian:checkItems');
|
|
39
|
+
return checkItemsObj ? `${checkItemsObj.checkedItems}/${checkItemsObj.totalItems}` : undefined;
|
|
40
|
+
};
|
package/dist/es2019/messages.js
CHANGED
|
@@ -80,6 +80,11 @@ export const messages = defineMessages({
|
|
|
80
80
|
defaultMessage: 'Connect {context} to Atlassian to view more details from your work and collaboration from one place.',
|
|
81
81
|
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.'
|
|
82
82
|
},
|
|
83
|
+
connect_unauthorised_account_description_no_provider: {
|
|
84
|
+
id: 'fabric.linking.connect_unauthorised_account_description',
|
|
85
|
+
defaultMessage: 'Connect to Atlassian to view more details from your work and collaboration from one place.',
|
|
86
|
+
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.'
|
|
87
|
+
},
|
|
83
88
|
could_not_load_link: {
|
|
84
89
|
id: 'fabric.linking.couldnt_load_link',
|
|
85
90
|
defaultMessage: "We couldn't load this link for an unknown reason.",
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
4
|
import { ActionName } from '../../../../constants';
|
|
4
5
|
import { messages } from '../../../../messages';
|
|
5
6
|
/**
|
|
6
|
-
* Returns a CustomActionItem with a "Connect"
|
|
7
|
+
* Returns a CustomActionItem with a "Connect to <providerName>" message
|
|
7
8
|
*
|
|
8
9
|
* @see CustomActionItem
|
|
9
10
|
* @param onAuthorize a function that will be called on the click of the button
|
|
11
|
+
* @param providerName a string which is inserted into the message of the button
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
|
-
export const AuthorizeAction = onAuthorize => ({
|
|
14
|
+
export const AuthorizeAction = (onAuthorize, providerName) => ({
|
|
13
15
|
name: ActionName.CustomAction,
|
|
14
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.
|
|
16
|
+
content: providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
|
|
17
|
+
values: {
|
|
18
|
+
context: providerName
|
|
19
|
+
}
|
|
20
|
+
})) : /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_link_account_card),
|
|
15
21
|
onClick: onAuthorize
|
|
16
22
|
});
|
|
@@ -34,7 +34,8 @@ const BlockCardFooter = props => {
|
|
|
34
34
|
const {
|
|
35
35
|
actions,
|
|
36
36
|
size = SmartLinkSize.Medium,
|
|
37
|
-
testId = 'smart-block-card-footer'
|
|
37
|
+
testId = 'smart-block-card-footer',
|
|
38
|
+
actionGroupAppearance = 'default'
|
|
38
39
|
} = props;
|
|
39
40
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Provider, {
|
|
40
41
|
testId: `${testId}-provider`,
|
|
@@ -47,7 +48,7 @@ const BlockCardFooter = props => {
|
|
|
47
48
|
width: SmartLinkWidth.Flexible
|
|
48
49
|
}, /*#__PURE__*/React.createElement(ActionGroup, {
|
|
49
50
|
items: actions,
|
|
50
|
-
appearance:
|
|
51
|
+
appearance: actionGroupAppearance
|
|
51
52
|
})) : null);
|
|
52
53
|
};
|
|
53
54
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import FlexibleCard from '../../../FlexibleCard';
|
|
3
|
-
import TitleBlock from '../../../FlexibleCard/components/blocks/title-block';
|
|
4
|
-
import { messages } from '../../../../messages';
|
|
5
|
-
import Text from '../../../FlexibleCard/components/elements/text';
|
|
6
3
|
import { AuthorizeAction } from '../../actions/flexible/AuthorizeAction';
|
|
7
4
|
import BlockCardFooter from '../../components/flexible/footer';
|
|
8
|
-
import { CustomBlock } from '../../../FlexibleCard/components/blocks';
|
|
9
|
-
|
|
5
|
+
import { CustomBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
|
|
6
|
+
import { SmartLinkStatus } from '../../../../constants';
|
|
7
|
+
import { extractProvider } from '@atlaskit/linking-common/extractors';
|
|
8
|
+
import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
|
|
9
|
+
import { css } from '@emotion/react';
|
|
10
|
+
import { tokens } from '../../../../utils/token';
|
|
11
|
+
const contentStyles = css`
|
|
12
|
+
color: ${tokens.text};
|
|
13
|
+
margin-top: 0.5rem;
|
|
14
|
+
font-size: 0.75rem;
|
|
15
|
+
`;
|
|
10
16
|
/**
|
|
11
17
|
* This view represents a Block card that has an 'Unauthorized' status .
|
|
12
18
|
* It should have a "Connect" button that will allow a user to connect their account and view the block card.
|
|
@@ -14,9 +20,9 @@ import { CustomBlock } from '../../../FlexibleCard/components/blocks';
|
|
|
14
20
|
* @see SmartLinkStatus
|
|
15
21
|
* @see FlexibleCardProps
|
|
16
22
|
*/
|
|
23
|
+
|
|
17
24
|
const FlexibleUnauthorisedView = ({
|
|
18
25
|
cardState,
|
|
19
|
-
providerName = '',
|
|
20
26
|
onAuthorize,
|
|
21
27
|
onClick,
|
|
22
28
|
onError,
|
|
@@ -24,8 +30,11 @@ const FlexibleUnauthorisedView = ({
|
|
|
24
30
|
ui,
|
|
25
31
|
url
|
|
26
32
|
}) => {
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
var _cardState$details, _extractProvider;
|
|
34
|
+
|
|
35
|
+
const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
36
|
+
const providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
37
|
+
const actions = useMemo(() => onAuthorize ? [AuthorizeAction(onAuthorize, providerName)] : [], [onAuthorize, providerName]);
|
|
29
38
|
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
30
39
|
appearance: "block",
|
|
31
40
|
cardState: cardState,
|
|
@@ -37,16 +46,15 @@ const FlexibleUnauthorisedView = ({
|
|
|
37
46
|
url: url
|
|
38
47
|
}, /*#__PURE__*/React.createElement(TitleBlock, {
|
|
39
48
|
hideRetry: true
|
|
40
|
-
}), /*#__PURE__*/React.createElement(CustomBlock,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
})), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
|
|
49
|
+
}), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
50
|
+
overrideCss: contentStyles,
|
|
51
|
+
testId: `${testId}-content`
|
|
52
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
53
|
+
providerName: providerName
|
|
54
|
+
}))), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
|
|
48
55
|
actions: actions,
|
|
49
|
-
status:
|
|
56
|
+
status: SmartLinkStatus.Unauthorized,
|
|
57
|
+
actionGroupAppearance: "primary"
|
|
50
58
|
})));
|
|
51
59
|
};
|
|
52
60
|
|
|
@@ -10,6 +10,7 @@ import ElementGroup from './element-group';
|
|
|
10
10
|
export const ElementDisplaySchema = {
|
|
11
11
|
[ElementName.AttachmentCount]: ['inline'],
|
|
12
12
|
[ElementName.AuthorGroup]: ['inline'],
|
|
13
|
+
[ElementName.ChecklistProgress]: ['inline'],
|
|
13
14
|
[ElementName.CollaboratorGroup]: ['inline'],
|
|
14
15
|
[ElementName.CommentCount]: ['inline'],
|
|
15
16
|
[ElementName.ViewCount]: ['inline'],
|
|
@@ -146,6 +146,9 @@ const importIconMapper = {
|
|
|
146
146
|
[IconType.Attachment]: () => import(
|
|
147
147
|
/* webpackChunkName: "glyphAttachment" */
|
|
148
148
|
'@atlaskit/icon/glyph/attachment'),
|
|
149
|
+
[IconType.CheckItem]: () => import(
|
|
150
|
+
/* webpackChunkName: "glyphAttachment" */
|
|
151
|
+
'@atlaskit/icon/glyph/task'),
|
|
149
152
|
[IconType.Comment]: () => import(
|
|
150
153
|
/* webpackChunkName: "glyphComment" */
|
|
151
154
|
'@atlaskit/icon/glyph/comment'),
|
|
@@ -15,6 +15,12 @@ export const AttachmentCount = createElement(ElementName.AttachmentCount);
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export const AuthorGroup = createElement(ElementName.AuthorGroup);
|
|
18
|
+
/**
|
|
19
|
+
* Creates a Checklist Badge element using the data from ChecklistProgress in the Flexible UI Context.
|
|
20
|
+
* @see Badge
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export const ChecklistProgress = createElement(ElementName.ChecklistProgress);
|
|
18
24
|
/**
|
|
19
25
|
* An AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
|
|
20
26
|
* @see AvatarGroup
|
|
@@ -25,6 +25,12 @@ const elementMappings = {
|
|
|
25
25
|
[ElementName.AuthorGroup]: {
|
|
26
26
|
component: AvatarGroup
|
|
27
27
|
},
|
|
28
|
+
[ElementName.ChecklistProgress]: {
|
|
29
|
+
component: Badge,
|
|
30
|
+
props: {
|
|
31
|
+
icon: IconType.CheckItem
|
|
32
|
+
}
|
|
33
|
+
},
|
|
28
34
|
[ElementName.CollaboratorGroup]: {
|
|
29
35
|
component: AvatarGroup
|
|
30
36
|
},
|
|
@@ -139,6 +145,7 @@ const getData = (elementName, contextKey, context) => {
|
|
|
139
145
|
return toAvatarGroupProps(data);
|
|
140
146
|
|
|
141
147
|
case ElementName.AttachmentCount:
|
|
148
|
+
case ElementName.ChecklistProgress:
|
|
142
149
|
case ElementName.CommentCount:
|
|
143
150
|
case ElementName.ViewCount:
|
|
144
151
|
case ElementName.ReactCount:
|
|
@@ -44,7 +44,7 @@ export const getSimulatedMetadata = (extensionKey = '', types = []) => {
|
|
|
44
44
|
return {
|
|
45
45
|
metadata: {
|
|
46
46
|
primary: [ElementName.AuthorGroup, ElementName.State, ElementName.DueOn],
|
|
47
|
-
secondary: [ElementName.ReactCount, ElementName.CommentCount, ElementName.AttachmentCount],
|
|
47
|
+
secondary: [ElementName.ReactCount, ElementName.CommentCount, ElementName.AttachmentCount, ElementName.ChecklistProgress],
|
|
48
48
|
subtitle: []
|
|
49
49
|
}
|
|
50
50
|
};
|
|
@@ -11,11 +11,11 @@ import { CONTENT_URL_SECURITY_AND_PERMISSIONS } from '../../constants';
|
|
|
11
11
|
const UnauthorisedViewContent = ({
|
|
12
12
|
providerName,
|
|
13
13
|
testId = 'unauthorised-view-content'
|
|
14
|
-
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_description, {
|
|
14
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_description, {
|
|
15
15
|
values: {
|
|
16
16
|
context: providerName
|
|
17
17
|
}
|
|
18
|
-
})), ' ', /*#__PURE__*/React.createElement("a", {
|
|
18
|
+
})) : /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_unauthorised_account_description_no_provider), ' ', /*#__PURE__*/React.createElement("a", {
|
|
19
19
|
href: CONTENT_URL_SECURITY_AND_PERMISSIONS,
|
|
20
20
|
target: "_blank",
|
|
21
21
|
"data-testid": `${testId}-learn-more`
|
package/dist/esm/constants.js
CHANGED
|
@@ -110,6 +110,7 @@ export var ElementName;
|
|
|
110
110
|
(function (ElementName) {
|
|
111
111
|
ElementName["AttachmentCount"] = "AttachmentCount";
|
|
112
112
|
ElementName["AuthorGroup"] = "AuthorGroup";
|
|
113
|
+
ElementName["ChecklistProgress"] = "ChecklistProgress";
|
|
113
114
|
ElementName["CollaboratorGroup"] = "CollaboratorGroup";
|
|
114
115
|
ElementName["CommentCount"] = "CommentCount";
|
|
115
116
|
ElementName["CreatedBy"] = "CreatedBy";
|
|
@@ -198,6 +199,7 @@ export var IconType;
|
|
|
198
199
|
IconType["Error"] = "Default:Error";
|
|
199
200
|
IconType["Forbidden"] = "Default:Forbidden";
|
|
200
201
|
IconType["Attachment"] = "Badge:Attachment";
|
|
202
|
+
IconType["CheckItem"] = "Badge:Task";
|
|
201
203
|
IconType["Comment"] = "Badge:Comment";
|
|
202
204
|
IconType["View"] = "Badge:View";
|
|
203
205
|
IconType["React"] = "Badge:React";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractSummary } from '../common/primitives';
|
|
2
2
|
import { extractLozenge } from '../common/lozenge';
|
|
3
3
|
import { extractLinkIcon } from './icon';
|
|
4
|
-
import { extractAttachmentCount, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn } from './utils';
|
|
4
|
+
import { extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn } from './utils';
|
|
5
5
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
6
6
|
import { extractPersonCreatedBy, extractTitle, extractDateUpdated, extractDateCreated, extractLink } from '@atlaskit/linking-common/extractors';
|
|
7
7
|
import extractPriority from './extract-priority';
|
|
@@ -27,6 +27,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext(response, rende
|
|
|
27
27
|
viewCount: extractViewCount(data),
|
|
28
28
|
reactCount: extractReactCount(data),
|
|
29
29
|
voteCount: extractVoteCount(data),
|
|
30
|
+
checklistProgress: extractChecklistProgress(data),
|
|
30
31
|
createdBy: extractCreatedBy(data),
|
|
31
32
|
createdOn: extractDateCreated(data),
|
|
32
33
|
dueOn: extractDueOn(data),
|
|
@@ -54,4 +54,8 @@ export var extractAttachmentCount = function extractAttachmentCount(data) {
|
|
|
54
54
|
};
|
|
55
55
|
export var extractTargetBranch = function extractTargetBranch(data) {
|
|
56
56
|
return extractLinkName(data['atlassian:mergeDestination']);
|
|
57
|
+
};
|
|
58
|
+
export var extractChecklistProgress = function extractChecklistProgress(data) {
|
|
59
|
+
var checkItemsObj = extractValue(data, 'atlassian:checkItems');
|
|
60
|
+
return checkItemsObj ? "".concat(checkItemsObj.checkedItems, "/").concat(checkItemsObj.totalItems) : undefined;
|
|
57
61
|
};
|
package/dist/esm/messages.js
CHANGED
|
@@ -80,6 +80,11 @@ export var messages = defineMessages({
|
|
|
80
80
|
defaultMessage: 'Connect {context} to Atlassian to view more details from your work and collaboration from one place.',
|
|
81
81
|
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.'
|
|
82
82
|
},
|
|
83
|
+
connect_unauthorised_account_description_no_provider: {
|
|
84
|
+
id: 'fabric.linking.connect_unauthorised_account_description',
|
|
85
|
+
defaultMessage: 'Connect to Atlassian to view more details from your work and collaboration from one place.',
|
|
86
|
+
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.'
|
|
87
|
+
},
|
|
83
88
|
could_not_load_link: {
|
|
84
89
|
id: 'fabric.linking.couldnt_load_link',
|
|
85
90
|
defaultMessage: "We couldn't load this link for an unknown reason.",
|
package/dist/esm/version.json
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
4
|
import { ActionName } from '../../../../constants';
|
|
4
5
|
import { messages } from '../../../../messages';
|
|
5
6
|
/**
|
|
6
|
-
* Returns a CustomActionItem with a "Connect"
|
|
7
|
+
* Returns a CustomActionItem with a "Connect to <providerName>" message
|
|
7
8
|
*
|
|
8
9
|
* @see CustomActionItem
|
|
9
10
|
* @param onAuthorize a function that will be called on the click of the button
|
|
11
|
+
* @param providerName a string which is inserted into the message of the button
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
|
-
export var AuthorizeAction = function AuthorizeAction(onAuthorize) {
|
|
14
|
+
export var AuthorizeAction = function AuthorizeAction(onAuthorize, providerName) {
|
|
13
15
|
return {
|
|
14
16
|
name: ActionName.CustomAction,
|
|
15
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.
|
|
17
|
+
content: providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
|
|
18
|
+
values: {
|
|
19
|
+
context: providerName
|
|
20
|
+
}
|
|
21
|
+
})) : /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_link_account_card),
|
|
16
22
|
onClick: onAuthorize
|
|
17
23
|
};
|
|
18
24
|
};
|
|
@@ -33,7 +33,9 @@ var BlockCardFooter = function BlockCardFooter(props) {
|
|
|
33
33
|
_props$size = props.size,
|
|
34
34
|
size = _props$size === void 0 ? SmartLinkSize.Medium : _props$size,
|
|
35
35
|
_props$testId = props.testId,
|
|
36
|
-
testId = _props$testId === void 0 ? 'smart-block-card-footer' : _props$testId
|
|
36
|
+
testId = _props$testId === void 0 ? 'smart-block-card-footer' : _props$testId,
|
|
37
|
+
_props$actionGroupApp = props.actionGroupAppearance,
|
|
38
|
+
actionGroupAppearance = _props$actionGroupApp === void 0 ? 'default' : _props$actionGroupApp;
|
|
37
39
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Provider, {
|
|
38
40
|
testId: "".concat(testId, "-provider"),
|
|
39
41
|
overrideCss: providerStyles
|
|
@@ -45,7 +47,7 @@ var BlockCardFooter = function BlockCardFooter(props) {
|
|
|
45
47
|
width: SmartLinkWidth.Flexible
|
|
46
48
|
}, /*#__PURE__*/React.createElement(ActionGroup, {
|
|
47
49
|
items: actions,
|
|
48
|
-
appearance:
|
|
50
|
+
appearance: actionGroupAppearance
|
|
49
51
|
})) : null);
|
|
50
52
|
};
|
|
51
53
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject;
|
|
4
|
+
|
|
1
5
|
import React, { useMemo } from 'react';
|
|
2
6
|
import FlexibleCard from '../../../FlexibleCard';
|
|
3
|
-
import TitleBlock from '../../../FlexibleCard/components/blocks/title-block';
|
|
4
|
-
import { messages } from '../../../../messages';
|
|
5
|
-
import Text from '../../../FlexibleCard/components/elements/text';
|
|
6
7
|
import { AuthorizeAction } from '../../actions/flexible/AuthorizeAction';
|
|
7
8
|
import BlockCardFooter from '../../components/flexible/footer';
|
|
8
|
-
import { CustomBlock } from '../../../FlexibleCard/components/blocks';
|
|
9
|
-
|
|
9
|
+
import { CustomBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
|
|
10
|
+
import { SmartLinkStatus } from '../../../../constants';
|
|
11
|
+
import { extractProvider } from '@atlaskit/linking-common/extractors';
|
|
12
|
+
import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
|
|
13
|
+
import { css } from '@emotion/react';
|
|
14
|
+
import { tokens } from '../../../../utils/token';
|
|
15
|
+
var contentStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n margin-top: 0.5rem;\n font-size: 0.75rem;\n"])), tokens.text);
|
|
10
16
|
/**
|
|
11
17
|
* This view represents a Block card that has an 'Unauthorized' status .
|
|
12
18
|
* It should have a "Connect" button that will allow a user to connect their account and view the block card.
|
|
@@ -14,10 +20,11 @@ import { CustomBlock } from '../../../FlexibleCard/components/blocks';
|
|
|
14
20
|
* @see SmartLinkStatus
|
|
15
21
|
* @see FlexibleCardProps
|
|
16
22
|
*/
|
|
23
|
+
|
|
17
24
|
var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
25
|
+
var _cardState$details, _extractProvider;
|
|
26
|
+
|
|
18
27
|
var cardState = _ref.cardState,
|
|
19
|
-
_ref$providerName = _ref.providerName,
|
|
20
|
-
providerName = _ref$providerName === void 0 ? '' : _ref$providerName,
|
|
21
28
|
onAuthorize = _ref.onAuthorize,
|
|
22
29
|
onClick = _ref.onClick,
|
|
23
30
|
onError = _ref.onError,
|
|
@@ -25,10 +32,11 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
25
32
|
testId = _ref$testId === void 0 ? 'smart-block-unauthorized-view' : _ref$testId,
|
|
26
33
|
ui = _ref.ui,
|
|
27
34
|
url = _ref.url;
|
|
28
|
-
var
|
|
35
|
+
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
36
|
+
var providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
29
37
|
var actions = useMemo(function () {
|
|
30
|
-
return onAuthorize ? [AuthorizeAction(onAuthorize)] : [];
|
|
31
|
-
}, [onAuthorize]);
|
|
38
|
+
return onAuthorize ? [AuthorizeAction(onAuthorize, providerName)] : [];
|
|
39
|
+
}, [onAuthorize, providerName]);
|
|
32
40
|
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
33
41
|
appearance: "block",
|
|
34
42
|
cardState: cardState,
|
|
@@ -40,16 +48,15 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
40
48
|
url: url
|
|
41
49
|
}, /*#__PURE__*/React.createElement(TitleBlock, {
|
|
42
50
|
hideRetry: true
|
|
43
|
-
}), /*#__PURE__*/React.createElement(CustomBlock,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
})), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
|
|
51
|
+
}), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
52
|
+
overrideCss: contentStyles,
|
|
53
|
+
testId: "".concat(testId, "-content")
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
55
|
+
providerName: providerName
|
|
56
|
+
}))), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
|
|
51
57
|
actions: actions,
|
|
52
|
-
status:
|
|
58
|
+
status: SmartLinkStatus.Unauthorized,
|
|
59
|
+
actionGroupAppearance: "primary"
|
|
53
60
|
})));
|
|
54
61
|
};
|
|
55
62
|
|
|
@@ -20,7 +20,7 @@ import * as Actions from '../actions';
|
|
|
20
20
|
import { isFlexibleUiElement } from '../../../../utils/flexible';
|
|
21
21
|
import ActionGroup from './action-group';
|
|
22
22
|
import ElementGroup from './element-group';
|
|
23
|
-
export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_ElementDisplaySchema, ElementName.AttachmentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.AuthorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CollaboratorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CommentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ViewCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ReactCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.VoteCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.DueOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LatestCommit, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LinkIcon, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Preview, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.Priority, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ProgrammingLanguage, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Provider, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Snippet, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.SourceBranch, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.State, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubscriberCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.TargetBranch, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Title, ['inline']), _ElementDisplaySchema);
|
|
23
|
+
export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_ElementDisplaySchema, ElementName.AttachmentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.AuthorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ChecklistProgress, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CollaboratorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CommentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ViewCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ReactCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.VoteCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.DueOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LatestCommit, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LinkIcon, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Preview, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.Priority, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ProgrammingLanguage, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Provider, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Snippet, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.SourceBranch, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.State, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubscriberCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.TargetBranch, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Title, ['inline']), _ElementDisplaySchema);
|
|
24
24
|
|
|
25
25
|
var getDirectionStyles = function getDirectionStyles(direction) {
|
|
26
26
|
switch (direction) {
|
|
@@ -188,6 +188,10 @@ var importIconMapper = (_importIconMapper = {}, _defineProperty(_importIconMappe
|
|
|
188
188
|
return import(
|
|
189
189
|
/* webpackChunkName: "glyphAttachment" */
|
|
190
190
|
'@atlaskit/icon/glyph/attachment');
|
|
191
|
+
}), _defineProperty(_importIconMapper, IconType.CheckItem, function () {
|
|
192
|
+
return import(
|
|
193
|
+
/* webpackChunkName: "glyphAttachment" */
|
|
194
|
+
'@atlaskit/icon/glyph/task');
|
|
191
195
|
}), _defineProperty(_importIconMapper, IconType.Comment, function () {
|
|
192
196
|
return import(
|
|
193
197
|
/* webpackChunkName: "glyphComment" */
|
|
@@ -15,6 +15,12 @@ export var AttachmentCount = createElement(ElementName.AttachmentCount);
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export var AuthorGroup = createElement(ElementName.AuthorGroup);
|
|
18
|
+
/**
|
|
19
|
+
* Creates a Checklist Badge element using the data from ChecklistProgress in the Flexible UI Context.
|
|
20
|
+
* @see Badge
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export var ChecklistProgress = createElement(ElementName.ChecklistProgress);
|
|
18
24
|
/**
|
|
19
25
|
* An AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
|
|
20
26
|
* @see AvatarGroup
|
|
@@ -27,6 +27,11 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
|
|
|
27
27
|
}
|
|
28
28
|
}), _defineProperty(_elementMappings, ElementName.AuthorGroup, {
|
|
29
29
|
component: AvatarGroup
|
|
30
|
+
}), _defineProperty(_elementMappings, ElementName.ChecklistProgress, {
|
|
31
|
+
component: Badge,
|
|
32
|
+
props: {
|
|
33
|
+
icon: IconType.CheckItem
|
|
34
|
+
}
|
|
30
35
|
}), _defineProperty(_elementMappings, ElementName.CollaboratorGroup, {
|
|
31
36
|
component: AvatarGroup
|
|
32
37
|
}), _defineProperty(_elementMappings, ElementName.CommentCount, {
|
|
@@ -117,6 +122,7 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
117
122
|
return toAvatarGroupProps(data);
|
|
118
123
|
|
|
119
124
|
case ElementName.AttachmentCount:
|
|
125
|
+
case ElementName.ChecklistProgress:
|
|
120
126
|
case ElementName.CommentCount:
|
|
121
127
|
case ElementName.ViewCount:
|
|
122
128
|
case ElementName.ReactCount:
|
|
@@ -53,7 +53,7 @@ export var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
53
53
|
return {
|
|
54
54
|
metadata: {
|
|
55
55
|
primary: [ElementName.AuthorGroup, ElementName.State, ElementName.DueOn],
|
|
56
|
-
secondary: [ElementName.ReactCount, ElementName.CommentCount, ElementName.AttachmentCount],
|
|
56
|
+
secondary: [ElementName.ReactCount, ElementName.CommentCount, ElementName.AttachmentCount, ElementName.ChecklistProgress],
|
|
57
57
|
subtitle: []
|
|
58
58
|
}
|
|
59
59
|
};
|
|
@@ -12,11 +12,11 @@ var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
|
12
12
|
var providerName = _ref.providerName,
|
|
13
13
|
_ref$testId = _ref.testId,
|
|
14
14
|
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId;
|
|
15
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_description, {
|
|
15
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_description, {
|
|
16
16
|
values: {
|
|
17
17
|
context: providerName
|
|
18
18
|
}
|
|
19
|
-
})), ' ', /*#__PURE__*/React.createElement("a", {
|
|
19
|
+
})) : /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_unauthorised_account_description_no_provider), ' ', /*#__PURE__*/React.createElement("a", {
|
|
20
20
|
href: CONTENT_URL_SECURITY_AND_PERMISSIONS,
|
|
21
21
|
target: "_blank",
|
|
22
22
|
"data-testid": "".concat(testId, "-learn-more")
|
|
@@ -83,6 +83,7 @@ export declare enum SmartLinkWidth {
|
|
|
83
83
|
export declare enum ElementName {
|
|
84
84
|
AttachmentCount = "AttachmentCount",
|
|
85
85
|
AuthorGroup = "AuthorGroup",
|
|
86
|
+
ChecklistProgress = "ChecklistProgress",
|
|
86
87
|
CollaboratorGroup = "CollaboratorGroup",
|
|
87
88
|
CommentCount = "CommentCount",
|
|
88
89
|
CreatedBy = "CreatedBy",
|
|
@@ -165,6 +166,7 @@ export declare enum IconType {
|
|
|
165
166
|
Error = "Default:Error",
|
|
166
167
|
Forbidden = "Default:Forbidden",
|
|
167
168
|
Attachment = "Badge:Attachment",
|
|
169
|
+
CheckItem = "Badge:Task",
|
|
168
170
|
Comment = "Badge:Comment",
|
|
169
171
|
View = "Badge:View",
|
|
170
172
|
React = "Badge:React",
|
|
@@ -11,3 +11,4 @@ export declare const extractSourceBranch: (data: JsonLd.Data.SourceCodePullReque
|
|
|
11
11
|
export declare const extractSubscriberCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
12
12
|
export declare const extractAttachmentCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
13
13
|
export declare const extractTargetBranch: (data: JsonLd.Data.SourceCodePullRequest) => string | undefined;
|
|
14
|
+
export declare const extractChecklistProgress: (data: JsonLd.Data.BaseData) => string | undefined;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export declare type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
|
|
3
|
-
export declare type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'could_not_load_link' | 'download' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'delete' | 'edit' | 'learn_more_about_smart_links_security' | 'loading' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_link_in_a_new_tab' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
3
|
+
export declare type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'could_not_load_link' | 'download' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'delete' | 'edit' | 'learn_more_about_smart_links_security' | 'loading' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_link_in_a_new_tab' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
4
4
|
declare type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -17,6 +17,11 @@ export declare type FlexibleUiDataContext = {
|
|
|
17
17
|
* @see AvatarGroup
|
|
18
18
|
*/
|
|
19
19
|
authorGroup?: LinkPerson[];
|
|
20
|
+
/**
|
|
21
|
+
* A string displaying progress on a checklist
|
|
22
|
+
* @see ChecklistProgress
|
|
23
|
+
*/
|
|
24
|
+
checklistProgress?: string;
|
|
20
25
|
/**
|
|
21
26
|
* An array containing a @type {LinkPerson} used to populate the CollaboratorGroup element.
|
|
22
27
|
* @see CollaboratorGroup
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CustomActionItem } from '../../../FlexibleCard/components/blocks/types';
|
|
2
2
|
/**
|
|
3
|
-
* Returns a CustomActionItem with a "Connect"
|
|
3
|
+
* Returns a CustomActionItem with a "Connect to <providerName>" message
|
|
4
4
|
*
|
|
5
5
|
* @see CustomActionItem
|
|
6
6
|
* @param onAuthorize a function that will be called on the click of the button
|
|
7
|
+
* @param providerName a string which is inserted into the message of the button
|
|
7
8
|
*/
|
|
8
|
-
export declare const AuthorizeAction: (onAuthorize: () => void) => CustomActionItem;
|
|
9
|
+
export declare const AuthorizeAction: (onAuthorize: () => void, providerName?: string | undefined) => CustomActionItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BlockCardFooterProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* This Components is a footer that is used in a Block Card with Flexible UI.
|
|
5
5
|
* It contains a provider icon if provider is present and an actions list if one is passed.
|
|
@@ -8,5 +8,5 @@ import { FooterBlockProps } from '../../../../FlexibleCard/components/blocks/foo
|
|
|
8
8
|
* @see CustomBlock
|
|
9
9
|
* @param props are the data required for the block, such as actions to be displayed.
|
|
10
10
|
*/
|
|
11
|
-
declare const BlockCardFooter: React.FC<
|
|
11
|
+
declare const BlockCardFooter: React.FC<BlockCardFooterProps>;
|
|
12
12
|
export default BlockCardFooter;
|
|
@@ -7,5 +7,5 @@ import { FlexibleBlockCardProps } from './types';
|
|
|
7
7
|
* @see SmartLinkStatus
|
|
8
8
|
* @see FlexibleCardProps
|
|
9
9
|
*/
|
|
10
|
-
declare const FlexibleUnauthorisedView: ({ cardState,
|
|
10
|
+
declare const FlexibleUnauthorisedView: ({ cardState, onAuthorize, onClick, onError, testId, ui, url, }: FlexibleBlockCardProps) => JSX.Element;
|
|
11
11
|
export default FlexibleUnauthorisedView;
|
|
@@ -56,7 +56,7 @@ export declare type TitleBlockProps = {
|
|
|
56
56
|
*/
|
|
57
57
|
retry?: RetryOptions;
|
|
58
58
|
/**
|
|
59
|
-
* This option
|
|
59
|
+
* This option determines whenever we show any of the links and messages on the right side of the block,
|
|
60
60
|
* like "connect to preview" or "Can't find link" or "Restricted link, try another account" etc.
|
|
61
61
|
* Default is false.
|
|
62
62
|
*/
|
|
@@ -168,7 +168,7 @@ export declare type OnActionMenuOpenChangeOptions = {
|
|
|
168
168
|
/**
|
|
169
169
|
* A type that contains all the possible combinations of elements with their corresponding props.
|
|
170
170
|
*/
|
|
171
|
-
export declare type ElementItemProps = AttachmentCount | AuthorGroup | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | Snippet | SourceBranch | State | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
171
|
+
export declare type ElementItemProps = AttachmentCount | AuthorGroup | ChecklistProgress | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | Snippet | SourceBranch | State | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
172
172
|
/**
|
|
173
173
|
* Represents the props available for an AttachmentCount element.
|
|
174
174
|
* @see AttachmentCount
|
|
@@ -183,6 +183,13 @@ export declare type AttachmentCount = {
|
|
|
183
183
|
export declare type AuthorGroup = {
|
|
184
184
|
name: ElementName.AuthorGroup;
|
|
185
185
|
};
|
|
186
|
+
/**
|
|
187
|
+
* Represents the props available for an ChecklistProgress element.
|
|
188
|
+
* @see ChecklistProgress
|
|
189
|
+
*/
|
|
190
|
+
export declare type ChecklistProgress = {
|
|
191
|
+
name: ElementName.ChecklistProgress;
|
|
192
|
+
};
|
|
186
193
|
/**
|
|
187
194
|
* Represents the props available for an CollaboratorGroup element.
|
|
188
195
|
* @see CollaboratorGroup
|
|
@@ -17,6 +17,11 @@ export declare const AttachmentCount: import("react").FC<BadgeProps>;
|
|
|
17
17
|
* @see AvatarGroup
|
|
18
18
|
*/
|
|
19
19
|
export declare const AuthorGroup: import("react").FC<AvatarGroupProps>;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a Checklist Badge element using the data from ChecklistProgress in the Flexible UI Context.
|
|
22
|
+
* @see Badge
|
|
23
|
+
*/
|
|
24
|
+
export declare const ChecklistProgress: import("react").FC<BadgeProps>;
|
|
20
25
|
/**
|
|
21
26
|
* An AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
|
|
22
27
|
* @see AvatarGroup
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -315,6 +315,11 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
315
315
|
|
|
316
316
|
export { CardType };
|
|
317
317
|
|
|
318
|
+
// @public
|
|
319
|
+
type ChecklistProgress = {
|
|
320
|
+
name: ElementName.ChecklistProgress;
|
|
321
|
+
};
|
|
322
|
+
|
|
318
323
|
export { Client };
|
|
319
324
|
|
|
320
325
|
// @public
|
|
@@ -407,6 +412,7 @@ export type ElementItem = {
|
|
|
407
412
|
type ElementItemProps =
|
|
408
413
|
| AttachmentCount
|
|
409
414
|
| AuthorGroup
|
|
415
|
+
| ChecklistProgress
|
|
410
416
|
| CollaboratorGroup
|
|
411
417
|
| CommentCount
|
|
412
418
|
| CreatedBy
|
|
@@ -437,6 +443,8 @@ export enum ElementName {
|
|
|
437
443
|
// (undocumented)
|
|
438
444
|
AuthorGroup = 'AuthorGroup',
|
|
439
445
|
// (undocumented)
|
|
446
|
+
ChecklistProgress = 'ChecklistProgress',
|
|
447
|
+
// (undocumented)
|
|
440
448
|
CollaboratorGroup = 'CollaboratorGroup',
|
|
441
449
|
// (undocumented)
|
|
442
450
|
CommentCount = 'CommentCount',
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -241,6 +241,11 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
241
241
|
|
|
242
242
|
export { CardType }
|
|
243
243
|
|
|
244
|
+
// @public
|
|
245
|
+
type ChecklistProgress = {
|
|
246
|
+
name: ElementName.ChecklistProgress;
|
|
247
|
+
};
|
|
248
|
+
|
|
244
249
|
export { Client }
|
|
245
250
|
|
|
246
251
|
// @public
|
|
@@ -324,7 +329,7 @@ export type ElementItem = {
|
|
|
324
329
|
} & ElementItemProps;
|
|
325
330
|
|
|
326
331
|
// @public
|
|
327
|
-
type ElementItemProps = AttachmentCount | AuthorGroup | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider_2 | ReactCount | Snippet | SourceBranch | State_2 | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
332
|
+
type ElementItemProps = AttachmentCount | AuthorGroup | ChecklistProgress | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider_2 | ReactCount | Snippet | SourceBranch | State_2 | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
328
333
|
|
|
329
334
|
// @public
|
|
330
335
|
export enum ElementName {
|
|
@@ -333,6 +338,8 @@ export enum ElementName {
|
|
|
333
338
|
// (undocumented)
|
|
334
339
|
AuthorGroup = "AuthorGroup",
|
|
335
340
|
// (undocumented)
|
|
341
|
+
ChecklistProgress = "ChecklistProgress",
|
|
342
|
+
// (undocumented)
|
|
336
343
|
CollaboratorGroup = "CollaboratorGroup",
|
|
337
344
|
// (undocumented)
|
|
338
345
|
CommentCount = "CommentCount",
|