@atlaskit/link-datasource 3.13.16 → 3.13.18
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 +21 -0
- package/dist/cjs/hooks/useLoadOptions.js +20 -9
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +8 -27
- package/dist/cjs/ui/issue-like-table/edit-type/icon/index.js +4 -1
- package/dist/cjs/ui/issue-like-table/edit-type/index.js +9 -4
- package/dist/cjs/ui/issue-like-table/edit-type/status/index.js +7 -1
- package/dist/cjs/ui/issue-like-table/edit-type/text/index.js +3 -1
- package/dist/cjs/ui/issue-like-table/edit-type/user/index.js +7 -1
- package/dist/cjs/ui/issue-like-table/index.js +6 -2
- package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +5 -0
- package/dist/cjs/ui/issue-like-table/table-cell-content/inline-edit.js +31 -2
- package/dist/cjs/ui/issue-like-table/table-cell-content/messages.js +14 -0
- package/dist/cjs/ui/issue-like-table/utils.js +21 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +1 -18
- package/dist/es2019/hooks/useLoadOptions.js +15 -4
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +12 -35
- package/dist/es2019/ui/issue-like-table/edit-type/icon/index.js +4 -1
- package/dist/es2019/ui/issue-like-table/edit-type/index.js +9 -4
- package/dist/es2019/ui/issue-like-table/edit-type/status/index.js +5 -1
- package/dist/es2019/ui/issue-like-table/edit-type/text/index.js +3 -1
- package/dist/es2019/ui/issue-like-table/edit-type/user/index.js +5 -1
- package/dist/es2019/ui/issue-like-table/index.js +7 -3
- package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +5 -0
- package/dist/es2019/ui/issue-like-table/table-cell-content/inline-edit.js +33 -3
- package/dist/es2019/ui/issue-like-table/table-cell-content/messages.js +8 -0
- package/dist/es2019/ui/issue-like-table/utils.js +18 -1
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +4 -25
- package/dist/esm/hooks/useLoadOptions.js +21 -10
- package/dist/esm/ui/confluence-search-modal/modal/index.js +9 -28
- package/dist/esm/ui/issue-like-table/edit-type/icon/index.js +4 -1
- package/dist/esm/ui/issue-like-table/edit-type/index.js +9 -4
- package/dist/esm/ui/issue-like-table/edit-type/status/index.js +7 -1
- package/dist/esm/ui/issue-like-table/edit-type/text/index.js +3 -1
- package/dist/esm/ui/issue-like-table/edit-type/user/index.js +7 -1
- package/dist/esm/ui/issue-like-table/index.js +7 -3
- package/dist/esm/ui/issue-like-table/table-cell-content/index.js +5 -0
- package/dist/esm/ui/issue-like-table/table-cell-content/inline-edit.js +32 -3
- package/dist/esm/ui/issue-like-table/table-cell-content/messages.js +8 -0
- package/dist/esm/ui/issue-like-table/utils.js +19 -0
- package/dist/esm/ui/jira-issues-modal/modal/index.js +4 -21
- package/dist/types/ui/issue-like-table/edit-type/icon/index.d.ts +1 -0
- package/dist/types/ui/issue-like-table/edit-type/index.d.ts +2 -1
- package/dist/types/ui/issue-like-table/edit-type/status/index.d.ts +1 -0
- package/dist/types/ui/issue-like-table/edit-type/text/index.d.ts +1 -0
- package/dist/types/ui/issue-like-table/edit-type/user/index.d.ts +1 -0
- package/dist/types/ui/issue-like-table/table-cell-content/index.d.ts +2 -1
- package/dist/types/ui/issue-like-table/table-cell-content/inline-edit.d.ts +2 -1
- package/dist/types/ui/issue-like-table/table-cell-content/messages.d.ts +7 -0
- package/dist/types/ui/issue-like-table/utils.d.ts +20 -0
- package/dist/types-ts4.5/ui/issue-like-table/edit-type/icon/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/issue-like-table/edit-type/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/issue-like-table/edit-type/status/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/issue-like-table/edit-type/text/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/issue-like-table/edit-type/user/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/issue-like-table/table-cell-content/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/issue-like-table/table-cell-content/inline-edit.d.ts +2 -1
- package/dist/types-ts4.5/ui/issue-like-table/table-cell-content/messages.d.ts +7 -0
- package/dist/types-ts4.5/ui/issue-like-table/utils.d.ts +20 -0
- package/package.json +3 -6
- package/dist/cjs/ui/confluence-search-modal/modal/ModalOld.js +0 -455
- package/dist/cjs/ui/jira-issues-modal/modal/ModalOld.js +0 -493
- package/dist/es2019/ui/confluence-search-modal/modal/ModalOld.js +0 -430
- package/dist/es2019/ui/jira-issues-modal/modal/ModalOld.js +0 -476
- package/dist/esm/ui/confluence-search-modal/modal/ModalOld.js +0 -451
- package/dist/esm/ui/jira-issues-modal/modal/ModalOld.js +0 -490
- package/dist/types/ui/confluence-search-modal/modal/ModalOld.d.ts +0 -3
- package/dist/types/ui/jira-issues-modal/modal/ModalOld.d.ts +0 -3
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/ModalOld.d.ts +0 -3
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/ModalOld.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 3.13.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#172124](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/172124)
|
|
8
|
+
[`e1ccef8760b47`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e1ccef8760b47) -
|
|
9
|
+
Add labels to inline editable fields to improve accessibility
|
|
10
|
+
- [#168855](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/168855)
|
|
11
|
+
[`eb71b8f29a212`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/eb71b8f29a212) -
|
|
12
|
+
Refactor behind ff - Fixes loading state not showing on user typeahead search
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 3.13.17
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#174013](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/174013)
|
|
20
|
+
[`39cb9b152b1bc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/39cb9b152b1bc) -
|
|
21
|
+
Removes feature flag platform-datasources-use-refactored-config-modal which removes the old
|
|
22
|
+
implementation of the Jira and Confluence SLLV modals, and now uses a refactored implementation.
|
|
23
|
+
|
|
3
24
|
## 3.13.16
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -8,10 +8,13 @@ exports.useLoadOptions = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
13
|
var _react = require("react");
|
|
13
14
|
var _linkingTypes = require("@atlaskit/linking-types");
|
|
14
15
|
var _useDatasourceTableFlag = require("./useDatasourceTableFlag");
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
15
18
|
var loadOptions = /*#__PURE__*/function () {
|
|
16
19
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
17
20
|
var fetchInputs,
|
|
@@ -53,30 +56,38 @@ var loadOptions = /*#__PURE__*/function () {
|
|
|
53
56
|
return _ref.apply(this, arguments);
|
|
54
57
|
};
|
|
55
58
|
}();
|
|
59
|
+
var reducer = function reducer(state, payload) {
|
|
60
|
+
return _objectSpread(_objectSpread({}, state), payload);
|
|
61
|
+
};
|
|
56
62
|
var useLoadOptions = exports.useLoadOptions = function useLoadOptions(_ref2) {
|
|
57
63
|
var fetchInputs = _ref2.fetchInputs,
|
|
58
64
|
executeFetch = _ref2.executeFetch,
|
|
59
65
|
emptyOption = _ref2.emptyOption;
|
|
60
|
-
var
|
|
66
|
+
var _useReducer = (0, _react.useReducer)(reducer, {
|
|
61
67
|
isLoading: true,
|
|
62
68
|
options: [],
|
|
63
69
|
hasFailed: false
|
|
64
70
|
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
options =
|
|
68
|
-
isLoading =
|
|
69
|
-
hasFailed =
|
|
70
|
-
|
|
71
|
+
_useReducer2 = (0, _slicedToArray2.default)(_useReducer, 2),
|
|
72
|
+
_useReducer2$ = _useReducer2[0],
|
|
73
|
+
options = _useReducer2$.options,
|
|
74
|
+
isLoading = _useReducer2$.isLoading,
|
|
75
|
+
hasFailed = _useReducer2$.hasFailed,
|
|
76
|
+
dispatch = _useReducer2[1];
|
|
71
77
|
var _useDatasourceTableFl = (0, _useDatasourceTableFlag.useDatasourceTableFlag)({
|
|
72
78
|
isFetchAction: true
|
|
73
79
|
}),
|
|
74
80
|
showErrorFlag = _useDatasourceTableFl.showErrorFlag;
|
|
75
81
|
(0, _react.useEffect)(function () {
|
|
76
82
|
var isMounted = true;
|
|
83
|
+
// Set the loading state before sending the request
|
|
84
|
+
dispatch({
|
|
85
|
+
isLoading: true
|
|
86
|
+
});
|
|
87
|
+
// Query the options
|
|
77
88
|
loadOptions(fetchInputs, executeFetch).then(function (options) {
|
|
78
89
|
if (isMounted) {
|
|
79
|
-
|
|
90
|
+
dispatch({
|
|
80
91
|
isLoading: false,
|
|
81
92
|
options: emptyOption ? [emptyOption].concat((0, _toConsumableArray2.default)(options)) : options,
|
|
82
93
|
hasFailed: false
|
|
@@ -84,7 +95,7 @@ var useLoadOptions = exports.useLoadOptions = function useLoadOptions(_ref2) {
|
|
|
84
95
|
}
|
|
85
96
|
}).catch(function (err) {
|
|
86
97
|
showErrorFlag();
|
|
87
|
-
|
|
98
|
+
dispatch({
|
|
88
99
|
isLoading: false,
|
|
89
100
|
options: [],
|
|
90
101
|
hasFailed: true
|
|
@@ -10,16 +10,12 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _reactIntlNext = require("react-intl-next");
|
|
13
|
-
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
14
13
|
var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
|
|
15
14
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
16
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
15
|
var _primitives = require("@atlaskit/primitives");
|
|
18
16
|
var _analytics = require("../../../analytics");
|
|
19
|
-
var _constants = require("../../../analytics/constants");
|
|
20
17
|
var _types = require("../../../analytics/types");
|
|
21
18
|
var _fetchMessagesForLocale = require("../../../common/utils/locale/fetch-messages-for-locale");
|
|
22
|
-
var _datasourceExperienceId = require("../../../contexts/datasource-experience-id");
|
|
23
19
|
var _userInteractions = require("../../../contexts/user-interactions");
|
|
24
20
|
var _en = _interopRequireDefault(require("../../../i18n/en"));
|
|
25
21
|
var _useAvailableSites2 = require("../../../services/useAvailableSites");
|
|
@@ -45,7 +41,6 @@ var _issueLikeTable = require("../../issue-like-table");
|
|
|
45
41
|
var _confluenceSearchContainer = _interopRequireDefault(require("../confluence-search-container"));
|
|
46
42
|
var _confluenceSearchInitialStateSvg = require("./confluence-search-initial-state-svg");
|
|
47
43
|
var _messages = require("./messages");
|
|
48
|
-
var _ModalOld = require("./ModalOld");
|
|
49
44
|
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; }
|
|
50
45
|
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; } /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */ /**
|
|
51
46
|
* @jsxRuntime classic
|
|
@@ -345,32 +340,18 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
345
340
|
getAnalyticsPayload: getButtonAnalyticsPayload
|
|
346
341
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.confluenceSearchModalMessages.insertResultsButtonText)))));
|
|
347
342
|
};
|
|
348
|
-
var analyticsContextAttributes = {
|
|
349
|
-
dataProvider: 'confluence-search'
|
|
350
|
-
};
|
|
351
|
-
var analyticsContextData = _objectSpread(_objectSpread({}, _constants.componentMetadata.configModal), {}, {
|
|
352
|
-
source: 'datasourceConfigModal'
|
|
353
|
-
});
|
|
354
|
-
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
355
|
-
attributes: _objectSpread({}, analyticsContextAttributes)
|
|
356
|
-
});
|
|
357
343
|
var ConnectedConfluenceSearchConfigModal = (0, _createDatasourceModal.createDatasourceModal)({
|
|
358
344
|
isValidParameters: isValidParameters,
|
|
359
345
|
dataProvider: 'confluence-search',
|
|
360
346
|
component: PlainConfluenceSearchConfigModal
|
|
361
347
|
});
|
|
362
348
|
var ConfluenceSearchConfigModal = exports.ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(props) {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
})));
|
|
372
|
-
}
|
|
373
|
-
return (0, _react2.jsx)(_state.StoreContainer, null, (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
374
|
-
data: contextData
|
|
375
|
-
}, (0, _react2.jsx)(_datasourceExperienceId.DatasourceExperienceIdProvider, null, (0, _react2.jsx)(_userInteractions.UserInteractionsProvider, null, (0, _react2.jsx)(_ModalOld.PlainConfluenceSearchConfigModal, props)))));
|
|
349
|
+
return (0, _react2.jsx)(_state.StoreContainer, null, (0, _react2.jsx)(ConnectedConfluenceSearchConfigModal, (0, _extends2.default)({}, props, {
|
|
350
|
+
/**
|
|
351
|
+
* If the intial parameters are not valid, we will not initialise the modal state
|
|
352
|
+
* with `overrideParameters`. This is to allow the modal to be opened without
|
|
353
|
+
* any initial parameters and require the user to perform a search.
|
|
354
|
+
*/
|
|
355
|
+
parameters: props.overrideParameters && isValidParameters(props.parameters) ? _objectSpread(_objectSpread({}, props.parameters), props.overrideParameters) : props.parameters
|
|
356
|
+
})));
|
|
376
357
|
};
|
|
@@ -16,6 +16,7 @@ var _datasourceExperienceId = require("../../../../contexts/datasource-experienc
|
|
|
16
16
|
var _useLoadOptions2 = require("../../../../hooks/useLoadOptions");
|
|
17
17
|
var _icon = require("../../shared-components/icon");
|
|
18
18
|
var _inlineEdit = require("../../table-cell-content/inline-edit");
|
|
19
|
+
var _utils = require("../../utils");
|
|
19
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
22
|
/**
|
|
@@ -24,6 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
24
25
|
var IconEditType = function IconEditType(props) {
|
|
25
26
|
var _currentValue$values;
|
|
26
27
|
var currentValue = props.currentValue,
|
|
28
|
+
labelId = props.labelId,
|
|
27
29
|
executeFetch = props.executeFetch;
|
|
28
30
|
var _useLoadOptions = (0, _useLoadOptions2.useLoadOptions)({
|
|
29
31
|
executeFetch: executeFetch
|
|
@@ -48,7 +50,7 @@ var IconEditType = function IconEditType(props) {
|
|
|
48
50
|
}, [experienceId, isLoading, hasFailed]);
|
|
49
51
|
return /*#__PURE__*/_react.default.createElement(_layering.Layering, {
|
|
50
52
|
isDisabled: false
|
|
51
|
-
}, /*#__PURE__*/_react.default.createElement(_select.default, (0, _extends2.default)({}, props, {
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_select.default, (0, _extends2.default)({}, (0, _utils.getCleanedSelectProps)(props), {
|
|
52
54
|
autoFocus: true,
|
|
53
55
|
blurInputOnSelect: true,
|
|
54
56
|
defaultMenuIsOpen: true,
|
|
@@ -58,6 +60,7 @@ var IconEditType = function IconEditType(props) {
|
|
|
58
60
|
filterOption: filterOption,
|
|
59
61
|
testId: "inline-edit-priority",
|
|
60
62
|
value: currentValue === null || currentValue === void 0 || (_currentValue$values = currentValue.values) === null || _currentValue$values === void 0 ? void 0 : _currentValue$values[0],
|
|
63
|
+
labelId: labelId,
|
|
61
64
|
getOptionValue: function getOptionValue(option) {
|
|
62
65
|
return option.text || '';
|
|
63
66
|
},
|
|
@@ -22,6 +22,7 @@ var editType = exports.editType = function editType(_ref) {
|
|
|
22
22
|
var _toValueType, _value$atlassianUserI;
|
|
23
23
|
var defaultValue = _ref.defaultValue,
|
|
24
24
|
currentValue = _ref.currentValue,
|
|
25
|
+
labelId = _ref.labelId,
|
|
25
26
|
setEditValues = _ref.setEditValues,
|
|
26
27
|
executeFetch = _ref.executeFetch;
|
|
27
28
|
switch (defaultValue.type) {
|
|
@@ -33,7 +34,8 @@ var editType = exports.editType = function editType(_ref) {
|
|
|
33
34
|
return /*#__PURE__*/_react.default.createElement(_text.default, (0, _extends2.default)({}, fieldProps, {
|
|
34
35
|
currentValue: currentValue,
|
|
35
36
|
setEditValues: setEditValues,
|
|
36
|
-
id: ACTIVE_INLINE_EDIT_ID
|
|
37
|
+
id: ACTIVE_INLINE_EDIT_ID,
|
|
38
|
+
labelId: labelId
|
|
37
39
|
}));
|
|
38
40
|
}
|
|
39
41
|
};
|
|
@@ -47,7 +49,8 @@ var editType = exports.editType = function editType(_ref) {
|
|
|
47
49
|
currentValue: currentValue,
|
|
48
50
|
setEditValues: setEditValues,
|
|
49
51
|
id: ACTIVE_INLINE_EDIT_ID,
|
|
50
|
-
executeFetch: executeFetch
|
|
52
|
+
executeFetch: executeFetch,
|
|
53
|
+
labelId: labelId
|
|
51
54
|
}));
|
|
52
55
|
}
|
|
53
56
|
};
|
|
@@ -60,7 +63,8 @@ var editType = exports.editType = function editType(_ref) {
|
|
|
60
63
|
currentValue: currentValue,
|
|
61
64
|
setEditValues: setEditValues,
|
|
62
65
|
id: ACTIVE_INLINE_EDIT_ID,
|
|
63
|
-
executeFetch: executeFetch
|
|
66
|
+
executeFetch: executeFetch,
|
|
67
|
+
labelId: labelId
|
|
64
68
|
}));
|
|
65
69
|
}
|
|
66
70
|
};
|
|
@@ -74,7 +78,8 @@ var editType = exports.editType = function editType(_ref) {
|
|
|
74
78
|
currentValue: currentValue,
|
|
75
79
|
setEditValues: setEditValues,
|
|
76
80
|
id: ACTIVE_INLINE_EDIT_ID,
|
|
77
|
-
executeFetch: executeFetch
|
|
81
|
+
executeFetch: executeFetch,
|
|
82
|
+
labelId: labelId
|
|
78
83
|
}));
|
|
79
84
|
}
|
|
80
85
|
};
|
|
@@ -16,11 +16,13 @@ var _ufoExperiences = require("../../../../analytics/ufoExperiences");
|
|
|
16
16
|
var _datasourceExperienceId = require("../../../../contexts/datasource-experience-id");
|
|
17
17
|
var _useLoadOptions2 = require("../../../../hooks/useLoadOptions");
|
|
18
18
|
var _inlineEdit = require("../../table-cell-content/inline-edit");
|
|
19
|
+
var _utils = require("../../utils");
|
|
19
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
22
|
var StatusEditType = function StatusEditType(props) {
|
|
22
23
|
var _currentValue$values;
|
|
23
24
|
var currentValue = props.currentValue,
|
|
25
|
+
labelId = props.labelId,
|
|
24
26
|
executeFetch = props.executeFetch;
|
|
25
27
|
var _useLoadOptions = (0, _useLoadOptions2.useLoadOptions)({
|
|
26
28
|
executeFetch: executeFetch
|
|
@@ -45,7 +47,7 @@ var StatusEditType = function StatusEditType(props) {
|
|
|
45
47
|
}, [experienceId, isLoading, hasFailed]);
|
|
46
48
|
return /*#__PURE__*/_react.default.createElement(_layering.Layering, {
|
|
47
49
|
isDisabled: false
|
|
48
|
-
}, /*#__PURE__*/_react.default.createElement(_select.default, (0, _extends2.default)({}, props, {
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(_select.default, (0, _extends2.default)({}, (0, _utils.getCleanedSelectProps)(props), {
|
|
49
51
|
autoFocus: true,
|
|
50
52
|
options: options,
|
|
51
53
|
defaultMenuIsOpen: true,
|
|
@@ -58,6 +60,7 @@ var StatusEditType = function StatusEditType(props) {
|
|
|
58
60
|
return option.text;
|
|
59
61
|
},
|
|
60
62
|
value: currentValue === null || currentValue === void 0 || (_currentValue$values = currentValue.values) === null || _currentValue$values === void 0 ? void 0 : _currentValue$values[0],
|
|
63
|
+
labelId: labelId,
|
|
61
64
|
formatOptionLabel: function formatOptionLabel(option) {
|
|
62
65
|
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
63
66
|
content: option.text
|
|
@@ -65,6 +68,9 @@ var StatusEditType = function StatusEditType(props) {
|
|
|
65
68
|
testId: "inline-edit-status-option-".concat(option.text)
|
|
66
69
|
}, option.style), option.text));
|
|
67
70
|
},
|
|
71
|
+
getOptionLabel: function getOptionLabel(option) {
|
|
72
|
+
return option.text;
|
|
73
|
+
},
|
|
68
74
|
onChange: function onChange(e) {
|
|
69
75
|
return props.setEditValues({
|
|
70
76
|
type: 'status',
|
|
@@ -17,7 +17,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
17
17
|
var TextEditType = function TextEditType(props) {
|
|
18
18
|
var _currentValue$values$, _currentValue$values;
|
|
19
19
|
var experienceId = (0, _datasourceExperienceId.useDatasourceExperienceId)();
|
|
20
|
-
var currentValue = props.currentValue
|
|
20
|
+
var currentValue = props.currentValue,
|
|
21
|
+
labelId = props.labelId;
|
|
21
22
|
(0, _react.useEffect)(function () {
|
|
22
23
|
if (experienceId) {
|
|
23
24
|
(0, _ufoExperiences.succeedUfoExperience)({
|
|
@@ -36,6 +37,7 @@ var TextEditType = function TextEditType(props) {
|
|
|
36
37
|
padding: "var(--ds-space-100, 8px)".concat(" calc(", "var(--ds-space-100, 8px)", " - 1px)")
|
|
37
38
|
},
|
|
38
39
|
value: (_currentValue$values$ = currentValue === null || currentValue === void 0 || (_currentValue$values = currentValue.values) === null || _currentValue$values === void 0 ? void 0 : _currentValue$values[0]) !== null && _currentValue$values$ !== void 0 ? _currentValue$values$ : '',
|
|
40
|
+
"aria-labelledby": labelId,
|
|
39
41
|
onChange: function onChange(e) {
|
|
40
42
|
return props.setEditValues({
|
|
41
43
|
type: 'string',
|
|
@@ -22,11 +22,13 @@ var _constants = require("../../../common/modal/popup-select/constants");
|
|
|
22
22
|
var _user = require("../../render-type/user");
|
|
23
23
|
var _messages = require("../../render-type/user/messages");
|
|
24
24
|
var _inlineEdit = require("../../table-cell-content/inline-edit");
|
|
25
|
+
var _utils = require("../../utils");
|
|
25
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
26
27
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
27
28
|
var UserEditType = function UserEditType(props) {
|
|
28
29
|
var _currentValue$values;
|
|
29
30
|
var currentValue = props.currentValue,
|
|
31
|
+
labelId = props.labelId,
|
|
30
32
|
executeFetch = props.executeFetch;
|
|
31
33
|
var _useState = (0, _react.useState)({
|
|
32
34
|
query: ''
|
|
@@ -75,7 +77,7 @@ var UserEditType = function UserEditType(props) {
|
|
|
75
77
|
}, [experienceId, isLoading, hasFailed]);
|
|
76
78
|
return /*#__PURE__*/_react.default.createElement(_layering.Layering, {
|
|
77
79
|
isDisabled: false
|
|
78
|
-
}, /*#__PURE__*/_react.default.createElement(_select.default, (0, _extends2.default)({}, props, {
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_select.default, (0, _extends2.default)({}, (0, _utils.getCleanedSelectProps)(props), {
|
|
79
81
|
autoFocus: true,
|
|
80
82
|
defaultMenuIsOpen: true,
|
|
81
83
|
blurInputOnSelect: true,
|
|
@@ -86,9 +88,13 @@ var UserEditType = function UserEditType(props) {
|
|
|
86
88
|
menuPlacement: "auto",
|
|
87
89
|
onInputChange: handleUserInputDebounced,
|
|
88
90
|
value: currentValue === null || currentValue === void 0 || (_currentValue$values = currentValue.values) === null || _currentValue$values === void 0 ? void 0 : _currentValue$values[0],
|
|
91
|
+
labelId: labelId,
|
|
89
92
|
getOptionValue: function getOptionValue(option) {
|
|
90
93
|
return option.atlassianUserId;
|
|
91
94
|
},
|
|
95
|
+
getOptionLabel: function getOptionLabel(option) {
|
|
96
|
+
return option.displayName || '';
|
|
97
|
+
},
|
|
92
98
|
formatOptionLabel: function formatOptionLabel(option) {
|
|
93
99
|
var _option$displayName;
|
|
94
100
|
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
@@ -477,7 +477,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
477
477
|
key: id,
|
|
478
478
|
cells: visibleSortedColumns.map(function (_ref12, cellIndex) {
|
|
479
479
|
var key = _ref12.key,
|
|
480
|
-
type = _ref12.type
|
|
480
|
+
type = _ref12.type,
|
|
481
|
+
title = _ref12.title;
|
|
481
482
|
return {
|
|
482
483
|
key: key,
|
|
483
484
|
columnKey: key,
|
|
@@ -486,11 +487,13 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
486
487
|
id: id,
|
|
487
488
|
columnKey: key,
|
|
488
489
|
columnType: type,
|
|
490
|
+
columnTitle: title,
|
|
489
491
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
490
492
|
renderItem: renderItem
|
|
491
493
|
}) : (0, _react2.jsx)(_tableCellContent.ReadOnlyCell, {
|
|
492
494
|
id: id,
|
|
493
495
|
columnKey: key,
|
|
496
|
+
columnTitle: title,
|
|
494
497
|
columnType: type,
|
|
495
498
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
496
499
|
renderItem: renderItem
|
|
@@ -646,7 +649,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
646
649
|
position: "bottom-start",
|
|
647
650
|
testId: 'datasource-header-content'
|
|
648
651
|
}, (0, _react2.jsx)("span", {
|
|
649
|
-
css: headerStyles
|
|
652
|
+
css: headerStyles,
|
|
653
|
+
id: (0, _utils.getFieldLabelById)(key)
|
|
650
654
|
}, content));
|
|
651
655
|
var isHeadingOutsideButton = !isEditable || !onWrappedColumnChange;
|
|
652
656
|
if (isHeadingOutsideButton) {
|
|
@@ -82,6 +82,7 @@ var InlineEditableCell = function InlineEditableCell(_ref3) {
|
|
|
82
82
|
var ari = _ref3.ari,
|
|
83
83
|
values = _ref3.values,
|
|
84
84
|
columnKey = _ref3.columnKey,
|
|
85
|
+
columnTitle = _ref3.columnTitle,
|
|
85
86
|
renderItem = _ref3.renderItem,
|
|
86
87
|
integrationKey = _ref3.integrationKey,
|
|
87
88
|
wrappedColumnKeys = _ref3.wrappedColumnKeys;
|
|
@@ -121,6 +122,7 @@ var InlineEditableCell = function InlineEditableCell(_ref3) {
|
|
|
121
122
|
executeFetch: executeFetch,
|
|
122
123
|
readView: readView,
|
|
123
124
|
columnKey: columnKey,
|
|
125
|
+
columnTitle: columnTitle,
|
|
124
126
|
datasourceTypeWithValues: values
|
|
125
127
|
});
|
|
126
128
|
};
|
|
@@ -140,6 +142,7 @@ var toDatasourceTypeWithValues = function toDatasourceTypeWithValues(_ref4) {
|
|
|
140
142
|
var TableCellContent = exports.TableCellContent = function TableCellContent(_ref5) {
|
|
141
143
|
var id = _ref5.id,
|
|
142
144
|
columnKey = _ref5.columnKey,
|
|
145
|
+
columnTitle = _ref5.columnTitle,
|
|
143
146
|
columnType = _ref5.columnType,
|
|
144
147
|
renderItem = _ref5.renderItem,
|
|
145
148
|
wrappedColumnKeys = _ref5.wrappedColumnKeys;
|
|
@@ -155,6 +158,7 @@ var TableCellContent = exports.TableCellContent = function TableCellContent(_ref
|
|
|
155
158
|
return /*#__PURE__*/_react.default.createElement(InlineEditableCell, {
|
|
156
159
|
ari: ari,
|
|
157
160
|
columnKey: columnKey,
|
|
161
|
+
columnTitle: columnTitle,
|
|
158
162
|
renderItem: renderItem,
|
|
159
163
|
integrationKey: integrationKey,
|
|
160
164
|
values: toDatasourceTypeWithValues({
|
|
@@ -174,6 +178,7 @@ var TableCellContent = exports.TableCellContent = function TableCellContent(_ref
|
|
|
174
178
|
}, /*#__PURE__*/_react.default.createElement(ReadOnlyCell, {
|
|
175
179
|
id: id,
|
|
176
180
|
columnKey: columnKey,
|
|
181
|
+
columnTitle: columnTitle,
|
|
177
182
|
columnType: columnType,
|
|
178
183
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
179
184
|
renderItem: renderItem
|
|
@@ -11,6 +11,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _reactIntlNext = require("react-intl-next");
|
|
14
15
|
var _inlineEdit = _interopRequireDefault(require("@atlaskit/inline-edit"));
|
|
15
16
|
var _primitives = require("@atlaskit/primitives");
|
|
16
17
|
var _hooks = require("@atlaskit/smart-card/hooks");
|
|
@@ -21,6 +22,8 @@ var _useDatasourceTableFlag = require("../../../hooks/useDatasourceTableFlag");
|
|
|
21
22
|
var _state = require("../../../state");
|
|
22
23
|
var _editType = require("../edit-type");
|
|
23
24
|
var _avatar = require("../shared-components/avatar");
|
|
25
|
+
var _utils = require("../utils");
|
|
26
|
+
var _messages = require("./messages");
|
|
24
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
29
|
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; }
|
|
@@ -43,6 +46,21 @@ var getBackendUpdateValue = function getBackendUpdateValue(typedNewValue) {
|
|
|
43
46
|
}
|
|
44
47
|
throw new Error("Datasource 2 way sync Backend update value not implemented for type ".concat(typedNewValue.type));
|
|
45
48
|
};
|
|
49
|
+
var getCurrentFieldLabel = function getCurrentFieldLabel(typedNewValue) {
|
|
50
|
+
var _typedNewValue$values4, _typedNewValue$values5, _typedNewValue$values6;
|
|
51
|
+
switch (typedNewValue.type) {
|
|
52
|
+
case 'string':
|
|
53
|
+
return typedNewValue.values[0] || '';
|
|
54
|
+
case 'status':
|
|
55
|
+
return ((_typedNewValue$values4 = typedNewValue.values[0]) === null || _typedNewValue$values4 === void 0 ? void 0 : _typedNewValue$values4.text) || '';
|
|
56
|
+
case 'user':
|
|
57
|
+
return ((_typedNewValue$values5 = typedNewValue.values[0]) === null || _typedNewValue$values5 === void 0 ? void 0 : _typedNewValue$values5.displayName) || '';
|
|
58
|
+
case 'icon':
|
|
59
|
+
return ((_typedNewValue$values6 = typedNewValue.values[0]) === null || _typedNewValue$values6 === void 0 ? void 0 : _typedNewValue$values6.text) || '';
|
|
60
|
+
default:
|
|
61
|
+
return '';
|
|
62
|
+
}
|
|
63
|
+
};
|
|
46
64
|
var mapUpdatedItem = function mapUpdatedItem(existingItem, columnKey, newValue) {
|
|
47
65
|
switch (newValue.type) {
|
|
48
66
|
case 'string':
|
|
@@ -83,6 +101,7 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
83
101
|
executeFetch = _ref.executeFetch,
|
|
84
102
|
readView = _ref.readView,
|
|
85
103
|
columnKey = _ref.columnKey,
|
|
104
|
+
columnTitle = _ref.columnTitle,
|
|
86
105
|
datasourceTypeWithValues = _ref.datasourceTypeWithValues;
|
|
87
106
|
var _useState = (0, _react.useState)(false),
|
|
88
107
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -153,13 +172,22 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
153
172
|
});
|
|
154
173
|
}
|
|
155
174
|
}, [columnKey, entityType, fireEvent, integrationKey]);
|
|
175
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
176
|
+
formatMessage = _useIntl.formatMessage;
|
|
177
|
+
var editButtonLabel = (0, _react.useMemo)(function () {
|
|
178
|
+
return formatMessage(_messages.tableCellMessages.editButtonLabel, {
|
|
179
|
+
fieldName: columnTitle,
|
|
180
|
+
fieldValue: getCurrentFieldLabel(editValues)
|
|
181
|
+
});
|
|
182
|
+
}, [columnTitle, formatMessage, editValues]);
|
|
156
183
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
157
184
|
xcss: editContainerStyles
|
|
158
185
|
}, /*#__PURE__*/_react.default.createElement(_inlineEdit.default, (0, _extends2.default)({}, (0, _editType.editType)({
|
|
159
186
|
defaultValue: datasourceTypeWithValues,
|
|
160
187
|
currentValue: editValues,
|
|
161
188
|
setEditValues: setEditValues,
|
|
162
|
-
executeFetch: executeFetch
|
|
189
|
+
executeFetch: executeFetch,
|
|
190
|
+
labelId: (0, _utils.getFieldLabelById)(columnKey)
|
|
163
191
|
}), {
|
|
164
192
|
hideActionButtons: true,
|
|
165
193
|
readView: editableRenderType({
|
|
@@ -172,7 +200,8 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
172
200
|
onCancel: onCancelEdit,
|
|
173
201
|
onConfirm: function onConfirm() {
|
|
174
202
|
return onCommitUpdate(editValues);
|
|
175
|
-
}
|
|
203
|
+
},
|
|
204
|
+
editButtonLabel: editButtonLabel
|
|
176
205
|
})));
|
|
177
206
|
};
|
|
178
207
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.tableCellMessages = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var tableCellMessages = exports.tableCellMessages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
editButtonLabel: {
|
|
10
|
+
id: 'linkDataSource.issue-line-table.edit-button-label.non-final',
|
|
11
|
+
description: 'Label of inline editable field, used mostly for screen readers. This label is used to describe the field that is editable and can be changed. e.g John Doe, Assignee field',
|
|
12
|
+
defaultMessage: '{fieldValue}, {fieldName} field'
|
|
13
|
+
}
|
|
14
|
+
});
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.getWidthCss = exports.getColumnMinWidth = exports.getColumnAction = exports.COLUMN_BASE_WIDTH = void 0;
|
|
7
|
+
exports.getWidthCss = exports.getFieldLabelById = exports.getColumnMinWidth = exports.getColumnAction = exports.getCleanedSelectProps = exports.COLUMN_BASE_WIDTH = void 0;
|
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
7
9
|
var _types = require("../../analytics/types");
|
|
10
|
+
var _excluded = ["aria-labelledby"];
|
|
8
11
|
var COLUMN_BASE_WIDTH = exports.COLUMN_BASE_WIDTH = 8;
|
|
9
12
|
var COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 4;
|
|
10
13
|
var keyBasedMinWidthMap = {
|
|
@@ -58,4 +61,21 @@ var getColumnAction = exports.getColumnAction = function getColumnAction(oldVisi
|
|
|
58
61
|
} else {
|
|
59
62
|
return _types.DatasourceAction.COLUMN_REORDERED;
|
|
60
63
|
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Remove deprecated `aria-labelledby` prop from select component props.
|
|
68
|
+
*/
|
|
69
|
+
var getCleanedSelectProps = exports.getCleanedSelectProps = function getCleanedSelectProps(props) {
|
|
70
|
+
// Component Field auto adds `aria-labelledby` prop, which is deprecated and should not be used - https://hello.jira.atlassian.cloud/browse/ENGHEALTH-14529
|
|
71
|
+
var removedLabelByProps = props['aria-labelledby'],
|
|
72
|
+
selectProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
73
|
+
return selectProps;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Create id for table header to be used as aria-labelledby on form fields.
|
|
78
|
+
*/
|
|
79
|
+
var getFieldLabelById = exports.getFieldLabelById = function getFieldLabelById(fieldId) {
|
|
80
|
+
return "datasource-header-title-".concat(fieldId);
|
|
61
81
|
};
|
|
@@ -11,10 +11,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _reactIntlNext = require("react-intl-next");
|
|
14
|
-
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
15
14
|
var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
|
|
16
15
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
16
|
var _analytics = require("../../../analytics");
|
|
19
17
|
var _constants = require("../../../analytics/constants");
|
|
20
18
|
var _types = require("../../../analytics/types");
|
|
@@ -53,7 +51,6 @@ var _isQueryTooComplex = require("../basic-filters/utils/isQueryTooComplex");
|
|
|
53
51
|
var _jiraSearchContainer = require("../jira-search-container");
|
|
54
52
|
var _jiraIssuesInitialStateSvg = require("./jira-issues-initial-state-svg");
|
|
55
53
|
var _messages3 = require("./messages");
|
|
56
|
-
var _ModalOld = require("./ModalOld");
|
|
57
54
|
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; }
|
|
58
55
|
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; } /* eslint-disable @atlaskit/platform/no-preconditioning */ /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */ /**
|
|
59
56
|
* @jsxRuntime classic
|
|
@@ -379,15 +376,6 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
379
376
|
getAnalyticsPayload: getInsertButtonAnalyticsPayload
|
|
380
377
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages3.modalMessages.insertIssuesButtonText))))));
|
|
381
378
|
};
|
|
382
|
-
var analyticsContextAttributes = {
|
|
383
|
-
dataProvider: 'jira-issues'
|
|
384
|
-
};
|
|
385
|
-
var analyticsContextData = _objectSpread(_objectSpread({}, _constants.componentMetadata.configModal), {}, {
|
|
386
|
-
source: 'datasourceConfigModal'
|
|
387
|
-
});
|
|
388
|
-
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
389
|
-
attributes: _objectSpread({}, analyticsContextAttributes)
|
|
390
|
-
});
|
|
391
379
|
var ConnectedJiraIssueConfigModal = (0, _createDatasourceModal.createDatasourceModal)({
|
|
392
380
|
isValidParameters: isValidParameters,
|
|
393
381
|
dataProvider: 'jira-issues',
|
|
@@ -413,10 +401,5 @@ var JiraIssuesConfigModalWithExtraAnalyticsOnInsert = function JiraIssuesConfigM
|
|
|
413
401
|
})));
|
|
414
402
|
};
|
|
415
403
|
var JiraIssuesConfigModal = exports.JiraIssuesConfigModal = function JiraIssuesConfigModal(props) {
|
|
416
|
-
|
|
417
|
-
return (0, _react2.jsx)(JiraIssuesConfigModalWithExtraAnalyticsOnInsert, props);
|
|
418
|
-
}
|
|
419
|
-
return (0, _react2.jsx)(_state.StoreContainer, null, (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
420
|
-
data: contextData
|
|
421
|
-
}, (0, _react2.jsx)(_datasourceExperienceId.DatasourceExperienceIdProvider, null, (0, _react2.jsx)(_userInteractions.UserInteractionsProvider, null, (0, _react2.jsx)(_ModalOld.PlainJiraIssuesConfigModalOld, props)))));
|
|
404
|
+
return (0, _react2.jsx)(JiraIssuesConfigModalWithExtraAnalyticsOnInsert, props);
|
|
422
405
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect,
|
|
1
|
+
import { useEffect, useReducer } from 'react';
|
|
2
2
|
import { ActionOperationStatus } from '@atlaskit/linking-types';
|
|
3
3
|
import { useDatasourceTableFlag } from './useDatasourceTableFlag';
|
|
4
4
|
const loadOptions = async (fetchInputs = {}, executeFetch) => {
|
|
@@ -15,6 +15,12 @@ const loadOptions = async (fetchInputs = {}, executeFetch) => {
|
|
|
15
15
|
}
|
|
16
16
|
return entities !== null && entities !== void 0 ? entities : [];
|
|
17
17
|
};
|
|
18
|
+
const reducer = (state, payload) => {
|
|
19
|
+
return {
|
|
20
|
+
...state,
|
|
21
|
+
...payload
|
|
22
|
+
};
|
|
23
|
+
};
|
|
18
24
|
export const useLoadOptions = ({
|
|
19
25
|
fetchInputs,
|
|
20
26
|
executeFetch,
|
|
@@ -24,7 +30,7 @@ export const useLoadOptions = ({
|
|
|
24
30
|
options,
|
|
25
31
|
isLoading,
|
|
26
32
|
hasFailed
|
|
27
|
-
},
|
|
33
|
+
}, dispatch] = useReducer(reducer, {
|
|
28
34
|
isLoading: true,
|
|
29
35
|
options: [],
|
|
30
36
|
hasFailed: false
|
|
@@ -36,9 +42,14 @@ export const useLoadOptions = ({
|
|
|
36
42
|
});
|
|
37
43
|
useEffect(() => {
|
|
38
44
|
let isMounted = true;
|
|
45
|
+
// Set the loading state before sending the request
|
|
46
|
+
dispatch({
|
|
47
|
+
isLoading: true
|
|
48
|
+
});
|
|
49
|
+
// Query the options
|
|
39
50
|
loadOptions(fetchInputs, executeFetch).then(options => {
|
|
40
51
|
if (isMounted) {
|
|
41
|
-
|
|
52
|
+
dispatch({
|
|
42
53
|
isLoading: false,
|
|
43
54
|
options: emptyOption ? [emptyOption, ...options] : options,
|
|
44
55
|
hasFailed: false
|
|
@@ -46,7 +57,7 @@ export const useLoadOptions = ({
|
|
|
46
57
|
}
|
|
47
58
|
}).catch(err => {
|
|
48
59
|
showErrorFlag();
|
|
49
|
-
|
|
60
|
+
dispatch({
|
|
50
61
|
isLoading: false,
|
|
51
62
|
options: [],
|
|
52
63
|
hasFailed: true
|