@atlaskit/link-datasource 6.13.5 → 6.13.6
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 +9 -0
- package/dist/cjs/ui/common/error-state/loading-error.js +41 -16
- package/dist/cjs/ui/common/error-state/messages.js +18 -1
- package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +12 -2
- package/dist/es2019/ui/common/error-state/loading-error.js +37 -16
- package/dist/es2019/ui/common/error-state/messages.js +17 -0
- package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +12 -2
- package/dist/esm/ui/common/error-state/loading-error.js +43 -18
- package/dist/esm/ui/common/error-state/messages.js +17 -0
- package/dist/esm/ui/datasource-table-view/datasourceTableView.js +12 -2
- package/dist/types/ui/common/error-state/loading-error.d.ts +3 -1
- package/dist/types/ui/common/error-state/messages.d.ts +61 -56
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 6.13.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`808ffc3b50fc9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/808ffc3b50fc9) -
|
|
8
|
+
Show an error with column recovery instructions instead of indefinite loading when results have no
|
|
9
|
+
available columns, behind platform_datasource_missing_columns_error.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 6.13.5
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -12,14 +12,18 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
16
|
var _reactIntl = require("react-intl");
|
|
16
17
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
17
18
|
var _link = _interopRequireDefault(require("@atlaskit/link/link"));
|
|
19
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
18
20
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
21
|
var _analytics = require("../../../analytics");
|
|
20
22
|
var _search = require("../../../common/ui/spot/error-state/search");
|
|
21
23
|
var _messages = require("./messages");
|
|
22
24
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
25
|
+
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; }
|
|
26
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
23
27
|
var styles = {
|
|
24
28
|
errorContainerStyles: "_zulppxbi _4cvr1h6o _6a6z1h6o _195g1wug _18zroahv _1rjcoahv _1e0c11p5 _p12f1kdj _y3gn1h6o",
|
|
25
29
|
errorMessageContainerStyles: "_zulpu2gc _4cvr1h6o _6a6z1h6o _1e0c11p5",
|
|
@@ -33,20 +37,37 @@ var isJiraIssuesList = function isJiraIssuesList(url) {
|
|
|
33
37
|
};
|
|
34
38
|
var LoadingError = exports.LoadingError = function LoadingError(_ref) {
|
|
35
39
|
var onRefresh = _ref.onRefresh,
|
|
36
|
-
url = _ref.url
|
|
40
|
+
url = _ref.url,
|
|
41
|
+
_ref$errorType = _ref.errorType,
|
|
42
|
+
errorType = _ref$errorType === void 0 ? 'network' : _ref$errorType,
|
|
43
|
+
_ref$unavailableColum = _ref.unavailableColumnKeys,
|
|
44
|
+
unavailableColumnKeys = _ref$unavailableColum === void 0 ? [] : _ref$unavailableColum;
|
|
37
45
|
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
38
46
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
47
|
+
var effectiveErrorType = (0, _fg.fg)('platform_datasource_missing_columns_error') ? errorType : 'network';
|
|
39
48
|
(0, _react.useEffect)(function () {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
if (effectiveErrorType !== 'missing-columns') {
|
|
50
|
+
fireEvent('ui.error.shown', {
|
|
51
|
+
reason: 'network'
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}, [fireEvent, effectiveErrorType]);
|
|
55
|
+
var title = _messages.loadingErrorMessages.unableToLoadResults;
|
|
56
|
+
var description = _messages.loadingErrorMessages.checkConnection;
|
|
57
|
+
switch (effectiveErrorType) {
|
|
58
|
+
case 'missing-columns':
|
|
59
|
+
title = _messages.missingColumnsMessages.missingColumnsTitle;
|
|
60
|
+
description = unavailableColumnKeys.length ? _messages.missingColumnsMessages.missingColumnsDescriptionWithNames : _messages.missingColumnsMessages.missingColumnsDescription;
|
|
61
|
+
break;
|
|
62
|
+
case 'network':
|
|
63
|
+
default:
|
|
64
|
+
if (url && isConfluenceSearch(url)) {
|
|
65
|
+
description = _messages.loadingErrorMessages.checkConnectionConfluence;
|
|
66
|
+
}
|
|
67
|
+
if (url && isJiraIssuesList(url)) {
|
|
68
|
+
description = _messages.loadingErrorMessages.checkConnectionJira;
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
50
71
|
}
|
|
51
72
|
return /*#__PURE__*/React.createElement("div", {
|
|
52
73
|
contentEditable: false
|
|
@@ -61,18 +82,22 @@ var LoadingError = exports.LoadingError = function LoadingError(_ref) {
|
|
|
61
82
|
}, /*#__PURE__*/React.createElement(_compiled.Inline, {
|
|
62
83
|
as: "span",
|
|
63
84
|
xcss: styles.errorMessageStyles
|
|
64
|
-
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage,
|
|
85
|
+
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, title)), /*#__PURE__*/React.createElement(_compiled.Text, {
|
|
65
86
|
as: "p"
|
|
66
|
-
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({},
|
|
67
|
-
values: {
|
|
87
|
+
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, description, {
|
|
88
|
+
values: _objectSpread(_objectSpread({}, effectiveErrorType === 'missing-columns' ? {
|
|
89
|
+
columns: /*#__PURE__*/React.createElement(_reactIntl.FormattedList, {
|
|
90
|
+
value: unavailableColumnKeys
|
|
91
|
+
})
|
|
92
|
+
} : {}), {}, {
|
|
68
93
|
a: function a(chunks) {
|
|
69
94
|
return /*#__PURE__*/React.createElement(_link.default, {
|
|
70
95
|
href: url || '',
|
|
71
96
|
target: "blank"
|
|
72
97
|
}, chunks);
|
|
73
98
|
}
|
|
74
|
-
}
|
|
75
|
-
}))), onRefresh && /*#__PURE__*/React.createElement(_standardButton.default, {
|
|
99
|
+
})
|
|
100
|
+
}))), effectiveErrorType !== 'missing-columns' && onRefresh && /*#__PURE__*/React.createElement(_standardButton.default, {
|
|
76
101
|
appearance: "primary",
|
|
77
102
|
onClick: onRefresh
|
|
78
103
|
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _messages.loadingErrorMessages.refresh)))));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.loadingErrorMessages = void 0;
|
|
6
|
+
exports.missingColumnsMessages = exports.loadingErrorMessages = void 0;
|
|
7
7
|
var _reactIntl = require("react-intl");
|
|
8
8
|
var loadingErrorMessages = exports.loadingErrorMessages = (0, _reactIntl.defineMessages)({
|
|
9
9
|
accessInstructionsDuplicate: {
|
|
@@ -122,4 +122,21 @@ var loadingErrorMessages = exports.loadingErrorMessages = (0, _reactIntl.defineM
|
|
|
122
122
|
defaultMessage: 'Connect your {providerName} account to collaborate on work across Atlassian apps.',
|
|
123
123
|
description: 'Description text to be displayed in the auth screen UI.'
|
|
124
124
|
}
|
|
125
|
+
});
|
|
126
|
+
var missingColumnsMessages = exports.missingColumnsMessages = (0, _reactIntl.defineMessages)({
|
|
127
|
+
missingColumnsTitle: {
|
|
128
|
+
id: 'link-datasource.common.error-state.missingColumnsTitle',
|
|
129
|
+
description: 'Error title when results have loaded but no selected columns are available',
|
|
130
|
+
defaultMessage: "We can't display these columns"
|
|
131
|
+
},
|
|
132
|
+
missingColumnsDescription: {
|
|
133
|
+
id: 'link-datasource.common.error-state.missingColumnsDescription',
|
|
134
|
+
description: 'Instructions for recovering a table with no available selected columns',
|
|
135
|
+
defaultMessage: "The selected columns aren't available. Edit this table to select different columns."
|
|
136
|
+
},
|
|
137
|
+
missingColumnsDescriptionWithNames: {
|
|
138
|
+
id: 'link-datasource.common.error-state.missingColumnsDescriptionWithNames',
|
|
139
|
+
description: 'Instructions for recovering a table, with columns listing the unavailable saved column names or keys',
|
|
140
|
+
defaultMessage: "These columns aren't available: {columns}. Edit this table to select different columns."
|
|
141
|
+
}
|
|
125
142
|
});
|
|
@@ -209,16 +209,26 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
209
209
|
url: url
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
+
var loadingError;
|
|
212
213
|
if (status === 'rejected') {
|
|
213
|
-
|
|
214
|
+
loadingError = /*#__PURE__*/React.createElement(_loadingError.LoadingError, {
|
|
214
215
|
onRefresh: handleErrorRefresh,
|
|
215
216
|
url: url
|
|
216
217
|
});
|
|
218
|
+
if (!(0, _fg.fg)('platform_datasource_missing_columns_error')) {
|
|
219
|
+
return loadingError;
|
|
220
|
+
}
|
|
221
|
+
} else if ((0, _fg.fg)('platform_datasource_missing_columns_error') && status === 'resolved' && !hasColumns) {
|
|
222
|
+
loadingError = /*#__PURE__*/React.createElement(_loadingError.LoadingError, {
|
|
223
|
+
errorType: "missing-columns",
|
|
224
|
+
unavailableColumnKeys: visibleColumnKeys !== null && visibleColumnKeys !== void 0 && visibleColumnKeys.length ? visibleColumnKeys : defaultVisibleColumnKeys,
|
|
225
|
+
url: url
|
|
226
|
+
});
|
|
217
227
|
}
|
|
218
228
|
return /*#__PURE__*/React.createElement(_main.default, {
|
|
219
229
|
defaultMessages: _en.default,
|
|
220
230
|
loaderFn: _fetchMessagesForLocale.fetchMessagesForLocale
|
|
221
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
231
|
+
}, loadingError || /*#__PURE__*/React.createElement("div", {
|
|
222
232
|
className: (0, _runtime.ax)(["_2rko1kw7", "datasource-table"])
|
|
223
233
|
}, hasColumns ? /*#__PURE__*/React.createElement(_issueLikeDataTableView.IssueLikeDataTableView, (0, _extends2.default)({
|
|
224
234
|
testId: 'datasource-table-view',
|
|
@@ -4,13 +4,14 @@ import "./loading-error.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useEffect } from 'react';
|
|
7
|
-
import { FormattedMessage } from 'react-intl';
|
|
7
|
+
import { FormattedList, FormattedMessage } from 'react-intl';
|
|
8
8
|
import Button from '@atlaskit/button/standard-button';
|
|
9
9
|
import AKLink from '@atlaskit/link/link';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
11
|
import { Box, Inline, Text } from '@atlaskit/primitives/compiled';
|
|
11
12
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
12
13
|
import { SpotErrorSearch } from '../../../common/ui/spot/error-state/search';
|
|
13
|
-
import { loadingErrorMessages } from './messages';
|
|
14
|
+
import { loadingErrorMessages, missingColumnsMessages } from './messages';
|
|
14
15
|
const styles = {
|
|
15
16
|
errorContainerStyles: "_zulppxbi _4cvr1h6o _6a6z1h6o _195g1wug _18zroahv _1rjcoahv _1e0c11p5 _p12f1kdj _y3gn1h6o",
|
|
16
17
|
errorMessageContainerStyles: "_zulpu2gc _4cvr1h6o _6a6z1h6o _1e0c11p5",
|
|
@@ -20,22 +21,37 @@ const isConfluenceSearch = url => !!url.match(/https:\/\/.*\/wiki\/search/);
|
|
|
20
21
|
const isJiraIssuesList = url => !!url.match(/https:\/\/.*\/issues\/?\?jql=/);
|
|
21
22
|
export const LoadingError = ({
|
|
22
23
|
onRefresh,
|
|
23
|
-
url
|
|
24
|
+
url,
|
|
25
|
+
errorType = 'network',
|
|
26
|
+
unavailableColumnKeys = []
|
|
24
27
|
}) => {
|
|
25
28
|
const {
|
|
26
29
|
fireEvent
|
|
27
30
|
} = useDatasourceAnalyticsEvents();
|
|
31
|
+
const effectiveErrorType = fg('platform_datasource_missing_columns_error') ? errorType : 'network';
|
|
28
32
|
useEffect(() => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
if (effectiveErrorType !== 'missing-columns') {
|
|
34
|
+
fireEvent('ui.error.shown', {
|
|
35
|
+
reason: 'network'
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, [fireEvent, effectiveErrorType]);
|
|
39
|
+
let title = loadingErrorMessages.unableToLoadResults;
|
|
40
|
+
let description = loadingErrorMessages.checkConnection;
|
|
41
|
+
switch (effectiveErrorType) {
|
|
42
|
+
case 'missing-columns':
|
|
43
|
+
title = missingColumnsMessages.missingColumnsTitle;
|
|
44
|
+
description = unavailableColumnKeys.length ? missingColumnsMessages.missingColumnsDescriptionWithNames : missingColumnsMessages.missingColumnsDescription;
|
|
45
|
+
break;
|
|
46
|
+
case 'network':
|
|
47
|
+
default:
|
|
48
|
+
if (url && isConfluenceSearch(url)) {
|
|
49
|
+
description = loadingErrorMessages.checkConnectionConfluence;
|
|
50
|
+
}
|
|
51
|
+
if (url && isJiraIssuesList(url)) {
|
|
52
|
+
description = loadingErrorMessages.checkConnectionJira;
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
39
55
|
}
|
|
40
56
|
return /*#__PURE__*/React.createElement("div", {
|
|
41
57
|
contentEditable: false
|
|
@@ -50,16 +66,21 @@ export const LoadingError = ({
|
|
|
50
66
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
51
67
|
as: "span",
|
|
52
68
|
xcss: styles.errorMessageStyles
|
|
53
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage,
|
|
69
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, title)), /*#__PURE__*/React.createElement(Text, {
|
|
54
70
|
as: "p"
|
|
55
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({},
|
|
71
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, description, {
|
|
56
72
|
values: {
|
|
73
|
+
...(effectiveErrorType === 'missing-columns' ? {
|
|
74
|
+
columns: /*#__PURE__*/React.createElement(FormattedList, {
|
|
75
|
+
value: unavailableColumnKeys
|
|
76
|
+
})
|
|
77
|
+
} : {}),
|
|
57
78
|
a: chunks => /*#__PURE__*/React.createElement(AKLink, {
|
|
58
79
|
href: url || '',
|
|
59
80
|
target: "blank"
|
|
60
81
|
}, chunks)
|
|
61
82
|
}
|
|
62
|
-
}))), onRefresh && /*#__PURE__*/React.createElement(Button, {
|
|
83
|
+
}))), effectiveErrorType !== 'missing-columns' && onRefresh && /*#__PURE__*/React.createElement(Button, {
|
|
63
84
|
appearance: "primary",
|
|
64
85
|
onClick: onRefresh
|
|
65
86
|
}, /*#__PURE__*/React.createElement(FormattedMessage, loadingErrorMessages.refresh)))));
|
|
@@ -116,4 +116,21 @@ export const loadingErrorMessages = defineMessages({
|
|
|
116
116
|
defaultMessage: 'Connect your {providerName} account to collaborate on work across Atlassian apps.',
|
|
117
117
|
description: 'Description text to be displayed in the auth screen UI.'
|
|
118
118
|
}
|
|
119
|
+
});
|
|
120
|
+
export const missingColumnsMessages = defineMessages({
|
|
121
|
+
missingColumnsTitle: {
|
|
122
|
+
id: 'link-datasource.common.error-state.missingColumnsTitle',
|
|
123
|
+
description: 'Error title when results have loaded but no selected columns are available',
|
|
124
|
+
defaultMessage: "We can't display these columns"
|
|
125
|
+
},
|
|
126
|
+
missingColumnsDescription: {
|
|
127
|
+
id: 'link-datasource.common.error-state.missingColumnsDescription',
|
|
128
|
+
description: 'Instructions for recovering a table with no available selected columns',
|
|
129
|
+
defaultMessage: "The selected columns aren't available. Edit this table to select different columns."
|
|
130
|
+
},
|
|
131
|
+
missingColumnsDescriptionWithNames: {
|
|
132
|
+
id: 'link-datasource.common.error-state.missingColumnsDescriptionWithNames',
|
|
133
|
+
description: 'Instructions for recovering a table, with columns listing the unavailable saved column names or keys',
|
|
134
|
+
defaultMessage: "These columns aren't available: {columns}. Edit this table to select different columns."
|
|
135
|
+
}
|
|
119
136
|
});
|
|
@@ -194,16 +194,26 @@ const DatasourceTableViewWithoutAnalytics = ({
|
|
|
194
194
|
url: url
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
+
let loadingError;
|
|
197
198
|
if (status === 'rejected') {
|
|
198
|
-
|
|
199
|
+
loadingError = /*#__PURE__*/React.createElement(LoadingError, {
|
|
199
200
|
onRefresh: handleErrorRefresh,
|
|
200
201
|
url: url
|
|
201
202
|
});
|
|
203
|
+
if (!fg('platform_datasource_missing_columns_error')) {
|
|
204
|
+
return loadingError;
|
|
205
|
+
}
|
|
206
|
+
} else if (fg('platform_datasource_missing_columns_error') && status === 'resolved' && !hasColumns) {
|
|
207
|
+
loadingError = /*#__PURE__*/React.createElement(LoadingError, {
|
|
208
|
+
errorType: "missing-columns",
|
|
209
|
+
unavailableColumnKeys: visibleColumnKeys !== null && visibleColumnKeys !== void 0 && visibleColumnKeys.length ? visibleColumnKeys : defaultVisibleColumnKeys,
|
|
210
|
+
url: url
|
|
211
|
+
});
|
|
202
212
|
}
|
|
203
213
|
return /*#__PURE__*/React.createElement(IntlMessagesProvider, {
|
|
204
214
|
defaultMessages: i18nEN,
|
|
205
215
|
loaderFn: fetchMessagesForLocale
|
|
206
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
216
|
+
}, loadingError || /*#__PURE__*/React.createElement("div", {
|
|
207
217
|
className: ax(["_2rko1kw7", "datasource-table"])
|
|
208
218
|
}, hasColumns ? /*#__PURE__*/React.createElement(IssueLikeDataTableView, _extends({
|
|
209
219
|
testId: 'datasource-table-view',
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
/* loading-error.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
4
|
import "./loading-error.compiled.css";
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
6
9
|
import { useEffect } from 'react';
|
|
7
|
-
import { FormattedMessage } from 'react-intl';
|
|
10
|
+
import { FormattedList, FormattedMessage } from 'react-intl';
|
|
8
11
|
import Button from '@atlaskit/button/standard-button';
|
|
9
12
|
import AKLink from '@atlaskit/link/link';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
14
|
import { Box, Inline, Text } from '@atlaskit/primitives/compiled';
|
|
11
15
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
12
16
|
import { SpotErrorSearch } from '../../../common/ui/spot/error-state/search';
|
|
13
|
-
import { loadingErrorMessages } from './messages';
|
|
17
|
+
import { loadingErrorMessages, missingColumnsMessages } from './messages';
|
|
14
18
|
var styles = {
|
|
15
19
|
errorContainerStyles: "_zulppxbi _4cvr1h6o _6a6z1h6o _195g1wug _18zroahv _1rjcoahv _1e0c11p5 _p12f1kdj _y3gn1h6o",
|
|
16
20
|
errorMessageContainerStyles: "_zulpu2gc _4cvr1h6o _6a6z1h6o _1e0c11p5",
|
|
@@ -24,20 +28,37 @@ var isJiraIssuesList = function isJiraIssuesList(url) {
|
|
|
24
28
|
};
|
|
25
29
|
export var LoadingError = function LoadingError(_ref) {
|
|
26
30
|
var onRefresh = _ref.onRefresh,
|
|
27
|
-
url = _ref.url
|
|
31
|
+
url = _ref.url,
|
|
32
|
+
_ref$errorType = _ref.errorType,
|
|
33
|
+
errorType = _ref$errorType === void 0 ? 'network' : _ref$errorType,
|
|
34
|
+
_ref$unavailableColum = _ref.unavailableColumnKeys,
|
|
35
|
+
unavailableColumnKeys = _ref$unavailableColum === void 0 ? [] : _ref$unavailableColum;
|
|
28
36
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
29
37
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
38
|
+
var effectiveErrorType = fg('platform_datasource_missing_columns_error') ? errorType : 'network';
|
|
30
39
|
useEffect(function () {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
if (effectiveErrorType !== 'missing-columns') {
|
|
41
|
+
fireEvent('ui.error.shown', {
|
|
42
|
+
reason: 'network'
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}, [fireEvent, effectiveErrorType]);
|
|
46
|
+
var title = loadingErrorMessages.unableToLoadResults;
|
|
47
|
+
var description = loadingErrorMessages.checkConnection;
|
|
48
|
+
switch (effectiveErrorType) {
|
|
49
|
+
case 'missing-columns':
|
|
50
|
+
title = missingColumnsMessages.missingColumnsTitle;
|
|
51
|
+
description = unavailableColumnKeys.length ? missingColumnsMessages.missingColumnsDescriptionWithNames : missingColumnsMessages.missingColumnsDescription;
|
|
52
|
+
break;
|
|
53
|
+
case 'network':
|
|
54
|
+
default:
|
|
55
|
+
if (url && isConfluenceSearch(url)) {
|
|
56
|
+
description = loadingErrorMessages.checkConnectionConfluence;
|
|
57
|
+
}
|
|
58
|
+
if (url && isJiraIssuesList(url)) {
|
|
59
|
+
description = loadingErrorMessages.checkConnectionJira;
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
41
62
|
}
|
|
42
63
|
return /*#__PURE__*/React.createElement("div", {
|
|
43
64
|
contentEditable: false
|
|
@@ -52,18 +73,22 @@ export var LoadingError = function LoadingError(_ref) {
|
|
|
52
73
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
53
74
|
as: "span",
|
|
54
75
|
xcss: styles.errorMessageStyles
|
|
55
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage,
|
|
76
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, title)), /*#__PURE__*/React.createElement(Text, {
|
|
56
77
|
as: "p"
|
|
57
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({},
|
|
58
|
-
values: {
|
|
78
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, description, {
|
|
79
|
+
values: _objectSpread(_objectSpread({}, effectiveErrorType === 'missing-columns' ? {
|
|
80
|
+
columns: /*#__PURE__*/React.createElement(FormattedList, {
|
|
81
|
+
value: unavailableColumnKeys
|
|
82
|
+
})
|
|
83
|
+
} : {}), {}, {
|
|
59
84
|
a: function a(chunks) {
|
|
60
85
|
return /*#__PURE__*/React.createElement(AKLink, {
|
|
61
86
|
href: url || '',
|
|
62
87
|
target: "blank"
|
|
63
88
|
}, chunks);
|
|
64
89
|
}
|
|
65
|
-
}
|
|
66
|
-
}))), onRefresh && /*#__PURE__*/React.createElement(Button, {
|
|
90
|
+
})
|
|
91
|
+
}))), effectiveErrorType !== 'missing-columns' && onRefresh && /*#__PURE__*/React.createElement(Button, {
|
|
67
92
|
appearance: "primary",
|
|
68
93
|
onClick: onRefresh
|
|
69
94
|
}, /*#__PURE__*/React.createElement(FormattedMessage, loadingErrorMessages.refresh)))));
|
|
@@ -116,4 +116,21 @@ export var loadingErrorMessages = defineMessages({
|
|
|
116
116
|
defaultMessage: 'Connect your {providerName} account to collaborate on work across Atlassian apps.',
|
|
117
117
|
description: 'Description text to be displayed in the auth screen UI.'
|
|
118
118
|
}
|
|
119
|
+
});
|
|
120
|
+
export var missingColumnsMessages = defineMessages({
|
|
121
|
+
missingColumnsTitle: {
|
|
122
|
+
id: 'link-datasource.common.error-state.missingColumnsTitle',
|
|
123
|
+
description: 'Error title when results have loaded but no selected columns are available',
|
|
124
|
+
defaultMessage: "We can't display these columns"
|
|
125
|
+
},
|
|
126
|
+
missingColumnsDescription: {
|
|
127
|
+
id: 'link-datasource.common.error-state.missingColumnsDescription',
|
|
128
|
+
description: 'Instructions for recovering a table with no available selected columns',
|
|
129
|
+
defaultMessage: "The selected columns aren't available. Edit this table to select different columns."
|
|
130
|
+
},
|
|
131
|
+
missingColumnsDescriptionWithNames: {
|
|
132
|
+
id: 'link-datasource.common.error-state.missingColumnsDescriptionWithNames',
|
|
133
|
+
description: 'Instructions for recovering a table, with columns listing the unavailable saved column names or keys',
|
|
134
|
+
defaultMessage: "These columns aren't available: {columns}. Edit this table to select different columns."
|
|
135
|
+
}
|
|
119
136
|
});
|
|
@@ -200,16 +200,26 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
200
200
|
url: url
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
+
var loadingError;
|
|
203
204
|
if (status === 'rejected') {
|
|
204
|
-
|
|
205
|
+
loadingError = /*#__PURE__*/React.createElement(LoadingError, {
|
|
205
206
|
onRefresh: handleErrorRefresh,
|
|
206
207
|
url: url
|
|
207
208
|
});
|
|
209
|
+
if (!fg('platform_datasource_missing_columns_error')) {
|
|
210
|
+
return loadingError;
|
|
211
|
+
}
|
|
212
|
+
} else if (fg('platform_datasource_missing_columns_error') && status === 'resolved' && !hasColumns) {
|
|
213
|
+
loadingError = /*#__PURE__*/React.createElement(LoadingError, {
|
|
214
|
+
errorType: "missing-columns",
|
|
215
|
+
unavailableColumnKeys: visibleColumnKeys !== null && visibleColumnKeys !== void 0 && visibleColumnKeys.length ? visibleColumnKeys : defaultVisibleColumnKeys,
|
|
216
|
+
url: url
|
|
217
|
+
});
|
|
208
218
|
}
|
|
209
219
|
return /*#__PURE__*/React.createElement(IntlMessagesProvider, {
|
|
210
220
|
defaultMessages: i18nEN,
|
|
211
221
|
loaderFn: fetchMessagesForLocale
|
|
212
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
222
|
+
}, loadingError || /*#__PURE__*/React.createElement("div", {
|
|
213
223
|
className: ax(["_2rko1kw7", "datasource-table"])
|
|
214
224
|
}, hasColumns ? /*#__PURE__*/React.createElement(IssueLikeDataTableView, _extends({
|
|
215
225
|
testId: 'datasource-table-view',
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
interface LoadingErrorProps {
|
|
2
|
+
errorType?: 'network' | 'missing-columns';
|
|
2
3
|
onRefresh?: () => void;
|
|
4
|
+
unavailableColumnKeys?: string[];
|
|
3
5
|
url?: string;
|
|
4
6
|
}
|
|
5
|
-
export declare const LoadingError: ({ onRefresh, url }: LoadingErrorProps) => JSX.Element;
|
|
7
|
+
export declare const LoadingError: ({ onRefresh, url, errorType, unavailableColumnKeys, }: LoadingErrorProps) => JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -1,112 +1,117 @@
|
|
|
1
1
|
export declare const loadingErrorMessages: {
|
|
2
|
-
accessInstructionsDuplicate: {
|
|
3
|
-
id: string;
|
|
4
|
-
description: string;
|
|
5
|
-
defaultMessage: string;
|
|
6
|
-
};
|
|
7
2
|
accessInstructions: {
|
|
8
|
-
id: string;
|
|
9
|
-
description: string;
|
|
10
3
|
defaultMessage: string;
|
|
11
|
-
};
|
|
12
|
-
accessRequiredDuplicate: {
|
|
13
|
-
id: string;
|
|
14
4
|
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
accessInstructionsDuplicate: {
|
|
15
8
|
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
16
11
|
};
|
|
17
12
|
accessRequired: {
|
|
18
|
-
|
|
13
|
+
defaultMessage: string;
|
|
19
14
|
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
accessRequiredDuplicate: {
|
|
20
18
|
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
21
|
};
|
|
22
22
|
accessRequiredWithSite: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
23
25
|
id: string;
|
|
26
|
+
};
|
|
27
|
+
authConnectButtonText: {
|
|
28
|
+
defaultMessage: string;
|
|
24
29
|
description: string;
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
authScreenDescriptionText: {
|
|
25
33
|
defaultMessage: string;
|
|
34
|
+
description: string;
|
|
35
|
+
id: string;
|
|
26
36
|
};
|
|
27
|
-
|
|
37
|
+
authScreenDescriptionTextAppify: {
|
|
38
|
+
defaultMessage: string;
|
|
39
|
+
description: string;
|
|
28
40
|
id: string;
|
|
41
|
+
};
|
|
42
|
+
authScreenHeaderText: {
|
|
43
|
+
defaultMessage: string;
|
|
29
44
|
description: string;
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
checkConnection: {
|
|
30
48
|
defaultMessage: string;
|
|
49
|
+
description: string;
|
|
50
|
+
id: string;
|
|
31
51
|
};
|
|
32
52
|
checkConnectionConfluence: {
|
|
33
|
-
|
|
53
|
+
defaultMessage: string;
|
|
34
54
|
description: string;
|
|
55
|
+
id: string;
|
|
56
|
+
};
|
|
57
|
+
checkConnectionDuplicate: {
|
|
35
58
|
defaultMessage: string;
|
|
59
|
+
description: string;
|
|
60
|
+
id: string;
|
|
36
61
|
};
|
|
37
62
|
checkConnectionJira: {
|
|
38
|
-
id: string;
|
|
39
|
-
description: string;
|
|
40
63
|
defaultMessage: string;
|
|
41
|
-
};
|
|
42
|
-
checkConnection: {
|
|
43
|
-
id: string;
|
|
44
64
|
description: string;
|
|
45
|
-
defaultMessage: string;
|
|
46
|
-
};
|
|
47
|
-
noResultsFound: {
|
|
48
65
|
id: string;
|
|
49
|
-
description: string;
|
|
50
|
-
defaultMessage: string;
|
|
51
66
|
};
|
|
52
|
-
|
|
53
|
-
id: string;
|
|
54
|
-
description: string;
|
|
67
|
+
learnMoreAboutSmartLinks: {
|
|
55
68
|
defaultMessage: string;
|
|
56
|
-
};
|
|
57
|
-
refreshDuplicate: {
|
|
58
|
-
id: string;
|
|
59
69
|
description: string;
|
|
60
|
-
defaultMessage: string;
|
|
61
|
-
};
|
|
62
|
-
refresh: {
|
|
63
70
|
id: string;
|
|
64
|
-
description: string;
|
|
65
|
-
defaultMessage: string;
|
|
66
71
|
};
|
|
67
|
-
|
|
68
|
-
id: string;
|
|
69
|
-
description: string;
|
|
72
|
+
noAccessToJiraSitesDescription: {
|
|
70
73
|
defaultMessage: string;
|
|
71
|
-
};
|
|
72
|
-
unableToLoadResults: {
|
|
73
|
-
id: string;
|
|
74
74
|
description: string;
|
|
75
|
-
|
|
75
|
+
id: string;
|
|
76
76
|
};
|
|
77
77
|
noAccessToJiraSitesTitle: {
|
|
78
|
-
id: string;
|
|
79
|
-
description: string;
|
|
80
78
|
defaultMessage: string;
|
|
81
|
-
};
|
|
82
|
-
noAccessToJiraSitesDescription: {
|
|
83
|
-
id: string;
|
|
84
79
|
description: string;
|
|
85
|
-
defaultMessage: string;
|
|
86
|
-
};
|
|
87
|
-
authScreenHeaderText: {
|
|
88
80
|
id: string;
|
|
81
|
+
};
|
|
82
|
+
noResultsFound: {
|
|
89
83
|
defaultMessage: string;
|
|
90
84
|
description: string;
|
|
91
|
-
};
|
|
92
|
-
authScreenDescriptionText: {
|
|
93
85
|
id: string;
|
|
86
|
+
};
|
|
87
|
+
noResultsFoundDescription: {
|
|
94
88
|
defaultMessage: string;
|
|
95
89
|
description: string;
|
|
96
|
-
};
|
|
97
|
-
learnMoreAboutSmartLinks: {
|
|
98
90
|
id: string;
|
|
91
|
+
};
|
|
92
|
+
refresh: {
|
|
99
93
|
defaultMessage: string;
|
|
100
94
|
description: string;
|
|
101
|
-
};
|
|
102
|
-
authConnectButtonText: {
|
|
103
95
|
id: string;
|
|
96
|
+
};
|
|
97
|
+
refreshDuplicate: {
|
|
104
98
|
defaultMessage: string;
|
|
105
99
|
description: string;
|
|
100
|
+
id: string;
|
|
106
101
|
};
|
|
107
|
-
|
|
102
|
+
unableToLoadItemsDuplicate: {
|
|
103
|
+
defaultMessage: string;
|
|
104
|
+
description: string;
|
|
108
105
|
id: string;
|
|
106
|
+
};
|
|
107
|
+
unableToLoadResults: {
|
|
109
108
|
defaultMessage: string;
|
|
110
109
|
description: string;
|
|
110
|
+
id: string;
|
|
111
111
|
};
|
|
112
112
|
};
|
|
113
|
+
export declare const missingColumnsMessages: Record<'missingColumnsDescription' | 'missingColumnsDescriptionWithNames' | 'missingColumnsTitle', {
|
|
114
|
+
defaultMessage: string;
|
|
115
|
+
description: string;
|
|
116
|
+
id: string;
|
|
117
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "6.13.
|
|
3
|
+
"version": "6.13.6",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -146,6 +146,9 @@
|
|
|
146
146
|
"platform_datasource_sync_info_boundary_updates": {
|
|
147
147
|
"type": "boolean"
|
|
148
148
|
},
|
|
149
|
+
"platform_datasource_missing_columns_error": {
|
|
150
|
+
"type": "boolean"
|
|
151
|
+
},
|
|
149
152
|
"platform_navx_3298_message_wrapper": {
|
|
150
153
|
"type": "boolean"
|
|
151
154
|
},
|