@atlaskit/link-datasource 3.9.0 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/cjs/hooks/useDatasourceTableFlag.js +12 -3
- package/dist/cjs/state/actions/index.js +7 -4
- package/dist/cjs/ui/issue-like-table/edit-type/icon/index.js +134 -0
- package/dist/cjs/ui/issue-like-table/edit-type/index.js +25 -8
- package/dist/cjs/ui/issue-like-table/edit-type/status/index.js +34 -17
- package/dist/cjs/ui/issue-like-table/messages.js +10 -0
- package/dist/cjs/ui/issue-like-table/render-type/icon/index.js +5 -0
- package/dist/cjs/ui/issue-like-table/render-type/index.js +5 -1
- package/dist/cjs/ui/issue-like-table/render-type/new-icon/index.js +25 -0
- package/dist/cjs/ui/issue-like-table/shared-components/icon/index.js +42 -0
- package/dist/cjs/ui/table-footer/index.js +1 -2
- package/dist/es2019/hooks/useDatasourceTableFlag.js +12 -3
- package/dist/es2019/state/actions/index.js +6 -5
- package/dist/es2019/ui/issue-like-table/edit-type/icon/index.js +94 -0
- package/dist/es2019/ui/issue-like-table/edit-type/index.js +19 -6
- package/dist/es2019/ui/issue-like-table/edit-type/status/index.js +18 -6
- package/dist/es2019/ui/issue-like-table/messages.js +10 -0
- package/dist/es2019/ui/issue-like-table/render-type/icon/index.js +5 -0
- package/dist/es2019/ui/issue-like-table/render-type/index.js +3 -1
- package/dist/es2019/ui/issue-like-table/render-type/new-icon/index.js +18 -0
- package/dist/es2019/ui/issue-like-table/shared-components/icon/index.js +36 -0
- package/dist/es2019/ui/table-footer/index.js +1 -2
- package/dist/esm/hooks/useDatasourceTableFlag.js +12 -3
- package/dist/esm/state/actions/index.js +7 -4
- package/dist/esm/ui/issue-like-table/edit-type/icon/index.js +124 -0
- package/dist/esm/ui/issue-like-table/edit-type/index.js +25 -8
- package/dist/esm/ui/issue-like-table/edit-type/status/index.js +34 -17
- package/dist/esm/ui/issue-like-table/messages.js +10 -0
- package/dist/esm/ui/issue-like-table/render-type/icon/index.js +5 -0
- package/dist/esm/ui/issue-like-table/render-type/index.js +5 -1
- package/dist/esm/ui/issue-like-table/render-type/new-icon/index.js +18 -0
- package/dist/esm/ui/issue-like-table/shared-components/icon/index.js +35 -0
- package/dist/esm/ui/table-footer/index.js +1 -2
- package/dist/types/hooks/useDatasourceTableFlag.d.ts +1 -0
- package/dist/types/ui/issue-like-table/edit-type/icon/index.d.ts +14 -0
- package/dist/types/ui/issue-like-table/edit-type/index.d.ts +2 -1
- package/dist/types/ui/issue-like-table/messages.d.ts +10 -0
- package/dist/types/ui/issue-like-table/render-type/icon/index.d.ts +4 -0
- package/dist/types/ui/issue-like-table/render-type/new-icon/index.d.ts +9 -0
- package/dist/types/ui/issue-like-table/shared-components/icon/index.d.ts +23 -0
- package/dist/types/ui/issue-like-table/types.d.ts +7 -0
- package/dist/types-ts4.5/hooks/useDatasourceTableFlag.d.ts +1 -0
- package/dist/types-ts4.5/ui/issue-like-table/edit-type/icon/index.d.ts +14 -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/messages.d.ts +10 -0
- package/dist/types-ts4.5/ui/issue-like-table/render-type/icon/index.d.ts +4 -0
- package/dist/types-ts4.5/ui/issue-like-table/render-type/new-icon/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/issue-like-table/shared-components/icon/index.d.ts +23 -0
- package/dist/types-ts4.5/ui/issue-like-table/types.d.ts +7 -0
- package/package.json +5 -5
|
@@ -8,12 +8,15 @@ import Lozenge from '@atlaskit/lozenge';
|
|
|
8
8
|
import Select from '@atlaskit/select';
|
|
9
9
|
import { failUfoExperience, succeedUfoExperience } from '../../../../analytics/ufoExperiences';
|
|
10
10
|
import { useDatasourceExperienceId } from '../../../../contexts/datasource-experience-id';
|
|
11
|
+
import { useDatasourceTableFlag } from '../../../../hooks/useDatasourceTableFlag';
|
|
11
12
|
import { InlineEditUFOExperience } from '../../table-cell-content/inline-edit';
|
|
12
13
|
var StatusEditType = function StatusEditType(props) {
|
|
13
14
|
var _currentValue$values;
|
|
14
15
|
var currentValue = props.currentValue,
|
|
15
16
|
executeFetch = props.executeFetch;
|
|
16
|
-
var _useStatusOptions = useStatusOptions(
|
|
17
|
+
var _useStatusOptions = useStatusOptions({
|
|
18
|
+
executeFetch: executeFetch
|
|
19
|
+
}),
|
|
17
20
|
options = _useStatusOptions.options,
|
|
18
21
|
isLoading = _useStatusOptions.isLoading,
|
|
19
22
|
hasFailed = _useStatusOptions.hasFailed;
|
|
@@ -61,7 +64,9 @@ var StatusEditType = function StatusEditType(props) {
|
|
|
61
64
|
var filterOption = function filterOption(option, inputValue) {
|
|
62
65
|
return option.data.text.toLowerCase().includes(inputValue.toLowerCase());
|
|
63
66
|
};
|
|
64
|
-
var useStatusOptions = function useStatusOptions(
|
|
67
|
+
var useStatusOptions = function useStatusOptions(_ref) {
|
|
68
|
+
var fetchInputs = _ref.fetchInputs,
|
|
69
|
+
executeFetch = _ref.executeFetch;
|
|
65
70
|
var _useState = useState({
|
|
66
71
|
isLoading: true,
|
|
67
72
|
options: [],
|
|
@@ -73,9 +78,13 @@ var useStatusOptions = function useStatusOptions(currentValue, executeFetch) {
|
|
|
73
78
|
isLoading = _useState2$.isLoading,
|
|
74
79
|
hasFailed = _useState2$.hasFailed,
|
|
75
80
|
setOptions = _useState2[1];
|
|
81
|
+
var _useDatasourceTableFl = useDatasourceTableFlag({
|
|
82
|
+
isFetchAction: true
|
|
83
|
+
}),
|
|
84
|
+
showErrorFlag = _useDatasourceTableFl.showErrorFlag;
|
|
76
85
|
useEffect(function () {
|
|
77
86
|
var isMounted = true;
|
|
78
|
-
loadOptions(
|
|
87
|
+
loadOptions(fetchInputs, executeFetch).then(function (options) {
|
|
79
88
|
if (isMounted) {
|
|
80
89
|
setOptions({
|
|
81
90
|
isLoading: false,
|
|
@@ -84,6 +93,7 @@ var useStatusOptions = function useStatusOptions(currentValue, executeFetch) {
|
|
|
84
93
|
});
|
|
85
94
|
}
|
|
86
95
|
}).catch(function (err) {
|
|
96
|
+
showErrorFlag();
|
|
87
97
|
setOptions({
|
|
88
98
|
isLoading: false,
|
|
89
99
|
options: [],
|
|
@@ -93,7 +103,7 @@ var useStatusOptions = function useStatusOptions(currentValue, executeFetch) {
|
|
|
93
103
|
return function () {
|
|
94
104
|
isMounted = false;
|
|
95
105
|
};
|
|
96
|
-
}, [
|
|
106
|
+
}, [fetchInputs, executeFetch, showErrorFlag]);
|
|
97
107
|
return {
|
|
98
108
|
options: options,
|
|
99
109
|
isLoading: isLoading,
|
|
@@ -101,28 +111,35 @@ var useStatusOptions = function useStatusOptions(currentValue, executeFetch) {
|
|
|
101
111
|
};
|
|
102
112
|
};
|
|
103
113
|
var loadOptions = /*#__PURE__*/function () {
|
|
104
|
-
var
|
|
105
|
-
var
|
|
114
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
115
|
+
var fetchInputs,
|
|
116
|
+
executeFetch,
|
|
117
|
+
result,
|
|
118
|
+
operationStatus,
|
|
119
|
+
entities,
|
|
120
|
+
_args = arguments;
|
|
106
121
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
107
122
|
while (1) switch (_context.prev = _context.next) {
|
|
108
123
|
case 0:
|
|
124
|
+
fetchInputs = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
125
|
+
executeFetch = _args.length > 1 ? _args[1] : undefined;
|
|
109
126
|
if (!executeFetch) {
|
|
110
|
-
_context.next =
|
|
127
|
+
_context.next = 11;
|
|
111
128
|
break;
|
|
112
129
|
}
|
|
113
|
-
_context.next =
|
|
114
|
-
return executeFetch(
|
|
115
|
-
case
|
|
130
|
+
_context.next = 5;
|
|
131
|
+
return executeFetch(fetchInputs);
|
|
132
|
+
case 5:
|
|
116
133
|
result = _context.sent;
|
|
117
134
|
operationStatus = result.operationStatus, entities = result.entities;
|
|
118
135
|
if (!(operationStatus === ActionOperationStatus.FAILURE)) {
|
|
119
|
-
_context.next =
|
|
136
|
+
_context.next = 9;
|
|
120
137
|
break;
|
|
121
138
|
}
|
|
122
139
|
throw new Error('Failed to fetch status options');
|
|
123
|
-
case
|
|
140
|
+
case 9:
|
|
124
141
|
if (!entities) {
|
|
125
|
-
_context.next =
|
|
142
|
+
_context.next = 11;
|
|
126
143
|
break;
|
|
127
144
|
}
|
|
128
145
|
return _context.abrupt("return", entities.map(function (entity) {
|
|
@@ -133,16 +150,16 @@ var loadOptions = /*#__PURE__*/function () {
|
|
|
133
150
|
transitionId: entity.transitionId
|
|
134
151
|
};
|
|
135
152
|
}));
|
|
136
|
-
case
|
|
153
|
+
case 11:
|
|
137
154
|
return _context.abrupt("return", []);
|
|
138
|
-
case
|
|
155
|
+
case 12:
|
|
139
156
|
case "end":
|
|
140
157
|
return _context.stop();
|
|
141
158
|
}
|
|
142
159
|
}, _callee);
|
|
143
160
|
}));
|
|
144
|
-
return function loadOptions(
|
|
145
|
-
return
|
|
161
|
+
return function loadOptions() {
|
|
162
|
+
return _ref2.apply(this, arguments);
|
|
146
163
|
};
|
|
147
164
|
}();
|
|
148
165
|
export default StatusEditType;
|
|
@@ -20,6 +20,16 @@ export var issueLikeTableMessages = defineMessages({
|
|
|
20
20
|
description: 'Generic error message title shown when updating issue field fails',
|
|
21
21
|
defaultMessage: 'Something went wrong'
|
|
22
22
|
},
|
|
23
|
+
fetchActionErrorGenericDescription: {
|
|
24
|
+
id: 'linkDataSource.issue-line-table.fetch-action-error-generic-description',
|
|
25
|
+
description: 'Generic error message description shown when fetching inline edit dropdown field fails',
|
|
26
|
+
defaultMessage: 'Wait a few minutes, then try again. Check your project settings or contact support if this keeps happening.'
|
|
27
|
+
},
|
|
28
|
+
fetchActionErrorGenericTitle: {
|
|
29
|
+
id: 'linkDataSource.issue-line-table.fetch-action-error-generic-title',
|
|
30
|
+
description: 'Generic error message title shown when fetching inline edit dropdown field fails',
|
|
31
|
+
defaultMessage: 'We’re having trouble fetching options'
|
|
32
|
+
},
|
|
23
33
|
wrapText: {
|
|
24
34
|
id: 'linkDataSource.issue-line-table.wrap-text',
|
|
25
35
|
description: 'Table header Dropdown item for making whole column to wrap text',
|
|
@@ -18,6 +18,11 @@ var textWrapperStyles = xcss({
|
|
|
18
18
|
});
|
|
19
19
|
export var ICON_TYPE_TEST_ID = 'link-datasource-render-type--icon';
|
|
20
20
|
export var ICON_TYPE_TEXT_TEST_ID = "".concat(ICON_TYPE_TEST_ID, "-text");
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated: To be cleaned up and replaced with new-icon after
|
|
24
|
+
* `platform-datasources-enable-two-way-sync-priority` rollout.
|
|
25
|
+
*/
|
|
21
26
|
var IconRenderType = function IconRenderType(_ref) {
|
|
22
27
|
var label = _ref.label,
|
|
23
28
|
text = _ref.text,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import BooleanRenderType from './boolean';
|
|
4
5
|
import DateTimeRenderType, { getFormattedDate } from './date-time';
|
|
5
6
|
import IconRenderType from './icon';
|
|
6
7
|
import LinkRenderType from './link';
|
|
8
|
+
import NewIconRenderType from './new-icon';
|
|
7
9
|
import NumberRenderType from './number';
|
|
8
10
|
import RichTextRenderType, { parseRichText } from './richtext';
|
|
9
11
|
import StatusRenderType from './status';
|
|
@@ -65,7 +67,9 @@ export var renderType = function renderType(item) {
|
|
|
65
67
|
});
|
|
66
68
|
});
|
|
67
69
|
case 'icon':
|
|
68
|
-
return item.values.map(function (iconValue) {
|
|
70
|
+
return fg('platform-datasources-enable-two-way-sync-priority') ? item.values.map(function (iconValue) {
|
|
71
|
+
return /*#__PURE__*/React.createElement(NewIconRenderType, iconValue);
|
|
72
|
+
}) : item.values.map(function (iconValue) {
|
|
69
73
|
return /*#__PURE__*/React.createElement(IconRenderType, iconValue);
|
|
70
74
|
});
|
|
71
75
|
case 'link':
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SharedIconComponent } from '../../shared-components/icon';
|
|
3
|
+
export var ICON_TYPE_TEST_ID = 'link-datasource-render-type--icon';
|
|
4
|
+
export var ICON_TYPE_TEXT_TEST_ID = "".concat(ICON_TYPE_TEST_ID, "-text");
|
|
5
|
+
var IconRenderType = function IconRenderType(_ref) {
|
|
6
|
+
var label = _ref.label,
|
|
7
|
+
text = _ref.text,
|
|
8
|
+
source = _ref.source,
|
|
9
|
+
_ref$testId = _ref.testId,
|
|
10
|
+
testId = _ref$testId === void 0 ? ICON_TYPE_TEST_ID : _ref$testId;
|
|
11
|
+
return /*#__PURE__*/React.createElement(SharedIconComponent, {
|
|
12
|
+
testId: testId,
|
|
13
|
+
iconUrl: source,
|
|
14
|
+
label: label,
|
|
15
|
+
text: text
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export default IconRenderType;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Flex, Inline, xcss } from '@atlaskit/primitives';
|
|
3
|
+
var labelStyles = xcss({
|
|
4
|
+
overflow: 'hidden',
|
|
5
|
+
textOverflow: 'ellipsis',
|
|
6
|
+
width: '100%'
|
|
7
|
+
});
|
|
8
|
+
/**
|
|
9
|
+
* Renders a icon and label.
|
|
10
|
+
* If the text is undefined, render the capitalised label.
|
|
11
|
+
*/
|
|
12
|
+
export function SharedIconComponent(_ref) {
|
|
13
|
+
var iconUrl = _ref.iconUrl,
|
|
14
|
+
label = _ref.label,
|
|
15
|
+
text = _ref.text,
|
|
16
|
+
testId = _ref.testId;
|
|
17
|
+
var displayText = text === undefined || text === '' ? label ? label.charAt(0).toUpperCase() + label.slice(1) : undefined : text;
|
|
18
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
19
|
+
gap: "space.100",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
testId: testId
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement("img", {
|
|
23
|
+
src: iconUrl,
|
|
24
|
+
alt: label
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
26
|
+
,
|
|
27
|
+
style: {
|
|
28
|
+
minWidth: '24px',
|
|
29
|
+
maxWidth: '24px'
|
|
30
|
+
} // having just width: '24px' shrinks it when table width is reduced
|
|
31
|
+
})), displayText && /*#__PURE__*/React.createElement(Box, {
|
|
32
|
+
xcss: labelStyles,
|
|
33
|
+
testId: "".concat(testId, "-text")
|
|
34
|
+
}, displayText));
|
|
35
|
+
}
|
|
@@ -12,7 +12,6 @@ import styled from '@emotion/styled';
|
|
|
12
12
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
13
13
|
import Button from '@atlaskit/button';
|
|
14
14
|
import RefreshIcon from '@atlaskit/icon/core/migration/refresh';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
15
|
import { Flex } from '@atlaskit/primitives';
|
|
17
16
|
import { N0, N40, N90 } from '@atlaskit/theme/colors';
|
|
18
17
|
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '../assets-modal';
|
|
@@ -73,7 +72,7 @@ export var TableFooter = function TableFooter(_ref) {
|
|
|
73
72
|
// ensure correct positioning since 'justify-content: space-between' is used).
|
|
74
73
|
return onRefresh || showItemCount ? jsx(FooterWrapper, {
|
|
75
74
|
"data-testid": "table-footer"
|
|
76
|
-
}, jsx(TopBorderWrapper, null, showItemCount && jsx(Flex, null, datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID
|
|
75
|
+
}, jsx(TopBorderWrapper, null, showItemCount && jsx(Flex, null, datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? jsx(AssetsItemCount, {
|
|
77
76
|
searchCount: itemCount,
|
|
78
77
|
url: url,
|
|
79
78
|
testId: "item-count"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CreateFlagArgs } from '@atlaskit/flag';
|
|
2
2
|
interface DatasourceTableFlagOptions {
|
|
3
3
|
url?: string;
|
|
4
|
+
isFetchAction?: boolean;
|
|
4
5
|
}
|
|
5
6
|
export declare const useDatasourceTableFlag: (options?: DatasourceTableFlagOptions) => {
|
|
6
7
|
showErrorFlag: (args?: Partial<CreateFlagArgs> & {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FieldProps } from '@atlaskit/form';
|
|
3
|
+
import { type ExecuteFetch } from '../../../../state/actions';
|
|
4
|
+
import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
|
|
5
|
+
interface Props extends Omit<FieldProps<string>, 'value'> {
|
|
6
|
+
currentValue: DatasourceTypeWithOnlyTypeValues<'icon'>;
|
|
7
|
+
setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
|
|
8
|
+
executeFetch?: ExecuteFetch;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Should be gated by FF rollout of platform-datasources-enable-two-way-sync-priority
|
|
12
|
+
*/
|
|
13
|
+
declare const PriorityEditType: (props: Props) => JSX.Element;
|
|
14
|
+
export default PriorityEditType;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type InlineEdit from '@atlaskit/inline-edit';
|
|
3
3
|
import type { DatasourceType } from '@atlaskit/linking-types';
|
|
4
|
+
import { type ExecuteFetch } from '../../../state/actions';
|
|
4
5
|
import { type DatasourceTypeWithOnlyValues } from '../types';
|
|
5
6
|
export declare const editType: ({ defaultValue, currentValue, setEditValues, executeFetch, }: {
|
|
6
7
|
defaultValue: DatasourceTypeWithOnlyValues;
|
|
7
8
|
currentValue: DatasourceTypeWithOnlyValues;
|
|
8
9
|
setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
|
|
9
|
-
executeFetch?:
|
|
10
|
+
executeFetch?: ExecuteFetch | undefined;
|
|
10
11
|
}) => Pick<React.ComponentProps<typeof InlineEdit>, 'defaultValue' | 'editView'>;
|
|
11
12
|
export declare const isEditTypeSupported: (type: DatasourceType['type']) => boolean;
|
|
12
13
|
export declare const isEditTypeSelectable: (type: DatasourceType['type']) => boolean;
|
|
@@ -19,6 +19,16 @@ export declare const issueLikeTableMessages: {
|
|
|
19
19
|
description: string;
|
|
20
20
|
defaultMessage: string;
|
|
21
21
|
};
|
|
22
|
+
fetchActionErrorGenericDescription: {
|
|
23
|
+
id: string;
|
|
24
|
+
description: string;
|
|
25
|
+
defaultMessage: string;
|
|
26
|
+
};
|
|
27
|
+
fetchActionErrorGenericTitle: {
|
|
28
|
+
id: string;
|
|
29
|
+
description: string;
|
|
30
|
+
defaultMessage: string;
|
|
31
|
+
};
|
|
22
32
|
wrapText: {
|
|
23
33
|
id: string;
|
|
24
34
|
description: string;
|
|
@@ -5,5 +5,9 @@ interface IconProps extends Icon {
|
|
|
5
5
|
}
|
|
6
6
|
export declare const ICON_TYPE_TEST_ID = "link-datasource-render-type--icon";
|
|
7
7
|
export declare const ICON_TYPE_TEXT_TEST_ID = "link-datasource-render-type--icon-text";
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated: To be cleaned up and replaced with new-icon after
|
|
10
|
+
* `platform-datasources-enable-two-way-sync-priority` rollout.
|
|
11
|
+
*/
|
|
8
12
|
declare const IconRenderType: ({ label, text, source, testId }: IconProps) => JSX.Element;
|
|
9
13
|
export default IconRenderType;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type Icon } from '@atlaskit/linking-types';
|
|
3
|
+
interface IconProps extends Icon {
|
|
4
|
+
testId?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const ICON_TYPE_TEST_ID = "link-datasource-render-type--icon";
|
|
7
|
+
export declare const ICON_TYPE_TEXT_TEST_ID = "link-datasource-render-type--icon-text";
|
|
8
|
+
declare const IconRenderType: ({ label, text, source, testId }: IconProps) => JSX.Element;
|
|
9
|
+
export default IconRenderType;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface SharedIconComponentProps {
|
|
3
|
+
/**
|
|
4
|
+
* URL or SVG for the priority icon
|
|
5
|
+
*/
|
|
6
|
+
iconUrl: string;
|
|
7
|
+
/**
|
|
8
|
+
* Text that labels the icon. Will not be capitalised.
|
|
9
|
+
*/
|
|
10
|
+
text?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Label.
|
|
13
|
+
* Used for icon alt.
|
|
14
|
+
*/
|
|
15
|
+
label?: string;
|
|
16
|
+
testId: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Renders a icon and label.
|
|
20
|
+
* If the text is undefined, render the capitalised label.
|
|
21
|
+
*/
|
|
22
|
+
export declare function SharedIconComponent({ iconUrl, label, text, testId }: SharedIconComponentProps): JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -9,6 +9,13 @@ export type DatasourceTypeWithOnlyValues = {
|
|
|
9
9
|
}>['value'][];
|
|
10
10
|
};
|
|
11
11
|
}[DatasourceType['type']];
|
|
12
|
+
/** Object typing a list of data objects for type K */
|
|
13
|
+
export type DatasourceTypeWithOnlyTypeValues<K> = {
|
|
14
|
+
type: K;
|
|
15
|
+
values: Extract<DatasourceType, {
|
|
16
|
+
type: K;
|
|
17
|
+
}>['value'][];
|
|
18
|
+
};
|
|
12
19
|
export type TableViewPropsRenderType = (item: DatasourceTypeWithOnlyValues) => React.ReactNode;
|
|
13
20
|
export interface ColumnSizesMap {
|
|
14
21
|
[key: string]: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CreateFlagArgs } from '@atlaskit/flag';
|
|
2
2
|
interface DatasourceTableFlagOptions {
|
|
3
3
|
url?: string;
|
|
4
|
+
isFetchAction?: boolean;
|
|
4
5
|
}
|
|
5
6
|
export declare const useDatasourceTableFlag: (options?: DatasourceTableFlagOptions) => {
|
|
6
7
|
showErrorFlag: (args?: Partial<CreateFlagArgs> & {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FieldProps } from '@atlaskit/form';
|
|
3
|
+
import { type ExecuteFetch } from '../../../../state/actions';
|
|
4
|
+
import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
|
|
5
|
+
interface Props extends Omit<FieldProps<string>, 'value'> {
|
|
6
|
+
currentValue: DatasourceTypeWithOnlyTypeValues<'icon'>;
|
|
7
|
+
setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
|
|
8
|
+
executeFetch?: ExecuteFetch;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Should be gated by FF rollout of platform-datasources-enable-two-way-sync-priority
|
|
12
|
+
*/
|
|
13
|
+
declare const PriorityEditType: (props: Props) => JSX.Element;
|
|
14
|
+
export default PriorityEditType;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type InlineEdit from '@atlaskit/inline-edit';
|
|
3
3
|
import type { DatasourceType } from '@atlaskit/linking-types';
|
|
4
|
+
import { type ExecuteFetch } from '../../../state/actions';
|
|
4
5
|
import { type DatasourceTypeWithOnlyValues } from '../types';
|
|
5
6
|
export declare const editType: ({ defaultValue, currentValue, setEditValues, executeFetch, }: {
|
|
6
7
|
defaultValue: DatasourceTypeWithOnlyValues;
|
|
7
8
|
currentValue: DatasourceTypeWithOnlyValues;
|
|
8
9
|
setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
|
|
9
|
-
executeFetch?:
|
|
10
|
+
executeFetch?: ExecuteFetch | undefined;
|
|
10
11
|
}) => Pick<React.ComponentProps<typeof InlineEdit>, 'defaultValue' | 'editView'>;
|
|
11
12
|
export declare const isEditTypeSupported: (type: DatasourceType['type']) => boolean;
|
|
12
13
|
export declare const isEditTypeSelectable: (type: DatasourceType['type']) => boolean;
|
|
@@ -19,6 +19,16 @@ export declare const issueLikeTableMessages: {
|
|
|
19
19
|
description: string;
|
|
20
20
|
defaultMessage: string;
|
|
21
21
|
};
|
|
22
|
+
fetchActionErrorGenericDescription: {
|
|
23
|
+
id: string;
|
|
24
|
+
description: string;
|
|
25
|
+
defaultMessage: string;
|
|
26
|
+
};
|
|
27
|
+
fetchActionErrorGenericTitle: {
|
|
28
|
+
id: string;
|
|
29
|
+
description: string;
|
|
30
|
+
defaultMessage: string;
|
|
31
|
+
};
|
|
22
32
|
wrapText: {
|
|
23
33
|
id: string;
|
|
24
34
|
description: string;
|
|
@@ -5,5 +5,9 @@ interface IconProps extends Icon {
|
|
|
5
5
|
}
|
|
6
6
|
export declare const ICON_TYPE_TEST_ID = "link-datasource-render-type--icon";
|
|
7
7
|
export declare const ICON_TYPE_TEXT_TEST_ID = "link-datasource-render-type--icon-text";
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated: To be cleaned up and replaced with new-icon after
|
|
10
|
+
* `platform-datasources-enable-two-way-sync-priority` rollout.
|
|
11
|
+
*/
|
|
8
12
|
declare const IconRenderType: ({ label, text, source, testId }: IconProps) => JSX.Element;
|
|
9
13
|
export default IconRenderType;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type Icon } from '@atlaskit/linking-types';
|
|
3
|
+
interface IconProps extends Icon {
|
|
4
|
+
testId?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const ICON_TYPE_TEST_ID = "link-datasource-render-type--icon";
|
|
7
|
+
export declare const ICON_TYPE_TEXT_TEST_ID = "link-datasource-render-type--icon-text";
|
|
8
|
+
declare const IconRenderType: ({ label, text, source, testId }: IconProps) => JSX.Element;
|
|
9
|
+
export default IconRenderType;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface SharedIconComponentProps {
|
|
3
|
+
/**
|
|
4
|
+
* URL or SVG for the priority icon
|
|
5
|
+
*/
|
|
6
|
+
iconUrl: string;
|
|
7
|
+
/**
|
|
8
|
+
* Text that labels the icon. Will not be capitalised.
|
|
9
|
+
*/
|
|
10
|
+
text?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Label.
|
|
13
|
+
* Used for icon alt.
|
|
14
|
+
*/
|
|
15
|
+
label?: string;
|
|
16
|
+
testId: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Renders a icon and label.
|
|
20
|
+
* If the text is undefined, render the capitalised label.
|
|
21
|
+
*/
|
|
22
|
+
export declare function SharedIconComponent({ iconUrl, label, text, testId }: SharedIconComponentProps): JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -9,6 +9,13 @@ export type DatasourceTypeWithOnlyValues = {
|
|
|
9
9
|
}>['value'][];
|
|
10
10
|
};
|
|
11
11
|
}[DatasourceType['type']];
|
|
12
|
+
/** Object typing a list of data objects for type K */
|
|
13
|
+
export type DatasourceTypeWithOnlyTypeValues<K> = {
|
|
14
|
+
type: K;
|
|
15
|
+
values: Extract<DatasourceType, {
|
|
16
|
+
type: K;
|
|
17
|
+
}>['value'][];
|
|
18
|
+
};
|
|
12
19
|
export type TableViewPropsRenderType = (item: DatasourceTypeWithOnlyValues) => React.ReactNode;
|
|
13
20
|
export interface ColumnSizesMap {
|
|
14
21
|
[key: string]: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
71
71
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^1.2.0",
|
|
72
72
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
|
|
73
|
-
"@atlaskit/primitives": "^13.
|
|
73
|
+
"@atlaskit/primitives": "^13.2.0",
|
|
74
74
|
"@atlaskit/react-select": "^1.3.0",
|
|
75
75
|
"@atlaskit/select": "^18.5.0",
|
|
76
76
|
"@atlaskit/smart-card": "^30.2.0",
|
|
@@ -168,13 +168,13 @@
|
|
|
168
168
|
"platform-datasources-enable-two-way-sync-statuses": {
|
|
169
169
|
"type": "boolean"
|
|
170
170
|
},
|
|
171
|
-
"platform
|
|
171
|
+
"platform-datasources-enable-two-way-sync-priority": {
|
|
172
172
|
"type": "boolean"
|
|
173
173
|
},
|
|
174
|
-
"platform.linking-platform.datasource-
|
|
174
|
+
"platform.linking-platform.datasource-assets_add_version_parameter": {
|
|
175
175
|
"type": "boolean"
|
|
176
176
|
},
|
|
177
|
-
"platform.linking-platform.datasource
|
|
177
|
+
"platform.linking-platform.datasource-assets_update_refresh_button_dt3qk": {
|
|
178
178
|
"type": "boolean"
|
|
179
179
|
},
|
|
180
180
|
"platform-datasources-use-refactored-config-modal": {
|