@atlaskit/smart-card 26.13.0 → 26.14.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 +12 -0
- package/dist/cjs/constants.js +5 -0
- package/dist/cjs/extractors/flexible/index.js +5 -0
- package/dist/cjs/extractors/flexible/utils.js +23 -2
- package/dist/cjs/extractors/hover/extractMetadata.js +2 -1
- package/dist/cjs/messages.js +31 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +21 -37
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -5
- package/dist/cjs/view/BlockCard/views/flexible/styled.js +15 -0
- package/dist/cjs/view/BlockCard/views/flexible/utils.js +116 -0
- package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +31 -18
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +33 -4
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +20 -0
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +28 -12
- package/dist/cjs/view/HoverCard/utils.js +102 -3
- package/dist/es2019/constants.js +6 -0
- package/dist/es2019/extractors/flexible/index.js +7 -2
- package/dist/es2019/extractors/flexible/utils.js +18 -1
- package/dist/es2019/extractors/hover/extractMetadata.js +1 -1
- package/dist/es2019/messages.js +31 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +24 -38
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +13 -5
- package/dist/es2019/view/BlockCard/views/flexible/styled.js +14 -0
- package/dist/es2019/view/BlockCard/views/flexible/utils.js +108 -0
- package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +33 -20
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +5 -0
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +24 -0
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +25 -0
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +30 -14
- package/dist/es2019/view/HoverCard/utils.js +100 -1
- package/dist/esm/constants.js +6 -0
- package/dist/esm/extractors/flexible/index.js +7 -2
- package/dist/esm/extractors/flexible/utils.js +18 -1
- package/dist/esm/extractors/hover/extractMetadata.js +1 -1
- package/dist/esm/messages.js +31 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +23 -38
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -5
- package/dist/esm/view/BlockCard/views/flexible/styled.js +7 -0
- package/dist/esm/view/BlockCard/views/flexible/utils.js +108 -0
- package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +33 -20
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/index.js +24 -0
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +20 -0
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +30 -14
- package/dist/esm/view/HoverCard/utils.js +98 -1
- package/dist/types/constants.d.ts +5 -0
- package/dist/types/extractors/flexible/utils.d.ts +5 -0
- package/dist/types/extractors/hover/extractMetadata.d.ts +2 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +25 -0
- package/dist/types/view/BlockCard/views/flexible/styled.d.ts +2 -0
- package/dist/types/view/BlockCard/views/flexible/utils.d.ts +10 -0
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +35 -2
- package/dist/types/view/FlexibleCard/components/elements/index.d.ts +24 -0
- package/dist/types/view/HoverCard/utils.d.ts +1 -0
- package/dist/types-ts4.5/constants.d.ts +5 -0
- package/dist/types-ts4.5/extractors/flexible/utils.d.ts +5 -0
- package/dist/types-ts4.5/extractors/hover/extractMetadata.d.ts +2 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +25 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/styled.d.ts +2 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/utils.d.ts +10 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +35 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/index.d.ts +24 -0
- package/dist/types-ts4.5/view/HoverCard/utils.d.ts +1 -0
- package/package.json +5 -2
- package/report.api.md +40 -0
- package/tmp/api-report-tmp.d.ts +36 -1
|
@@ -3,16 +3,28 @@
|
|
|
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.OwnedBy = exports.ModifiedOn = exports.ModifiedBy = exports.Location = exports.LinkIcon = exports.LatestCommit = exports.DueOn = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.ChecklistProgress = exports.AuthorGroup = exports.AttachmentCount = void 0;
|
|
6
|
+
exports.VoteCount = exports.ViewCount = exports.Title = exports.TargetBranch = exports.SubscriberCount = exports.SubTasksProgress = exports.State = exports.SourceBranch = exports.Snippet = exports.ReadTime = exports.ReactCount = exports.Provider = exports.ProgrammingLanguage = exports.Priority = exports.Preview = exports.OwnedByGroup = exports.OwnedBy = exports.ModifiedOn = exports.ModifiedBy = exports.Location = exports.LinkIcon = exports.LatestCommit = exports.DueOn = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.ChecklistProgress = exports.AuthorGroup = exports.AttachmentCount = exports.AssignedToGroup = exports.AssignedTo = void 0;
|
|
7
7
|
var _utils = require("./utils");
|
|
8
8
|
var _constants = require("../../../../constants");
|
|
9
9
|
// Attention: Keep the export name and element name the same.
|
|
10
10
|
// This will help reducing the code for mapping elements inside
|
|
11
11
|
// createElement and renderElementItems
|
|
12
|
+
/**
|
|
13
|
+
* Creates a AssignedTo text element using the data from AssignedTo in the Flexible UI Context.
|
|
14
|
+
* @see Text
|
|
15
|
+
*/
|
|
16
|
+
var AssignedTo = (0, _utils.createElement)(_constants.ElementName.AssignedTo);
|
|
17
|
+
/**
|
|
18
|
+
* An AvatarGroup element using the data from AssignedToGroup in the Flexible UI Context.
|
|
19
|
+
* @see AvatarGroup
|
|
20
|
+
*/
|
|
21
|
+
exports.AssignedTo = AssignedTo;
|
|
22
|
+
var AssignedToGroup = (0, _utils.createElement)(_constants.ElementName.AssignedToGroup);
|
|
12
23
|
/**
|
|
13
24
|
* Creates a AttachmentCount Badge element using the data from AttachmentCount in the Flexible UI Context.
|
|
14
25
|
* @see Badge
|
|
15
26
|
*/
|
|
27
|
+
exports.AssignedToGroup = AssignedToGroup;
|
|
16
28
|
var AttachmentCount = (0, _utils.createElement)(_constants.ElementName.AttachmentCount);
|
|
17
29
|
/**
|
|
18
30
|
* An AvatarGroup element using the data from AuthorGroup in the Flexible UI Context.
|
|
@@ -92,11 +104,17 @@ var ModifiedOn = (0, _utils.createElement)(_constants.ElementName.ModifiedOn);
|
|
|
92
104
|
*/
|
|
93
105
|
exports.ModifiedOn = ModifiedOn;
|
|
94
106
|
var OwnedBy = (0, _utils.createElement)(_constants.ElementName.OwnedBy);
|
|
107
|
+
/**
|
|
108
|
+
* An AvatarGroup element using the data from OwnedByGroup in the Flexible UI Context.
|
|
109
|
+
* @see AvatarGroup
|
|
110
|
+
*/
|
|
111
|
+
exports.OwnedBy = OwnedBy;
|
|
112
|
+
var OwnedByGroup = (0, _utils.createElement)(_constants.ElementName.OwnedByGroup);
|
|
95
113
|
/**
|
|
96
114
|
* Creates a Preview element using the data from Preview in the Flexible UI Context.
|
|
97
115
|
* @see Preview
|
|
98
116
|
*/
|
|
99
|
-
exports.
|
|
117
|
+
exports.OwnedByGroup = OwnedByGroup;
|
|
100
118
|
var Preview = (0, _utils.createElement)(_constants.ElementName.Preview);
|
|
101
119
|
/**
|
|
102
120
|
* Creates a Priority Badge element using the data from Priority in the Flexible UI Context.
|
|
@@ -122,11 +140,16 @@ var Provider = (0, _utils.createElement)(_constants.ElementName.Provider);
|
|
|
122
140
|
*/
|
|
123
141
|
exports.Provider = Provider;
|
|
124
142
|
var ReactCount = (0, _utils.createElement)(_constants.ElementName.ReactCount);
|
|
143
|
+
/**
|
|
144
|
+
* Creates a ReadTime Text element using the data from readTime in the Flexible UI Context
|
|
145
|
+
*/
|
|
146
|
+
exports.ReactCount = ReactCount;
|
|
147
|
+
var ReadTime = (0, _utils.createElement)(_constants.ElementName.ReadTime);
|
|
125
148
|
/**
|
|
126
149
|
* Creates a Snippet element using the data from Snippet in the Flexible UI Context.
|
|
127
150
|
* @see Text
|
|
128
151
|
*/
|
|
129
|
-
exports.
|
|
152
|
+
exports.ReadTime = ReadTime;
|
|
130
153
|
var Snippet = (0, _utils.createElement)(_constants.ElementName.Snippet);
|
|
131
154
|
/**
|
|
132
155
|
* Creates a SourceBranch Text element using the data from sourceBranch in the Flexible UI Context.
|
|
@@ -146,11 +169,17 @@ var State = (0, _utils.createElement)(_constants.ElementName.State);
|
|
|
146
169
|
*/
|
|
147
170
|
exports.State = State;
|
|
148
171
|
var SubscriberCount = (0, _utils.createElement)(_constants.ElementName.SubscriberCount);
|
|
172
|
+
/**
|
|
173
|
+
* Create a SubTasks Badge element using the data from subTasks in the Flexible UI Context.
|
|
174
|
+
* @see Badge
|
|
175
|
+
*/
|
|
176
|
+
exports.SubscriberCount = SubscriberCount;
|
|
177
|
+
var SubTasksProgress = (0, _utils.createElement)(_constants.ElementName.SubTasksProgress);
|
|
149
178
|
/**
|
|
150
179
|
* Creates a TargetBranch Text element using the data from targetBranch in the Flexible UI Context.
|
|
151
180
|
* @see Text
|
|
152
181
|
*/
|
|
153
|
-
exports.
|
|
182
|
+
exports.SubTasksProgress = SubTasksProgress;
|
|
154
183
|
var TargetBranch = (0, _utils.createElement)(_constants.ElementName.TargetBranch);
|
|
155
184
|
/**
|
|
156
185
|
* Creates a Title Link element using the data from Title in the Flexible UI Context.
|
|
@@ -67,6 +67,12 @@ var elementMappings = (_elementMappings = {}, (0, _defineProperty2.default)(_ele
|
|
|
67
67
|
component: _text.default
|
|
68
68
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.OwnedBy, {
|
|
69
69
|
component: _text.default
|
|
70
|
+
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.AssignedTo, {
|
|
71
|
+
component: _text.default
|
|
72
|
+
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.AssignedToGroup, {
|
|
73
|
+
component: _avatarGroup.default
|
|
74
|
+
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.OwnedByGroup, {
|
|
75
|
+
component: _avatarGroup.default
|
|
70
76
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.CreatedOn, {
|
|
71
77
|
component: _dateTime.default
|
|
72
78
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.DueOn, {
|
|
@@ -93,6 +99,8 @@ var elementMappings = (_elementMappings = {}, (0, _defineProperty2.default)(_ele
|
|
|
93
99
|
}
|
|
94
100
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.Provider, {
|
|
95
101
|
component: _badge.default
|
|
102
|
+
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.ReadTime, {
|
|
103
|
+
component: _text.default
|
|
96
104
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.Snippet, {
|
|
97
105
|
component: _text.default,
|
|
98
106
|
props: {
|
|
@@ -108,6 +116,11 @@ var elementMappings = (_elementMappings = {}, (0, _defineProperty2.default)(_ele
|
|
|
108
116
|
props: {
|
|
109
117
|
icon: _constants.IconType.Subscriber
|
|
110
118
|
}
|
|
119
|
+
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.SubTasksProgress, {
|
|
120
|
+
component: _badge.default,
|
|
121
|
+
props: {
|
|
122
|
+
icon: _constants.IconType.CheckItem
|
|
123
|
+
}
|
|
111
124
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.TargetBranch, {
|
|
112
125
|
component: _text.default
|
|
113
126
|
}), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.Title, {
|
|
@@ -130,7 +143,9 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
130
143
|
var data = context[contextKey];
|
|
131
144
|
switch (elementName) {
|
|
132
145
|
case _constants.ElementName.AuthorGroup:
|
|
146
|
+
case _constants.ElementName.AssignedToGroup:
|
|
133
147
|
case _constants.ElementName.CollaboratorGroup:
|
|
148
|
+
case _constants.ElementName.OwnedByGroup:
|
|
134
149
|
return toAvatarGroupProps(data);
|
|
135
150
|
case _constants.ElementName.AttachmentCount:
|
|
136
151
|
case _constants.ElementName.ChecklistProgress:
|
|
@@ -141,9 +156,12 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
141
156
|
case _constants.ElementName.ProgrammingLanguage:
|
|
142
157
|
case _constants.ElementName.SubscriberCount:
|
|
143
158
|
case _constants.ElementName.LatestCommit:
|
|
159
|
+
case _constants.ElementName.SubTasksProgress:
|
|
144
160
|
return toBadgeProps(data);
|
|
145
161
|
case _constants.ElementName.CreatedBy:
|
|
146
162
|
return toFormattedTextProps(_messages.messages.created_by, context.createdBy);
|
|
163
|
+
case _constants.ElementName.AssignedTo:
|
|
164
|
+
return toFormattedTextProps(_messages.messages.assigned_to, context.assignedTo);
|
|
147
165
|
case _constants.ElementName.OwnedBy:
|
|
148
166
|
return toFormattedTextProps(_messages.messages.owned_by, context.ownedBy);
|
|
149
167
|
case _constants.ElementName.CreatedOn:
|
|
@@ -154,6 +172,8 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
154
172
|
return toFormattedTextProps(_messages.messages.modified_by, context.modifiedBy);
|
|
155
173
|
case _constants.ElementName.ModifiedOn:
|
|
156
174
|
return toDateTimeProps('modified', context.modifiedOn);
|
|
175
|
+
case _constants.ElementName.ReadTime:
|
|
176
|
+
return toFormattedTextProps(_messages.messages.read_time, data);
|
|
157
177
|
case _constants.ElementName.Snippet:
|
|
158
178
|
case _constants.ElementName.SourceBranch:
|
|
159
179
|
case _constants.ElementName.TargetBranch:
|
|
@@ -19,6 +19,7 @@ var _SnippetOrPreview = _interopRequireDefault(require("../../SnippetOrPreview")
|
|
|
19
19
|
var _extractMetadata = require("../../../../../extractors/hover/extractMetadata");
|
|
20
20
|
var _messages = require("../../../../../messages");
|
|
21
21
|
var _reactIntlNext = require("react-intl-next");
|
|
22
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
25
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -83,16 +84,24 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
83
84
|
}, [cardActions, onActionClick, enableImprovedPreviewAction]);
|
|
84
85
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
85
86
|
var _useMemo = (0, _react.useMemo)(function () {
|
|
86
|
-
|
|
87
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg')) {
|
|
88
|
+
var betterMetadata = (0, _utils.getSimulatedBetterMetadata)(extensionKey, data);
|
|
89
|
+
return {
|
|
90
|
+
topPrimary: (0, _extractMetadata.elementNamesToItems)(betterMetadata.topMetadataBlock.primary),
|
|
91
|
+
topSecondary: (0, _extractMetadata.elementNamesToItems)(betterMetadata.topMetadataBlock.secondary),
|
|
92
|
+
bottomPrimary: (0, _extractMetadata.elementNamesToItems)(betterMetadata.bottomMetadataBlock.primary)
|
|
93
|
+
};
|
|
94
|
+
}
|
|
87
95
|
var metadata = (0, _extractMetadata.extractMetadata)((0, _utils.getSimulatedMetadata)(extensionKey, data));
|
|
88
96
|
return {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
topPrimary: metadata.primary,
|
|
98
|
+
topSecondary: metadata.secondary,
|
|
99
|
+
bottomPrimary: []
|
|
92
100
|
};
|
|
93
101
|
}, [data, extensionKey]),
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
topPrimary = _useMemo.topPrimary,
|
|
103
|
+
topSecondary = _useMemo.topSecondary,
|
|
104
|
+
bottomPrimary = _useMemo.bottomPrimary;
|
|
96
105
|
var snippetHeight = _react.default.useRef(0);
|
|
97
106
|
var snippetBlockRef = (0, _react.useRef)(null);
|
|
98
107
|
var onSnippetRender = (0, _react.useCallback)(function () {
|
|
@@ -105,17 +114,24 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
105
114
|
});
|
|
106
115
|
return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, flexibleCardProps, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, titleBlockProps, {
|
|
107
116
|
metadataPosition: _constants.SmartLinkPosition.Top
|
|
108
|
-
})), /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, {
|
|
109
|
-
primary:
|
|
110
|
-
secondary:
|
|
111
|
-
size: _constants.SmartLinkSize.Large,
|
|
117
|
+
})), /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, (0, _extends2.default)({
|
|
118
|
+
primary: topPrimary,
|
|
119
|
+
secondary: topSecondary,
|
|
112
120
|
overrideCss: _styled.metadataBlockCss,
|
|
113
|
-
maxLines: 1
|
|
114
|
-
|
|
121
|
+
maxLines: 1,
|
|
122
|
+
size: _constants.SmartLinkSize.Large
|
|
123
|
+
}, (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && {
|
|
124
|
+
size: _constants.SmartLinkSize.Medium
|
|
125
|
+
})), body, /*#__PURE__*/_react.default.createElement(_blocks.SnippetBlock, {
|
|
115
126
|
testId: 'hidden-snippet',
|
|
116
127
|
onRender: onSnippetRender,
|
|
117
128
|
blockRef: snippetBlockRef,
|
|
118
129
|
overrideCss: _styled.hiddenSnippetStyles
|
|
130
|
+
}), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, {
|
|
131
|
+
primary: bottomPrimary,
|
|
132
|
+
size: _constants.SmartLinkSize.Large,
|
|
133
|
+
overrideCss: _styled.metadataBlockCss,
|
|
134
|
+
maxLines: 1
|
|
119
135
|
}), /*#__PURE__*/_react.default.createElement(_blocks.FooterBlock, {
|
|
120
136
|
actions: footerActions,
|
|
121
137
|
size: _constants.SmartLinkSize.Large,
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.getSimulatedMetadata = void 0;
|
|
7
|
+
exports.getSimulatedMetadata = exports.getSimulatedBetterMetadata = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _constants = require("../../constants");
|
|
8
10
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
9
11
|
var _utils = require("../../extractors/flexible/utils");
|
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
+
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; }
|
|
10
14
|
var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
11
15
|
var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
12
16
|
var data = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -35,7 +39,7 @@ var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
35
39
|
return {
|
|
36
40
|
metadata: {
|
|
37
41
|
primary: [_constants.ElementName.AuthorGroup, primaryAttribution],
|
|
38
|
-
secondary: [_constants.ElementName.CommentCount, _constants.ElementName.
|
|
42
|
+
secondary: [_constants.ElementName.ReactCount, _constants.ElementName.CommentCount, _constants.ElementName.ViewCount],
|
|
39
43
|
subtitle: []
|
|
40
44
|
}
|
|
41
45
|
};
|
|
@@ -82,4 +86,99 @@ var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
82
86
|
};
|
|
83
87
|
}
|
|
84
88
|
};
|
|
85
|
-
exports.getSimulatedMetadata = getSimulatedMetadata;
|
|
89
|
+
exports.getSimulatedMetadata = getSimulatedMetadata;
|
|
90
|
+
var getSimulatedBetterMetadata = function getSimulatedBetterMetadata() {
|
|
91
|
+
var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
92
|
+
var data = arguments.length > 1 ? arguments[1] : undefined;
|
|
93
|
+
var types = data ? (0, _linkExtractors.extractType)(data) : undefined;
|
|
94
|
+
var defaultMetadata = {
|
|
95
|
+
topMetadataBlock: {
|
|
96
|
+
primary: [_constants.ElementName.ModifiedOn, _constants.ElementName.CreatedBy],
|
|
97
|
+
secondary: [],
|
|
98
|
+
subtitle: []
|
|
99
|
+
},
|
|
100
|
+
bottomMetadataBlock: {
|
|
101
|
+
primary: [],
|
|
102
|
+
secondary: [],
|
|
103
|
+
subtitle: []
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
switch (extensionKey) {
|
|
107
|
+
case 'bitbucket-object-provider':
|
|
108
|
+
case 'native-bitbucket-object-provider':
|
|
109
|
+
if (types !== null && types !== void 0 && types.includes('atlassian:SourceCodePullRequest')) {
|
|
110
|
+
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
111
|
+
topMetadataBlock: {
|
|
112
|
+
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.ModifiedOn, _constants.ElementName.SubscriberCount, _constants.ElementName.State],
|
|
113
|
+
secondary: [],
|
|
114
|
+
subtitle: [_constants.ElementName.SourceBranch, _constants.ElementName.TargetBranch]
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
119
|
+
topMetadataBlock: {
|
|
120
|
+
primary: [_constants.ElementName.ModifiedOn, _constants.ElementName.CreatedBy],
|
|
121
|
+
secondary: [],
|
|
122
|
+
subtitle: []
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
case 'confluence-object-provider':
|
|
126
|
+
var primaryAttribution = data && (0, _utils.extractOwnedBy)(data) ? _constants.ElementName.OwnedByGroup : _constants.ElementName.AuthorGroup;
|
|
127
|
+
return {
|
|
128
|
+
topMetadataBlock: {
|
|
129
|
+
primary: [primaryAttribution, _constants.ElementName.ModifiedOn],
|
|
130
|
+
secondary: [],
|
|
131
|
+
subtitle: []
|
|
132
|
+
},
|
|
133
|
+
bottomMetadataBlock: {
|
|
134
|
+
primary: [_constants.ElementName.CommentCount, _constants.ElementName.ReactCount, _constants.ElementName.ViewCount],
|
|
135
|
+
secondary: [],
|
|
136
|
+
subtitle: []
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
case 'jira-object-provider':
|
|
140
|
+
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
141
|
+
topMetadataBlock: {
|
|
142
|
+
primary: [_constants.ElementName.AssignedToGroup, _constants.ElementName.State, _constants.ElementName.Priority],
|
|
143
|
+
secondary: [],
|
|
144
|
+
subtitle: []
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
case 'trello-object-provider':
|
|
148
|
+
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
149
|
+
topMetadataBlock: {
|
|
150
|
+
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.State, _constants.ElementName.DueOn],
|
|
151
|
+
secondary: [_constants.ElementName.ReactCount, _constants.ElementName.CommentCount, _constants.ElementName.AttachmentCount, _constants.ElementName.ChecklistProgress],
|
|
152
|
+
subtitle: [_constants.ElementName.Location]
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
case 'watermelon-object-provider':
|
|
156
|
+
if (types !== null && types !== void 0 && types.includes('atlassian:Project')) {
|
|
157
|
+
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
158
|
+
topMetadataBlock: {
|
|
159
|
+
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.ModifiedOn, _constants.ElementName.State, _constants.ElementName.DueOn],
|
|
160
|
+
secondary: [],
|
|
161
|
+
subtitle: []
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
166
|
+
topMetadataBlock: {
|
|
167
|
+
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.State, _constants.ElementName.DueOn],
|
|
168
|
+
secondary: [],
|
|
169
|
+
subtitle: []
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
case 'google-object-provider':
|
|
173
|
+
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
174
|
+
topMetadataBlock: {
|
|
175
|
+
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.ModifiedOn],
|
|
176
|
+
secondary: [],
|
|
177
|
+
subtitle: []
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
default:
|
|
181
|
+
return defaultMetadata;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
exports.getSimulatedBetterMetadata = getSimulatedBetterMetadata;
|
package/dist/es2019/constants.js
CHANGED
|
@@ -100,6 +100,8 @@ export let SmartLinkWidth = /*#__PURE__*/function (SmartLinkWidth) {
|
|
|
100
100
|
* (src/view/FlexibleCard/components/blocks/utils.tsx)
|
|
101
101
|
*/
|
|
102
102
|
export let ElementName = /*#__PURE__*/function (ElementName) {
|
|
103
|
+
ElementName["AssignedTo"] = "AssignedTo";
|
|
104
|
+
ElementName["AssignedToGroup"] = "AssignedToGroup";
|
|
103
105
|
ElementName["AttachmentCount"] = "AttachmentCount";
|
|
104
106
|
ElementName["AuthorGroup"] = "AuthorGroup";
|
|
105
107
|
ElementName["ChecklistProgress"] = "ChecklistProgress";
|
|
@@ -114,15 +116,18 @@ export let ElementName = /*#__PURE__*/function (ElementName) {
|
|
|
114
116
|
ElementName["ModifiedBy"] = "ModifiedBy";
|
|
115
117
|
ElementName["ModifiedOn"] = "ModifiedOn";
|
|
116
118
|
ElementName["OwnedBy"] = "OwnedBy";
|
|
119
|
+
ElementName["OwnedByGroup"] = "OwnedByGroup";
|
|
117
120
|
ElementName["Preview"] = "Preview";
|
|
118
121
|
ElementName["Priority"] = "Priority";
|
|
119
122
|
ElementName["ProgrammingLanguage"] = "ProgrammingLanguage";
|
|
120
123
|
ElementName["Provider"] = "Provider";
|
|
121
124
|
ElementName["ReactCount"] = "ReactCount";
|
|
125
|
+
ElementName["ReadTime"] = "ReadTime";
|
|
122
126
|
ElementName["Snippet"] = "Snippet";
|
|
123
127
|
ElementName["SourceBranch"] = "SourceBranch";
|
|
124
128
|
ElementName["State"] = "State";
|
|
125
129
|
ElementName["SubscriberCount"] = "SubscriberCount";
|
|
130
|
+
ElementName["SubTasksProgress"] = "SubTasksProgress";
|
|
126
131
|
ElementName["TargetBranch"] = "TargetBranch";
|
|
127
132
|
ElementName["Title"] = "Title";
|
|
128
133
|
ElementName["ViewCount"] = "ViewCount";
|
|
@@ -146,6 +151,7 @@ export let ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
146
151
|
/**
|
|
147
152
|
* Flexible UI icons - each mapped to AK icons.
|
|
148
153
|
*/
|
|
154
|
+
|
|
149
155
|
export let IconType = /*#__PURE__*/function (IconType) {
|
|
150
156
|
IconType["Archive"] = "FileType:Archive";
|
|
151
157
|
IconType["Audio"] = "FileType:Audio";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { extractSummary } from '../common/primitives';
|
|
2
2
|
import { extractLinkIcon } from './icon';
|
|
3
|
-
import { extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn, extractLocation, extractOwnedBy } from './utils';
|
|
3
|
+
import { extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn, extractLocation, extractOwnedBy, extractAssignedTo, extractSubTasksProgress, extractReadTime, extractPersonAssignedToAsArray } from './utils';
|
|
4
4
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
5
|
-
import { extractPersonCreatedBy, extractTitle, extractDateUpdated, extractDateCreated, extractLink } from '@atlaskit/link-extractors';
|
|
5
|
+
import { extractPersonCreatedBy, extractTitle, extractDateUpdated, extractDateCreated, extractLink, extractPersonOwnedBy } from '@atlaskit/link-extractors';
|
|
6
6
|
import extractPriority from './extract-priority';
|
|
7
7
|
import extractProviderIcon from './icon/extract-provider-icon';
|
|
8
8
|
import extractPreview from './extract-preview';
|
|
@@ -25,8 +25,10 @@ const extractFlexibleUiContext = ({
|
|
|
25
25
|
const url = extractLink(data);
|
|
26
26
|
const showLozengeAction = (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.useLozengeAction) === 'experiment';
|
|
27
27
|
return {
|
|
28
|
+
assignedToGroup: extractPersonAssignedToAsArray(data),
|
|
28
29
|
attachmentCount: extractAttachmentCount(data),
|
|
29
30
|
authorGroup: extractPersonCreatedBy(data),
|
|
31
|
+
ownedByGroup: extractPersonOwnedBy(data),
|
|
30
32
|
collaboratorGroup: extractPersonsUpdatedBy(data),
|
|
31
33
|
commentCount: extractCommentCount(data),
|
|
32
34
|
viewCount: extractViewCount(data),
|
|
@@ -35,6 +37,7 @@ const extractFlexibleUiContext = ({
|
|
|
35
37
|
checklistProgress: extractChecklistProgress(data),
|
|
36
38
|
createdBy: extractCreatedBy(data),
|
|
37
39
|
ownedBy: extractOwnedBy(data),
|
|
40
|
+
assignedTo: extractAssignedTo(data),
|
|
38
41
|
createdOn: extractDateCreated(data),
|
|
39
42
|
dueOn: extractDueOn(data),
|
|
40
43
|
previewAction: extractPreviewAction(response),
|
|
@@ -49,11 +52,13 @@ const extractFlexibleUiContext = ({
|
|
|
49
52
|
priority: extractPriority(data),
|
|
50
53
|
provider: extractProviderIcon(data),
|
|
51
54
|
programmingLanguage: extractProgrammingLanguage(data),
|
|
55
|
+
readTime: extractReadTime(data),
|
|
52
56
|
snippet: extractSummary(data) || undefined,
|
|
53
57
|
// Explicitly set here to remove an empty string
|
|
54
58
|
sourceBranch: extractSourceBranch(data),
|
|
55
59
|
state: extractState(response, showServerActions || showLozengeAction, id),
|
|
56
60
|
subscriberCount: extractSubscriberCount(data),
|
|
61
|
+
subTasksProgress: extractSubTasksProgress(data),
|
|
57
62
|
targetBranch: extractTargetBranch(data),
|
|
58
63
|
title: extractTitle(data) || url,
|
|
59
64
|
url
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractPersonOwnedBy, extractPersonCreatedBy, extractPersonUpdatedBy } from '@atlaskit/link-extractors';
|
|
1
|
+
import { extractPersonOwnedBy, extractPersonCreatedBy, extractPersonUpdatedBy, extractPersonAssignedTo } from '@atlaskit/link-extractors';
|
|
2
2
|
const extractLinkName = link => {
|
|
3
3
|
if (link && typeof link === 'object' && link['@type'] === 'Link') {
|
|
4
4
|
return link.name;
|
|
@@ -18,6 +18,16 @@ export const extractOwnedBy = data => {
|
|
|
18
18
|
return persons[0].name;
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
+
export const extractAssignedTo = data => {
|
|
22
|
+
const person = extractPersonAssignedTo(data);
|
|
23
|
+
if (person) {
|
|
24
|
+
return person.name;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export const extractPersonAssignedToAsArray = data => {
|
|
28
|
+
const person = extractPersonAssignedTo(data);
|
|
29
|
+
return person ? [person] : undefined;
|
|
30
|
+
};
|
|
21
31
|
export const extractCreatedBy = data => {
|
|
22
32
|
const persons = extractPersonCreatedBy(data);
|
|
23
33
|
if (persons && persons.length) {
|
|
@@ -50,4 +60,11 @@ export const extractLocation = data => {
|
|
|
50
60
|
url
|
|
51
61
|
};
|
|
52
62
|
}
|
|
63
|
+
};
|
|
64
|
+
export const extractSubTasksProgress = data => {
|
|
65
|
+
const subTasksObject = extractValue(data, 'atlassian:subTasks');
|
|
66
|
+
return subTasksObject && subTasksObject.totalCount ? `${subTasksObject.resolvedCount}/${subTasksObject.totalCount}` : undefined;
|
|
67
|
+
};
|
|
68
|
+
export const extractReadTime = data => {
|
|
69
|
+
return extractValue(data, 'atlassian:readTimeInMinutes');
|
|
53
70
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementName } from '../../constants';
|
|
2
|
-
const elementNamesToItems = elementNames => {
|
|
2
|
+
export const elementNamesToItems = elementNames => {
|
|
3
3
|
return elementNames.filter(element => element in ElementName).map(elementName => ({
|
|
4
4
|
name: elementName,
|
|
5
5
|
testId: `${elementName.toLowerCase()}-metadata-element`
|
package/dist/es2019/messages.js
CHANGED
|
@@ -10,6 +10,11 @@ export const messages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'Add account',
|
|
11
11
|
description: 'Allows to add a new account'
|
|
12
12
|
},
|
|
13
|
+
assigned_to: {
|
|
14
|
+
id: 'fabric.linking.assigned_to',
|
|
15
|
+
defaultMessage: 'Assigned to {context}',
|
|
16
|
+
description: 'Indicates the person or entity that the resource is assigned to.'
|
|
17
|
+
},
|
|
13
18
|
cancel: {
|
|
14
19
|
id: 'fabric.linking.cancel',
|
|
15
20
|
defaultMessage: 'Cancel',
|
|
@@ -86,7 +91,7 @@ export const messages = defineMessages({
|
|
|
86
91
|
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.'
|
|
87
92
|
},
|
|
88
93
|
connect_unauthorised_account_description_no_provider: {
|
|
89
|
-
id: 'fabric.linking.
|
|
94
|
+
id: 'fabric.linking.connect_unauthorised_account_description_no_provider',
|
|
90
95
|
defaultMessage: 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
91
96
|
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.'
|
|
92
97
|
},
|
|
@@ -306,6 +311,11 @@ export const messages = defineMessages({
|
|
|
306
311
|
defaultMessage: 'Your access request is pending',
|
|
307
312
|
description: 'Shown when a user has requested an access but status is pending.'
|
|
308
313
|
},
|
|
314
|
+
read_time: {
|
|
315
|
+
id: 'fabric.linking.read_time',
|
|
316
|
+
defaultMessage: '{context} min read',
|
|
317
|
+
description: 'Estimated time to read this resource'
|
|
318
|
+
},
|
|
309
319
|
restricted_link: {
|
|
310
320
|
id: 'fabric.linking.restricted_link',
|
|
311
321
|
defaultMessage: 'Restricted link, try another account',
|
|
@@ -386,6 +396,26 @@ export const messages = defineMessages({
|
|
|
386
396
|
defaultMessage: 'The link {unsafeLinkText} is taking you to a different site, <a>actual link here</a>',
|
|
387
397
|
description: 'Link safety check warning message'
|
|
388
398
|
},
|
|
399
|
+
unauthorised_account_description: {
|
|
400
|
+
id: 'fabric.linking.unauthorised_account_description',
|
|
401
|
+
defaultMessage: "You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.",
|
|
402
|
+
description: 'Explains that user does not have access to a link.'
|
|
403
|
+
},
|
|
404
|
+
unauthorised_account_description_no_provider: {
|
|
405
|
+
id: 'fabric.linking.unauthorised_account_description_no_provider',
|
|
406
|
+
defaultMessage: "You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.",
|
|
407
|
+
description: 'Explains that user does not have access to a link.'
|
|
408
|
+
},
|
|
409
|
+
unauthorised_account_name: {
|
|
410
|
+
id: 'fabric.linking.unauthorised_account_name',
|
|
411
|
+
defaultMessage: "We can't display private pages from {context}",
|
|
412
|
+
description: 'Shown when a user does not have access to a link.'
|
|
413
|
+
},
|
|
414
|
+
unauthorised_account_name_no_provider: {
|
|
415
|
+
id: 'fabric.linking.unauthorised_account_name_no_provider',
|
|
416
|
+
defaultMessage: "We can't display private pages",
|
|
417
|
+
description: 'Shown when a user does not have access to a link.'
|
|
418
|
+
},
|
|
389
419
|
unlink_account: {
|
|
390
420
|
id: 'fabric.linking.unlink_account',
|
|
391
421
|
defaultMessage: 'Unlink Account',
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React, { useEffect, useState } from 'react';
|
|
2
3
|
import FlexibleCard from '../../../FlexibleCard';
|
|
3
4
|
import TitleBlock from '../../../FlexibleCard/components/blocks/title-block';
|
|
4
5
|
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock } from '../../../FlexibleCard/components/blocks';
|
|
5
|
-
import {
|
|
6
|
+
import { metadataBlockCss, titleBlockCss } from './styled';
|
|
7
|
+
import { ActionName, CardDisplay, ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../constants';
|
|
6
8
|
import uuid from 'uuid';
|
|
7
|
-
import {
|
|
9
|
+
import { getSimulatedMetadata, getSimulatedBetterMetadata } from './utils';
|
|
10
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
|
|
8
12
|
/**
|
|
9
13
|
* This view represents a Block card that has an 'Resolved' status.
|
|
10
14
|
* @see SmartLinkStatus
|
|
@@ -23,36 +27,16 @@ const FlexibleResolvedView = ({
|
|
|
23
27
|
url,
|
|
24
28
|
analytics
|
|
25
29
|
}) => {
|
|
26
|
-
var _cardState$details, _cardState$details2;
|
|
27
30
|
const [isPreviewBlockErrored, setIsPreviewBlockErrored] = useState(false);
|
|
28
31
|
useEffect(() => {
|
|
29
32
|
setIsPreviewBlockErrored(false);
|
|
30
33
|
}, [url, cardState]);
|
|
31
34
|
const [analyticsId] = useState(() => id ? id : uuid());
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
name: ElementName.CommentCount
|
|
38
|
-
}, {
|
|
39
|
-
name: ElementName.ReactCount
|
|
40
|
-
}, {
|
|
41
|
-
name: ElementName.SubscriberCount
|
|
42
|
-
}, {
|
|
43
|
-
name: ElementName.ViewCount
|
|
44
|
-
}, {
|
|
45
|
-
name: ElementName.VoteCount
|
|
46
|
-
}, {
|
|
47
|
-
name: ElementName.ChecklistProgress
|
|
48
|
-
}, {
|
|
49
|
-
name: ElementName.DueOn
|
|
50
|
-
}];
|
|
51
|
-
const metadata = cardState !== null && cardState !== void 0 && (_cardState$details = cardState.details) !== null && _cardState$details !== void 0 && _cardState$details.data && extractOwnedBy(cardState === null || cardState === void 0 ? void 0 : (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.data) ? [{
|
|
52
|
-
name: ElementName.OwnedBy
|
|
53
|
-
}, ...baseMetadata] : [{
|
|
54
|
-
name: ElementName.ModifiedBy
|
|
55
|
-
}, ...baseMetadata];
|
|
35
|
+
const {
|
|
36
|
+
titleMetadata,
|
|
37
|
+
topMetadata,
|
|
38
|
+
bottomMetadata
|
|
39
|
+
} = getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? getSimulatedBetterMetadata(cardState.details) : getSimulatedMetadata(cardState.details);
|
|
56
40
|
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
57
41
|
analytics: analytics,
|
|
58
42
|
appearance: "block",
|
|
@@ -64,25 +48,27 @@ const FlexibleResolvedView = ({
|
|
|
64
48
|
testId: testId,
|
|
65
49
|
ui: ui,
|
|
66
50
|
url: url
|
|
67
|
-
}, /*#__PURE__*/React.createElement(TitleBlock, {
|
|
51
|
+
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({
|
|
68
52
|
position: SmartLinkPosition.Center,
|
|
69
|
-
metadata:
|
|
70
|
-
name: ElementName.AuthorGroup
|
|
71
|
-
}, {
|
|
72
|
-
name: ElementName.Priority
|
|
73
|
-
}, {
|
|
74
|
-
name: ElementName.State
|
|
75
|
-
}],
|
|
53
|
+
metadata: titleMetadata,
|
|
76
54
|
hideRetry: true,
|
|
77
55
|
subtitle: [{
|
|
78
56
|
name: ElementName.Location
|
|
79
57
|
}],
|
|
80
58
|
metadataPosition: SmartLinkPosition.Top,
|
|
81
59
|
anchorTarget: anchorTarget
|
|
82
|
-
}
|
|
83
|
-
|
|
60
|
+
}, getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && {
|
|
61
|
+
overrideCss: titleBlockCss,
|
|
62
|
+
size: SmartLinkSize.Large
|
|
63
|
+
})), /*#__PURE__*/React.createElement(MetadataBlock, _extends({
|
|
64
|
+
primary: topMetadata,
|
|
65
|
+
maxLines: 1
|
|
66
|
+
}, getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && {
|
|
67
|
+
overrideCss: metadataBlockCss
|
|
68
|
+
})), /*#__PURE__*/React.createElement(SnippetBlock, null), getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
69
|
+
primary: bottomMetadata,
|
|
84
70
|
maxLines: 1
|
|
85
|
-
}),
|
|
71
|
+
}), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(PreviewBlock, {
|
|
86
72
|
placement: MediaPlacement.Right,
|
|
87
73
|
ignoreContainerPadding: true,
|
|
88
74
|
onError: () => {
|