@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
|
@@ -9,17 +9,13 @@ import { Fragment, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { jsx } from '@emotion/react';
|
|
11
11
|
import { FormattedMessage } from 'react-intl-next';
|
|
12
|
-
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
13
12
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
14
13
|
import { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
14
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
17
15
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
18
|
-
import { componentMetadata } from '../../../analytics/constants';
|
|
19
16
|
import { DatasourceAction, DatasourceSearchMethod } from '../../../analytics/types';
|
|
20
17
|
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
21
|
-
import {
|
|
22
|
-
import { UserInteractionsProvider, useUserInteractions } from '../../../contexts/user-interactions';
|
|
18
|
+
import { useUserInteractions } from '../../../contexts/user-interactions';
|
|
23
19
|
import i18nEN from '../../../i18n/en';
|
|
24
20
|
import { useAvailableSites } from '../../../services/useAvailableSites';
|
|
25
21
|
import { StoreContainer } from '../../../state';
|
|
@@ -44,7 +40,6 @@ import { EmptyState } from '../../issue-like-table';
|
|
|
44
40
|
import ConfluenceSearchContainer from '../confluence-search-container';
|
|
45
41
|
import { ConfluenceSearchInitialStateSVG } from './confluence-search-initial-state-svg';
|
|
46
42
|
import { confluenceSearchModalMessages } from './messages';
|
|
47
|
-
import { PlainConfluenceSearchConfigModal as PlainConfluenceSearchConfigModalOld } from './ModalOld';
|
|
48
43
|
const inputContainerStyles = xcss({
|
|
49
44
|
alignItems: 'baseline',
|
|
50
45
|
display: 'flex',
|
|
@@ -337,39 +332,21 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
337
332
|
getAnalyticsPayload: getButtonAnalyticsPayload
|
|
338
333
|
}, jsx(FormattedMessage, confluenceSearchModalMessages.insertResultsButtonText)))));
|
|
339
334
|
};
|
|
340
|
-
const analyticsContextAttributes = {
|
|
341
|
-
dataProvider: 'confluence-search'
|
|
342
|
-
};
|
|
343
|
-
const analyticsContextData = {
|
|
344
|
-
...componentMetadata.configModal,
|
|
345
|
-
source: 'datasourceConfigModal'
|
|
346
|
-
};
|
|
347
|
-
const contextData = {
|
|
348
|
-
...analyticsContextData,
|
|
349
|
-
attributes: {
|
|
350
|
-
...analyticsContextAttributes
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
335
|
const ConnectedConfluenceSearchConfigModal = createDatasourceModal({
|
|
354
336
|
isValidParameters,
|
|
355
337
|
dataProvider: 'confluence-search',
|
|
356
338
|
component: PlainConfluenceSearchConfigModal
|
|
357
339
|
});
|
|
358
340
|
export const ConfluenceSearchConfigModal = props => {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
})));
|
|
371
|
-
}
|
|
372
|
-
return jsx(StoreContainer, null, jsx(AnalyticsContext, {
|
|
373
|
-
data: contextData
|
|
374
|
-
}, jsx(DatasourceExperienceIdProvider, null, jsx(UserInteractionsProvider, null, jsx(PlainConfluenceSearchConfigModalOld, props)))));
|
|
341
|
+
return jsx(StoreContainer, null, jsx(ConnectedConfluenceSearchConfigModal, _extends({}, props, {
|
|
342
|
+
/**
|
|
343
|
+
* If the intial parameters are not valid, we will not initialise the modal state
|
|
344
|
+
* with `overrideParameters`. This is to allow the modal to be opened without
|
|
345
|
+
* any initial parameters and require the user to perform a search.
|
|
346
|
+
*/
|
|
347
|
+
parameters: props.overrideParameters && isValidParameters(props.parameters) ? {
|
|
348
|
+
...props.parameters,
|
|
349
|
+
...props.overrideParameters
|
|
350
|
+
} : props.parameters
|
|
351
|
+
})));
|
|
375
352
|
};
|
|
@@ -8,6 +8,7 @@ import { useDatasourceExperienceId } from '../../../../contexts/datasource-exper
|
|
|
8
8
|
import { useLoadOptions } from '../../../../hooks/useLoadOptions';
|
|
9
9
|
import { SharedIconComponent } from '../../shared-components/icon';
|
|
10
10
|
import { InlineEditUFOExperience } from '../../table-cell-content/inline-edit';
|
|
11
|
+
import { getCleanedSelectProps } from '../../utils';
|
|
11
12
|
/**
|
|
12
13
|
* Should be gated by FF rollout of platform-datasources-enable-two-way-sync-priority
|
|
13
14
|
*/
|
|
@@ -15,6 +16,7 @@ const IconEditType = props => {
|
|
|
15
16
|
var _currentValue$values;
|
|
16
17
|
const {
|
|
17
18
|
currentValue,
|
|
19
|
+
labelId,
|
|
18
20
|
executeFetch
|
|
19
21
|
} = props;
|
|
20
22
|
const {
|
|
@@ -41,7 +43,7 @@ const IconEditType = props => {
|
|
|
41
43
|
}, [experienceId, isLoading, hasFailed]);
|
|
42
44
|
return /*#__PURE__*/React.createElement(Layering, {
|
|
43
45
|
isDisabled: false
|
|
44
|
-
}, /*#__PURE__*/React.createElement(Select, _extends({}, props, {
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Select, _extends({}, getCleanedSelectProps(props), {
|
|
45
47
|
autoFocus: true,
|
|
46
48
|
blurInputOnSelect: true,
|
|
47
49
|
defaultMenuIsOpen: true,
|
|
@@ -51,6 +53,7 @@ const IconEditType = props => {
|
|
|
51
53
|
filterOption: filterOption,
|
|
52
54
|
testId: "inline-edit-priority",
|
|
53
55
|
value: currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$values = currentValue.values) === null || _currentValue$values === void 0 ? void 0 : _currentValue$values[0],
|
|
56
|
+
labelId: labelId,
|
|
54
57
|
getOptionValue: option => option.text || '',
|
|
55
58
|
formatOptionLabel: ({
|
|
56
59
|
source,
|
|
@@ -11,6 +11,7 @@ const ACTIVE_INLINE_EDIT_ID = 'sllv-active-inline-edit';
|
|
|
11
11
|
export const editType = ({
|
|
12
12
|
defaultValue,
|
|
13
13
|
currentValue,
|
|
14
|
+
labelId,
|
|
14
15
|
setEditValues,
|
|
15
16
|
executeFetch
|
|
16
17
|
}) => {
|
|
@@ -24,7 +25,8 @@ export const editType = ({
|
|
|
24
25
|
}) => /*#__PURE__*/React.createElement(TextEditType, _extends({}, fieldProps, {
|
|
25
26
|
currentValue: currentValue,
|
|
26
27
|
setEditValues: setEditValues,
|
|
27
|
-
id: ACTIVE_INLINE_EDIT_ID
|
|
28
|
+
id: ACTIVE_INLINE_EDIT_ID,
|
|
29
|
+
labelId: labelId
|
|
28
30
|
}))
|
|
29
31
|
};
|
|
30
32
|
case 'icon':
|
|
@@ -37,7 +39,8 @@ export const editType = ({
|
|
|
37
39
|
currentValue: currentValue,
|
|
38
40
|
setEditValues: setEditValues,
|
|
39
41
|
id: ACTIVE_INLINE_EDIT_ID,
|
|
40
|
-
executeFetch: executeFetch
|
|
42
|
+
executeFetch: executeFetch,
|
|
43
|
+
labelId: labelId
|
|
41
44
|
}))
|
|
42
45
|
};
|
|
43
46
|
case 'status':
|
|
@@ -49,7 +52,8 @@ export const editType = ({
|
|
|
49
52
|
currentValue: currentValue,
|
|
50
53
|
setEditValues: setEditValues,
|
|
51
54
|
id: ACTIVE_INLINE_EDIT_ID,
|
|
52
|
-
executeFetch: executeFetch
|
|
55
|
+
executeFetch: executeFetch,
|
|
56
|
+
labelId: labelId
|
|
53
57
|
}))
|
|
54
58
|
};
|
|
55
59
|
case 'user':
|
|
@@ -62,7 +66,8 @@ export const editType = ({
|
|
|
62
66
|
currentValue: currentValue,
|
|
63
67
|
setEditValues: setEditValues,
|
|
64
68
|
id: ACTIVE_INLINE_EDIT_ID,
|
|
65
|
-
executeFetch: executeFetch
|
|
69
|
+
executeFetch: executeFetch,
|
|
70
|
+
labelId: labelId
|
|
66
71
|
}))
|
|
67
72
|
};
|
|
68
73
|
}
|
|
@@ -8,10 +8,12 @@ import { failUfoExperience, succeedUfoExperience } from '../../../../analytics/u
|
|
|
8
8
|
import { useDatasourceExperienceId } from '../../../../contexts/datasource-experience-id';
|
|
9
9
|
import { useLoadOptions } from '../../../../hooks/useLoadOptions';
|
|
10
10
|
import { InlineEditUFOExperience } from '../../table-cell-content/inline-edit';
|
|
11
|
+
import { getCleanedSelectProps } from '../../utils';
|
|
11
12
|
const StatusEditType = props => {
|
|
12
13
|
var _currentValue$values;
|
|
13
14
|
const {
|
|
14
15
|
currentValue,
|
|
16
|
+
labelId,
|
|
15
17
|
executeFetch
|
|
16
18
|
} = props;
|
|
17
19
|
const {
|
|
@@ -38,7 +40,7 @@ const StatusEditType = props => {
|
|
|
38
40
|
}, [experienceId, isLoading, hasFailed]);
|
|
39
41
|
return /*#__PURE__*/React.createElement(Layering, {
|
|
40
42
|
isDisabled: false
|
|
41
|
-
}, /*#__PURE__*/React.createElement(Select, _extends({}, props, {
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Select, _extends({}, getCleanedSelectProps(props), {
|
|
42
44
|
autoFocus: true,
|
|
43
45
|
options: options,
|
|
44
46
|
defaultMenuIsOpen: true,
|
|
@@ -49,11 +51,13 @@ const StatusEditType = props => {
|
|
|
49
51
|
testId: "inline-edit-status",
|
|
50
52
|
getOptionValue: option => option.text,
|
|
51
53
|
value: currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$values = currentValue.values) === null || _currentValue$values === void 0 ? void 0 : _currentValue$values[0],
|
|
54
|
+
labelId: labelId,
|
|
52
55
|
formatOptionLabel: option => /*#__PURE__*/React.createElement(Tooltip, {
|
|
53
56
|
content: option.text
|
|
54
57
|
}, /*#__PURE__*/React.createElement(Lozenge, _extends({
|
|
55
58
|
testId: `inline-edit-status-option-${option.text}`
|
|
56
59
|
}, option.style), option.text)),
|
|
60
|
+
getOptionLabel: option => option.text,
|
|
57
61
|
onChange: e => props.setEditValues({
|
|
58
62
|
type: 'status',
|
|
59
63
|
values: e ? [e] : []
|
|
@@ -8,7 +8,8 @@ const TextEditType = props => {
|
|
|
8
8
|
var _currentValue$values$, _currentValue$values;
|
|
9
9
|
const experienceId = useDatasourceExperienceId();
|
|
10
10
|
const {
|
|
11
|
-
currentValue
|
|
11
|
+
currentValue,
|
|
12
|
+
labelId
|
|
12
13
|
} = props;
|
|
13
14
|
useEffect(() => {
|
|
14
15
|
if (experienceId) {
|
|
@@ -28,6 +29,7 @@ const TextEditType = props => {
|
|
|
28
29
|
padding: `${"var(--ds-space-100, 8px)"} calc(${"var(--ds-space-100, 8px)"} - 1px)`
|
|
29
30
|
},
|
|
30
31
|
value: (_currentValue$values$ = currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$values = currentValue.values) === null || _currentValue$values === void 0 ? void 0 : _currentValue$values[0]) !== null && _currentValue$values$ !== void 0 ? _currentValue$values$ : '',
|
|
32
|
+
"aria-labelledby": labelId,
|
|
31
33
|
onChange: e => props.setEditValues({
|
|
32
34
|
type: 'string',
|
|
33
35
|
values: [e.currentTarget.value]
|
|
@@ -13,10 +13,12 @@ import { SEARCH_DEBOUNCE_MS } from '../../../common/modal/popup-select/constants
|
|
|
13
13
|
import { USER_TYPE_TEST_ID } from '../../render-type/user';
|
|
14
14
|
import { userTypeMessages } from '../../render-type/user/messages';
|
|
15
15
|
import { InlineEditUFOExperience } from '../../table-cell-content/inline-edit';
|
|
16
|
+
import { getCleanedSelectProps } from '../../utils';
|
|
16
17
|
const UserEditType = props => {
|
|
17
18
|
var _currentValue$values;
|
|
18
19
|
const {
|
|
19
20
|
currentValue,
|
|
21
|
+
labelId,
|
|
20
22
|
executeFetch
|
|
21
23
|
} = props;
|
|
22
24
|
const [fetchInputs, setFetchInputs] = useState({
|
|
@@ -59,7 +61,7 @@ const UserEditType = props => {
|
|
|
59
61
|
}, [experienceId, isLoading, hasFailed]);
|
|
60
62
|
return /*#__PURE__*/React.createElement(Layering, {
|
|
61
63
|
isDisabled: false
|
|
62
|
-
}, /*#__PURE__*/React.createElement(Select, _extends({}, props, {
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Select, _extends({}, getCleanedSelectProps(props), {
|
|
63
65
|
autoFocus: true,
|
|
64
66
|
defaultMenuIsOpen: true,
|
|
65
67
|
blurInputOnSelect: true,
|
|
@@ -70,7 +72,9 @@ const UserEditType = props => {
|
|
|
70
72
|
menuPlacement: "auto",
|
|
71
73
|
onInputChange: handleUserInputDebounced,
|
|
72
74
|
value: currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$values = currentValue.values) === null || _currentValue$values === void 0 ? void 0 : _currentValue$values[0],
|
|
75
|
+
labelId: labelId,
|
|
73
76
|
getOptionValue: option => option.atlassianUserId,
|
|
77
|
+
getOptionLabel: option => option.displayName || '',
|
|
74
78
|
formatOptionLabel: option => {
|
|
75
79
|
var _option$displayName;
|
|
76
80
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -36,7 +36,7 @@ import { InlineEditableTableCell, Table, TableCell, TableHeading, withTablePlugi
|
|
|
36
36
|
import { ReadOnlyCell, TableCellContent } from './table-cell-content';
|
|
37
37
|
import { TruncateTextTag } from './truncate-text-tag';
|
|
38
38
|
import { useIsOnScreen } from './useIsOnScreen';
|
|
39
|
-
import { COLUMN_BASE_WIDTH, getWidthCss } from './utils';
|
|
39
|
+
import { COLUMN_BASE_WIDTH, getFieldLabelById, getWidthCss } from './utils';
|
|
40
40
|
const tableSidePadding = "var(--ds-space-200, 16px)";
|
|
41
41
|
const tableHeadStyles = css({
|
|
42
42
|
background: "var(--ds-elevation-surface-current, #FFF)",
|
|
@@ -474,7 +474,8 @@ export const IssueLikeDataTableView = ({
|
|
|
474
474
|
key: id,
|
|
475
475
|
cells: visibleSortedColumns.map(({
|
|
476
476
|
key,
|
|
477
|
-
type
|
|
477
|
+
type,
|
|
478
|
+
title
|
|
478
479
|
}, cellIndex) => {
|
|
479
480
|
return {
|
|
480
481
|
key,
|
|
@@ -484,11 +485,13 @@ export const IssueLikeDataTableView = ({
|
|
|
484
485
|
id: id,
|
|
485
486
|
columnKey: key,
|
|
486
487
|
columnType: type,
|
|
488
|
+
columnTitle: title,
|
|
487
489
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
488
490
|
renderItem: renderItem
|
|
489
491
|
}) : jsx(ReadOnlyCell, {
|
|
490
492
|
id: id,
|
|
491
493
|
columnKey: key,
|
|
494
|
+
columnTitle: title,
|
|
492
495
|
columnType: type,
|
|
493
496
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
494
497
|
renderItem: renderItem
|
|
@@ -618,7 +621,8 @@ export const IssueLikeDataTableView = ({
|
|
|
618
621
|
position: "bottom-start",
|
|
619
622
|
testId: 'datasource-header-content'
|
|
620
623
|
}, jsx("span", {
|
|
621
|
-
css: headerStyles
|
|
624
|
+
css: headerStyles,
|
|
625
|
+
id: getFieldLabelById(key)
|
|
622
626
|
}, content));
|
|
623
627
|
const isHeadingOutsideButton = !isEditable || !onWrappedColumnChange;
|
|
624
628
|
if (isHeadingOutsideButton) {
|
|
@@ -73,6 +73,7 @@ const InlineEditableCell = ({
|
|
|
73
73
|
ari,
|
|
74
74
|
values,
|
|
75
75
|
columnKey,
|
|
76
|
+
columnTitle,
|
|
76
77
|
renderItem,
|
|
77
78
|
integrationKey,
|
|
78
79
|
wrappedColumnKeys
|
|
@@ -114,6 +115,7 @@ const InlineEditableCell = ({
|
|
|
114
115
|
executeFetch: executeFetch,
|
|
115
116
|
readView: readView,
|
|
116
117
|
columnKey: columnKey,
|
|
118
|
+
columnTitle: columnTitle,
|
|
117
119
|
datasourceTypeWithValues: values
|
|
118
120
|
});
|
|
119
121
|
};
|
|
@@ -134,6 +136,7 @@ const toDatasourceTypeWithValues = ({
|
|
|
134
136
|
export const TableCellContent = ({
|
|
135
137
|
id,
|
|
136
138
|
columnKey,
|
|
139
|
+
columnTitle,
|
|
137
140
|
columnType,
|
|
138
141
|
renderItem,
|
|
139
142
|
wrappedColumnKeys
|
|
@@ -152,6 +155,7 @@ export const TableCellContent = ({
|
|
|
152
155
|
return /*#__PURE__*/React.createElement(InlineEditableCell, {
|
|
153
156
|
ari: ari,
|
|
154
157
|
columnKey: columnKey,
|
|
158
|
+
columnTitle: columnTitle,
|
|
155
159
|
renderItem: renderItem,
|
|
156
160
|
integrationKey: integrationKey,
|
|
157
161
|
values: toDatasourceTypeWithValues({
|
|
@@ -171,6 +175,7 @@ export const TableCellContent = ({
|
|
|
171
175
|
}, /*#__PURE__*/React.createElement(ReadOnlyCell, {
|
|
172
176
|
id: id,
|
|
173
177
|
columnKey: columnKey,
|
|
178
|
+
columnTitle: columnTitle,
|
|
174
179
|
columnType: columnType,
|
|
175
180
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
176
181
|
renderItem: renderItem
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import { useIntl } from 'react-intl-next';
|
|
3
4
|
import AKInlineEdit from '@atlaskit/inline-edit';
|
|
4
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
6
|
import { useSmartLinkReload } from '@atlaskit/smart-card/hooks';
|
|
@@ -10,6 +11,8 @@ import { useDatasourceTableFlag } from '../../../hooks/useDatasourceTableFlag';
|
|
|
10
11
|
import { useDatasourceActions, useDatasourceItem } from '../../../state';
|
|
11
12
|
import { editType } from '../edit-type';
|
|
12
13
|
import { EmptyAvatar } from '../shared-components/avatar';
|
|
14
|
+
import { getFieldLabelById } from '../utils';
|
|
15
|
+
import { tableCellMessages } from './messages';
|
|
13
16
|
export const InlineEditUFOExperience = 'inline-edit-rendered';
|
|
14
17
|
const editContainerStyles = xcss({
|
|
15
18
|
marginBlockStart: 'space.negative.100'
|
|
@@ -28,6 +31,21 @@ const getBackendUpdateValue = typedNewValue => {
|
|
|
28
31
|
}
|
|
29
32
|
throw new Error(`Datasource 2 way sync Backend update value not implemented for type ${typedNewValue.type}`);
|
|
30
33
|
};
|
|
34
|
+
const getCurrentFieldLabel = typedNewValue => {
|
|
35
|
+
var _typedNewValue$values4, _typedNewValue$values5, _typedNewValue$values6;
|
|
36
|
+
switch (typedNewValue.type) {
|
|
37
|
+
case 'string':
|
|
38
|
+
return typedNewValue.values[0] || '';
|
|
39
|
+
case 'status':
|
|
40
|
+
return ((_typedNewValue$values4 = typedNewValue.values[0]) === null || _typedNewValue$values4 === void 0 ? void 0 : _typedNewValue$values4.text) || '';
|
|
41
|
+
case 'user':
|
|
42
|
+
return ((_typedNewValue$values5 = typedNewValue.values[0]) === null || _typedNewValue$values5 === void 0 ? void 0 : _typedNewValue$values5.displayName) || '';
|
|
43
|
+
case 'icon':
|
|
44
|
+
return ((_typedNewValue$values6 = typedNewValue.values[0]) === null || _typedNewValue$values6 === void 0 ? void 0 : _typedNewValue$values6.text) || '';
|
|
45
|
+
default:
|
|
46
|
+
return '';
|
|
47
|
+
}
|
|
48
|
+
};
|
|
31
49
|
const mapUpdatedItem = (existingItem, columnKey, newValue) => {
|
|
32
50
|
switch (newValue.type) {
|
|
33
51
|
case 'string':
|
|
@@ -74,6 +92,7 @@ export const InlineEdit = ({
|
|
|
74
92
|
executeFetch,
|
|
75
93
|
readView,
|
|
76
94
|
columnKey,
|
|
95
|
+
columnTitle,
|
|
77
96
|
datasourceTypeWithValues
|
|
78
97
|
}) => {
|
|
79
98
|
const [isEditing, setIsEditing] = useState(false);
|
|
@@ -143,13 +162,23 @@ export const InlineEdit = ({
|
|
|
143
162
|
});
|
|
144
163
|
}
|
|
145
164
|
}, [columnKey, entityType, fireEvent, integrationKey]);
|
|
165
|
+
const {
|
|
166
|
+
formatMessage
|
|
167
|
+
} = useIntl();
|
|
168
|
+
const editButtonLabel = useMemo(() => {
|
|
169
|
+
return formatMessage(tableCellMessages.editButtonLabel, {
|
|
170
|
+
fieldName: columnTitle,
|
|
171
|
+
fieldValue: getCurrentFieldLabel(editValues)
|
|
172
|
+
});
|
|
173
|
+
}, [columnTitle, formatMessage, editValues]);
|
|
146
174
|
return /*#__PURE__*/React.createElement(Box, {
|
|
147
175
|
xcss: editContainerStyles
|
|
148
176
|
}, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType({
|
|
149
177
|
defaultValue: datasourceTypeWithValues,
|
|
150
178
|
currentValue: editValues,
|
|
151
179
|
setEditValues,
|
|
152
|
-
executeFetch
|
|
180
|
+
executeFetch,
|
|
181
|
+
labelId: getFieldLabelById(columnKey)
|
|
153
182
|
}), {
|
|
154
183
|
hideActionButtons: true,
|
|
155
184
|
readView: editableRenderType({
|
|
@@ -160,7 +189,8 @@ export const InlineEdit = ({
|
|
|
160
189
|
isEditing: isEditing,
|
|
161
190
|
onEdit: onEdit,
|
|
162
191
|
onCancel: onCancelEdit,
|
|
163
|
-
onConfirm: () => onCommitUpdate(editValues)
|
|
192
|
+
onConfirm: () => onCommitUpdate(editValues),
|
|
193
|
+
editButtonLabel: editButtonLabel
|
|
164
194
|
})));
|
|
165
195
|
};
|
|
166
196
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const tableCellMessages = defineMessages({
|
|
3
|
+
editButtonLabel: {
|
|
4
|
+
id: 'linkDataSource.issue-line-table.edit-button-label.non-final',
|
|
5
|
+
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',
|
|
6
|
+
defaultMessage: '{fieldValue}, {fieldName} field'
|
|
7
|
+
}
|
|
8
|
+
});
|
|
@@ -53,4 +53,21 @@ export const getColumnAction = (oldVisibleColumnKeys, newVisibleColumnKeys) => {
|
|
|
53
53
|
} else {
|
|
54
54
|
return DatasourceAction.COLUMN_REORDERED;
|
|
55
55
|
}
|
|
56
|
-
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Remove deprecated `aria-labelledby` prop from select component props.
|
|
60
|
+
*/
|
|
61
|
+
export const getCleanedSelectProps = props => {
|
|
62
|
+
// Component Field auto adds `aria-labelledby` prop, which is deprecated and should not be used - https://hello.jira.atlassian.cloud/browse/ENGHEALTH-14529
|
|
63
|
+
const {
|
|
64
|
+
'aria-labelledby': removedLabelByProps,
|
|
65
|
+
...selectProps
|
|
66
|
+
} = props;
|
|
67
|
+
return selectProps;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Create id for table header to be used as aria-labelledby on form fields.
|
|
72
|
+
*/
|
|
73
|
+
export const getFieldLabelById = fieldId => `datasource-header-title-${fieldId}`;
|
|
@@ -10,20 +10,18 @@ import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'rea
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
11
|
import { jsx } from '@emotion/react';
|
|
12
12
|
import { FormattedMessage } from 'react-intl-next';
|
|
13
|
-
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
14
13
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
15
14
|
import { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
15
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
18
|
-
import {
|
|
16
|
+
import { EVENT_CHANNEL } from '../../../analytics/constants';
|
|
19
17
|
import { DatasourceAction, DatasourceDisplay } from '../../../analytics/types';
|
|
20
18
|
import { startUfoExperience } from '../../../analytics/ufoExperiences';
|
|
21
19
|
import { useColumnPickerRenderedFailedUfoExperience } from '../../../analytics/ufoExperiences/hooks/useColumnPickerRenderedFailedUfoExperience';
|
|
22
20
|
import { useDataRenderedUfoExperience } from '../../../analytics/ufoExperiences/hooks/useDataRenderedUfoExperience';
|
|
23
21
|
import { mapSearchMethod } from '../../../analytics/utils';
|
|
24
22
|
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
23
|
+
import { useDatasourceExperienceId } from '../../../contexts/datasource-experience-id';
|
|
24
|
+
import { useUserInteractions } from '../../../contexts/user-interactions';
|
|
27
25
|
import i18nEN from '../../../i18n/en';
|
|
28
26
|
import { useAvailableSites } from '../../../services/useAvailableSites';
|
|
29
27
|
import { StoreContainer } from '../../../state';
|
|
@@ -52,7 +50,6 @@ import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
|
52
50
|
import { JiraSearchContainer } from '../jira-search-container';
|
|
53
51
|
import { JiraInitialStateSVG } from './jira-issues-initial-state-svg';
|
|
54
52
|
import { modalMessages } from './messages';
|
|
55
|
-
import { PlainJiraIssuesConfigModalOld } from './ModalOld';
|
|
56
53
|
const getDisplayValue = (currentViewMode, itemCount) => {
|
|
57
54
|
if (currentViewMode === 'table') {
|
|
58
55
|
return DatasourceDisplay.DATASOURCE_TABLE;
|
|
@@ -372,19 +369,6 @@ const PlainJiraIssuesConfigModal = props => {
|
|
|
372
369
|
getAnalyticsPayload: getInsertButtonAnalyticsPayload
|
|
373
370
|
}, jsx(FormattedMessage, modalMessages.insertIssuesButtonText))))));
|
|
374
371
|
};
|
|
375
|
-
const analyticsContextAttributes = {
|
|
376
|
-
dataProvider: 'jira-issues'
|
|
377
|
-
};
|
|
378
|
-
const analyticsContextData = {
|
|
379
|
-
...componentMetadata.configModal,
|
|
380
|
-
source: 'datasourceConfigModal'
|
|
381
|
-
};
|
|
382
|
-
const contextData = {
|
|
383
|
-
...analyticsContextData,
|
|
384
|
-
attributes: {
|
|
385
|
-
...analyticsContextAttributes
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
372
|
const ConnectedJiraIssueConfigModal = createDatasourceModal({
|
|
389
373
|
isValidParameters,
|
|
390
374
|
dataProvider: 'jira-issues',
|
|
@@ -410,10 +394,5 @@ const JiraIssuesConfigModalWithExtraAnalyticsOnInsert = props => {
|
|
|
410
394
|
})));
|
|
411
395
|
};
|
|
412
396
|
export const JiraIssuesConfigModal = props => {
|
|
413
|
-
|
|
414
|
-
return jsx(JiraIssuesConfigModalWithExtraAnalyticsOnInsert, props);
|
|
415
|
-
}
|
|
416
|
-
return jsx(StoreContainer, null, jsx(AnalyticsContext, {
|
|
417
|
-
data: contextData
|
|
418
|
-
}, jsx(DatasourceExperienceIdProvider, null, jsx(UserInteractionsProvider, null, jsx(PlainJiraIssuesConfigModalOld, props)))));
|
|
397
|
+
return jsx(JiraIssuesConfigModalWithExtraAnalyticsOnInsert, props);
|
|
419
398
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
|
+
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; }
|
|
6
|
+
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
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
-
import { useEffect,
|
|
8
|
+
import { useEffect, useReducer } from 'react';
|
|
6
9
|
import { ActionOperationStatus } from '@atlaskit/linking-types';
|
|
7
10
|
import { useDatasourceTableFlag } from './useDatasourceTableFlag';
|
|
8
11
|
var loadOptions = /*#__PURE__*/function () {
|
|
@@ -46,30 +49,38 @@ var loadOptions = /*#__PURE__*/function () {
|
|
|
46
49
|
return _ref.apply(this, arguments);
|
|
47
50
|
};
|
|
48
51
|
}();
|
|
52
|
+
var reducer = function reducer(state, payload) {
|
|
53
|
+
return _objectSpread(_objectSpread({}, state), payload);
|
|
54
|
+
};
|
|
49
55
|
export var useLoadOptions = function useLoadOptions(_ref2) {
|
|
50
56
|
var fetchInputs = _ref2.fetchInputs,
|
|
51
57
|
executeFetch = _ref2.executeFetch,
|
|
52
58
|
emptyOption = _ref2.emptyOption;
|
|
53
|
-
var
|
|
59
|
+
var _useReducer = useReducer(reducer, {
|
|
54
60
|
isLoading: true,
|
|
55
61
|
options: [],
|
|
56
62
|
hasFailed: false
|
|
57
63
|
}),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
options =
|
|
61
|
-
isLoading =
|
|
62
|
-
hasFailed =
|
|
63
|
-
|
|
64
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
65
|
+
_useReducer2$ = _useReducer2[0],
|
|
66
|
+
options = _useReducer2$.options,
|
|
67
|
+
isLoading = _useReducer2$.isLoading,
|
|
68
|
+
hasFailed = _useReducer2$.hasFailed,
|
|
69
|
+
dispatch = _useReducer2[1];
|
|
64
70
|
var _useDatasourceTableFl = useDatasourceTableFlag({
|
|
65
71
|
isFetchAction: true
|
|
66
72
|
}),
|
|
67
73
|
showErrorFlag = _useDatasourceTableFl.showErrorFlag;
|
|
68
74
|
useEffect(function () {
|
|
69
75
|
var isMounted = true;
|
|
76
|
+
// Set the loading state before sending the request
|
|
77
|
+
dispatch({
|
|
78
|
+
isLoading: true
|
|
79
|
+
});
|
|
80
|
+
// Query the options
|
|
70
81
|
loadOptions(fetchInputs, executeFetch).then(function (options) {
|
|
71
82
|
if (isMounted) {
|
|
72
|
-
|
|
83
|
+
dispatch({
|
|
73
84
|
isLoading: false,
|
|
74
85
|
options: emptyOption ? [emptyOption].concat(_toConsumableArray(options)) : options,
|
|
75
86
|
hasFailed: false
|
|
@@ -77,7 +88,7 @@ export var useLoadOptions = function useLoadOptions(_ref2) {
|
|
|
77
88
|
}
|
|
78
89
|
}).catch(function (err) {
|
|
79
90
|
showErrorFlag();
|
|
80
|
-
|
|
91
|
+
dispatch({
|
|
81
92
|
isLoading: false,
|
|
82
93
|
options: [],
|
|
83
94
|
hasFailed: true
|
|
@@ -12,17 +12,13 @@ import { Fragment, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
13
|
import { jsx } from '@emotion/react';
|
|
14
14
|
import { FormattedMessage } from 'react-intl-next';
|
|
15
|
-
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
16
15
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
17
16
|
import { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
18
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
17
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
20
18
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
21
|
-
import { componentMetadata } from '../../../analytics/constants';
|
|
22
19
|
import { DatasourceAction, DatasourceSearchMethod } from '../../../analytics/types';
|
|
23
20
|
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
24
|
-
import {
|
|
25
|
-
import { UserInteractionsProvider, useUserInteractions } from '../../../contexts/user-interactions';
|
|
21
|
+
import { useUserInteractions } from '../../../contexts/user-interactions';
|
|
26
22
|
import i18nEN from '../../../i18n/en';
|
|
27
23
|
import { useAvailableSites } from '../../../services/useAvailableSites';
|
|
28
24
|
import { StoreContainer } from '../../../state';
|
|
@@ -47,7 +43,6 @@ import { EmptyState } from '../../issue-like-table';
|
|
|
47
43
|
import ConfluenceSearchContainer from '../confluence-search-container';
|
|
48
44
|
import { ConfluenceSearchInitialStateSVG } from './confluence-search-initial-state-svg';
|
|
49
45
|
import { confluenceSearchModalMessages } from './messages';
|
|
50
|
-
import { PlainConfluenceSearchConfigModal as PlainConfluenceSearchConfigModalOld } from './ModalOld';
|
|
51
46
|
var inputContainerStyles = xcss({
|
|
52
47
|
alignItems: 'baseline',
|
|
53
48
|
display: 'flex',
|
|
@@ -342,32 +337,18 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
342
337
|
getAnalyticsPayload: getButtonAnalyticsPayload
|
|
343
338
|
}, jsx(FormattedMessage, confluenceSearchModalMessages.insertResultsButtonText)))));
|
|
344
339
|
};
|
|
345
|
-
var analyticsContextAttributes = {
|
|
346
|
-
dataProvider: 'confluence-search'
|
|
347
|
-
};
|
|
348
|
-
var analyticsContextData = _objectSpread(_objectSpread({}, componentMetadata.configModal), {}, {
|
|
349
|
-
source: 'datasourceConfigModal'
|
|
350
|
-
});
|
|
351
|
-
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
352
|
-
attributes: _objectSpread({}, analyticsContextAttributes)
|
|
353
|
-
});
|
|
354
340
|
var ConnectedConfluenceSearchConfigModal = createDatasourceModal({
|
|
355
341
|
isValidParameters: isValidParameters,
|
|
356
342
|
dataProvider: 'confluence-search',
|
|
357
343
|
component: PlainConfluenceSearchConfigModal
|
|
358
344
|
});
|
|
359
345
|
export var ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(props) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
})));
|
|
369
|
-
}
|
|
370
|
-
return jsx(StoreContainer, null, jsx(AnalyticsContext, {
|
|
371
|
-
data: contextData
|
|
372
|
-
}, jsx(DatasourceExperienceIdProvider, null, jsx(UserInteractionsProvider, null, jsx(PlainConfluenceSearchConfigModalOld, props)))));
|
|
346
|
+
return jsx(StoreContainer, null, jsx(ConnectedConfluenceSearchConfigModal, _extends({}, props, {
|
|
347
|
+
/**
|
|
348
|
+
* If the intial parameters are not valid, we will not initialise the modal state
|
|
349
|
+
* with `overrideParameters`. This is to allow the modal to be opened without
|
|
350
|
+
* any initial parameters and require the user to perform a search.
|
|
351
|
+
*/
|
|
352
|
+
parameters: props.overrideParameters && isValidParameters(props.parameters) ? _objectSpread(_objectSpread({}, props.parameters), props.overrideParameters) : props.parameters
|
|
353
|
+
})));
|
|
373
354
|
};
|