@atlaskit/link-datasource 1.8.0 → 1.9.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 +6 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/common/zindex.js +8 -0
- package/dist/cjs/ui/assets-modal/modal/index.js +1 -1
- package/dist/cjs/ui/common/error-state/access-required.js +42 -8
- package/dist/cjs/ui/common/error-state/messages.js +4 -4
- package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +3 -1
- package/dist/cjs/ui/issue-like-table/index.js +2 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +24 -25
- package/dist/cjs/ui/jira-issues-modal/modal/messages.js +2 -2
- package/dist/cjs/ui/jira-issues-modal/site-selector/index.js +59 -37
- package/dist/cjs/ui/jira-issues-modal/site-selector/messages.js +4 -9
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/common/zindex.js +2 -0
- package/dist/es2019/ui/assets-modal/modal/index.js +1 -1
- package/dist/es2019/ui/common/error-state/access-required.js +41 -6
- package/dist/es2019/ui/common/error-state/messages.js +4 -4
- package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +3 -1
- package/dist/es2019/ui/issue-like-table/index.js +2 -1
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +25 -26
- package/dist/es2019/ui/jira-issues-modal/modal/messages.js +2 -2
- package/dist/es2019/ui/jira-issues-modal/site-selector/index.js +50 -32
- package/dist/es2019/ui/jira-issues-modal/site-selector/messages.js +4 -9
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/common/zindex.js +2 -0
- package/dist/esm/ui/assets-modal/modal/index.js +1 -1
- package/dist/esm/ui/common/error-state/access-required.js +43 -9
- package/dist/esm/ui/common/error-state/messages.js +4 -4
- package/dist/esm/ui/datasource-table-view/datasourceTableView.js +3 -1
- package/dist/esm/ui/issue-like-table/index.js +2 -1
- package/dist/esm/ui/jira-issues-modal/modal/index.js +25 -26
- package/dist/esm/ui/jira-issues-modal/modal/messages.js +2 -2
- package/dist/esm/ui/jira-issues-modal/site-selector/index.js +59 -34
- package/dist/esm/ui/jira-issues-modal/site-selector/messages.js +4 -9
- package/dist/types/common/zindex.d.ts +2 -0
- package/dist/types/ui/common/error-state/access-required.d.ts +2 -2
- package/dist/types/ui/jira-issues-modal/site-selector/index.d.ts +0 -1
- package/dist/types/ui/jira-issues-modal/site-selector/messages.d.ts +1 -6
- package/dist/types/ui/jira-issues-modal/types.d.ts +2 -0
- package/dist/types-ts4.5/common/zindex.d.ts +2 -0
- package/dist/types-ts4.5/ui/common/error-state/access-required.d.ts +2 -2
- package/dist/types-ts4.5/ui/jira-issues-modal/site-selector/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/jira-issues-modal/site-selector/messages.d.ts +1 -6
- package/dist/types-ts4.5/ui/jira-issues-modal/types.d.ts +2 -0
- package/package.json +2 -3
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
|
@@ -1,45 +1,70 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["width"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
6
|
/** @jsx jsx */
|
|
5
|
-
import {
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
6
9
|
import { useIntl } from 'react-intl-next';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
10
|
+
import Select from '@atlaskit/select';
|
|
11
|
+
import { siteSelectorIndex } from '../../../common/zindex';
|
|
10
12
|
import { siteSelectorMessages } from './messages';
|
|
13
|
+
var selectStyles = css({
|
|
14
|
+
fontSize: "var(--ds-font-size-100, 14px)",
|
|
15
|
+
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
16
|
+
lineHeight: "var(--ds-font-lineHeight-200, 20px)",
|
|
17
|
+
zIndex: siteSelectorIndex
|
|
18
|
+
});
|
|
11
19
|
export var JiraSiteSelector = function JiraSiteSelector(props) {
|
|
12
20
|
var availableSites = props.availableSites,
|
|
13
21
|
onSiteSelection = props.onSiteSelection,
|
|
14
22
|
selectedJiraSite = props.selectedJiraSite,
|
|
15
23
|
testId = props.testId;
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
testId: "".concat(testId, "--trigger"),
|
|
25
|
-
spacing: "none",
|
|
26
|
-
iconBefore: jsx(ChevronDownIcon, {
|
|
27
|
-
label: intl.formatMessage(siteSelectorMessages.dropdownChevronLabel)
|
|
28
|
-
}),
|
|
29
|
-
ref: triggerRef
|
|
30
|
-
}));
|
|
24
|
+
var _useIntl = useIntl(),
|
|
25
|
+
formatMessage = _useIntl.formatMessage;
|
|
26
|
+
var onChange = function onChange(newValue) {
|
|
27
|
+
var selectedSite = availableSites.find(function (site) {
|
|
28
|
+
return site.cloudId === (newValue === null || newValue === void 0 ? void 0 : newValue.value);
|
|
29
|
+
});
|
|
30
|
+
if (selectedSite) {
|
|
31
|
+
onSiteSelection(selectedSite);
|
|
31
32
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
33
|
+
};
|
|
34
|
+
var availableSitesOptions = useMemo(function () {
|
|
35
|
+
return availableSites.map(function (site) {
|
|
36
|
+
return {
|
|
37
|
+
label: site.displayName,
|
|
38
|
+
value: site.cloudId
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}, [availableSites]);
|
|
42
|
+
var selectedSiteOption = selectedJiraSite && {
|
|
43
|
+
label: selectedJiraSite.displayName,
|
|
44
|
+
value: selectedJiraSite.cloudId
|
|
45
|
+
};
|
|
46
|
+
return jsx("span", {
|
|
47
|
+
"data-testid": "".concat(testId, "--trigger")
|
|
48
|
+
}, jsx(Select, {
|
|
49
|
+
css: selectStyles,
|
|
50
|
+
classNamePrefix: testId,
|
|
51
|
+
isLoading: availableSites.length === 0,
|
|
52
|
+
onChange: onChange,
|
|
53
|
+
options: availableSitesOptions,
|
|
54
|
+
placeholder: formatMessage(siteSelectorMessages.chooseSite),
|
|
55
|
+
styles: {
|
|
56
|
+
// prevents the popup menu with available sites from being too narrow
|
|
57
|
+
// if the selected site is much shorter than the other options
|
|
58
|
+
menu: function menu(_ref) {
|
|
59
|
+
var width = _ref.width,
|
|
60
|
+
css = _objectWithoutProperties(_ref, _excluded);
|
|
61
|
+
return _objectSpread(_objectSpread({}, css), {}, {
|
|
62
|
+
minWidth: '100%',
|
|
63
|
+
width: 'max-content'
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
testId: testId,
|
|
68
|
+
value: selectedSiteOption
|
|
69
|
+
}));
|
|
45
70
|
};
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export var siteSelectorMessages = defineMessages({
|
|
3
|
-
|
|
4
|
-
id: 'linkDataSource.jira-issues.configmodal.
|
|
5
|
-
description: 'Label for
|
|
6
|
-
defaultMessage: '
|
|
7
|
-
},
|
|
8
|
-
selectedJiraSiteLabel: {
|
|
9
|
-
id: 'linkDataSource.jira-issues.configmodal.selectedJiraSiteLabel',
|
|
10
|
-
description: 'Label for a check icon declaring which option is selected',
|
|
11
|
-
defaultMessage: '{siteName} is selected'
|
|
3
|
+
chooseSite: {
|
|
4
|
+
id: 'linkDataSource.jira-issues.configmodal.chooseSite',
|
|
5
|
+
description: 'Label for input letting user know they have to choose a site',
|
|
6
|
+
defaultMessage: 'Choose site'
|
|
12
7
|
}
|
|
13
8
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
interface AccessRequiredProps {
|
|
3
|
-
|
|
3
|
+
url?: string;
|
|
4
4
|
}
|
|
5
|
-
export declare const AccessRequired: ({
|
|
5
|
+
export declare const AccessRequired: ({ url }: AccessRequiredProps) => jsx.JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -36,6 +36,8 @@ export interface JiraIssuesDatasourceAdf extends DatasourceAdf {
|
|
|
36
36
|
export interface JiraIssuesConfigModalProps {
|
|
37
37
|
datasourceId: string;
|
|
38
38
|
visibleColumnKeys?: string[];
|
|
39
|
+
/** The url that was used to insert a Jira List of Links */
|
|
40
|
+
url?: string;
|
|
39
41
|
parameters?: JiraIssueDatasourceParameters;
|
|
40
42
|
onCancel: () => void;
|
|
41
43
|
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
interface AccessRequiredProps {
|
|
3
|
-
|
|
3
|
+
url?: string;
|
|
4
4
|
}
|
|
5
|
-
export declare const AccessRequired: ({
|
|
5
|
+
export declare const AccessRequired: ({ url }: AccessRequiredProps) => jsx.JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -36,6 +36,8 @@ export interface JiraIssuesDatasourceAdf extends DatasourceAdf {
|
|
|
36
36
|
export interface JiraIssuesConfigModalProps {
|
|
37
37
|
datasourceId: string;
|
|
38
38
|
visibleColumnKeys?: string[];
|
|
39
|
+
/** The url that was used to insert a Jira List of Links */
|
|
40
|
+
url?: string;
|
|
39
41
|
parameters?: JiraIssueDatasourceParameters;
|
|
40
42
|
onCancel: () => void;
|
|
41
43
|
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"@atlaskit/analytics-next": "^9.1.3",
|
|
35
35
|
"@atlaskit/avatar": "^21.4.0",
|
|
36
36
|
"@atlaskit/button": "^16.10.0",
|
|
37
|
-
"@atlaskit/dropdown-menu": "^12.1.0",
|
|
38
37
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
39
38
|
"@atlaskit/empty-state": "^7.5.0",
|
|
40
39
|
"@atlaskit/form": "^8.11.0",
|
|
@@ -60,7 +59,7 @@
|
|
|
60
59
|
"@atlaskit/tag": "^11.6.0",
|
|
61
60
|
"@atlaskit/textfield": "5.6.8",
|
|
62
61
|
"@atlaskit/theme": "^12.6.0",
|
|
63
|
-
"@atlaskit/tokens": "^1.
|
|
62
|
+
"@atlaskit/tokens": "^1.27.0",
|
|
64
63
|
"@atlaskit/tooltip": "^17.8.0",
|
|
65
64
|
"@atlaskit/ufo": "^0.2.4",
|
|
66
65
|
"@atlassianlabs/jql-ast": "^2.1.0",
|
package/report.api.md
CHANGED
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ interface JiraIssuesConfigModalProps {
|
|
|
110
110
|
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
111
111
|
// (undocumented)
|
|
112
112
|
parameters?: JiraIssueDatasourceParameters;
|
|
113
|
+
url?: string;
|
|
113
114
|
// (undocumented)
|
|
114
115
|
viewMode?: JiraIssueViewModes;
|
|
115
116
|
// (undocumented)
|