@atlaskit/link-datasource 3.8.3 → 3.8.5
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 +17 -0
- package/dist/cjs/state/actions/index.js +0 -1
- package/dist/cjs/ui/issue-like-table/edit-type/status/index.js +1 -2
- package/dist/cjs/ui/issue-like-table/render-type/icon/index.js +17 -2
- package/dist/es2019/state/actions/index.js +0 -1
- package/dist/es2019/ui/issue-like-table/edit-type/status/index.js +1 -3
- package/dist/es2019/ui/issue-like-table/render-type/icon/index.js +16 -1
- package/dist/esm/state/actions/index.js +0 -1
- package/dist/esm/ui/issue-like-table/edit-type/status/index.js +1 -2
- package/dist/esm/ui/issue-like-table/render-type/icon/index.js +16 -1
- package/dist/types/state/actions/index.d.ts +3 -2
- package/dist/types/ui/issue-like-table/edit-type/status/index.d.ts +2 -1
- package/dist/types/ui/issue-like-table/render-type/icon/index.d.ts +2 -1
- package/dist/types-ts4.5/state/actions/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/issue-like-table/edit-type/status/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/issue-like-table/render-type/icon/index.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 3.8.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#158223](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/158223)
|
|
8
|
+
[`ab22f74a91062`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ab22f74a91062) -
|
|
9
|
+
The change here adds an optional `text` property for the Datasource Icon type.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.8.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#161257](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/161257)
|
|
17
|
+
[`085902303c5ee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/085902303c5ee) -
|
|
18
|
+
Fixes how we pass input params to executeFetchAction - behind ff
|
|
19
|
+
|
|
3
20
|
## 3.8.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -179,7 +179,6 @@ var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4)
|
|
|
179
179
|
var useAtomicUpdateActionSchema = exports.useAtomicUpdateActionSchema = (0, _reactSweetState.createHook)(ActionsStore, {
|
|
180
180
|
selector: getFieldUpdateActionByAri
|
|
181
181
|
});
|
|
182
|
-
|
|
183
182
|
/**
|
|
184
183
|
* Given an ARI + fieldKey + integrationKey
|
|
185
184
|
* Returns an executable action that updates a field on the entity if the user has permissions to do so
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -97,7 +96,7 @@ var loadOptions = /*#__PURE__*/function () {
|
|
|
97
96
|
break;
|
|
98
97
|
}
|
|
99
98
|
_context.next = 3;
|
|
100
|
-
return executeFetch(
|
|
99
|
+
return executeFetch({});
|
|
101
100
|
case 3:
|
|
102
101
|
result = _context.sent;
|
|
103
102
|
operationStatus = result.operationStatus, entities = result.entities;
|
|
@@ -4,9 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = exports.ICON_TYPE_TEST_ID = void 0;
|
|
7
|
+
exports.default = exports.ICON_TYPE_TEXT_TEST_ID = exports.ICON_TYPE_TEST_ID = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
|
+
var _primitives = require("@atlaskit/primitives");
|
|
11
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
10
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
13
|
|
|
12
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
@@ -15,9 +17,17 @@ var IconWrapper = _styled.default.div({
|
|
|
15
17
|
alignItems: 'center',
|
|
16
18
|
justifyContent: 'left'
|
|
17
19
|
});
|
|
20
|
+
var textWrapperStyles = (0, _primitives.xcss)({
|
|
21
|
+
marginLeft: 'space.100',
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
textOverflow: 'ellipsis',
|
|
24
|
+
whiteSpace: 'nowrap'
|
|
25
|
+
});
|
|
18
26
|
var ICON_TYPE_TEST_ID = exports.ICON_TYPE_TEST_ID = 'link-datasource-render-type--icon';
|
|
27
|
+
var ICON_TYPE_TEXT_TEST_ID = exports.ICON_TYPE_TEXT_TEST_ID = "".concat(ICON_TYPE_TEST_ID, "-text");
|
|
19
28
|
var IconRenderType = function IconRenderType(_ref) {
|
|
20
29
|
var label = _ref.label,
|
|
30
|
+
text = _ref.text,
|
|
21
31
|
source = _ref.source,
|
|
22
32
|
_ref$testId = _ref.testId,
|
|
23
33
|
testId = _ref$testId === void 0 ? ICON_TYPE_TEST_ID : _ref$testId;
|
|
@@ -31,6 +41,11 @@ var IconRenderType = function IconRenderType(_ref) {
|
|
|
31
41
|
minWidth: '20px',
|
|
32
42
|
maxWidth: '20px'
|
|
33
43
|
} // having just width: '20px' shrinks it when table width is reduced
|
|
34
|
-
})
|
|
44
|
+
}), text && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
45
|
+
xcss: textWrapperStyles
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
47
|
+
testId: ICON_TYPE_TEXT_TEST_ID,
|
|
48
|
+
text: text
|
|
49
|
+
})));
|
|
35
50
|
};
|
|
36
51
|
var _default = exports.default = IconRenderType;
|
|
@@ -161,7 +161,6 @@ const getFieldUpdateActionByAri = (state, {
|
|
|
161
161
|
export const useAtomicUpdateActionSchema = createHook(ActionsStore, {
|
|
162
162
|
selector: getFieldUpdateActionByAri
|
|
163
163
|
});
|
|
164
|
-
|
|
165
164
|
/**
|
|
166
165
|
* Given an ARI + fieldKey + integrationKey
|
|
167
166
|
* Returns an executable action that updates a field on the entity if the user has permissions to do so
|
|
@@ -67,9 +67,7 @@ const useStatusOptions = (currentValue, executeFetch) => {
|
|
|
67
67
|
};
|
|
68
68
|
const loadOptions = async (currentValue, executeFetch) => {
|
|
69
69
|
if (executeFetch) {
|
|
70
|
-
const result = await executeFetch({
|
|
71
|
-
[currentValue.type]: currentValue.values[0]
|
|
72
|
-
});
|
|
70
|
+
const result = await executeFetch({});
|
|
73
71
|
const {
|
|
74
72
|
operationStatus,
|
|
75
73
|
entities
|
|
@@ -2,15 +2,25 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
6
|
+
import TextRenderType from '../text';
|
|
5
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
6
8
|
const IconWrapper = styled.div({
|
|
7
9
|
display: 'flex',
|
|
8
10
|
alignItems: 'center',
|
|
9
11
|
justifyContent: 'left'
|
|
10
12
|
});
|
|
13
|
+
const textWrapperStyles = xcss({
|
|
14
|
+
marginLeft: 'space.100',
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
textOverflow: 'ellipsis',
|
|
17
|
+
whiteSpace: 'nowrap'
|
|
18
|
+
});
|
|
11
19
|
export const ICON_TYPE_TEST_ID = 'link-datasource-render-type--icon';
|
|
20
|
+
export const ICON_TYPE_TEXT_TEST_ID = `${ICON_TYPE_TEST_ID}-text`;
|
|
12
21
|
const IconRenderType = ({
|
|
13
22
|
label,
|
|
23
|
+
text,
|
|
14
24
|
source,
|
|
15
25
|
testId = ICON_TYPE_TEST_ID
|
|
16
26
|
}) => {
|
|
@@ -24,6 +34,11 @@ const IconRenderType = ({
|
|
|
24
34
|
minWidth: '20px',
|
|
25
35
|
maxWidth: '20px'
|
|
26
36
|
} // having just width: '20px' shrinks it when table width is reduced
|
|
27
|
-
})
|
|
37
|
+
}), text && /*#__PURE__*/React.createElement(Box, {
|
|
38
|
+
xcss: textWrapperStyles
|
|
39
|
+
}, /*#__PURE__*/React.createElement(TextRenderType, {
|
|
40
|
+
testId: ICON_TYPE_TEXT_TEST_ID,
|
|
41
|
+
text: text
|
|
42
|
+
})));
|
|
28
43
|
};
|
|
29
44
|
export default IconRenderType;
|
|
@@ -173,7 +173,6 @@ var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4)
|
|
|
173
173
|
export var useAtomicUpdateActionSchema = createHook(ActionsStore, {
|
|
174
174
|
selector: getFieldUpdateActionByAri
|
|
175
175
|
});
|
|
176
|
-
|
|
177
176
|
/**
|
|
178
177
|
* Given an ARI + fieldKey + integrationKey
|
|
179
178
|
* Returns an executable action that updates a field on the entity if the user has permissions to do so
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
@@ -87,7 +86,7 @@ var loadOptions = /*#__PURE__*/function () {
|
|
|
87
86
|
break;
|
|
88
87
|
}
|
|
89
88
|
_context.next = 3;
|
|
90
|
-
return executeFetch(
|
|
89
|
+
return executeFetch({});
|
|
91
90
|
case 3:
|
|
92
91
|
result = _context.sent;
|
|
93
92
|
operationStatus = result.operationStatus, entities = result.entities;
|
|
@@ -2,15 +2,25 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
6
|
+
import TextRenderType from '../text';
|
|
5
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
6
8
|
var IconWrapper = styled.div({
|
|
7
9
|
display: 'flex',
|
|
8
10
|
alignItems: 'center',
|
|
9
11
|
justifyContent: 'left'
|
|
10
12
|
});
|
|
13
|
+
var textWrapperStyles = xcss({
|
|
14
|
+
marginLeft: 'space.100',
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
textOverflow: 'ellipsis',
|
|
17
|
+
whiteSpace: 'nowrap'
|
|
18
|
+
});
|
|
11
19
|
export var ICON_TYPE_TEST_ID = 'link-datasource-render-type--icon';
|
|
20
|
+
export var ICON_TYPE_TEXT_TEST_ID = "".concat(ICON_TYPE_TEST_ID, "-text");
|
|
12
21
|
var IconRenderType = function IconRenderType(_ref) {
|
|
13
22
|
var label = _ref.label,
|
|
23
|
+
text = _ref.text,
|
|
14
24
|
source = _ref.source,
|
|
15
25
|
_ref$testId = _ref.testId,
|
|
16
26
|
testId = _ref$testId === void 0 ? ICON_TYPE_TEST_ID : _ref$testId;
|
|
@@ -24,6 +34,11 @@ var IconRenderType = function IconRenderType(_ref) {
|
|
|
24
34
|
minWidth: '20px',
|
|
25
35
|
maxWidth: '20px'
|
|
26
36
|
} // having just width: '20px' shrinks it when table width is reduced
|
|
27
|
-
})
|
|
37
|
+
}), text && /*#__PURE__*/React.createElement(Box, {
|
|
38
|
+
xcss: textWrapperStyles
|
|
39
|
+
}, /*#__PURE__*/React.createElement(TextRenderType, {
|
|
40
|
+
testId: ICON_TYPE_TEXT_TEST_ID,
|
|
41
|
+
text: text
|
|
42
|
+
})));
|
|
28
43
|
};
|
|
29
44
|
export default IconRenderType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Action } from 'react-sweet-state';
|
|
2
2
|
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
3
|
-
import type { ActionsDiscoveryRequest, AtomicActionExecuteResponse, AtomicActionInterface } from '@atlaskit/linking-types';
|
|
3
|
+
import type { ActionsDiscoveryRequest, AtomicActionExecuteRequest, AtomicActionExecuteResponse, AtomicActionInterface } from '@atlaskit/linking-types';
|
|
4
4
|
import { type DatasourceOperationFailedAttributesType, type EventKey } from '../../../src/analytics/generated/analytics.types';
|
|
5
5
|
import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
|
|
6
6
|
type IntegrationKey = string;
|
|
@@ -96,6 +96,7 @@ export declare const useAtomicUpdateActionSchema: import("react-sweet-state").Ho
|
|
|
96
96
|
fieldKey: string;
|
|
97
97
|
integrationKey: string;
|
|
98
98
|
}>;
|
|
99
|
+
export type ExecuteFetch = <E>(inputs: AtomicActionExecuteRequest['parameters']['inputs']) => Promise<E>;
|
|
99
100
|
/**
|
|
100
101
|
* Given an ARI + fieldKey + integrationKey
|
|
101
102
|
* Returns an executable action that updates a field on the entity if the user has permissions to do so
|
|
@@ -113,6 +114,6 @@ export declare const useExecuteAtomicAction: ({ ari, fieldKey, integrationKey, }
|
|
|
113
114
|
integrationKey: string;
|
|
114
115
|
}) => {
|
|
115
116
|
execute?: ((value: string | number) => Promise<AtomicActionExecuteResponse<unknown>>) | undefined;
|
|
116
|
-
executeFetch?:
|
|
117
|
+
executeFetch?: ExecuteFetch | undefined;
|
|
117
118
|
};
|
|
118
119
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type FieldProps } from '@atlaskit/form';
|
|
3
|
+
import type { ExecuteFetch } from '../../../../state/actions';
|
|
3
4
|
import type { DatasourceTypeWithOnlyValues } from '../../types';
|
|
4
5
|
interface Props extends Omit<FieldProps<string>, 'value'> {
|
|
5
6
|
currentValue: DatasourceTypeWithOnlyValues;
|
|
6
7
|
setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
|
|
7
|
-
executeFetch?:
|
|
8
|
+
executeFetch?: ExecuteFetch;
|
|
8
9
|
}
|
|
9
10
|
declare const StatusEditType: (props: Props) => JSX.Element;
|
|
10
11
|
export default StatusEditType;
|
|
@@ -4,5 +4,6 @@ interface IconProps extends Icon {
|
|
|
4
4
|
testId?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const ICON_TYPE_TEST_ID = "link-datasource-render-type--icon";
|
|
7
|
-
declare const
|
|
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;
|
|
8
9
|
export default IconRenderType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Action } from 'react-sweet-state';
|
|
2
2
|
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
3
|
-
import type { ActionsDiscoveryRequest, AtomicActionExecuteResponse, AtomicActionInterface } from '@atlaskit/linking-types';
|
|
3
|
+
import type { ActionsDiscoveryRequest, AtomicActionExecuteRequest, AtomicActionExecuteResponse, AtomicActionInterface } from '@atlaskit/linking-types';
|
|
4
4
|
import { type DatasourceOperationFailedAttributesType, type EventKey } from '../../../src/analytics/generated/analytics.types';
|
|
5
5
|
import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
|
|
6
6
|
type IntegrationKey = string;
|
|
@@ -96,6 +96,7 @@ export declare const useAtomicUpdateActionSchema: import("react-sweet-state").Ho
|
|
|
96
96
|
fieldKey: string;
|
|
97
97
|
integrationKey: string;
|
|
98
98
|
}>;
|
|
99
|
+
export type ExecuteFetch = <E>(inputs: AtomicActionExecuteRequest['parameters']['inputs']) => Promise<E>;
|
|
99
100
|
/**
|
|
100
101
|
* Given an ARI + fieldKey + integrationKey
|
|
101
102
|
* Returns an executable action that updates a field on the entity if the user has permissions to do so
|
|
@@ -113,6 +114,6 @@ export declare const useExecuteAtomicAction: ({ ari, fieldKey, integrationKey, }
|
|
|
113
114
|
integrationKey: string;
|
|
114
115
|
}) => {
|
|
115
116
|
execute?: ((value: string | number) => Promise<AtomicActionExecuteResponse<unknown>>) | undefined;
|
|
116
|
-
executeFetch?:
|
|
117
|
+
executeFetch?: ExecuteFetch | undefined;
|
|
117
118
|
};
|
|
118
119
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type FieldProps } from '@atlaskit/form';
|
|
3
|
+
import type { ExecuteFetch } from '../../../../state/actions';
|
|
3
4
|
import type { DatasourceTypeWithOnlyValues } from '../../types';
|
|
4
5
|
interface Props extends Omit<FieldProps<string>, 'value'> {
|
|
5
6
|
currentValue: DatasourceTypeWithOnlyValues;
|
|
6
7
|
setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
|
|
7
|
-
executeFetch?:
|
|
8
|
+
executeFetch?: ExecuteFetch;
|
|
8
9
|
}
|
|
9
10
|
declare const StatusEditType: (props: Props) => JSX.Element;
|
|
10
11
|
export default StatusEditType;
|
|
@@ -4,5 +4,6 @@ interface IconProps extends Icon {
|
|
|
4
4
|
testId?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const ICON_TYPE_TEST_ID = "link-datasource-render-type--icon";
|
|
7
|
-
declare const
|
|
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;
|
|
8
9
|
export default IconRenderType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.5",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/layering": "^0.7.0",
|
|
60
60
|
"@atlaskit/link-client-extension": "^2.4.0",
|
|
61
61
|
"@atlaskit/linking-common": "^6.0.0",
|
|
62
|
-
"@atlaskit/linking-types": "^9.
|
|
62
|
+
"@atlaskit/linking-types": "^9.5.0",
|
|
63
63
|
"@atlaskit/logo": "^14.3.0",
|
|
64
64
|
"@atlaskit/lozenge": "^11.12.0",
|
|
65
65
|
"@atlaskit/modal-dialog": "^12.17.0",
|