@atlaskit/smart-card 19.1.30 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/extractors/block/index.js +9 -19
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +3 -5
- package/dist/cjs/extractors/common/byline/extractByline.js +5 -11
- package/dist/cjs/extractors/common/context/index.js +0 -16
- package/dist/cjs/extractors/common/icon/extractIcon.js +11 -8
- package/dist/cjs/extractors/common/icon/priority.js +1 -0
- package/dist/cjs/extractors/common/lozenge/extractLozenge.js +9 -3
- package/dist/cjs/extractors/common/lozenge/extractState.js +2 -2
- package/dist/cjs/extractors/common/lozenge/extractTaskType.js +2 -2
- package/dist/cjs/extractors/common/primitives/index.js +0 -16
- package/dist/cjs/extractors/embed/index.js +5 -9
- package/dist/cjs/extractors/flexible/collaboratorGroup/index.js +2 -2
- package/dist/cjs/extractors/flexible/extract-preview.js +2 -2
- package/dist/cjs/extractors/flexible/extract-priority.js +2 -2
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +8 -2
- package/dist/cjs/extractors/flexible/icon/extract-provider-icon.js +2 -2
- package/dist/cjs/extractors/flexible/icon/extract-url-icon.js +2 -2
- package/dist/cjs/extractors/flexible/index.js +7 -10
- package/dist/cjs/extractors/flexible/utils.js +10 -4
- package/dist/cjs/extractors/inline/index.js +4 -4
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +9 -2
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +22 -0
- package/dist/cjs/view/FlexibleCard/utils.js +3 -1
- package/dist/cjs/view/HoverCard/components/hover-card-content.js +2 -2
- package/dist/cjs/view/HoverCard/utils.js +19 -0
- package/dist/cjs/view/InlineCard/index.js +5 -3
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/extractors/block/index.js +2 -7
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +1 -2
- package/dist/es2019/extractors/common/byline/extractByline.js +1 -4
- package/dist/es2019/extractors/common/context/index.js +0 -2
- package/dist/es2019/extractors/common/icon/extractIcon.js +7 -3
- package/dist/es2019/extractors/common/icon/priority.js +1 -0
- package/dist/es2019/extractors/common/lozenge/extractLozenge.js +5 -1
- package/dist/es2019/extractors/common/lozenge/extractState.js +2 -2
- package/dist/es2019/extractors/common/lozenge/extractTaskType.js +1 -1
- package/dist/es2019/extractors/common/primitives/index.js +0 -2
- package/dist/es2019/extractors/embed/index.js +1 -3
- package/dist/es2019/extractors/flexible/collaboratorGroup/index.js +1 -1
- package/dist/es2019/extractors/flexible/extract-preview.js +1 -1
- package/dist/es2019/extractors/flexible/extract-priority.js +1 -1
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +7 -1
- package/dist/es2019/extractors/flexible/icon/extract-provider-icon.js +1 -1
- package/dist/es2019/extractors/flexible/icon/extract-url-icon.js +1 -1
- package/dist/es2019/extractors/flexible/index.js +4 -5
- package/dist/es2019/extractors/flexible/utils.js +2 -1
- package/dist/es2019/extractors/inline/index.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +6 -0
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +22 -0
- package/dist/es2019/view/FlexibleCard/utils.js +2 -1
- package/dist/es2019/view/HoverCard/components/hover-card-content.js +1 -1
- package/dist/es2019/view/HoverCard/utils.js +19 -0
- package/dist/es2019/view/InlineCard/index.js +2 -1
- package/dist/esm/constants.js +1 -0
- package/dist/esm/extractors/block/index.js +2 -7
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +1 -2
- package/dist/esm/extractors/common/byline/extractByline.js +1 -4
- package/dist/esm/extractors/common/context/index.js +0 -2
- package/dist/esm/extractors/common/icon/extractIcon.js +7 -3
- package/dist/esm/extractors/common/icon/priority.js +1 -0
- package/dist/esm/extractors/common/lozenge/extractLozenge.js +8 -2
- package/dist/esm/extractors/common/lozenge/extractState.js +2 -2
- package/dist/esm/extractors/common/lozenge/extractTaskType.js +1 -1
- package/dist/esm/extractors/common/primitives/index.js +0 -2
- package/dist/esm/extractors/embed/index.js +1 -3
- package/dist/esm/extractors/flexible/collaboratorGroup/index.js +1 -1
- package/dist/esm/extractors/flexible/extract-preview.js +1 -1
- package/dist/esm/extractors/flexible/extract-priority.js +1 -1
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +7 -1
- package/dist/esm/extractors/flexible/icon/extract-provider-icon.js +1 -1
- package/dist/esm/extractors/flexible/icon/extract-url-icon.js +1 -1
- package/dist/esm/extractors/flexible/index.js +4 -5
- package/dist/esm/extractors/flexible/utils.js +4 -1
- package/dist/esm/extractors/inline/index.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/index.js +6 -0
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +21 -0
- package/dist/esm/view/FlexibleCard/utils.js +2 -1
- package/dist/esm/view/HoverCard/components/hover-card-content.js +1 -1
- package/dist/esm/view/HoverCard/utils.js +19 -0
- package/dist/esm/view/InlineCard/index.js +2 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/extractors/block/index.d.ts +1 -1
- package/dist/types/extractors/common/context/index.d.ts +0 -2
- package/dist/types/extractors/common/icon/extractIcon.d.ts +1 -1
- package/dist/types/extractors/common/lozenge/extractState.d.ts +1 -1
- package/dist/types/extractors/common/primitives/index.d.ts +0 -2
- package/dist/types/extractors/flexible/collaboratorGroup/index.d.ts +1 -1
- package/dist/types/extractors/flexible/utils.d.ts +1 -0
- package/dist/types/state/flexible-ui-context/types.d.ts +8 -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/dist/types/view/FlexibleCard/components/elements/lozenge/types.d.ts +2 -1
- package/package.json +3 -3
- package/report.api.md +2 -0
- package/dist/cjs/extractors/common/context/extractContext.js +0 -38
- package/dist/cjs/extractors/common/context/extractProvider.js +0 -83
- package/dist/cjs/extractors/common/date/extractDateCreated.js +0 -14
- package/dist/cjs/extractors/common/date/extractDateUpdated.js +0 -14
- package/dist/cjs/extractors/common/person/extractMembers.js +0 -37
- package/dist/cjs/extractors/common/person/extractPersonAssignedTo.js +0 -18
- package/dist/cjs/extractors/common/person/extractPersonCreatedBy.js +0 -28
- package/dist/cjs/extractors/common/person/extractPersonUpdatedBy.js +0 -18
- package/dist/cjs/extractors/common/person/index.js +0 -37
- package/dist/cjs/extractors/common/person/types.js +0 -5
- package/dist/cjs/extractors/common/preview/extractImage.js +0 -26
- package/dist/cjs/extractors/common/preview/index.js +0 -21
- package/dist/cjs/extractors/common/primitives/extractLink.js +0 -22
- package/dist/cjs/extractors/common/primitives/extractTitle.js +0 -55
- package/dist/cjs/extractors/common/primitives/extractType.js +0 -20
- package/dist/cjs/extractors/common/utils.js +0 -43
- package/dist/es2019/extractors/common/context/extractContext.js +0 -27
- package/dist/es2019/extractors/common/context/extractProvider.js +0 -65
- package/dist/es2019/extractors/common/date/extractDateCreated.js +0 -5
- package/dist/es2019/extractors/common/date/extractDateUpdated.js +0 -5
- package/dist/es2019/extractors/common/person/extractMembers.js +0 -23
- package/dist/es2019/extractors/common/person/extractPersonAssignedTo.js +0 -8
- package/dist/es2019/extractors/common/person/extractPersonCreatedBy.js +0 -16
- package/dist/es2019/extractors/common/person/extractPersonUpdatedBy.js +0 -8
- package/dist/es2019/extractors/common/person/index.js +0 -4
- package/dist/es2019/extractors/common/person/types.js +0 -1
- package/dist/es2019/extractors/common/preview/extractImage.js +0 -16
- package/dist/es2019/extractors/common/preview/index.js +0 -2
- package/dist/es2019/extractors/common/primitives/extractLink.js +0 -12
- package/dist/es2019/extractors/common/primitives/extractTitle.js +0 -37
- package/dist/es2019/extractors/common/primitives/extractType.js +0 -11
- package/dist/es2019/extractors/common/utils.js +0 -30
- package/dist/esm/extractors/common/context/extractContext.js +0 -27
- package/dist/esm/extractors/common/context/extractProvider.js +0 -65
- package/dist/esm/extractors/common/date/extractDateCreated.js +0 -5
- package/dist/esm/extractors/common/date/extractDateUpdated.js +0 -5
- package/dist/esm/extractors/common/person/extractMembers.js +0 -27
- package/dist/esm/extractors/common/person/extractPersonAssignedTo.js +0 -8
- package/dist/esm/extractors/common/person/extractPersonCreatedBy.js +0 -18
- package/dist/esm/extractors/common/person/extractPersonUpdatedBy.js +0 -8
- package/dist/esm/extractors/common/person/index.js +0 -4
- package/dist/esm/extractors/common/person/types.js +0 -1
- package/dist/esm/extractors/common/preview/extractImage.js +0 -16
- package/dist/esm/extractors/common/preview/index.js +0 -2
- package/dist/esm/extractors/common/primitives/extractLink.js +0 -12
- package/dist/esm/extractors/common/primitives/extractTitle.js +0 -41
- package/dist/esm/extractors/common/primitives/extractType.js +0 -11
- package/dist/esm/extractors/common/utils.js +0 -30
- package/dist/types/extractors/common/context/extractContext.d.ts +0 -7
- package/dist/types/extractors/common/context/extractProvider.d.ts +0 -8
- package/dist/types/extractors/common/date/extractDateCreated.d.ts +0 -3
- package/dist/types/extractors/common/date/extractDateUpdated.d.ts +0 -2
- package/dist/types/extractors/common/person/extractMembers.d.ts +0 -3
- package/dist/types/extractors/common/person/extractPersonAssignedTo.d.ts +0 -4
- package/dist/types/extractors/common/person/extractPersonCreatedBy.d.ts +0 -3
- package/dist/types/extractors/common/person/extractPersonUpdatedBy.d.ts +0 -5
- package/dist/types/extractors/common/person/index.d.ts +0 -5
- package/dist/types/extractors/common/person/types.d.ts +0 -4
- package/dist/types/extractors/common/preview/extractImage.d.ts +0 -2
- package/dist/types/extractors/common/preview/index.d.ts +0 -3
- package/dist/types/extractors/common/primitives/extractLink.d.ts +0 -2
- package/dist/types/extractors/common/primitives/extractTitle.d.ts +0 -2
- package/dist/types/extractors/common/primitives/extractType.d.ts +0 -2
- package/dist/types/extractors/common/utils.d.ts +0 -4
|
@@ -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.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.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.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);
|
|
52
52
|
exports.ElementDisplaySchema = ElementDisplaySchema;
|
|
53
53
|
|
|
54
54
|
var getDirectionStyles = function getDirectionStyles(direction) {
|
|
@@ -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.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.AuthorGroup = 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.AuthorGroup = void 0;
|
|
7
7
|
|
|
8
8
|
var _utils = require("./utils");
|
|
9
9
|
|
|
@@ -47,10 +47,17 @@ var CreatedOn = (0, _utils.createElement)(_constants.ElementName.CreatedOn);
|
|
|
47
47
|
exports.CreatedOn = CreatedOn;
|
|
48
48
|
var CreatedBy = (0, _utils.createElement)(_constants.ElementName.CreatedBy);
|
|
49
49
|
/**
|
|
50
|
-
* Creates
|
|
50
|
+
* Creates a DueOn Lozenge element using the data from dueOn in the Flexible UI Context.
|
|
51
|
+
* @see Lozenge
|
|
51
52
|
*/
|
|
52
53
|
|
|
53
54
|
exports.CreatedBy = CreatedBy;
|
|
55
|
+
var DueOn = (0, _utils.createElement)(_constants.ElementName.DueOn);
|
|
56
|
+
/**
|
|
57
|
+
* Creates an element that contains Last Commit hash
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
exports.DueOn = DueOn;
|
|
54
61
|
var LatestCommit = (0, _utils.createElement)(_constants.ElementName.LatestCommit);
|
|
55
62
|
/**
|
|
56
63
|
* Creates a LinkIcon Icon element using the data from LinkIcon in the Flexible UI Context.
|
|
@@ -17,6 +17,8 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
17
17
|
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
|
|
20
|
+
var _reactIntlNext = require("react-intl-next");
|
|
21
|
+
|
|
20
22
|
var _core = require("@emotion/core");
|
|
21
23
|
|
|
22
24
|
var _constants = require("../../../../constants");
|
|
@@ -78,6 +80,8 @@ var elementMappings = (_elementMappings = {}, (0, _defineProperty2.default)(_ele
|
|
|
78
80
|
component: _text.default
|
|
79
81
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.CreatedOn, {
|
|
80
82
|
component: _dateTime.default
|
|
83
|
+
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.DueOn, {
|
|
84
|
+
component: _lozenge.default
|
|
81
85
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.LatestCommit, {
|
|
82
86
|
component: _badge.default,
|
|
83
87
|
props: {
|
|
@@ -154,6 +158,9 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
154
158
|
case _constants.ElementName.CreatedOn:
|
|
155
159
|
return toDateTimeProps('created', context.createdOn);
|
|
156
160
|
|
|
161
|
+
case _constants.ElementName.DueOn:
|
|
162
|
+
return toDateLozengeProps(context.dueOn);
|
|
163
|
+
|
|
157
164
|
case _constants.ElementName.ModifiedBy:
|
|
158
165
|
return toFormattedTextProps(_messages.messages.modified_by, context.modifiedBy);
|
|
159
166
|
|
|
@@ -185,6 +192,21 @@ var toBadgeProps = function toBadgeProps(label) {
|
|
|
185
192
|
} : undefined;
|
|
186
193
|
};
|
|
187
194
|
|
|
195
|
+
var toDateLozengeProps = function toDateLozengeProps(dateString) {
|
|
196
|
+
if (dateString) {
|
|
197
|
+
var text = Date.parse(dateString) ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedDate, {
|
|
198
|
+
value: new Date(dateString),
|
|
199
|
+
year: "numeric",
|
|
200
|
+
month: "short",
|
|
201
|
+
day: "numeric",
|
|
202
|
+
formatMatcher: "best fit"
|
|
203
|
+
}) : dateString;
|
|
204
|
+
return {
|
|
205
|
+
text: text
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
|
|
188
210
|
var toDateTimeProps = function toDateTimeProps(type, dateString) {
|
|
189
211
|
return dateString ? {
|
|
190
212
|
date: new Date(dateString),
|
|
@@ -21,6 +21,8 @@ var _icon = require("../../extractors/flexible/icon");
|
|
|
21
21
|
|
|
22
22
|
var _utils = require("../../utils");
|
|
23
23
|
|
|
24
|
+
var _extractors = require("@atlaskit/linking-common/extractors");
|
|
25
|
+
|
|
24
26
|
var getContextByStatus = function getContextByStatus(url, status, details, renderers) {
|
|
25
27
|
switch (status) {
|
|
26
28
|
case _constants.SmartLinkStatus.Pending:
|
|
@@ -83,7 +85,7 @@ var getRetryOptions = function getRetryOptions(url, status, details, onAuthorize
|
|
|
83
85
|
case _constants.SmartLinkStatus.Forbidden:
|
|
84
86
|
var data = details && details.data || (0, _jsonld.getEmptyJsonLd)();
|
|
85
87
|
var meta = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : (0, _jsonld.getUnauthorizedJsonLd)().meta;
|
|
86
|
-
var provider = (0,
|
|
88
|
+
var provider = (0, _extractors.extractProvider)(data);
|
|
87
89
|
var context = provider === null || provider === void 0 ? void 0 : provider.text;
|
|
88
90
|
var access = (0, _context.extractRequestAccessContext)({
|
|
89
91
|
jsonLd: meta,
|
|
@@ -31,7 +31,7 @@ var _helpers = require("../../../state/helpers");
|
|
|
31
31
|
|
|
32
32
|
var _styled = require("../styled");
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _extractors = require("@atlaskit/linking-common/extractors");
|
|
35
35
|
|
|
36
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); }
|
|
37
37
|
|
|
@@ -103,7 +103,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
103
103
|
return toFooterActions(cardActions);
|
|
104
104
|
}, [cardActions]);
|
|
105
105
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
106
|
-
var types = data ? (0,
|
|
106
|
+
var types = data ? (0, _extractors.extractType)(data) : undefined; //TODO: EDM-3224 deleted simulated and use real JsonLd
|
|
107
107
|
|
|
108
108
|
var _extractMetadata = (0, _extractMetadata2.extractMetadata)((0, _utils.getSimulatedMetadata)(extensionKey, types)),
|
|
109
109
|
primary = _extractMetadata.primary,
|
|
@@ -53,6 +53,25 @@ var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
+
case 'watermelon-object-provider':
|
|
57
|
+
if (types.includes('atlassian:Project')) {
|
|
58
|
+
return {
|
|
59
|
+
metadata: {
|
|
60
|
+
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.ModifiedOn, _constants.ElementName.State, _constants.ElementName.DueOn],
|
|
61
|
+
secondary: [],
|
|
62
|
+
subtitle: []
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
metadata: {
|
|
69
|
+
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.State, _constants.ElementName.DueOn],
|
|
70
|
+
secondary: [],
|
|
71
|
+
subtitle: []
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
56
75
|
default:
|
|
57
76
|
return {
|
|
58
77
|
metadata: {
|
|
@@ -59,6 +59,8 @@ var _ResolvingView = require("./ResolvingView");
|
|
|
59
59
|
|
|
60
60
|
var _UnauthorisedView = require("./UnauthorisedView");
|
|
61
61
|
|
|
62
|
+
var _extractors = require("@atlaskit/linking-common/extractors");
|
|
63
|
+
|
|
62
64
|
var InlineCard = function InlineCard(_ref) {
|
|
63
65
|
var _details$meta;
|
|
64
66
|
|
|
@@ -109,7 +111,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
109
111
|
}));
|
|
110
112
|
|
|
111
113
|
case 'unauthorized':
|
|
112
|
-
var provider = (0,
|
|
114
|
+
var provider = (0, _extractors.extractProvider)(cardDetails);
|
|
113
115
|
return /*#__PURE__*/_react.default.createElement(_UnauthorisedView.InlineCardUnauthorizedView, {
|
|
114
116
|
icon: provider && provider.icon,
|
|
115
117
|
url: url,
|
|
@@ -120,7 +122,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
120
122
|
});
|
|
121
123
|
|
|
122
124
|
case 'forbidden':
|
|
123
|
-
var providerForbidden = (0,
|
|
125
|
+
var providerForbidden = (0, _extractors.extractProvider)(cardDetails);
|
|
124
126
|
var cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : (0, _jsonld.getUnauthorizedJsonLd)().meta;
|
|
125
127
|
var requestAccessContext = (0, _context.extractRequestAccessContext)({
|
|
126
128
|
jsonLd: cardMetadata,
|
|
@@ -139,7 +141,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
139
141
|
});
|
|
140
142
|
|
|
141
143
|
case 'not_found':
|
|
142
|
-
var providerNotFound = (0,
|
|
144
|
+
var providerNotFound = (0, _extractors.extractProvider)(cardDetails);
|
|
143
145
|
return /*#__PURE__*/_react.default.createElement(_ErroredView.InlineCardErroredView, {
|
|
144
146
|
url: url,
|
|
145
147
|
icon: providerNotFound && providerNotFound.icon,
|
package/dist/es2019/constants.js
CHANGED
|
@@ -111,6 +111,7 @@ export let ElementName;
|
|
|
111
111
|
ElementName["CommentCount"] = "CommentCount";
|
|
112
112
|
ElementName["CreatedBy"] = "CreatedBy";
|
|
113
113
|
ElementName["CreatedOn"] = "CreatedOn";
|
|
114
|
+
ElementName["DueOn"] = "DueOn";
|
|
114
115
|
ElementName["LinkIcon"] = "LinkIcon";
|
|
115
116
|
ElementName["ModifiedBy"] = "ModifiedBy";
|
|
116
117
|
ElementName["ModifiedOn"] = "ModifiedOn";
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { extractTitleTextColor, extractSummary } from '../common/primitives';
|
|
2
2
|
import { extractLozenge } from '../common/lozenge';
|
|
3
3
|
import { extractIcon } from '../common/icon';
|
|
4
|
-
import { extractProvider } from '../common/context/extractProvider';
|
|
5
4
|
import { extractCommentCount, extractProgrammingLanguage, extractSubscriberCount } from '../common/detail';
|
|
6
|
-
import { extractMembers } from '
|
|
7
|
-
import { extractPersonAssignedTo } from '../common/person/extractPersonAssignedTo';
|
|
8
|
-
import { extractPersonCreatedBy } from '../common/person/extractPersonCreatedBy';
|
|
9
|
-
import { extractPersonUpdatedBy } from '../common/person/extractPersonUpdatedBy';
|
|
5
|
+
import { extractLink, extractTitle, extractProvider, extractMembers, extractPersonAssignedTo, extractPersonCreatedBy, extractPersonUpdatedBy, extractImage } from '@atlaskit/linking-common/extractors';
|
|
10
6
|
import { extractByline } from '../common/byline/extractByline';
|
|
11
7
|
import { extractTitlePrefix } from '../common/title-prefix/extractTitlePrefix';
|
|
12
|
-
import { extractImage } from '../common/preview/extractImage';
|
|
13
8
|
import { extractActions } from '../common/actions/extractActions';
|
|
14
9
|
import { extractPreviewAction } from '../common/actions/extractPreviewAction';
|
|
15
10
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { uiRenderSuccessEvent, uiRenderFailedEvent } from '../../../utils/analytics';
|
|
2
2
|
import { extractDownloadUrl } from '../detail';
|
|
3
|
-
import { extractProvider } from '
|
|
4
|
-
import { extractPreview } from '../preview';
|
|
3
|
+
import { extractProvider, extractPreview } from '@atlaskit/linking-common/extractors';
|
|
5
4
|
import { PreviewAction } from '../../../view/BlockCard';
|
|
6
5
|
|
|
7
6
|
const getMetadataFromJsonLd = (jsonLd, platform) => {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormattedRelativeTime } from 'react-intl-next';
|
|
3
3
|
import { selectUnit } from '@formatjs/intl-utils';
|
|
4
|
-
import { extractPersonUpdatedBy } from '
|
|
5
|
-
import { extractPersonCreatedBy } from '../person/extractPersonCreatedBy';
|
|
6
|
-
import { extractDateCreated } from '../date/extractDateCreated';
|
|
7
|
-
import { extractDateUpdated } from '../date/extractDateUpdated';
|
|
4
|
+
import { extractDateCreated, extractDateUpdated, extractPersonCreatedBy, extractPersonUpdatedBy } from '@atlaskit/linking-common/extractors';
|
|
8
5
|
export const extractByline = jsonLd => {
|
|
9
6
|
const updatedAt = extractDateUpdated(jsonLd);
|
|
10
7
|
const createdAt = extractDateCreated(jsonLd);
|
|
@@ -4,14 +4,13 @@ import CommitIcon from '@atlaskit/icon-object/glyph/commit/16';
|
|
|
4
4
|
import PullRequestIcon from '@atlaskit/icon-object/glyph/pull-request/16';
|
|
5
5
|
import BranchIcon from '@atlaskit/icon-object/glyph/branch/16';
|
|
6
6
|
import RepoIcon from '@atlaskit/icon-object/glyph/code/16';
|
|
7
|
+
import TaskIcon from '@atlaskit/icon-object/glyph/task/16';
|
|
7
8
|
import { extractorPriorityMap } from './priority';
|
|
8
|
-
import { extractProvider } from '
|
|
9
|
-
import { extractTitle } from '../primitives/extractTitle';
|
|
9
|
+
import { extractProvider, extractUrlFromIconJsonLd, extractTitle } from '@atlaskit/linking-common/extractors';
|
|
10
10
|
import { extractFileFormat } from './extractFileFormat';
|
|
11
11
|
import { extractIconFromDocument } from './extractIconFromDocument';
|
|
12
12
|
import { extractIconFromTask } from './extractIconFromTask';
|
|
13
13
|
import { extractTaskType } from '../lozenge/extractTaskType';
|
|
14
|
-
import { extractUrlFromIconJsonLd } from '../utils';
|
|
15
14
|
export const extractIcon = (jsonLd, priority = 'type') => {
|
|
16
15
|
const type = jsonLd['@type'];
|
|
17
16
|
const opts = {
|
|
@@ -43,6 +42,11 @@ const extractIconByType = (type, opts) => {
|
|
|
43
42
|
case 'atlassian:UndefinedLink':
|
|
44
43
|
return extractIconFromDocument(type, opts);
|
|
45
44
|
|
|
45
|
+
case 'atlassian:Goal':
|
|
46
|
+
return opts.icon || /*#__PURE__*/React.createElement(TaskIcon, {
|
|
47
|
+
label: opts.title || 'goal'
|
|
48
|
+
});
|
|
49
|
+
|
|
46
50
|
case 'atlassian:Project':
|
|
47
51
|
return opts.icon || /*#__PURE__*/React.createElement(ProjectIcon, {
|
|
48
52
|
label: opts.title || 'project',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractState } from './extractState';
|
|
2
2
|
import { extractTag } from './extractTag';
|
|
3
3
|
import { extractTaskStatus } from './extractTaskStatus';
|
|
4
|
-
import { extractType } from '
|
|
4
|
+
import { extractType } from '@atlaskit/linking-common/extractors';
|
|
5
5
|
import { extractTaskType } from './extractTaskType';
|
|
6
6
|
const DOC_TYPES = ['schema:BlogPosting', 'schema:TextDigitalDocument', 'schema:DigitalDocument', 'schema:PresentationDigitalDocument', 'schema:SpreadsheetDigitalDocument'];
|
|
7
7
|
export const extractLozenge = jsonLd => {
|
|
@@ -20,6 +20,10 @@ export const extractLozenge = jsonLd => {
|
|
|
20
20
|
const jsonLdDocument = jsonLd;
|
|
21
21
|
const lozengeFromState = extractState(jsonLdDocument);
|
|
22
22
|
return lozengeFromState;
|
|
23
|
+
} else if (type.includes('atlassian:Goal')) {
|
|
24
|
+
const jsonLdProject = jsonLd;
|
|
25
|
+
const lozengeFromState = extractState(jsonLdProject);
|
|
26
|
+
return lozengeFromState;
|
|
23
27
|
} else if (type.includes('atlassian:Project')) {
|
|
24
28
|
const jsonLdProject = jsonLd;
|
|
25
29
|
const lozengeFromState = extractState(jsonLdProject);
|
|
@@ -16,14 +16,14 @@ export const extractState = jsonLd => {
|
|
|
16
16
|
if (state.name) {
|
|
17
17
|
return {
|
|
18
18
|
text: state.name,
|
|
19
|
-
appearance: 'default'
|
|
19
|
+
appearance: state.appearance || 'default'
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
} else if (state['@type'] === 'Object') {
|
|
23
23
|
if (state.name) {
|
|
24
24
|
return {
|
|
25
25
|
text: state.name,
|
|
26
|
-
appearance: 'default'
|
|
26
|
+
appearance: state.appearance || 'default'
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractUrlFromIconJsonLd } from '
|
|
1
|
+
import { extractUrlFromIconJsonLd } from '@atlaskit/linking-common/extractors';
|
|
2
2
|
export const extractTaskType = jsonLd => {
|
|
3
3
|
// TODO: Remove once Jira migrate to the correct type.
|
|
4
4
|
const taskType = jsonLd['atlassian:taskType'] || jsonLd.taskType;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { extractLink, extractTitle } from '
|
|
2
|
-
import { extractProvider } from '../common/context';
|
|
3
|
-
import { extractPreview } from '@atlaskit/linking-common';
|
|
1
|
+
import { extractLink, extractTitle, extractProvider, extractPreview } from '@atlaskit/linking-common/extractors';
|
|
4
2
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
5
3
|
|
|
6
4
|
const extractEmbedPreview = (jsonLd, platform) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractPersonFromJsonLd } from '
|
|
1
|
+
import { extractPersonFromJsonLd } from '@atlaskit/linking-common/extractors';
|
|
2
2
|
// Temporary Extractor until https://product-fabric.atlassian.net/browse/EDM-2652 is ready
|
|
3
3
|
export const extractPersonsUpdatedBy = jsonLd => {
|
|
4
4
|
const updatedBy = jsonLd['atlassian:updatedBy'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconType } from '../../constants';
|
|
2
|
-
import { extractUrlFromIconJsonLd } from '
|
|
2
|
+
import { extractUrlFromIconJsonLd } from '@atlaskit/linking-common/extractors';
|
|
3
3
|
const priorityMapper = {
|
|
4
4
|
blocker: IconType.PriorityBlocker,
|
|
5
5
|
critical: IconType.PriorityCritical,
|
|
@@ -5,7 +5,7 @@ import extractJiraTaskIcon from './extract-jira-task-icon';
|
|
|
5
5
|
import extractProviderIcon from './extract-provider-icon';
|
|
6
6
|
import extractUrlIcon from './extract-url-icon';
|
|
7
7
|
import { extractTaskType } from '../../common/lozenge';
|
|
8
|
-
import { extractTitle } from '
|
|
8
|
+
import { extractTitle } from '@atlaskit/linking-common/extractors';
|
|
9
9
|
import { extractorPriorityMap as priorityMap } from '../../common/icon/priority';
|
|
10
10
|
import { IconType } from '../../../constants';
|
|
11
11
|
|
|
@@ -82,6 +82,12 @@ const extractJsonldDataIcon = data => {
|
|
|
82
82
|
label: taskLabel
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
+
case 'atlassian:Goal':
|
|
86
|
+
return urlIcon || {
|
|
87
|
+
icon: IconType.Task,
|
|
88
|
+
label: label || 'Goal'
|
|
89
|
+
};
|
|
90
|
+
|
|
85
91
|
case 'atlassian:Project':
|
|
86
92
|
return urlIcon || {
|
|
87
93
|
icon: IconType.Project,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CONFLUENCE_GENERATOR_ID, JIRA_GENERATOR_ID } from '../../constants';
|
|
2
2
|
import { IconType } from '../../../constants';
|
|
3
3
|
import extractUrlIcon from './extract-url-icon';
|
|
4
|
-
import { extractTitle } from '
|
|
4
|
+
import { extractTitle } from '@atlaskit/linking-common/extractors';
|
|
5
5
|
|
|
6
6
|
const extractProviderIcon = data => {
|
|
7
7
|
if (!data) {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { extractSummary } from '../common/primitives';
|
|
2
2
|
import { extractLozenge } from '../common/lozenge';
|
|
3
3
|
import { extractLinkIcon } from './icon';
|
|
4
|
-
import { extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch } from './utils';
|
|
5
|
-
import { extractPersonCreatedBy } from '../common/person';
|
|
4
|
+
import { extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn } from './utils';
|
|
6
5
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
7
|
-
import { extractDateUpdated } from '
|
|
8
|
-
import { extractDateCreated } from '../common/date/extractDateCreated';
|
|
6
|
+
import { extractPersonCreatedBy, extractLink, extractTitle, extractDateUpdated, extractDateCreated } from '@atlaskit/linking-common/extractors';
|
|
9
7
|
import extractPriority from './extract-priority';
|
|
10
8
|
import extractProviderIcon from './icon/extract-provider-icon';
|
|
11
9
|
import extractPreview from './extract-preview';
|
|
@@ -27,6 +25,7 @@ const extractFlexibleUiContext = (response, renderers) => {
|
|
|
27
25
|
voteCount: extractVoteCount(data),
|
|
28
26
|
createdBy: extractCreatedBy(data),
|
|
29
27
|
createdOn: extractDateCreated(data),
|
|
28
|
+
dueOn: extractDueOn(data),
|
|
30
29
|
latestCommit: extractLatestCommit(data),
|
|
31
30
|
linkIcon: extractLinkIcon(response, renderers),
|
|
32
31
|
modifiedBy: extractModifiedBy(data),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractPersonCreatedBy, extractPersonUpdatedBy } from '
|
|
1
|
+
import { extractPersonCreatedBy, extractPersonUpdatedBy } from '@atlaskit/linking-common/extractors';
|
|
2
2
|
|
|
3
3
|
const extractLinkName = link => {
|
|
4
4
|
if (link && typeof link === 'object' && link['@type'] === 'Link') {
|
|
@@ -11,6 +11,7 @@ const extractValue = (data, key) => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const extractCommentCount = data => extractValue(data, 'schema:commentCount');
|
|
14
|
+
export const extractDueOn = data => extractValue(data, 'endTime');
|
|
14
15
|
export const extractViewCount = data => extractValue(data, 'atlassian:viewCount');
|
|
15
16
|
export const extractReactCount = data => extractValue(data, 'atlassian:reactCount');
|
|
16
17
|
export const extractVoteCount = data => extractValue(data, 'atlassian:voteCount');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { extractTitleTextColor } from '../common/primitives';
|
|
2
2
|
import { extractLozenge } from '../common/lozenge';
|
|
3
3
|
import { extractIcon } from '../common/icon';
|
|
4
4
|
import { extractTitlePrefix } from '../common/title-prefix';
|
|
5
|
-
import { extractProvider } from '
|
|
5
|
+
import { extractLink, extractTitle, extractProvider } from '@atlaskit/linking-common/extractors';
|
|
6
6
|
import { CONFLUENCE_GENERATOR_ID, JIRA_GENERATOR_ID } from '../constants';
|
|
7
7
|
export const extractInlineIcon = jsonLd => {
|
|
8
8
|
const provider = extractProvider(jsonLd);
|
package/dist/es2019/version.json
CHANGED
|
@@ -16,6 +16,7 @@ export const ElementDisplaySchema = {
|
|
|
16
16
|
[ElementName.VoteCount]: ['inline'],
|
|
17
17
|
[ElementName.CreatedBy]: ['inline'],
|
|
18
18
|
[ElementName.CreatedOn]: ['inline'],
|
|
19
|
+
[ElementName.DueOn]: ['inline'],
|
|
19
20
|
[ElementName.LatestCommit]: ['inline'],
|
|
20
21
|
[ElementName.LinkIcon]: ['inline'],
|
|
21
22
|
[ElementName.ModifiedBy]: ['inline'],
|
|
@@ -33,6 +33,12 @@ export const CreatedOn = createElement(ElementName.CreatedOn);
|
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
35
|
export const CreatedBy = createElement(ElementName.CreatedBy);
|
|
36
|
+
/**
|
|
37
|
+
* Creates a DueOn Lozenge element using the data from dueOn in the Flexible UI Context.
|
|
38
|
+
* @see Lozenge
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
export const DueOn = createElement(ElementName.DueOn);
|
|
36
42
|
/**
|
|
37
43
|
* Creates an element that contains Last Commit hash
|
|
38
44
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
|
+
import { FormattedDate } from 'react-intl-next';
|
|
3
4
|
import { css } from '@emotion/core';
|
|
4
5
|
import { ElementName, IconType } from '../../../../constants';
|
|
5
6
|
import Icon from './icon';
|
|
@@ -51,6 +52,9 @@ const elementMappings = {
|
|
|
51
52
|
[ElementName.CreatedOn]: {
|
|
52
53
|
component: DateTime
|
|
53
54
|
},
|
|
55
|
+
[ElementName.DueOn]: {
|
|
56
|
+
component: Lozenge
|
|
57
|
+
},
|
|
54
58
|
[ElementName.LatestCommit]: {
|
|
55
59
|
component: Badge,
|
|
56
60
|
props: {
|
|
@@ -143,6 +147,9 @@ const getData = (elementName, contextKey, context) => {
|
|
|
143
147
|
case ElementName.CreatedOn:
|
|
144
148
|
return toDateTimeProps('created', context.createdOn);
|
|
145
149
|
|
|
150
|
+
case ElementName.DueOn:
|
|
151
|
+
return toDateLozengeProps(context.dueOn);
|
|
152
|
+
|
|
146
153
|
case ElementName.ModifiedBy:
|
|
147
154
|
return toFormattedTextProps(messages.modified_by, context.modifiedBy);
|
|
148
155
|
|
|
@@ -174,6 +181,21 @@ const toBadgeProps = label => {
|
|
|
174
181
|
} : undefined;
|
|
175
182
|
};
|
|
176
183
|
|
|
184
|
+
const toDateLozengeProps = dateString => {
|
|
185
|
+
if (dateString) {
|
|
186
|
+
const text = Date.parse(dateString) ? /*#__PURE__*/React.createElement(FormattedDate, {
|
|
187
|
+
value: new Date(dateString),
|
|
188
|
+
year: "numeric",
|
|
189
|
+
month: "short",
|
|
190
|
+
day: "numeric",
|
|
191
|
+
formatMatcher: "best fit"
|
|
192
|
+
}) : dateString;
|
|
193
|
+
return {
|
|
194
|
+
text
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
177
199
|
const toDateTimeProps = (type, dateString) => {
|
|
178
200
|
return dateString ? {
|
|
179
201
|
date: new Date(dateString),
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SmartLinkStatus } from '../../constants';
|
|
2
2
|
import { getEmptyJsonLd, getUnauthorizedJsonLd } from '../../utils/jsonld';
|
|
3
|
-
import {
|
|
3
|
+
import { extractRequestAccessContext } from '../../extractors/common/context';
|
|
4
4
|
import { messages } from '../../messages';
|
|
5
5
|
import extractFlexibleLinkContext from '../../extractors/flexible';
|
|
6
6
|
import { extractErrorIcon } from '../../extractors/flexible/icon';
|
|
7
7
|
import { handleOnClick } from '../../utils';
|
|
8
|
+
import { extractProvider } from '@atlaskit/linking-common/extractors';
|
|
8
9
|
export const getContextByStatus = (url, status, details, renderers) => {
|
|
9
10
|
switch (status) {
|
|
10
11
|
case SmartLinkStatus.Pending:
|
|
@@ -9,7 +9,7 @@ import { isSpecialEvent } from '../../../utils';
|
|
|
9
9
|
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
10
10
|
import { getExtensionKey } from '../../../state/helpers';
|
|
11
11
|
import { titleBlockCss, metadataBlockCss, footerBlockCss } from '../styled';
|
|
12
|
-
import { extractType } from '
|
|
12
|
+
import { extractType } from '@atlaskit/linking-common/extractors';
|
|
13
13
|
const flexibleUiOptions = {
|
|
14
14
|
hideElevation: true,
|
|
15
15
|
size: SmartLinkSize.Medium,
|
|
@@ -40,6 +40,25 @@ export const getSimulatedMetadata = (extensionKey = '', types = []) => {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
case 'watermelon-object-provider':
|
|
44
|
+
if (types.includes('atlassian:Project')) {
|
|
45
|
+
return {
|
|
46
|
+
metadata: {
|
|
47
|
+
primary: [ElementName.AuthorGroup, ElementName.ModifiedOn, ElementName.State, ElementName.DueOn],
|
|
48
|
+
secondary: [],
|
|
49
|
+
subtitle: []
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
metadata: {
|
|
56
|
+
primary: [ElementName.AuthorGroup, ElementName.State, ElementName.DueOn],
|
|
57
|
+
secondary: [],
|
|
58
|
+
subtitle: []
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
43
62
|
default:
|
|
44
63
|
return {
|
|
45
64
|
metadata: {
|
|
@@ -2,13 +2,14 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { getEmptyJsonLd, getUnauthorizedJsonLd } from '../../utils/jsonld';
|
|
4
4
|
import { extractInlineProps } from '../../extractors/inline';
|
|
5
|
-
import {
|
|
5
|
+
import { extractRequestAccessContext } from '../../extractors/common/context';
|
|
6
6
|
import { CardLinkView } from '../LinkView';
|
|
7
7
|
import { InlineCardErroredView } from './ErroredView';
|
|
8
8
|
import { InlineCardForbiddenView } from './ForbiddenView';
|
|
9
9
|
import { InlineCardResolvedView } from './ResolvedView';
|
|
10
10
|
import { InlineCardResolvingView } from './ResolvingView';
|
|
11
11
|
import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
12
|
+
import { extractProvider } from '@atlaskit/linking-common/extractors';
|
|
12
13
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView };
|
|
13
14
|
export const InlineCard = ({
|
|
14
15
|
id,
|
package/dist/esm/constants.js
CHANGED
|
@@ -111,6 +111,7 @@ export var ElementName;
|
|
|
111
111
|
ElementName["CommentCount"] = "CommentCount";
|
|
112
112
|
ElementName["CreatedBy"] = "CreatedBy";
|
|
113
113
|
ElementName["CreatedOn"] = "CreatedOn";
|
|
114
|
+
ElementName["DueOn"] = "DueOn";
|
|
114
115
|
ElementName["LinkIcon"] = "LinkIcon";
|
|
115
116
|
ElementName["ModifiedBy"] = "ModifiedBy";
|
|
116
117
|
ElementName["ModifiedOn"] = "ModifiedOn";
|