@atlaskit/smart-card 26.14.5 → 26.15.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 +13 -0
- package/dist/cjs/constants.js +2 -0
- package/dist/cjs/extractors/flexible/index.js +1 -0
- package/dist/cjs/extractors/flexible/utils.js +6 -2
- package/dist/cjs/i18n/en.js +8 -1
- package/dist/cjs/i18n/en_GB.js +8 -1
- package/dist/cjs/i18n/en_ZZ.js +8 -1
- package/dist/cjs/utils/index.js +46 -5
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/DownloadAction.js +4 -34
- package/dist/cjs/view/BlockCard/views/flexible/utils.js +14 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/download-action/index.js +2 -47
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +4 -0
- package/dist/cjs/view/FlexibleCard/components/elements/atlaskit-badge/index.js +37 -0
- package/dist/cjs/view/FlexibleCard/components/elements/atlaskit-badge/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +8 -2
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +11 -1
- package/dist/cjs/view/HoverCard/utils.js +1 -1
- package/dist/es2019/constants.js +2 -0
- package/dist/es2019/extractors/flexible/index.js +2 -1
- package/dist/es2019/extractors/flexible/utils.js +3 -0
- package/dist/es2019/i18n/en.js +8 -1
- package/dist/es2019/i18n/en_GB.js +8 -1
- package/dist/es2019/i18n/en_ZZ.js +8 -1
- package/dist/es2019/utils/index.js +23 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/actions/DownloadAction.js +2 -12
- package/dist/es2019/view/BlockCard/views/flexible/utils.js +14 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/download-action/index.js +2 -28
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/elements/atlaskit-badge/index.js +28 -0
- package/dist/es2019/view/FlexibleCard/components/elements/atlaskit-badge/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +5 -0
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +12 -1
- package/dist/es2019/view/HoverCard/utils.js +1 -1
- package/dist/esm/constants.js +2 -0
- package/dist/esm/extractors/flexible/index.js +2 -1
- package/dist/esm/extractors/flexible/utils.js +3 -0
- package/dist/esm/i18n/en.js +8 -1
- package/dist/esm/i18n/en_GB.js +8 -1
- package/dist/esm/i18n/en_ZZ.js +8 -1
- package/dist/esm/utils/index.js +44 -4
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/DownloadAction.js +4 -33
- package/dist/esm/view/BlockCard/views/flexible/utils.js +14 -2
- package/dist/esm/view/FlexibleCard/components/actions/action/download-action/index.js +2 -47
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/elements/atlaskit-badge/index.js +28 -0
- package/dist/esm/view/FlexibleCard/components/elements/atlaskit-badge/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/index.js +5 -0
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +11 -1
- package/dist/esm/view/HoverCard/utils.js +1 -1
- package/dist/types/constants.d.ts +3 -1
- package/dist/types/extractors/flexible/utils.d.ts +1 -0
- package/dist/types/i18n/en.d.ts +7 -0
- package/dist/types/i18n/en_GB.d.ts +7 -0
- package/dist/types/i18n/en_ZZ.d.ts +7 -0
- package/dist/types/state/flexible-ui-context/types.d.ts +6 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/view/BlockCard/actions/DownloadAction.d.ts +0 -4
- package/dist/types/view/FlexibleCard/components/actions/action/download-action/types.d.ts +0 -3
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +8 -2
- package/dist/types/view/FlexibleCard/components/elements/atlaskit-badge/index.d.ts +10 -0
- package/dist/types/view/FlexibleCard/components/elements/atlaskit-badge/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/elements/index.d.ts +6 -0
- package/dist/types-ts4.5/constants.d.ts +3 -1
- package/dist/types-ts4.5/extractors/flexible/utils.d.ts +1 -0
- package/dist/types-ts4.5/i18n/en.d.ts +7 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +7 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +7 -0
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +6 -0
- package/dist/types-ts4.5/utils/index.d.ts +1 -0
- package/dist/types-ts4.5/view/BlockCard/actions/DownloadAction.d.ts +0 -4
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/download-action/types.d.ts +0 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +8 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/atlaskit-badge/index.d.ts +10 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/atlaskit-badge/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/index.d.ts +6 -0
- package/package.json +2 -2
- package/report.api.md +8 -0
- package/tmp/api-report-tmp.d.ts +8 -1
package/dist/es2019/i18n/en.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export default {
|
|
10
10
|
'fabric.linking.actions': 'Actions',
|
|
11
11
|
'fabric.linking.add_account': 'Add account',
|
|
12
|
+
'fabric.linking.assigned_to': 'Assigned to {context}',
|
|
12
13
|
'fabric.linking.cancel': 'Cancel',
|
|
13
14
|
'fabric.linking.cannot_connect': "Can't connect, try again",
|
|
14
15
|
'fabric.linking.cannot_find_link': "Can't find link",
|
|
@@ -23,7 +24,8 @@ export default {
|
|
|
23
24
|
'fabric.linking.connect_link_account_card_view_name': 'Connect your {context} account',
|
|
24
25
|
'fabric.linking.connect_to': 'Connect to {name}',
|
|
25
26
|
'fabric.linking.connect_unauthorised_account_action': 'Connect to {context}',
|
|
26
|
-
'fabric.linking.connect_unauthorised_account_description': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
|
+
'fabric.linking.connect_unauthorised_account_description': 'Connect {context} to Atlassian to view more details of your work and collaborate from one place.',
|
|
28
|
+
'fabric.linking.connect_unauthorised_account_description_no_provider': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
29
|
'fabric.linking.continue': 'Continue',
|
|
28
30
|
'fabric.linking.copy_url_to_clipboard': 'Copy link',
|
|
29
31
|
'fabric.linking.couldnt_load_link': "We couldn't load this link for an unknown reason.",
|
|
@@ -67,6 +69,7 @@ export default {
|
|
|
67
69
|
'fabric.linking.priority_minor': 'Minor',
|
|
68
70
|
'fabric.linking.priority_trivial': 'Trivial',
|
|
69
71
|
'fabric.linking.priority_undefined': 'Undefined',
|
|
72
|
+
'fabric.linking.read_time': '{context} min read',
|
|
70
73
|
'fabric.linking.request_access': 'Request access',
|
|
71
74
|
'fabric.linking.request_access_description': 'Request access to {context} view this preview.',
|
|
72
75
|
'fabric.linking.request_access_pending': 'Access pending',
|
|
@@ -84,6 +87,10 @@ export default {
|
|
|
84
87
|
'fabric.linking.status_change_update_error': 'We couldn’t update the status',
|
|
85
88
|
'fabric.linking.try_again': 'Try again',
|
|
86
89
|
'fabric.linking.try_another_account': 'Try another account',
|
|
90
|
+
'fabric.linking.unauthorised_account_description': "You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.",
|
|
91
|
+
'fabric.linking.unauthorised_account_description_no_provider': "You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.",
|
|
92
|
+
'fabric.linking.unauthorised_account_name': "We can't display private pages from {context}",
|
|
93
|
+
'fabric.linking.unauthorised_account_name_no_provider': "We can't display private pages",
|
|
87
94
|
'fabric.linking.unlink_account': 'Unlink Account',
|
|
88
95
|
'fabric.linking.updated_by': 'Modified by {context}',
|
|
89
96
|
'fabric.linking.view': 'View'
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export default {
|
|
10
10
|
'fabric.linking.actions': 'Actions',
|
|
11
11
|
'fabric.linking.add_account': 'Add account',
|
|
12
|
+
'fabric.linking.assigned_to': 'Assigned to {context}',
|
|
12
13
|
'fabric.linking.cancel': 'Cancel',
|
|
13
14
|
'fabric.linking.cannot_connect': "Can't connect, try again",
|
|
14
15
|
'fabric.linking.cannot_find_link': "Can't find link",
|
|
@@ -23,7 +24,8 @@ export default {
|
|
|
23
24
|
'fabric.linking.connect_link_account_card_view_name': 'Connect your {context} account',
|
|
24
25
|
'fabric.linking.connect_to': 'Connect to {name}',
|
|
25
26
|
'fabric.linking.connect_unauthorised_account_action': 'Connect to {context}',
|
|
26
|
-
'fabric.linking.connect_unauthorised_account_description': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
|
+
'fabric.linking.connect_unauthorised_account_description': 'Connect {context} to Atlassian to view more details of your work and collaborate from one place.',
|
|
28
|
+
'fabric.linking.connect_unauthorised_account_description_no_provider': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
29
|
'fabric.linking.continue': 'Continue',
|
|
28
30
|
'fabric.linking.copy_url_to_clipboard': 'Copy link',
|
|
29
31
|
'fabric.linking.couldnt_load_link': "We couldn't load this link for an unknown reason.",
|
|
@@ -67,6 +69,7 @@ export default {
|
|
|
67
69
|
'fabric.linking.priority_minor': 'Minor',
|
|
68
70
|
'fabric.linking.priority_trivial': 'Trivial',
|
|
69
71
|
'fabric.linking.priority_undefined': 'Undefined',
|
|
72
|
+
'fabric.linking.read_time': '{context} min read',
|
|
70
73
|
'fabric.linking.request_access': 'Request access',
|
|
71
74
|
'fabric.linking.request_access_description': 'Request access to {context} view this preview.',
|
|
72
75
|
'fabric.linking.request_access_pending': 'Access pending',
|
|
@@ -84,6 +87,10 @@ export default {
|
|
|
84
87
|
'fabric.linking.status_change_update_error': 'We couldn’t update the status',
|
|
85
88
|
'fabric.linking.try_again': 'Try again',
|
|
86
89
|
'fabric.linking.try_another_account': 'Try another account',
|
|
90
|
+
'fabric.linking.unauthorised_account_description': "You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.",
|
|
91
|
+
'fabric.linking.unauthorised_account_description_no_provider': "You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.",
|
|
92
|
+
'fabric.linking.unauthorised_account_name': "We can't display private pages from {context}",
|
|
93
|
+
'fabric.linking.unauthorised_account_name_no_provider': "We can't display private pages",
|
|
87
94
|
'fabric.linking.unlink_account': 'Unlink Account',
|
|
88
95
|
'fabric.linking.updated_by': 'Modified by {context}',
|
|
89
96
|
'fabric.linking.view': 'View'
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export default {
|
|
10
10
|
'fabric.linking.actions': 'Actions',
|
|
11
11
|
'fabric.linking.add_account': 'Add account',
|
|
12
|
+
'fabric.linking.assigned_to': 'Assigned to {context}',
|
|
12
13
|
'fabric.linking.cancel': 'Cancel',
|
|
13
14
|
'fabric.linking.cannot_connect': "Can't connect, try again",
|
|
14
15
|
'fabric.linking.cannot_find_link': "Can't find link",
|
|
@@ -23,7 +24,8 @@ export default {
|
|
|
23
24
|
'fabric.linking.connect_link_account_card_view_name': 'Connect your {context} account',
|
|
24
25
|
'fabric.linking.connect_to': 'Connect to {name}',
|
|
25
26
|
'fabric.linking.connect_unauthorised_account_action': 'Connect to {context}',
|
|
26
|
-
'fabric.linking.connect_unauthorised_account_description': 'Connect to Atlassian to view more details of your work and collaborate from one place
|
|
27
|
+
'fabric.linking.connect_unauthorised_account_description': 'Connect {context} to Atlassian to view more details of your work and collaborate from one place.',
|
|
28
|
+
'fabric.linking.connect_unauthorised_account_description_no_provider': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
29
|
'fabric.linking.continue': 'Continue',
|
|
28
30
|
'fabric.linking.copy_url_to_clipboard': 'Copy link',
|
|
29
31
|
'fabric.linking.couldnt_load_link': "We couldn't load this link for an unknown reason.",
|
|
@@ -67,6 +69,7 @@ export default {
|
|
|
67
69
|
'fabric.linking.priority_minor': 'Minor',
|
|
68
70
|
'fabric.linking.priority_trivial': 'Trivial',
|
|
69
71
|
'fabric.linking.priority_undefined': 'Undefined',
|
|
72
|
+
'fabric.linking.read_time': '{context} min read',
|
|
70
73
|
'fabric.linking.request_access': 'Request access',
|
|
71
74
|
'fabric.linking.request_access_description': 'Request access to {context} view this preview.',
|
|
72
75
|
'fabric.linking.request_access_pending': 'Access pending',
|
|
@@ -84,6 +87,10 @@ export default {
|
|
|
84
87
|
'fabric.linking.status_change_update_error': 'We couldn’t update the status',
|
|
85
88
|
'fabric.linking.try_again': 'Try again',
|
|
86
89
|
'fabric.linking.try_another_account': 'Try another account',
|
|
90
|
+
'fabric.linking.unauthorised_account_description': "You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.",
|
|
91
|
+
'fabric.linking.unauthorised_account_description_no_provider': "You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.",
|
|
92
|
+
'fabric.linking.unauthorised_account_name': "We can't display private pages from {context}",
|
|
93
|
+
'fabric.linking.unauthorised_account_name_no_provider': "We can't display private pages",
|
|
87
94
|
'fabric.linking.unlink_account': 'Unlink Account',
|
|
88
95
|
'fabric.linking.updated_by': 'Modified by {context}',
|
|
89
96
|
'fabric.linking.view': 'View'
|
|
@@ -120,6 +120,29 @@ export const importWithRetry = async (importFn, retries = 2, interval = 500) =>
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
|
+
export const downloadUrl = async url => {
|
|
124
|
+
if (!url) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
|
|
128
|
+
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
129
|
+
const iframeName = 'media-download-iframe';
|
|
130
|
+
const link = document.createElement('a');
|
|
131
|
+
let iframe = document.getElementById(iframeName);
|
|
132
|
+
if (!iframe) {
|
|
133
|
+
iframe = document.createElement('iframe');
|
|
134
|
+
iframe.style.display = 'none';
|
|
135
|
+
iframe.id = iframeName;
|
|
136
|
+
iframe.name = iframeName;
|
|
137
|
+
document.body.appendChild(iframe);
|
|
138
|
+
}
|
|
139
|
+
link.href = url;
|
|
140
|
+
link.download = url;
|
|
141
|
+
link.target = isIE11 || isSafari ? '_blank' : iframeName;
|
|
142
|
+
document.body.appendChild(link);
|
|
143
|
+
link.click();
|
|
144
|
+
document.body.removeChild(link);
|
|
145
|
+
};
|
|
123
146
|
export const openUrl = async url => {
|
|
124
147
|
if (!url) {
|
|
125
148
|
return;
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import { downloadUrl } from '@atlaskit/media-common';
|
|
4
3
|
import { messages } from '../../../messages';
|
|
5
|
-
|
|
6
|
-
url
|
|
7
|
-
}) {
|
|
8
|
-
if (!url) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
downloadUrl(url);
|
|
12
|
-
}
|
|
4
|
+
import { downloadUrl } from '../../../utils';
|
|
13
5
|
export const DownloadAction = ({
|
|
14
6
|
url
|
|
15
7
|
}) => ({
|
|
16
8
|
id: 'download-content',
|
|
17
9
|
text: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
|
|
18
|
-
promise: () =>
|
|
19
|
-
url
|
|
20
|
-
})
|
|
10
|
+
promise: () => downloadUrl(url)
|
|
21
11
|
});
|
|
@@ -58,8 +58,20 @@ export const getSimulatedBetterMetadata = cardDetails => {
|
|
|
58
58
|
name: ElementName.AssignedToGroup
|
|
59
59
|
}, {
|
|
60
60
|
name: ElementName.AssignedTo
|
|
61
|
-
},
|
|
62
|
-
|
|
61
|
+
}, {
|
|
62
|
+
name: ElementName.ModifiedOn
|
|
63
|
+
}] : [{
|
|
64
|
+
name: ElementName.AuthorGroup
|
|
65
|
+
}, {
|
|
66
|
+
name: ElementName.CreatedBy
|
|
67
|
+
}, {
|
|
68
|
+
name: ElementName.ModifiedOn
|
|
69
|
+
}],
|
|
70
|
+
bottomMetadata: [{
|
|
71
|
+
name: ElementName.Priority
|
|
72
|
+
}, {
|
|
73
|
+
name: ElementName.SubTasksProgress
|
|
74
|
+
}]
|
|
63
75
|
};
|
|
64
76
|
default:
|
|
65
77
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Action from '../index';
|
|
4
|
+
import { downloadUrl as download } from '../../../../../../utils';
|
|
4
5
|
const DownloadAction = props => {
|
|
5
6
|
const {
|
|
6
7
|
appearance,
|
|
@@ -14,9 +15,7 @@ const DownloadAction = props => {
|
|
|
14
15
|
const action = {
|
|
15
16
|
...props,
|
|
16
17
|
onClick: () => {
|
|
17
|
-
|
|
18
|
-
url: downloadUrl
|
|
19
|
-
});
|
|
18
|
+
download(downloadUrl);
|
|
20
19
|
if (onClick) {
|
|
21
20
|
onClick();
|
|
22
21
|
}
|
|
@@ -31,29 +30,4 @@ const DownloadAction = props => {
|
|
|
31
30
|
return null;
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
|
-
async function downloadFunction({
|
|
35
|
-
url
|
|
36
|
-
}) {
|
|
37
|
-
if (!url) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
|
|
41
|
-
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
42
|
-
const iframeName = 'media-download-iframe';
|
|
43
|
-
const link = document.createElement('a');
|
|
44
|
-
let iframe = document.getElementById(iframeName);
|
|
45
|
-
if (!iframe) {
|
|
46
|
-
iframe = document.createElement('iframe');
|
|
47
|
-
iframe.style.display = 'none';
|
|
48
|
-
iframe.id = iframeName;
|
|
49
|
-
iframe.name = iframeName;
|
|
50
|
-
document.body.appendChild(iframe);
|
|
51
|
-
}
|
|
52
|
-
link.href = url;
|
|
53
|
-
link.download = url;
|
|
54
|
-
link.target = isIE11 || isSafari ? '_blank' : iframeName;
|
|
55
|
-
document.body.appendChild(link);
|
|
56
|
-
link.click();
|
|
57
|
-
document.body.removeChild(link);
|
|
58
|
-
}
|
|
59
33
|
export default DownloadAction;
|
|
@@ -38,6 +38,7 @@ export const ElementDisplaySchema = {
|
|
|
38
38
|
[ElementName.State]: ['inline'],
|
|
39
39
|
[ElementName.SubscriberCount]: ['inline'],
|
|
40
40
|
[ElementName.SubTasksProgress]: ['inline'],
|
|
41
|
+
[ElementName.StoryPoints]: ['inline'],
|
|
41
42
|
[ElementName.TargetBranch]: ['inline'],
|
|
42
43
|
[ElementName.Title]: ['inline'],
|
|
43
44
|
[ElementName.ViewCount]: ['inline'],
|
|
@@ -78,7 +78,8 @@ const importIconMapper = {
|
|
|
78
78
|
[IconType.PriorityTrivial]: () => import( /* webpackChunkName: "glyphTrivial" */'@atlaskit/icon-priority/glyph/priority-trivial'),
|
|
79
79
|
[IconType.PriorityUndefined]: () => import( /* webpackChunkName: "glyphUndefined" */'@atlaskit/icon/glyph/question'),
|
|
80
80
|
[IconType.ProgrammingLanguage]: () => import( /* webpackChunkName: "glyphProgrammingLanguage" */'@atlaskit/icon/glyph/code'),
|
|
81
|
-
[IconType.Subscriber]: () => import( /* webpackChunkName: "glyphSubscriber" */'@atlaskit/icon/glyph/people')
|
|
81
|
+
[IconType.Subscriber]: () => import( /* webpackChunkName: "glyphSubscriber" */'@atlaskit/icon/glyph/people'),
|
|
82
|
+
[IconType.SubTasksProgress]: () => import( /* webpackChunkName: "glyphSubtask" */'@atlaskit/icon/glyph/subtask')
|
|
82
83
|
};
|
|
83
84
|
const getIconImportFn = icon => importIconMapper[icon];
|
|
84
85
|
const importIcon = importFn => {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import AKBadge from '@atlaskit/badge';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
/**
|
|
6
|
+
* A base element that displays a visual indicator for a numeric value
|
|
7
|
+
* @internal
|
|
8
|
+
* @see StoryPoints
|
|
9
|
+
* */
|
|
10
|
+
|
|
11
|
+
const AtlaskitBadge = ({
|
|
12
|
+
value,
|
|
13
|
+
name,
|
|
14
|
+
overrideCss,
|
|
15
|
+
testId = 'smart-element-atlaskit-badge'
|
|
16
|
+
}) => {
|
|
17
|
+
if (!value) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return jsx("span", {
|
|
21
|
+
css: overrideCss,
|
|
22
|
+
"data-fit-to-content": true,
|
|
23
|
+
"data-smart-element": name,
|
|
24
|
+
"data-smart-element-atlaskit-badge": true,
|
|
25
|
+
"data-testid": testId
|
|
26
|
+
}, jsx(AKBadge, null, value));
|
|
27
|
+
};
|
|
28
|
+
export default AtlaskitBadge;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -142,6 +142,11 @@ export const SubscriberCount = createElement(ElementName.SubscriberCount);
|
|
|
142
142
|
* @see Badge
|
|
143
143
|
*/
|
|
144
144
|
export const SubTasksProgress = createElement(ElementName.SubTasksProgress);
|
|
145
|
+
/**
|
|
146
|
+
* Create a StoryPoints Badge element using the data from storyPoints in the Flexible UI Context.
|
|
147
|
+
* @see AtlaskitBadge
|
|
148
|
+
*/
|
|
149
|
+
export const StoryPoints = createElement(ElementName.StoryPoints);
|
|
145
150
|
/**
|
|
146
151
|
* Creates a TargetBranch Text element using the data from targetBranch in the Flexible UI Context.
|
|
147
152
|
* @see Text
|
|
@@ -14,6 +14,7 @@ import Text from './text';
|
|
|
14
14
|
import { messages } from '../../../../messages';
|
|
15
15
|
import DateTime from './date-time';
|
|
16
16
|
import { tokens } from '../../../../utils/token';
|
|
17
|
+
import AtlaskitBadge from './atlaskit-badge';
|
|
17
18
|
const SNIPPET_DEFAULT_MAX_LINES = 3;
|
|
18
19
|
const elementMappings = {
|
|
19
20
|
[ElementName.AttachmentCount]: {
|
|
@@ -136,9 +137,12 @@ const elementMappings = {
|
|
|
136
137
|
[ElementName.SubTasksProgress]: {
|
|
137
138
|
component: Badge,
|
|
138
139
|
props: {
|
|
139
|
-
icon: IconType.
|
|
140
|
+
icon: IconType.SubTasksProgress
|
|
140
141
|
}
|
|
141
142
|
},
|
|
143
|
+
[ElementName.StoryPoints]: {
|
|
144
|
+
component: AtlaskitBadge
|
|
145
|
+
},
|
|
142
146
|
[ElementName.TargetBranch]: {
|
|
143
147
|
component: Text
|
|
144
148
|
},
|
|
@@ -179,6 +183,8 @@ const getData = (elementName, contextKey, context) => {
|
|
|
179
183
|
case ElementName.LatestCommit:
|
|
180
184
|
case ElementName.SubTasksProgress:
|
|
181
185
|
return toBadgeProps(data);
|
|
186
|
+
case ElementName.StoryPoints:
|
|
187
|
+
return toAtlaskitBadgeProps(data);
|
|
182
188
|
case ElementName.CreatedBy:
|
|
183
189
|
return toFormattedTextProps(messages.created_by, context.createdBy);
|
|
184
190
|
case ElementName.AssignedTo:
|
|
@@ -215,6 +221,11 @@ const toBadgeProps = label => {
|
|
|
215
221
|
label
|
|
216
222
|
} : undefined;
|
|
217
223
|
};
|
|
224
|
+
const toAtlaskitBadgeProps = value => {
|
|
225
|
+
return value ? {
|
|
226
|
+
value
|
|
227
|
+
} : undefined;
|
|
228
|
+
};
|
|
218
229
|
const toDateLozengeProps = dateString => {
|
|
219
230
|
if (dateString) {
|
|
220
231
|
const text = Date.parse(dateString) ? /*#__PURE__*/React.createElement(FormattedDate, {
|
|
@@ -118,7 +118,7 @@ export const getSimulatedBetterMetadata = (extensionKey = '', data) => {
|
|
|
118
118
|
subtitle: []
|
|
119
119
|
},
|
|
120
120
|
bottomMetadataBlock: {
|
|
121
|
-
primary: [ElementName.
|
|
121
|
+
primary: [ElementName.ReactCount, ElementName.CommentCount, ElementName.ViewCount],
|
|
122
122
|
secondary: [],
|
|
123
123
|
subtitle: []
|
|
124
124
|
}
|
package/dist/esm/constants.js
CHANGED
|
@@ -128,6 +128,7 @@ export var ElementName = /*#__PURE__*/function (ElementName) {
|
|
|
128
128
|
ElementName["State"] = "State";
|
|
129
129
|
ElementName["SubscriberCount"] = "SubscriberCount";
|
|
130
130
|
ElementName["SubTasksProgress"] = "SubTasksProgress";
|
|
131
|
+
ElementName["StoryPoints"] = "StoryPoints";
|
|
131
132
|
ElementName["TargetBranch"] = "TargetBranch";
|
|
132
133
|
ElementName["Title"] = "Title";
|
|
133
134
|
ElementName["ViewCount"] = "ViewCount";
|
|
@@ -215,6 +216,7 @@ export var IconType = /*#__PURE__*/function (IconType) {
|
|
|
215
216
|
IconType["PriorityUndefined"] = "Badge:PriorityUndefined";
|
|
216
217
|
IconType["ProgrammingLanguage"] = "Badge:ProgrammingLanguage";
|
|
217
218
|
IconType["Subscriber"] = "Badge:Subscriber";
|
|
219
|
+
IconType["SubTasksProgress"] = "Badge:SubTask";
|
|
218
220
|
return IconType;
|
|
219
221
|
}({});
|
|
220
222
|
|
|
@@ -1,6 +1,6 @@
|
|
|
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, extractAssignedTo, extractSubTasksProgress, extractReadTime, extractPersonAssignedToAsArray } from './utils';
|
|
3
|
+
import { extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn, extractLocation, extractOwnedBy, extractAssignedTo, extractSubTasksProgress, extractStoryPoints, extractReadTime, extractPersonAssignedToAsArray } from './utils';
|
|
4
4
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
5
5
|
import { extractPersonCreatedBy, extractTitle, extractDateUpdated, extractDateCreated, extractLink, extractPersonOwnedBy } from '@atlaskit/link-extractors';
|
|
6
6
|
import extractPriority from './extract-priority';
|
|
@@ -59,6 +59,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
59
59
|
state: extractState(response, showServerActions || showLozengeAction, id),
|
|
60
60
|
subscriberCount: extractSubscriberCount(data),
|
|
61
61
|
subTasksProgress: extractSubTasksProgress(data),
|
|
62
|
+
storyPoints: extractStoryPoints(data),
|
|
62
63
|
targetBranch: extractTargetBranch(data),
|
|
63
64
|
title: extractTitle(data) || url,
|
|
64
65
|
url: url
|
|
@@ -87,4 +87,7 @@ export var extractSubTasksProgress = function extractSubTasksProgress(data) {
|
|
|
87
87
|
};
|
|
88
88
|
export var extractReadTime = function extractReadTime(data) {
|
|
89
89
|
return extractValue(data, 'atlassian:readTimeInMinutes');
|
|
90
|
+
};
|
|
91
|
+
export var extractStoryPoints = function extractStoryPoints(data) {
|
|
92
|
+
return extractValue(data, 'atlassian:storyPoints');
|
|
90
93
|
};
|
package/dist/esm/i18n/en.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export default {
|
|
10
10
|
'fabric.linking.actions': 'Actions',
|
|
11
11
|
'fabric.linking.add_account': 'Add account',
|
|
12
|
+
'fabric.linking.assigned_to': 'Assigned to {context}',
|
|
12
13
|
'fabric.linking.cancel': 'Cancel',
|
|
13
14
|
'fabric.linking.cannot_connect': "Can't connect, try again",
|
|
14
15
|
'fabric.linking.cannot_find_link': "Can't find link",
|
|
@@ -23,7 +24,8 @@ export default {
|
|
|
23
24
|
'fabric.linking.connect_link_account_card_view_name': 'Connect your {context} account',
|
|
24
25
|
'fabric.linking.connect_to': 'Connect to {name}',
|
|
25
26
|
'fabric.linking.connect_unauthorised_account_action': 'Connect to {context}',
|
|
26
|
-
'fabric.linking.connect_unauthorised_account_description': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
|
+
'fabric.linking.connect_unauthorised_account_description': 'Connect {context} to Atlassian to view more details of your work and collaborate from one place.',
|
|
28
|
+
'fabric.linking.connect_unauthorised_account_description_no_provider': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
29
|
'fabric.linking.continue': 'Continue',
|
|
28
30
|
'fabric.linking.copy_url_to_clipboard': 'Copy link',
|
|
29
31
|
'fabric.linking.couldnt_load_link': "We couldn't load this link for an unknown reason.",
|
|
@@ -67,6 +69,7 @@ export default {
|
|
|
67
69
|
'fabric.linking.priority_minor': 'Minor',
|
|
68
70
|
'fabric.linking.priority_trivial': 'Trivial',
|
|
69
71
|
'fabric.linking.priority_undefined': 'Undefined',
|
|
72
|
+
'fabric.linking.read_time': '{context} min read',
|
|
70
73
|
'fabric.linking.request_access': 'Request access',
|
|
71
74
|
'fabric.linking.request_access_description': 'Request access to {context} view this preview.',
|
|
72
75
|
'fabric.linking.request_access_pending': 'Access pending',
|
|
@@ -84,6 +87,10 @@ export default {
|
|
|
84
87
|
'fabric.linking.status_change_update_error': 'We couldn’t update the status',
|
|
85
88
|
'fabric.linking.try_again': 'Try again',
|
|
86
89
|
'fabric.linking.try_another_account': 'Try another account',
|
|
90
|
+
'fabric.linking.unauthorised_account_description': "You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.",
|
|
91
|
+
'fabric.linking.unauthorised_account_description_no_provider': "You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.",
|
|
92
|
+
'fabric.linking.unauthorised_account_name': "We can't display private pages from {context}",
|
|
93
|
+
'fabric.linking.unauthorised_account_name_no_provider': "We can't display private pages",
|
|
87
94
|
'fabric.linking.unlink_account': 'Unlink Account',
|
|
88
95
|
'fabric.linking.updated_by': 'Modified by {context}',
|
|
89
96
|
'fabric.linking.view': 'View'
|
package/dist/esm/i18n/en_GB.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export default {
|
|
10
10
|
'fabric.linking.actions': 'Actions',
|
|
11
11
|
'fabric.linking.add_account': 'Add account',
|
|
12
|
+
'fabric.linking.assigned_to': 'Assigned to {context}',
|
|
12
13
|
'fabric.linking.cancel': 'Cancel',
|
|
13
14
|
'fabric.linking.cannot_connect': "Can't connect, try again",
|
|
14
15
|
'fabric.linking.cannot_find_link': "Can't find link",
|
|
@@ -23,7 +24,8 @@ export default {
|
|
|
23
24
|
'fabric.linking.connect_link_account_card_view_name': 'Connect your {context} account',
|
|
24
25
|
'fabric.linking.connect_to': 'Connect to {name}',
|
|
25
26
|
'fabric.linking.connect_unauthorised_account_action': 'Connect to {context}',
|
|
26
|
-
'fabric.linking.connect_unauthorised_account_description': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
|
+
'fabric.linking.connect_unauthorised_account_description': 'Connect {context} to Atlassian to view more details of your work and collaborate from one place.',
|
|
28
|
+
'fabric.linking.connect_unauthorised_account_description_no_provider': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
29
|
'fabric.linking.continue': 'Continue',
|
|
28
30
|
'fabric.linking.copy_url_to_clipboard': 'Copy link',
|
|
29
31
|
'fabric.linking.couldnt_load_link': "We couldn't load this link for an unknown reason.",
|
|
@@ -67,6 +69,7 @@ export default {
|
|
|
67
69
|
'fabric.linking.priority_minor': 'Minor',
|
|
68
70
|
'fabric.linking.priority_trivial': 'Trivial',
|
|
69
71
|
'fabric.linking.priority_undefined': 'Undefined',
|
|
72
|
+
'fabric.linking.read_time': '{context} min read',
|
|
70
73
|
'fabric.linking.request_access': 'Request access',
|
|
71
74
|
'fabric.linking.request_access_description': 'Request access to {context} view this preview.',
|
|
72
75
|
'fabric.linking.request_access_pending': 'Access pending',
|
|
@@ -84,6 +87,10 @@ export default {
|
|
|
84
87
|
'fabric.linking.status_change_update_error': 'We couldn’t update the status',
|
|
85
88
|
'fabric.linking.try_again': 'Try again',
|
|
86
89
|
'fabric.linking.try_another_account': 'Try another account',
|
|
90
|
+
'fabric.linking.unauthorised_account_description': "You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.",
|
|
91
|
+
'fabric.linking.unauthorised_account_description_no_provider': "You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.",
|
|
92
|
+
'fabric.linking.unauthorised_account_name': "We can't display private pages from {context}",
|
|
93
|
+
'fabric.linking.unauthorised_account_name_no_provider': "We can't display private pages",
|
|
87
94
|
'fabric.linking.unlink_account': 'Unlink Account',
|
|
88
95
|
'fabric.linking.updated_by': 'Modified by {context}',
|
|
89
96
|
'fabric.linking.view': 'View'
|
package/dist/esm/i18n/en_ZZ.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export default {
|
|
10
10
|
'fabric.linking.actions': 'Actions',
|
|
11
11
|
'fabric.linking.add_account': 'Add account',
|
|
12
|
+
'fabric.linking.assigned_to': 'Assigned to {context}',
|
|
12
13
|
'fabric.linking.cancel': 'Cancel',
|
|
13
14
|
'fabric.linking.cannot_connect': "Can't connect, try again",
|
|
14
15
|
'fabric.linking.cannot_find_link': "Can't find link",
|
|
@@ -23,7 +24,8 @@ export default {
|
|
|
23
24
|
'fabric.linking.connect_link_account_card_view_name': 'Connect your {context} account',
|
|
24
25
|
'fabric.linking.connect_to': 'Connect to {name}',
|
|
25
26
|
'fabric.linking.connect_unauthorised_account_action': 'Connect to {context}',
|
|
26
|
-
'fabric.linking.connect_unauthorised_account_description': 'Connect to Atlassian to view more details of your work and collaborate from one place
|
|
27
|
+
'fabric.linking.connect_unauthorised_account_description': 'Connect {context} to Atlassian to view more details of your work and collaborate from one place.',
|
|
28
|
+
'fabric.linking.connect_unauthorised_account_description_no_provider': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
27
29
|
'fabric.linking.continue': 'Continue',
|
|
28
30
|
'fabric.linking.copy_url_to_clipboard': 'Copy link',
|
|
29
31
|
'fabric.linking.couldnt_load_link': "We couldn't load this link for an unknown reason.",
|
|
@@ -67,6 +69,7 @@ export default {
|
|
|
67
69
|
'fabric.linking.priority_minor': 'Minor',
|
|
68
70
|
'fabric.linking.priority_trivial': 'Trivial',
|
|
69
71
|
'fabric.linking.priority_undefined': 'Undefined',
|
|
72
|
+
'fabric.linking.read_time': '{context} min read',
|
|
70
73
|
'fabric.linking.request_access': 'Request access',
|
|
71
74
|
'fabric.linking.request_access_description': 'Request access to {context} view this preview.',
|
|
72
75
|
'fabric.linking.request_access_pending': 'Access pending',
|
|
@@ -84,6 +87,10 @@ export default {
|
|
|
84
87
|
'fabric.linking.status_change_update_error': 'We couldn’t update the status',
|
|
85
88
|
'fabric.linking.try_again': 'Try again',
|
|
86
89
|
'fabric.linking.try_another_account': 'Try another account',
|
|
90
|
+
'fabric.linking.unauthorised_account_description': "You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.",
|
|
91
|
+
'fabric.linking.unauthorised_account_description_no_provider': "You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.",
|
|
92
|
+
'fabric.linking.unauthorised_account_name': "We can't display private pages from {context}",
|
|
93
|
+
'fabric.linking.unauthorised_account_name_no_provider': "We can't display private pages",
|
|
87
94
|
'fabric.linking.unlink_account': 'Unlink Account',
|
|
88
95
|
'fabric.linking.updated_by': 'Modified by {context}',
|
|
89
96
|
'fabric.linking.view': 'View'
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -276,8 +276,9 @@ export var importWithRetry = /*#__PURE__*/function () {
|
|
|
276
276
|
return _ref.apply(this, arguments);
|
|
277
277
|
};
|
|
278
278
|
}();
|
|
279
|
-
export var
|
|
279
|
+
export var downloadUrl = /*#__PURE__*/function () {
|
|
280
280
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url) {
|
|
281
|
+
var isIE11, isSafari, iframeName, link, iframe;
|
|
281
282
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
282
283
|
while (1) switch (_context2.prev = _context2.next) {
|
|
283
284
|
case 0:
|
|
@@ -287,14 +288,53 @@ export var openUrl = /*#__PURE__*/function () {
|
|
|
287
288
|
}
|
|
288
289
|
return _context2.abrupt("return");
|
|
289
290
|
case 2:
|
|
290
|
-
window.
|
|
291
|
-
|
|
291
|
+
isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
|
|
292
|
+
isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
293
|
+
iframeName = 'media-download-iframe';
|
|
294
|
+
link = document.createElement('a');
|
|
295
|
+
iframe = document.getElementById(iframeName);
|
|
296
|
+
if (!iframe) {
|
|
297
|
+
iframe = document.createElement('iframe');
|
|
298
|
+
iframe.style.display = 'none';
|
|
299
|
+
iframe.id = iframeName;
|
|
300
|
+
iframe.name = iframeName;
|
|
301
|
+
document.body.appendChild(iframe);
|
|
302
|
+
}
|
|
303
|
+
link.href = url;
|
|
304
|
+
link.download = url;
|
|
305
|
+
link.target = isIE11 || isSafari ? '_blank' : iframeName;
|
|
306
|
+
document.body.appendChild(link);
|
|
307
|
+
link.click();
|
|
308
|
+
document.body.removeChild(link);
|
|
309
|
+
case 14:
|
|
292
310
|
case "end":
|
|
293
311
|
return _context2.stop();
|
|
294
312
|
}
|
|
295
313
|
}, _callee2);
|
|
296
314
|
}));
|
|
297
|
-
return function
|
|
315
|
+
return function downloadUrl(_x2) {
|
|
298
316
|
return _ref2.apply(this, arguments);
|
|
299
317
|
};
|
|
318
|
+
}();
|
|
319
|
+
export var openUrl = /*#__PURE__*/function () {
|
|
320
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(url) {
|
|
321
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
322
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
323
|
+
case 0:
|
|
324
|
+
if (url) {
|
|
325
|
+
_context3.next = 2;
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
return _context3.abrupt("return");
|
|
329
|
+
case 2:
|
|
330
|
+
window.open(url, '_blank', 'noopener=yes');
|
|
331
|
+
case 3:
|
|
332
|
+
case "end":
|
|
333
|
+
return _context3.stop();
|
|
334
|
+
}
|
|
335
|
+
}, _callee3);
|
|
336
|
+
}));
|
|
337
|
+
return function openUrl(_x3) {
|
|
338
|
+
return _ref3.apply(this, arguments);
|
|
339
|
+
};
|
|
300
340
|
}();
|
package/dist/esm/version.json
CHANGED