@atlaskit/smart-card 19.1.30 → 19.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/extractors/common/icon/extractIcon.js +7 -0
- package/dist/cjs/extractors/common/icon/priority.js +1 -0
- package/dist/cjs/extractors/common/lozenge/extractLozenge.js +7 -1
- package/dist/cjs/extractors/common/lozenge/extractState.js +2 -2
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +6 -0
- package/dist/cjs/extractors/flexible/index.js +1 -0
- package/dist/cjs/extractors/flexible/utils.js +7 -1
- 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/HoverCard/utils.js +19 -0
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/extractors/common/icon/extractIcon.js +6 -0
- package/dist/es2019/extractors/common/icon/priority.js +1 -0
- package/dist/es2019/extractors/common/lozenge/extractLozenge.js +4 -0
- package/dist/es2019/extractors/common/lozenge/extractState.js +2 -2
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +6 -0
- package/dist/es2019/extractors/flexible/index.js +2 -1
- package/dist/es2019/extractors/flexible/utils.js +1 -0
- 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/HoverCard/utils.js +19 -0
- package/dist/esm/constants.js +1 -0
- package/dist/esm/extractors/common/icon/extractIcon.js +6 -0
- package/dist/esm/extractors/common/icon/priority.js +1 -0
- package/dist/esm/extractors/common/lozenge/extractLozenge.js +7 -1
- package/dist/esm/extractors/common/lozenge/extractState.js +2 -2
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +6 -0
- package/dist/esm/extractors/flexible/index.js +2 -1
- package/dist/esm/extractors/flexible/utils.js +3 -0
- 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/HoverCard/utils.js +19 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/extractors/common/lozenge/extractState.d.ts +1 -1
- package/dist/types/extractors/flexible/utils.d.ts +1 -0
- package/dist/types/state/flexible-ui-context/types.d.ts +7 -0
- 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 +1 -1
- package/report.api.md +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 19.1.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`34d17437062`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34d17437062) - Flexible UI: Add DueOn element
|
|
8
|
+
Hover Preview: Update Atlas metadata
|
|
9
|
+
|
|
3
10
|
## 19.1.30
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -134,6 +134,7 @@ exports.ElementName = ElementName;
|
|
|
134
134
|
ElementName["CommentCount"] = "CommentCount";
|
|
135
135
|
ElementName["CreatedBy"] = "CreatedBy";
|
|
136
136
|
ElementName["CreatedOn"] = "CreatedOn";
|
|
137
|
+
ElementName["DueOn"] = "DueOn";
|
|
137
138
|
ElementName["LinkIcon"] = "LinkIcon";
|
|
138
139
|
ElementName["ModifiedBy"] = "ModifiedBy";
|
|
139
140
|
ElementName["ModifiedOn"] = "ModifiedOn";
|
|
@@ -19,6 +19,8 @@ var _3 = _interopRequireDefault(require("@atlaskit/icon-object/glyph/branch/16")
|
|
|
19
19
|
|
|
20
20
|
var _4 = _interopRequireDefault(require("@atlaskit/icon-object/glyph/code/16"));
|
|
21
21
|
|
|
22
|
+
var _5 = _interopRequireDefault(require("@atlaskit/icon-object/glyph/task/16"));
|
|
23
|
+
|
|
22
24
|
var _priority = require("./priority");
|
|
23
25
|
|
|
24
26
|
var _extractProvider = require("../context/extractProvider");
|
|
@@ -71,6 +73,11 @@ var extractIconByType = function extractIconByType(type, opts) {
|
|
|
71
73
|
case 'atlassian:UndefinedLink':
|
|
72
74
|
return (0, _extractIconFromDocument.extractIconFromDocument)(type, opts);
|
|
73
75
|
|
|
76
|
+
case 'atlassian:Goal':
|
|
77
|
+
return opts.icon || /*#__PURE__*/_react.default.createElement(_5.default, {
|
|
78
|
+
label: opts.title || 'goal'
|
|
79
|
+
});
|
|
80
|
+
|
|
74
81
|
case 'atlassian:Project':
|
|
75
82
|
return opts.icon || /*#__PURE__*/_react.default.createElement(_peopleGroup.default, {
|
|
76
83
|
label: opts.title || 'project',
|
|
@@ -35,12 +35,18 @@ var extractLozenge = function extractLozenge(jsonLd) {
|
|
|
35
35
|
var jsonLdDocument = jsonLd;
|
|
36
36
|
var lozengeFromState = (0, _extractState.extractState)(jsonLdDocument);
|
|
37
37
|
return lozengeFromState;
|
|
38
|
-
} else if (type.includes('atlassian:
|
|
38
|
+
} else if (type.includes('atlassian:Goal')) {
|
|
39
39
|
var jsonLdProject = jsonLd;
|
|
40
40
|
|
|
41
41
|
var _lozengeFromState = (0, _extractState.extractState)(jsonLdProject);
|
|
42
42
|
|
|
43
43
|
return _lozengeFromState;
|
|
44
|
+
} else if (type.includes('atlassian:Project')) {
|
|
45
|
+
var _jsonLdProject = jsonLd;
|
|
46
|
+
|
|
47
|
+
var _lozengeFromState2 = (0, _extractState.extractState)(_jsonLdProject);
|
|
48
|
+
|
|
49
|
+
return _lozengeFromState2;
|
|
44
50
|
} else if (type.includes('atlassian:UndefinedLink')) {
|
|
45
51
|
return {
|
|
46
52
|
text: 'UNDEFINED',
|
|
@@ -24,14 +24,14 @@ var extractState = function extractState(jsonLd) {
|
|
|
24
24
|
if (state.name) {
|
|
25
25
|
return {
|
|
26
26
|
text: state.name,
|
|
27
|
-
appearance: 'default'
|
|
27
|
+
appearance: state.appearance || 'default'
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
} else if (state['@type'] === 'Object') {
|
|
31
31
|
if (state.name) {
|
|
32
32
|
return {
|
|
33
33
|
text: state.name,
|
|
34
|
-
appearance: 'default'
|
|
34
|
+
appearance: state.appearance || 'default'
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -108,6 +108,12 @@ var extractJsonldDataIcon = function extractJsonldDataIcon(data) {
|
|
|
108
108
|
label: taskLabel
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
+
case 'atlassian:Goal':
|
|
112
|
+
return urlIcon || {
|
|
113
|
+
icon: _constants2.IconType.Task,
|
|
114
|
+
label: label || 'Goal'
|
|
115
|
+
};
|
|
116
|
+
|
|
111
117
|
case 'atlassian:Project':
|
|
112
118
|
return urlIcon || {
|
|
113
119
|
icon: _constants2.IconType.Project,
|
|
@@ -47,6 +47,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext(response, rende
|
|
|
47
47
|
voteCount: (0, _utils.extractVoteCount)(data),
|
|
48
48
|
createdBy: (0, _utils.extractCreatedBy)(data),
|
|
49
49
|
createdOn: (0, _extractDateCreated.extractDateCreated)(data),
|
|
50
|
+
dueOn: (0, _utils.extractDueOn)(data),
|
|
50
51
|
latestCommit: (0, _latestCommit.extractLatestCommit)(data),
|
|
51
52
|
linkIcon: (0, _icon.extractLinkIcon)(response, renderers),
|
|
52
53
|
modifiedBy: (0, _utils.extractModifiedBy)(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.extractCreatedBy = exports.extractCommentCount = 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 = void 0;
|
|
9
9
|
|
|
10
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
11
|
|
|
@@ -27,6 +27,12 @@ var extractCommentCount = function extractCommentCount(data) {
|
|
|
27
27
|
|
|
28
28
|
exports.extractCommentCount = extractCommentCount;
|
|
29
29
|
|
|
30
|
+
var extractDueOn = function extractDueOn(data) {
|
|
31
|
+
return extractValue(data, 'endTime');
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.extractDueOn = extractDueOn;
|
|
35
|
+
|
|
30
36
|
var extractViewCount = function extractViewCount(data) {
|
|
31
37
|
return extractValue(data, 'atlassian:viewCount');
|
|
32
38
|
};
|
package/dist/cjs/version.json
CHANGED
|
@@ -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),
|
|
@@ -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: {
|
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";
|
|
@@ -4,6 +4,7 @@ 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
9
|
import { extractProvider } from '../context/extractProvider';
|
|
9
10
|
import { extractTitle } from '../primitives/extractTitle';
|
|
@@ -43,6 +44,11 @@ const extractIconByType = (type, opts) => {
|
|
|
43
44
|
case 'atlassian:UndefinedLink':
|
|
44
45
|
return extractIconFromDocument(type, opts);
|
|
45
46
|
|
|
47
|
+
case 'atlassian:Goal':
|
|
48
|
+
return opts.icon || /*#__PURE__*/React.createElement(TaskIcon, {
|
|
49
|
+
label: opts.title || 'goal'
|
|
50
|
+
});
|
|
51
|
+
|
|
46
52
|
case 'atlassian:Project':
|
|
47
53
|
return opts.icon || /*#__PURE__*/React.createElement(ProjectIcon, {
|
|
48
54
|
label: opts.title || 'project',
|
|
@@ -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
|
}
|
|
@@ -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 { extractLink, extractSummary, extractTitle } 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';
|
|
4
|
+
import { extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn } from './utils';
|
|
5
5
|
import { extractPersonCreatedBy } from '../common/person';
|
|
6
6
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
7
7
|
import { extractDateUpdated } from '../common/date/extractDateUpdated';
|
|
@@ -27,6 +27,7 @@ const extractFlexibleUiContext = (response, renderers) => {
|
|
|
27
27
|
voteCount: extractVoteCount(data),
|
|
28
28
|
createdBy: extractCreatedBy(data),
|
|
29
29
|
createdOn: extractDateCreated(data),
|
|
30
|
+
dueOn: extractDueOn(data),
|
|
30
31
|
latestCommit: extractLatestCommit(data),
|
|
31
32
|
linkIcon: extractLinkIcon(response, renderers),
|
|
32
33
|
modifiedBy: extractModifiedBy(data),
|
|
@@ -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');
|
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),
|
|
@@ -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: {
|
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";
|
|
@@ -4,6 +4,7 @@ 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
9
|
import { extractProvider } from '../context/extractProvider';
|
|
9
10
|
import { extractTitle } from '../primitives/extractTitle';
|
|
@@ -46,6 +47,11 @@ var extractIconByType = function extractIconByType(type, opts) {
|
|
|
46
47
|
case 'atlassian:UndefinedLink':
|
|
47
48
|
return extractIconFromDocument(type, opts);
|
|
48
49
|
|
|
50
|
+
case 'atlassian:Goal':
|
|
51
|
+
return opts.icon || /*#__PURE__*/React.createElement(TaskIcon, {
|
|
52
|
+
label: opts.title || 'goal'
|
|
53
|
+
});
|
|
54
|
+
|
|
49
55
|
case 'atlassian:Project':
|
|
50
56
|
return opts.icon || /*#__PURE__*/React.createElement(ProjectIcon, {
|
|
51
57
|
label: opts.title || 'project',
|
|
@@ -22,12 +22,18 @@ export var extractLozenge = function extractLozenge(jsonLd) {
|
|
|
22
22
|
var jsonLdDocument = jsonLd;
|
|
23
23
|
var lozengeFromState = extractState(jsonLdDocument);
|
|
24
24
|
return lozengeFromState;
|
|
25
|
-
} else if (type.includes('atlassian:
|
|
25
|
+
} else if (type.includes('atlassian:Goal')) {
|
|
26
26
|
var jsonLdProject = jsonLd;
|
|
27
27
|
|
|
28
28
|
var _lozengeFromState = extractState(jsonLdProject);
|
|
29
29
|
|
|
30
30
|
return _lozengeFromState;
|
|
31
|
+
} else if (type.includes('atlassian:Project')) {
|
|
32
|
+
var _jsonLdProject = jsonLd;
|
|
33
|
+
|
|
34
|
+
var _lozengeFromState2 = extractState(_jsonLdProject);
|
|
35
|
+
|
|
36
|
+
return _lozengeFromState2;
|
|
31
37
|
} else if (type.includes('atlassian:UndefinedLink')) {
|
|
32
38
|
return {
|
|
33
39
|
text: 'UNDEFINED',
|
|
@@ -16,14 +16,14 @@ export var extractState = function 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
|
}
|
|
@@ -90,6 +90,12 @@ var extractJsonldDataIcon = function extractJsonldDataIcon(data) {
|
|
|
90
90
|
label: taskLabel
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
+
case 'atlassian:Goal':
|
|
94
|
+
return urlIcon || {
|
|
95
|
+
icon: IconType.Task,
|
|
96
|
+
label: label || 'Goal'
|
|
97
|
+
};
|
|
98
|
+
|
|
93
99
|
case 'atlassian:Project':
|
|
94
100
|
return urlIcon || {
|
|
95
101
|
icon: IconType.Project,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractLink, extractSummary, extractTitle } 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';
|
|
4
|
+
import { extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn } from './utils';
|
|
5
5
|
import { extractPersonCreatedBy } from '../common/person';
|
|
6
6
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
7
7
|
import { extractDateUpdated } from '../common/date/extractDateUpdated';
|
|
@@ -27,6 +27,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext(response, rende
|
|
|
27
27
|
voteCount: extractVoteCount(data),
|
|
28
28
|
createdBy: extractCreatedBy(data),
|
|
29
29
|
createdOn: extractDateCreated(data),
|
|
30
|
+
dueOn: extractDueOn(data),
|
|
30
31
|
latestCommit: extractLatestCommit(data),
|
|
31
32
|
linkIcon: extractLinkIcon(response, renderers),
|
|
32
33
|
modifiedBy: extractModifiedBy(data),
|
|
@@ -14,6 +14,9 @@ var extractValue = function extractValue(data, key) {
|
|
|
14
14
|
export var extractCommentCount = function extractCommentCount(data) {
|
|
15
15
|
return extractValue(data, 'schema:commentCount');
|
|
16
16
|
};
|
|
17
|
+
export var extractDueOn = function extractDueOn(data) {
|
|
18
|
+
return extractValue(data, 'endTime');
|
|
19
|
+
};
|
|
17
20
|
export var extractViewCount = function extractViewCount(data) {
|
|
18
21
|
return extractValue(data, 'atlassian:viewCount');
|
|
19
22
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -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.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.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.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);
|
|
24
24
|
|
|
25
25
|
var getDirectionStyles = function getDirectionStyles(direction) {
|
|
26
26
|
switch (direction) {
|
|
@@ -33,6 +33,12 @@ export var CreatedOn = createElement(ElementName.CreatedOn);
|
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
35
|
export var 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 var DueOn = createElement(ElementName.DueOn);
|
|
36
42
|
/**
|
|
37
43
|
* Creates an element that contains Last Commit hash
|
|
38
44
|
*/
|
|
@@ -5,6 +5,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
5
5
|
var _templateObject, _elementMappings;
|
|
6
6
|
|
|
7
7
|
import React, { useContext } from 'react';
|
|
8
|
+
import { FormattedDate } from 'react-intl-next';
|
|
8
9
|
import { css } from '@emotion/core';
|
|
9
10
|
import { ElementName, IconType } from '../../../../constants';
|
|
10
11
|
import Icon from './icon';
|
|
@@ -47,6 +48,8 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
|
|
|
47
48
|
component: Text
|
|
48
49
|
}), _defineProperty(_elementMappings, ElementName.CreatedOn, {
|
|
49
50
|
component: DateTime
|
|
51
|
+
}), _defineProperty(_elementMappings, ElementName.DueOn, {
|
|
52
|
+
component: Lozenge
|
|
50
53
|
}), _defineProperty(_elementMappings, ElementName.LatestCommit, {
|
|
51
54
|
component: Badge,
|
|
52
55
|
props: {
|
|
@@ -123,6 +126,9 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
123
126
|
case ElementName.CreatedOn:
|
|
124
127
|
return toDateTimeProps('created', context.createdOn);
|
|
125
128
|
|
|
129
|
+
case ElementName.DueOn:
|
|
130
|
+
return toDateLozengeProps(context.dueOn);
|
|
131
|
+
|
|
126
132
|
case ElementName.ModifiedBy:
|
|
127
133
|
return toFormattedTextProps(messages.modified_by, context.modifiedBy);
|
|
128
134
|
|
|
@@ -154,6 +160,21 @@ var toBadgeProps = function toBadgeProps(label) {
|
|
|
154
160
|
} : undefined;
|
|
155
161
|
};
|
|
156
162
|
|
|
163
|
+
var toDateLozengeProps = function toDateLozengeProps(dateString) {
|
|
164
|
+
if (dateString) {
|
|
165
|
+
var text = Date.parse(dateString) ? /*#__PURE__*/React.createElement(FormattedDate, {
|
|
166
|
+
value: new Date(dateString),
|
|
167
|
+
year: "numeric",
|
|
168
|
+
month: "short",
|
|
169
|
+
day: "numeric",
|
|
170
|
+
formatMatcher: "best fit"
|
|
171
|
+
}) : dateString;
|
|
172
|
+
return {
|
|
173
|
+
text: text
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
157
178
|
var toDateTimeProps = function toDateTimeProps(type, dateString) {
|
|
158
179
|
return dateString ? {
|
|
159
180
|
date: new Date(dateString),
|
|
@@ -43,6 +43,25 @@ export var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
case 'watermelon-object-provider':
|
|
47
|
+
if (types.includes('atlassian:Project')) {
|
|
48
|
+
return {
|
|
49
|
+
metadata: {
|
|
50
|
+
primary: [ElementName.AuthorGroup, ElementName.ModifiedOn, ElementName.State, ElementName.DueOn],
|
|
51
|
+
secondary: [],
|
|
52
|
+
subtitle: []
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
metadata: {
|
|
59
|
+
primary: [ElementName.AuthorGroup, ElementName.State, ElementName.DueOn],
|
|
60
|
+
secondary: [],
|
|
61
|
+
subtitle: []
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
46
65
|
default:
|
|
47
66
|
return {
|
|
48
67
|
metadata: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { LinkLozenge } from './types';
|
|
3
|
-
export declare const extractState: (jsonLd: JsonLd.Data.SourceCodePullRequest | JsonLd.Data.Document | JsonLd.Data.Project) => LinkLozenge | undefined;
|
|
3
|
+
export declare const extractState: (jsonLd: JsonLd.Data.SourceCodePullRequest | JsonLd.Data.Document | JsonLd.Data.Project | JsonLd.Data.Goal) => LinkLozenge | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
export declare const extractCommentCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
3
|
+
export declare const extractDueOn: (data: JsonLd.Data.BaseData) => string | undefined;
|
|
3
4
|
export declare const extractViewCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
4
5
|
export declare const extractReactCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
5
6
|
export declare const extractVoteCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
@@ -22,6 +22,13 @@ export declare type FlexibleUiDataContext = {
|
|
|
22
22
|
* @see CommentCount
|
|
23
23
|
*/
|
|
24
24
|
commentCount?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Contains the ISO timestamp of when the resource was due.
|
|
27
|
+
* This value is mapped to JsonLD endTime.
|
|
28
|
+
* @type string - ISO Timestamp
|
|
29
|
+
* @see DueOn
|
|
30
|
+
*/
|
|
31
|
+
dueOn?: string;
|
|
25
32
|
/**
|
|
26
33
|
* Contains the number of views of the linked resource.
|
|
27
34
|
* @type number
|
|
@@ -103,7 +103,7 @@ export declare type ActionItem = NamedActionItem | CustomActionItem;
|
|
|
103
103
|
/**
|
|
104
104
|
* A type that contains all the possible combinations of elements with their corresponding props.
|
|
105
105
|
*/
|
|
106
|
-
export declare type ElementItemProps = AuthorGroup | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | Snippet | SourceBranch | State | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
106
|
+
export declare type ElementItemProps = AuthorGroup | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | Snippet | SourceBranch | State | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
107
107
|
/**
|
|
108
108
|
* Represents the props available for an AuthorGroup element.
|
|
109
109
|
* @see AuthorGroup
|
|
@@ -143,6 +143,13 @@ export declare type CreatedOn = {
|
|
|
143
143
|
*/
|
|
144
144
|
text?: string;
|
|
145
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* Represents the props available for an DueOn element.
|
|
148
|
+
* @see CreatedOn
|
|
149
|
+
*/
|
|
150
|
+
export declare type DueOn = {
|
|
151
|
+
name: ElementName.DueOn;
|
|
152
|
+
};
|
|
146
153
|
/**
|
|
147
154
|
* Represents the props available for an LastCommit element.
|
|
148
155
|
* @see BadgeProps
|
|
@@ -32,6 +32,11 @@ export declare const CreatedOn: import("react").FC<DateTimeProps>;
|
|
|
32
32
|
* @see Text
|
|
33
33
|
*/
|
|
34
34
|
export declare const CreatedBy: import("react").FC<TextProps>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a DueOn Lozenge element using the data from dueOn in the Flexible UI Context.
|
|
37
|
+
* @see Lozenge
|
|
38
|
+
*/
|
|
39
|
+
export declare const DueOn: import("react").FC<LozengeProps>;
|
|
35
40
|
/**
|
|
36
41
|
* Creates an element that contains Last Commit hash
|
|
37
42
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ElementProps } from '../types';
|
|
2
3
|
export declare type LozengeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
|
|
3
4
|
export declare type LozengeProps = ElementProps & {
|
|
@@ -8,5 +9,5 @@ export declare type LozengeProps = ElementProps & {
|
|
|
8
9
|
/**
|
|
9
10
|
* The text to display within the lozenge.
|
|
10
11
|
*/
|
|
11
|
-
text?: string;
|
|
12
|
+
text?: string | React.ReactNode;
|
|
12
13
|
};
|
package/package.json
CHANGED
package/report.api.md
CHANGED