@atlaskit/link-datasource 1.24.7 → 1.24.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/ui/assets-modal/modal/render-assets-content/initial-state-view/index.js +2 -1
- package/dist/cjs/ui/common/error-state/access-required.js +2 -1
- package/dist/cjs/ui/common/error-state/loading-error.js +2 -1
- package/dist/cjs/ui/common/error-state/messages.js +0 -11
- package/dist/cjs/ui/common/error-state/modal-loading-error.js +5 -13
- package/dist/cjs/ui/common/error-state/no-instances.js +2 -1
- package/dist/cjs/ui/common/error-state/no-results.js +2 -1
- package/dist/cjs/ui/common/initial-state-view/index.js +2 -1
- package/dist/cjs/ui/confluence-search-modal/confluence-search-container/index.js +48 -0
- package/dist/cjs/ui/confluence-search-modal/confluence-search-container/messages.js +14 -0
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +209 -30
- package/dist/cjs/ui/confluence-search-modal/modal/messages.js +4 -4
- package/dist/cjs/ui/confluence-search-modal/types.js +5 -0
- package/dist/cjs/ui/issue-like-table/column-picker/concatenated-menu-list.js +2 -1
- package/dist/cjs/ui/issue-like-table/drag-column-preview.js +2 -1
- package/dist/cjs/ui/issue-like-table/index.js +2 -1
- package/dist/cjs/ui/issue-like-table/styled.js +2 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +9 -1
- package/dist/cjs/ui/jira-issues-modal/modal/messages.js +5 -0
- package/dist/cjs/ui/jira-issues-modal/mode-switcher/index.js +1 -0
- package/dist/es2019/ui/assets-modal/modal/render-assets-content/initial-state-view/index.js +2 -1
- package/dist/es2019/ui/common/error-state/access-required.js +2 -1
- package/dist/es2019/ui/common/error-state/loading-error.js +2 -1
- package/dist/es2019/ui/common/error-state/messages.js +0 -11
- package/dist/es2019/ui/common/error-state/modal-loading-error.js +4 -10
- package/dist/es2019/ui/common/error-state/no-instances.js +2 -1
- package/dist/es2019/ui/common/error-state/no-results.js +2 -1
- package/dist/es2019/ui/common/initial-state-view/index.js +2 -1
- package/dist/es2019/ui/confluence-search-modal/confluence-search-container/index.js +35 -0
- package/dist/es2019/ui/confluence-search-modal/confluence-search-container/messages.js +8 -0
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +192 -27
- package/dist/es2019/ui/confluence-search-modal/modal/messages.js +4 -4
- package/dist/es2019/ui/confluence-search-modal/types.js +1 -0
- package/dist/es2019/ui/issue-like-table/column-picker/concatenated-menu-list.js +2 -1
- package/dist/es2019/ui/issue-like-table/drag-column-preview.js +2 -1
- package/dist/es2019/ui/issue-like-table/index.js +2 -1
- package/dist/es2019/ui/issue-like-table/styled.js +2 -1
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +7 -1
- package/dist/es2019/ui/jira-issues-modal/modal/messages.js +5 -0
- package/dist/es2019/ui/jira-issues-modal/mode-switcher/index.js +1 -0
- package/dist/esm/ui/assets-modal/modal/render-assets-content/initial-state-view/index.js +2 -1
- package/dist/esm/ui/common/error-state/access-required.js +2 -1
- package/dist/esm/ui/common/error-state/loading-error.js +2 -1
- package/dist/esm/ui/common/error-state/messages.js +0 -11
- package/dist/esm/ui/common/error-state/modal-loading-error.js +5 -12
- package/dist/esm/ui/common/error-state/no-instances.js +2 -1
- package/dist/esm/ui/common/error-state/no-results.js +2 -1
- package/dist/esm/ui/common/initial-state-view/index.js +2 -1
- package/dist/esm/ui/confluence-search-modal/confluence-search-container/index.js +38 -0
- package/dist/esm/ui/confluence-search-modal/confluence-search-container/messages.js +8 -0
- package/dist/esm/ui/confluence-search-modal/modal/index.js +211 -30
- package/dist/esm/ui/confluence-search-modal/modal/messages.js +4 -4
- package/dist/esm/ui/confluence-search-modal/types.js +1 -0
- package/dist/esm/ui/issue-like-table/column-picker/concatenated-menu-list.js +2 -1
- package/dist/esm/ui/issue-like-table/drag-column-preview.js +2 -1
- package/dist/esm/ui/issue-like-table/index.js +2 -1
- package/dist/esm/ui/issue-like-table/styled.js +2 -1
- package/dist/esm/ui/jira-issues-modal/modal/index.js +9 -1
- package/dist/esm/ui/jira-issues-modal/modal/messages.js +5 -0
- package/dist/esm/ui/jira-issues-modal/mode-switcher/index.js +1 -0
- package/dist/types/common/types.d.ts +3 -6
- package/dist/types/ui/common/error-state/messages.d.ts +0 -10
- package/dist/types/ui/common/error-state/modal-loading-error.d.ts +3 -2
- package/dist/types/ui/confluence-search-modal/confluence-search-container/index.d.ts +9 -0
- package/dist/types/ui/confluence-search-modal/confluence-search-container/messages.d.ts +7 -0
- package/dist/types/ui/confluence-search-modal/index.d.ts +2 -2
- package/dist/types/ui/confluence-search-modal/modal/index.d.ts +2 -2
- package/dist/types/ui/confluence-search-modal/modal/messages.d.ts +1 -1
- package/dist/types/ui/confluence-search-modal/types.d.ts +12 -0
- package/dist/types/ui/jira-issues-modal/index.d.ts +2 -2
- package/dist/types/ui/jira-issues-modal/modal/index.d.ts +3 -13
- package/dist/types/ui/jira-issues-modal/modal/messages.d.ts +5 -0
- package/dist/types/ui/jira-issues-modal/types.d.ts +5 -1
- package/dist/types-ts4.5/common/types.d.ts +3 -6
- package/dist/types-ts4.5/ui/common/error-state/messages.d.ts +0 -10
- package/dist/types-ts4.5/ui/common/error-state/modal-loading-error.d.ts +3 -2
- package/dist/types-ts4.5/ui/confluence-search-modal/confluence-search-container/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/confluence-search-modal/confluence-search-container/messages.d.ts +7 -0
- package/dist/types-ts4.5/ui/confluence-search-modal/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/messages.d.ts +1 -1
- package/dist/types-ts4.5/ui/confluence-search-modal/types.d.ts +12 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/index.d.ts +3 -13
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/messages.d.ts +5 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/types.d.ts +5 -1
- package/examples-helpers/buildConfluenceSearchTable.tsx +77 -0
- package/package.json +3 -3
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { useIntl } from 'react-intl-next';
|
|
5
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
5
6
|
import { CrystalBallSVG } from './assets/crystal-ball-svg';
|
|
6
7
|
import { initialStateViewMessages } from './messages';
|
|
7
8
|
var initialStateViewContainerStyles = css({
|
|
@@ -14,7 +15,7 @@ var svgAndTextsWrapperStyles = css({
|
|
|
14
15
|
alignSelf: 'center'
|
|
15
16
|
});
|
|
16
17
|
var searchTitleStyles = css({
|
|
17
|
-
font: "var(--ds-font-heading-small,
|
|
18
|
+
font: "var(--ds-font-heading-small, ".concat(fontFallback.heading.small, ")"),
|
|
18
19
|
paddingTop: "var(--ds-space-200, 16px)",
|
|
19
20
|
paddingBottom: "var(--ds-space-100, 8px)"
|
|
20
21
|
});
|
|
@@ -5,12 +5,13 @@ import { useIntl } from 'react-intl-next';
|
|
|
5
5
|
import EmptyState from '@atlaskit/empty-state';
|
|
6
6
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
7
|
import { N400 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
8
9
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
9
10
|
import { AccessRequiredSVG } from './access-required-svg';
|
|
10
11
|
import { loadingErrorMessages } from './messages';
|
|
11
12
|
var urlStyles = css({
|
|
12
13
|
color: "var(--ds-text-subtlest, ".concat(N400, ")"),
|
|
13
|
-
font: "var(--ds-font-body,
|
|
14
|
+
font: "var(--ds-font-body, ".concat(fontFallback.body.medium, ")")
|
|
14
15
|
});
|
|
15
16
|
var descriptionMessageStyles = css({
|
|
16
17
|
display: 'flex',
|
|
@@ -3,6 +3,7 @@ import { useEffect } from 'react';
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
5
|
import Button from '@atlaskit/button/standard-button';
|
|
6
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
6
7
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
7
8
|
import { LoadingErrorSVG } from './loading-error-svg';
|
|
8
9
|
import { loadingErrorMessages } from './messages';
|
|
@@ -18,7 +19,7 @@ var errorMessageContainerStyles = css({
|
|
|
18
19
|
placeItems: 'center'
|
|
19
20
|
});
|
|
20
21
|
var errorMessageStyles = css({
|
|
21
|
-
font: "var(--ds-font-heading-small,
|
|
22
|
+
font: "var(--ds-font-heading-small, ".concat(fontFallback.heading.small, ")")
|
|
22
23
|
});
|
|
23
24
|
var errorDescriptionStyles = css({
|
|
24
25
|
margin: 0
|
|
@@ -44,17 +44,6 @@ export var loadingErrorMessages = defineMessages({
|
|
|
44
44
|
description: 'Instructions to let the user know how to resolve the network error that occurred or to try again at a different time',
|
|
45
45
|
defaultMessage: 'Check your connection and refresh, or try again later.'
|
|
46
46
|
},
|
|
47
|
-
checkConnectionWithSourceDuplicate: {
|
|
48
|
-
id: 'linkDataSource.checkConnectionWithSource',
|
|
49
|
-
description: 'Instructions to let the user know how to resolve the error that occured, or click the link provided to open the query in Jira',
|
|
50
|
-
defaultMessage: 'Check your connection and refresh, or <a>open this query in Jira</a> to review.'
|
|
51
|
-
},
|
|
52
|
-
//delete and remove duplicate from title above
|
|
53
|
-
checkConnectionWithSource: {
|
|
54
|
-
id: 'linkDataSource.jira-issues.checkConnectionWithSource',
|
|
55
|
-
description: 'Instructions to let the user know how to resolve the error that occured, or click the link provided to open the query in Jira',
|
|
56
|
-
defaultMessage: 'Check your connection and refresh, or <a>open this query in Jira</a> to review.'
|
|
57
|
-
},
|
|
58
47
|
noResultsFoundDuplicate: {
|
|
59
48
|
id: 'linkDataSource.noResultsFound',
|
|
60
49
|
description: 'Status message letting the user know their query did not have any results',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
/** @jsx jsx */
|
|
3
2
|
import { useEffect } from 'react';
|
|
4
3
|
import { css, jsx } from '@emotion/react';
|
|
5
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
6
6
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
7
7
|
import { LoadingErrorSVG } from './loading-error-svg';
|
|
8
8
|
import { loadingErrorMessages } from './messages';
|
|
@@ -18,13 +18,14 @@ var errorMessageContainerStyles = css({
|
|
|
18
18
|
placeItems: 'center'
|
|
19
19
|
});
|
|
20
20
|
var errorMessageStyles = css({
|
|
21
|
-
font: "var(--ds-font-heading-small,
|
|
21
|
+
font: "var(--ds-font-heading-small, ".concat(fontFallback.heading.small, ")")
|
|
22
22
|
});
|
|
23
23
|
var errorDescriptionStyles = css({
|
|
24
24
|
margin: 0
|
|
25
25
|
});
|
|
26
26
|
export var ModalLoadingError = function ModalLoadingError(_ref) {
|
|
27
|
-
var
|
|
27
|
+
var _ref$errorMessage = _ref.errorMessage,
|
|
28
|
+
errorMessage = _ref$errorMessage === void 0 ? jsx(FormattedMessage, loadingErrorMessages.checkConnection) : _ref$errorMessage;
|
|
28
29
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
29
30
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
30
31
|
useEffect(function () {
|
|
@@ -41,13 +42,5 @@ export var ModalLoadingError = function ModalLoadingError(_ref) {
|
|
|
41
42
|
css: errorMessageStyles
|
|
42
43
|
}, jsx(FormattedMessage, loadingErrorMessages.unableToLoadResults)), jsx("p", {
|
|
43
44
|
css: errorDescriptionStyles
|
|
44
|
-
},
|
|
45
|
-
values: {
|
|
46
|
-
a: function a(chunk) {
|
|
47
|
-
return jsx("a", {
|
|
48
|
-
href: url
|
|
49
|
-
}, chunk);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
})) : jsx(FormattedMessage, loadingErrorMessages.checkConnection))));
|
|
45
|
+
}, errorMessage)));
|
|
53
46
|
};
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { useIntl } from 'react-intl-next';
|
|
4
4
|
import { Flex, xcss } from '@atlaskit/primitives';
|
|
5
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
5
6
|
import { NoInstancesSvg } from './no-instances-svg';
|
|
6
7
|
var titleStyles = css({
|
|
7
|
-
font: "var(--ds-font-heading-small,
|
|
8
|
+
font: "var(--ds-font-heading-small, ".concat(fontFallback.heading.small, ")"),
|
|
8
9
|
marginTop: "var(--ds-space-200, 16px)"
|
|
9
10
|
});
|
|
10
11
|
var descriptionStyles = css({
|
|
@@ -3,6 +3,7 @@ import { useEffect } from 'react';
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
5
|
import Button from '@atlaskit/button/standard-button';
|
|
6
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
6
7
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
7
8
|
import { loadingErrorMessages } from './messages';
|
|
8
9
|
var noResultsContainerStyles = css({
|
|
@@ -17,7 +18,7 @@ var noResultsMessageContainerStyles = css({
|
|
|
17
18
|
placeItems: 'center'
|
|
18
19
|
});
|
|
19
20
|
var noResultsMessageStyles = css({
|
|
20
|
-
font: "var(--ds-font-heading-small,
|
|
21
|
+
font: "var(--ds-font-heading-small, ".concat(fontFallback.heading.small, ")")
|
|
21
22
|
});
|
|
22
23
|
export var NoResults = function NoResults(_ref) {
|
|
23
24
|
var onRefresh = _ref.onRefresh;
|
|
@@ -3,6 +3,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
3
3
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
4
4
|
import Lozenge from '@atlaskit/lozenge';
|
|
5
5
|
import { N300 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
6
7
|
import { initialStateViewMessages } from './messages';
|
|
7
8
|
var initialStateViewContainerStyles = css({
|
|
8
9
|
display: 'flex',
|
|
@@ -20,7 +21,7 @@ var betaTagStyles = css({
|
|
|
20
21
|
});
|
|
21
22
|
var searchTitleStyles = css({
|
|
22
23
|
color: "var(--ds-text-subtlest, ".concat(N300, ")"),
|
|
23
|
-
font: "var(--ds-font-heading-medium,
|
|
24
|
+
font: "var(--ds-font-heading-medium, ".concat(fontFallback.heading.medium, ")"),
|
|
24
25
|
paddingTop: "var(--ds-space-200, 16px)",
|
|
25
26
|
paddingBottom: "var(--ds-space-100, 8px)",
|
|
26
27
|
display: 'flex',
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { BasicSearchInput } from '../../common/modal/basic-search-input';
|
|
4
|
+
import { searchMessages } from './messages';
|
|
5
|
+
var ConfluenceSearchContainer = function ConfluenceSearchContainer(_ref) {
|
|
6
|
+
var cloudId = _ref.cloudId,
|
|
7
|
+
initialSearchValue = _ref.initialSearchValue,
|
|
8
|
+
isSearching = _ref.isSearching,
|
|
9
|
+
onSearch = _ref.onSearch;
|
|
10
|
+
var currentCloudId = useRef(cloudId);
|
|
11
|
+
var _useState = useState(initialSearchValue !== null && initialSearchValue !== void 0 ? initialSearchValue : ''),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
searchBarSearchString = _useState2[0],
|
|
14
|
+
setSearchBarSearchString = _useState2[1];
|
|
15
|
+
var handleSearchChange = useCallback(function (e) {
|
|
16
|
+
var rawSearch = e.currentTarget.value;
|
|
17
|
+
setSearchBarSearchString(rawSearch);
|
|
18
|
+
}, []);
|
|
19
|
+
|
|
20
|
+
// TODO: further refactoring in EDM-9573
|
|
21
|
+
// https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6827913
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
if (currentCloudId.current !== cloudId) {
|
|
24
|
+
setSearchBarSearchString('');
|
|
25
|
+
currentCloudId.current = cloudId;
|
|
26
|
+
}
|
|
27
|
+
}, [cloudId]);
|
|
28
|
+
return /*#__PURE__*/React.createElement(BasicSearchInput, {
|
|
29
|
+
testId: "confluence-search-datasource-modal--search-input",
|
|
30
|
+
isSearching: isSearching,
|
|
31
|
+
onChange: handleSearchChange,
|
|
32
|
+
onSearch: onSearch,
|
|
33
|
+
searchTerm: searchBarSearchString,
|
|
34
|
+
placeholder: searchMessages.searchLabel,
|
|
35
|
+
fullWidth: true
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
export default ConfluenceSearchContainer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export var searchMessages = defineMessages({
|
|
3
|
+
searchLabel: {
|
|
4
|
+
id: 'linkDataSource.confluence-search.configmodal.searchLabel',
|
|
5
|
+
description: 'Placeholder text for the search input box',
|
|
6
|
+
defaultMessage: 'Enter keywords to find pages, attachments, and more'
|
|
7
|
+
}
|
|
8
|
+
});
|
|
@@ -1,27 +1,57 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
5
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
|
+
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; }
|
|
7
|
+
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
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
9
|
/** @jsx jsx */
|
|
6
|
-
import { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
|
|
10
|
+
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
11
|
import { jsx } from '@emotion/react';
|
|
8
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
12
|
+
import { FormattedMessage, FormattedNumber } from 'react-intl-next';
|
|
13
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
14
|
import Button from '@atlaskit/button/standard-button';
|
|
10
15
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
11
16
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
17
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
18
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
19
|
+
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
20
|
+
import { N800 } from '@atlaskit/theme/colors';
|
|
12
21
|
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
22
|
+
import { useDatasourceTableState } from '../../../hooks/useDatasourceTableState';
|
|
13
23
|
import i18nEN from '../../../i18n/en';
|
|
14
24
|
import { getAvailableSites } from '../../../services/getAvailableSites';
|
|
25
|
+
import { AccessRequired } from '../../common/error-state/access-required';
|
|
26
|
+
import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
|
|
15
27
|
import { NoInstancesView } from '../../common/error-state/no-instances';
|
|
28
|
+
import { NoResults } from '../../common/error-state/no-results';
|
|
16
29
|
import { InitialStateView } from '../../common/initial-state-view';
|
|
17
|
-
import { BasicSearchInput } from '../../common/modal/basic-search-input';
|
|
18
30
|
import { ContentContainer } from '../../common/modal/content-container';
|
|
19
31
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
32
|
+
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
33
|
+
import ConfluenceSearchContainer from '../confluence-search-container';
|
|
20
34
|
import { ConfluenceSearchInitialStateSVG } from './confluence-search-initial-state-svg';
|
|
21
35
|
import { confluenceSearchModalMessages } from './messages';
|
|
36
|
+
var inputContainerStyles = xcss({
|
|
37
|
+
alignItems: 'baseline',
|
|
38
|
+
display: 'flex',
|
|
39
|
+
minHeight: '72px'
|
|
40
|
+
});
|
|
41
|
+
var searchCountStyles = xcss({
|
|
42
|
+
flex: 1,
|
|
43
|
+
fontWeight: 600
|
|
44
|
+
});
|
|
22
45
|
export var ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(props) {
|
|
23
|
-
var
|
|
24
|
-
|
|
46
|
+
var _useRef = useRef(uuidv4()),
|
|
47
|
+
modalRenderInstanceId = _useRef.current;
|
|
48
|
+
var datasourceId = props.datasourceId,
|
|
49
|
+
initialColumnCustomSizes = props.columnCustomSizes,
|
|
50
|
+
initialWrappedColumnKeys = props.wrappedColumnKeys,
|
|
51
|
+
onCancel = props.onCancel,
|
|
52
|
+
initialParameters = props.parameters,
|
|
53
|
+
urlBeingEdited = props.url,
|
|
54
|
+
initialVisibleColumnKeys = props.visibleColumnKeys;
|
|
25
55
|
var _useState = useState(undefined),
|
|
26
56
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
57
|
availableSites = _useState2[0],
|
|
@@ -30,13 +60,44 @@ export var ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(pr
|
|
|
30
60
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
31
61
|
cloudId = _useState4[0],
|
|
32
62
|
setCloudId = _useState4[1];
|
|
33
|
-
var _useState5 = useState(
|
|
63
|
+
var _useState5 = useState(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.searchString),
|
|
34
64
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
65
|
+
searchString = _useState6[0],
|
|
66
|
+
setSearchString = _useState6[1];
|
|
67
|
+
var _useState7 = useState(initialVisibleColumnKeys),
|
|
68
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
69
|
+
visibleColumnKeys = _useState8[0],
|
|
70
|
+
setVisibleColumnKeys = _useState8[1];
|
|
71
|
+
|
|
72
|
+
// TODO: further refactoring in EDM-9573
|
|
73
|
+
// https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6829210
|
|
74
|
+
var parameters = useMemo(function () {
|
|
75
|
+
return cloudId ? {
|
|
76
|
+
cloudId: cloudId,
|
|
77
|
+
searchString: searchString
|
|
78
|
+
} : undefined;
|
|
79
|
+
}, [cloudId, searchString /** Add more parameters when more filters are added */]);
|
|
80
|
+
var isParametersSet = useMemo(function () {
|
|
81
|
+
return !!cloudId && Object.values(parameters !== null && parameters !== void 0 ? parameters : {}).filter(function (v) {
|
|
82
|
+
return v !== undefined;
|
|
83
|
+
}).length > 1;
|
|
84
|
+
}, [cloudId, parameters]);
|
|
85
|
+
var _useDatasourceTableSt = useDatasourceTableState({
|
|
86
|
+
datasourceId: datasourceId,
|
|
87
|
+
parameters: isParametersSet ? parameters : undefined,
|
|
88
|
+
fieldKeys: visibleColumnKeys
|
|
89
|
+
}),
|
|
90
|
+
reset = _useDatasourceTableSt.reset,
|
|
91
|
+
status = _useDatasourceTableSt.status,
|
|
92
|
+
onNextPage = _useDatasourceTableSt.onNextPage,
|
|
93
|
+
responseItems = _useDatasourceTableSt.responseItems,
|
|
94
|
+
hasNextPage = _useDatasourceTableSt.hasNextPage,
|
|
95
|
+
columns = _useDatasourceTableSt.columns,
|
|
96
|
+
defaultVisibleColumnKeys = _useDatasourceTableSt.defaultVisibleColumnKeys,
|
|
97
|
+
loadDatasourceDetails = _useDatasourceTableSt.loadDatasourceDetails,
|
|
98
|
+
_useDatasourceTableSt2 = _useDatasourceTableSt.extensionKey,
|
|
99
|
+
extensionKey = _useDatasourceTableSt2 === void 0 ? null : _useDatasourceTableSt2,
|
|
100
|
+
totalCount = _useDatasourceTableSt.totalCount;
|
|
40
101
|
var hasNoConfluenceSites = availableSites && availableSites.length === 0;
|
|
41
102
|
var selectedConfluenceSite = useMemo(function () {
|
|
42
103
|
if (cloudId) {
|
|
@@ -53,10 +114,24 @@ export var ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(pr
|
|
|
53
114
|
})) || (availableSites === null || availableSites === void 0 ? void 0 : availableSites[0]);
|
|
54
115
|
}
|
|
55
116
|
}, [availableSites, cloudId]);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
117
|
+
|
|
118
|
+
// TODO: further refactoring in EDM-9573
|
|
119
|
+
// https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6828283
|
|
120
|
+
useEffect(function () {
|
|
121
|
+
if (selectedConfluenceSite && (!cloudId || cloudId !== selectedConfluenceSite.cloudId)) {
|
|
122
|
+
setCloudId(selectedConfluenceSite.cloudId);
|
|
123
|
+
}
|
|
124
|
+
}, [cloudId, selectedConfluenceSite]);
|
|
125
|
+
|
|
126
|
+
// TODO: further refactoring in EDM-9573
|
|
127
|
+
// https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6829171
|
|
128
|
+
var onSiteSelection = useCallback(function (site) {
|
|
129
|
+
setSearchString(undefined);
|
|
130
|
+
setCloudId(site.cloudId);
|
|
131
|
+
reset({
|
|
132
|
+
shouldForceRequest: true
|
|
133
|
+
});
|
|
134
|
+
}, [reset]);
|
|
60
135
|
useEffect(function () {
|
|
61
136
|
var fetchSiteDisplayNames = /*#__PURE__*/function () {
|
|
62
137
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -85,6 +160,101 @@ export var ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(pr
|
|
|
85
160
|
void fetchSiteDisplayNames();
|
|
86
161
|
}, []);
|
|
87
162
|
var siteSelectorLabel = availableSites && availableSites.length > 1 ? confluenceSearchModalMessages.insertIssuesTitleManySites : confluenceSearchModalMessages.insertIssuesTitle;
|
|
163
|
+
var _useState9 = useState(initialColumnCustomSizes),
|
|
164
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
165
|
+
columnCustomSizes = _useState10[0],
|
|
166
|
+
setColumnCustomSizes = _useState10[1];
|
|
167
|
+
var onColumnResize = useCallback(function (key, width) {
|
|
168
|
+
setColumnCustomSizes(_objectSpread(_objectSpread({}, columnCustomSizes), {}, _defineProperty({}, key, width)));
|
|
169
|
+
}, [columnCustomSizes]);
|
|
170
|
+
var _useState11 = useState(initialWrappedColumnKeys),
|
|
171
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
172
|
+
wrappedColumnKeys = _useState12[0],
|
|
173
|
+
setWrappedColumnKeys = _useState12[1];
|
|
174
|
+
var onWrappedColumnChange = useCallback(function (key, isWrapped) {
|
|
175
|
+
var set = new Set(wrappedColumnKeys);
|
|
176
|
+
if (isWrapped) {
|
|
177
|
+
set.add(key);
|
|
178
|
+
} else {
|
|
179
|
+
set.delete(key);
|
|
180
|
+
}
|
|
181
|
+
setWrappedColumnKeys(Array.from(set));
|
|
182
|
+
}, [wrappedColumnKeys]);
|
|
183
|
+
|
|
184
|
+
// TODO: further refactoring in EDM-9573
|
|
185
|
+
// https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6798258
|
|
186
|
+
var confluenceSearchTable = useMemo(function () {
|
|
187
|
+
return jsx(ContentContainer, {
|
|
188
|
+
withTableBorder: true
|
|
189
|
+
}, jsx(IssueLikeDataTableView, {
|
|
190
|
+
testId: "confluence-search-datasource-table",
|
|
191
|
+
status: status,
|
|
192
|
+
columns: columns,
|
|
193
|
+
items: responseItems,
|
|
194
|
+
hasNextPage: hasNextPage,
|
|
195
|
+
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
196
|
+
onNextPage: onNextPage,
|
|
197
|
+
onLoadDatasourceDetails: loadDatasourceDetails,
|
|
198
|
+
onVisibleColumnKeysChange: setVisibleColumnKeys,
|
|
199
|
+
parentContainerRenderInstanceId: modalRenderInstanceId,
|
|
200
|
+
extensionKey: extensionKey,
|
|
201
|
+
columnCustomSizes: columnCustomSizes,
|
|
202
|
+
onColumnResize: onColumnResize,
|
|
203
|
+
wrappedColumnKeys: wrappedColumnKeys,
|
|
204
|
+
onWrappedColumnChange: getBooleanFF('platform.linking-platform.datasource-word_wrap') ? onWrappedColumnChange : undefined
|
|
205
|
+
}));
|
|
206
|
+
}, [status, columns, responseItems, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, onNextPage, loadDatasourceDetails, setVisibleColumnKeys, modalRenderInstanceId, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
207
|
+
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
208
|
+
var hasConfluenceSearchParams = selectedConfluenceSite && searchString;
|
|
209
|
+
var selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
|
|
210
|
+
var confluenceSearchUrl = selectedConfluenceSiteUrl && searchString !== undefined && "".concat(selectedConfluenceSiteUrl, "/wiki/search/?text=").concat(encodeURI(searchString));
|
|
211
|
+
var renderModalContent = useCallback(function () {
|
|
212
|
+
if (status === 'rejected') {
|
|
213
|
+
return jsx(ModalLoadingError, null);
|
|
214
|
+
} else if (status === 'unauthorized') {
|
|
215
|
+
return jsx(AccessRequired, {
|
|
216
|
+
url: selectedConfluenceSiteUrl || urlBeingEdited
|
|
217
|
+
});
|
|
218
|
+
} else if (resolvedWithNoResults || status === 'forbidden') {
|
|
219
|
+
return jsx(NoResults, null);
|
|
220
|
+
} else if (status === 'empty' || !columns.length) {
|
|
221
|
+
// persist the empty state when making the initial /data request which contains the columns
|
|
222
|
+
if (hasConfluenceSearchParams !== undefined) {
|
|
223
|
+
return jsx(EmptyState, {
|
|
224
|
+
testId: "confluence-search-datasource-modal--empty-state"
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
return jsx(ContentContainer, null, jsx(InitialStateView, {
|
|
228
|
+
icon: jsx(ConfluenceSearchInitialStateSVG, null),
|
|
229
|
+
title: confluenceSearchModalMessages.initialViewSearchTitle,
|
|
230
|
+
description: confluenceSearchModalMessages.initialViewSearchDescription
|
|
231
|
+
}));
|
|
232
|
+
}
|
|
233
|
+
return confluenceSearchTable;
|
|
234
|
+
}, [columns.length, selectedConfluenceSiteUrl, confluenceSearchTable, resolvedWithNoResults, status, urlBeingEdited, hasConfluenceSearchParams]);
|
|
235
|
+
var shouldShowResultsCount = !!totalCount && totalCount !== 1;
|
|
236
|
+
var onInsertPressed = useCallback(function () {
|
|
237
|
+
// eslint-disable-next-line no-console
|
|
238
|
+
// TODO: Implement onInsert in EDM-9412
|
|
239
|
+
/**
|
|
240
|
+
* onInsert(
|
|
241
|
+
{
|
|
242
|
+
type: 'inlineCard',
|
|
243
|
+
attrs: {
|
|
244
|
+
url,
|
|
245
|
+
},
|
|
246
|
+
} as InlineCardAdf,
|
|
247
|
+
consumerEvent,
|
|
248
|
+
);
|
|
249
|
+
*/
|
|
250
|
+
}, []);
|
|
251
|
+
var onSearch = useCallback(function (newSearchString) {
|
|
252
|
+
setSearchString(newSearchString);
|
|
253
|
+
reset({
|
|
254
|
+
shouldForceRequest: true
|
|
255
|
+
});
|
|
256
|
+
}, [reset]);
|
|
257
|
+
var isInsertDisabled = !isParametersSet || status === 'rejected' || status === 'unauthorized' || status === 'loading';
|
|
88
258
|
return jsx(IntlMessagesProvider, {
|
|
89
259
|
defaultMessages: i18nEN,
|
|
90
260
|
loaderFn: fetchMessagesForLocale
|
|
@@ -99,29 +269,40 @@ export var ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(pr
|
|
|
99
269
|
selectedSite: selectedConfluenceSite,
|
|
100
270
|
testId: "confluence-search-datasource-modal--site-selector",
|
|
101
271
|
label: siteSelectorLabel
|
|
102
|
-
}))), jsx(ModalBody, null, !hasNoConfluenceSites ? jsx(Fragment, null, jsx(
|
|
103
|
-
|
|
272
|
+
}))), jsx(ModalBody, null, !hasNoConfluenceSites ? jsx(Fragment, null, jsx(Box, {
|
|
273
|
+
xcss: inputContainerStyles
|
|
274
|
+
}, jsx(ConfluenceSearchContainer, {
|
|
275
|
+
cloudId: cloudId,
|
|
104
276
|
isSearching: status === 'loading',
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
placeholder: confluenceSearchModalMessages.searchLabel,
|
|
109
|
-
fullWidth: true
|
|
110
|
-
}), jsx(ContentContainer, null, jsx(InitialStateView, {
|
|
111
|
-
icon: jsx(ConfluenceSearchInitialStateSVG, null),
|
|
112
|
-
title: confluenceSearchModalMessages.initialViewSearchTitle,
|
|
113
|
-
description: confluenceSearchModalMessages.initialViewSearchDescription
|
|
114
|
-
}))) : jsx(NoInstancesView, {
|
|
277
|
+
onSearch: onSearch,
|
|
278
|
+
initialSearchValue: initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.searchString
|
|
279
|
+
})), renderModalContent()) : jsx(NoInstancesView, {
|
|
115
280
|
title: confluenceSearchModalMessages.noAccessToConfluenceSitesTitle,
|
|
116
281
|
description: confluenceSearchModalMessages.noAccessToConfluenceSitesDescription,
|
|
117
282
|
testId: 'no-confluence-instances-content'
|
|
118
|
-
})), jsx(ModalFooter, null, jsx(
|
|
283
|
+
})), jsx(ModalFooter, null, shouldShowResultsCount && confluenceSearchUrl && jsx(Box, {
|
|
284
|
+
testId: "confluence-search-datasource-modal-total-results-count",
|
|
285
|
+
xcss: searchCountStyles
|
|
286
|
+
}, jsx(LinkUrl, {
|
|
287
|
+
href: confluenceSearchUrl,
|
|
288
|
+
target: "_blank",
|
|
289
|
+
testId: "item-count-url",
|
|
290
|
+
style: {
|
|
291
|
+
color: "var(--ds-text-accent-gray, ".concat(N800, ")")
|
|
292
|
+
}
|
|
293
|
+
}, jsx(FormattedNumber, {
|
|
294
|
+
value: totalCount
|
|
295
|
+
}), ' ', jsx(FormattedMessage, _extends({}, confluenceSearchModalMessages.searchCountText, {
|
|
296
|
+
values: {
|
|
297
|
+
totalCount: totalCount
|
|
298
|
+
}
|
|
299
|
+
})))), jsx(Button, {
|
|
119
300
|
appearance: "default",
|
|
120
301
|
onClick: onCancel
|
|
121
302
|
}, jsx(FormattedMessage, confluenceSearchModalMessages.cancelButtonText)), !hasNoConfluenceSites && jsx(Button, {
|
|
122
303
|
appearance: "primary",
|
|
123
|
-
onClick:
|
|
124
|
-
isDisabled:
|
|
304
|
+
onClick: onInsertPressed,
|
|
305
|
+
isDisabled: isInsertDisabled,
|
|
125
306
|
testId: "confluence-search-datasource-modal--insert-button"
|
|
126
307
|
}, jsx(FormattedMessage, confluenceSearchModalMessages.insertResultsButtonText)))));
|
|
127
308
|
};
|
|
@@ -10,10 +10,10 @@ export var confluenceSearchModalMessages = defineMessages({
|
|
|
10
10
|
description: 'Button text to insert the displayed content',
|
|
11
11
|
defaultMessage: 'Insert results'
|
|
12
12
|
},
|
|
13
|
-
|
|
14
|
-
id: 'linkDataSource.confluence-search.configmodal.
|
|
15
|
-
description: '
|
|
16
|
-
defaultMessage: '
|
|
13
|
+
searchCountText: {
|
|
14
|
+
id: 'linkDataSource.confluence-search.configmodal.resultsCountText',
|
|
15
|
+
description: 'Text that appears after search count number.',
|
|
16
|
+
defaultMessage: '{totalCount, plural, one {result} other {results}}'
|
|
17
17
|
},
|
|
18
18
|
insertIssuesTitle: {
|
|
19
19
|
id: 'linkDataSource.confluence-search.configmodal.insertConfluenceTitle',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,11 +5,12 @@ var _excluded = ["children"];
|
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
7
|
import { components } from '@atlaskit/select';
|
|
8
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
8
9
|
import { columnPickerMessages } from './messages';
|
|
9
10
|
export var SELECT_ITEMS_MAXIMUM_THRESHOLD = 200;
|
|
10
11
|
var messageStyles = css({
|
|
11
12
|
color: "var(--ds-text-subtle, #44546F)",
|
|
12
|
-
font: "var(--ds-font-body-small,
|
|
13
|
+
font: "var(--ds-font-body-small, ".concat(fontFallback.body.small, ")"),
|
|
13
14
|
fontWeight: "var(--ds-font-weight-regular, 400)"
|
|
14
15
|
});
|
|
15
16
|
export var ConcatenatedMenuList = function ConcatenatedMenuList(_ref) {
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
5
|
import { N40 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
6
7
|
import { TableHeading } from './styled';
|
|
7
8
|
var maxWidth = '200px';
|
|
8
9
|
var firstLastChildOverride = "\n &:first-of-type, &:last-of-type {\n padding-left: ".concat("var(--ds-space-100, 8px)", ";\n padding-right: ", "var(--ds-space-100, 8px)", ";\n }\n");
|
|
@@ -27,7 +28,7 @@ var tableStyles = css({
|
|
|
27
28
|
background: "var(--ds-surface, #FFF)",
|
|
28
29
|
borderCollapse: 'separate',
|
|
29
30
|
borderSpacing: 0,
|
|
30
|
-
font: "var(--ds-font-body,
|
|
31
|
+
font: "var(--ds-font-body, ".concat(fontFallback.body.medium, ")"),
|
|
31
32
|
maxWidth: maxWidth
|
|
32
33
|
});
|
|
33
34
|
export var DragColumnPreview = function DragColumnPreview(_ref) {
|
|
@@ -20,6 +20,7 @@ import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-
|
|
|
20
20
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
21
21
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
22
22
|
import { N40 } from '@atlaskit/theme/colors';
|
|
23
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
23
24
|
import Tooltip from '@atlaskit/tooltip';
|
|
24
25
|
import { startUfoExperience, succeedUfoExperience } from '../../analytics/ufoExperiences';
|
|
25
26
|
import { stickyTableHeadersIndex } from '../../common/zindex';
|
|
@@ -190,7 +191,7 @@ var noDefaultBorderStyles = css({
|
|
|
190
191
|
borderBottom: 0
|
|
191
192
|
});
|
|
192
193
|
var headerStyles = css({
|
|
193
|
-
font: "var(--ds-font-body-UNSAFE_small,
|
|
194
|
+
font: "var(--ds-font-body-UNSAFE_small, ".concat(fontFallback.body.UNSAFE_small, ")"),
|
|
194
195
|
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
195
196
|
});
|
|
196
197
|
var headingHoverEffectStyles = css({
|
|
@@ -2,8 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
var _styled$th;
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { N40 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { fontFallback } from '@atlaskit/theme/typography';
|
|
5
6
|
export var ScrollableContainerHeight = 590;
|
|
6
|
-
export var fieldTextFontSize = "var(--ds-font-body,
|
|
7
|
+
export var fieldTextFontSize = "var(--ds-font-body, ".concat(fontFallback.body.medium, ")");
|
|
7
8
|
export var Table = styled.table({
|
|
8
9
|
width: '100%'
|
|
9
10
|
});
|
|
@@ -502,7 +502,15 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
502
502
|
var selectedJiraSiteUrl = selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url;
|
|
503
503
|
if (status === 'rejected' && jqlUrl) {
|
|
504
504
|
return jsx(ModalLoadingError, {
|
|
505
|
-
|
|
505
|
+
errorMessage: jqlUrl ? jsx(FormattedMessage, _extends({}, modalMessages.checkConnectionWithSource, {
|
|
506
|
+
values: {
|
|
507
|
+
a: function a(urlText) {
|
|
508
|
+
return jsx("a", {
|
|
509
|
+
href: jqlUrl
|
|
510
|
+
}, urlText);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
})) : undefined
|
|
506
514
|
});
|
|
507
515
|
} else if (status === 'unauthorized') {
|
|
508
516
|
return jsx(AccessRequired, {
|
|
@@ -115,5 +115,10 @@ export var modalMessages = defineMessages({
|
|
|
115
115
|
id: 'linkDataSource.jira-issues.no.jira.sites.access.description',
|
|
116
116
|
description: 'Description that shows in the modal when user has no access to any Jira sites',
|
|
117
117
|
defaultMessage: 'To request access, contact your admin.'
|
|
118
|
+
},
|
|
119
|
+
checkConnectionWithSource: {
|
|
120
|
+
id: 'linkDataSource.jira-issues.checkConnectionWithSource',
|
|
121
|
+
description: 'Instructions to let the user know how to resolve the error that occured, or click the link provided to open the query in Jira',
|
|
122
|
+
defaultMessage: 'Check your connection and refresh, or <a>open this query in Jira</a> to review.'
|
|
118
123
|
}
|
|
119
124
|
});
|
|
@@ -80,6 +80,7 @@ export var ModeSwitcher = function ModeSwitcher(props) {
|
|
|
80
80
|
tooltipText = _ref.tooltipText;
|
|
81
81
|
var isSelected = value === selectedOptionValue;
|
|
82
82
|
return jsx(Tooltip, {
|
|
83
|
+
key: value,
|
|
83
84
|
content: tooltipText
|
|
84
85
|
}, function (tooltipProps) {
|
|
85
86
|
return jsx("label", _extends({}, tooltipProps, {
|