@atlaskit/link-datasource 2.9.3 → 2.9.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 +19 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +43 -17
- package/dist/cjs/state/actions/index.js +183 -0
- package/dist/cjs/state/index.js +8 -4
- package/dist/cjs/ui/issue-like-table/index.js +87 -70
- package/dist/cjs/ui/issue-like-table/styled.js +22 -3
- package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +98 -23
- package/dist/es2019/hooks/useDatasourceTableState.js +26 -2
- package/dist/es2019/state/actions/index.js +166 -0
- package/dist/es2019/state/index.js +11 -5
- package/dist/es2019/ui/issue-like-table/index.js +27 -11
- package/dist/es2019/ui/issue-like-table/styled.js +28 -0
- package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +96 -18
- package/dist/esm/hooks/useDatasourceTableState.js +43 -17
- package/dist/esm/state/actions/index.js +177 -0
- package/dist/esm/state/index.js +8 -4
- package/dist/esm/ui/issue-like-table/index.js +88 -71
- package/dist/esm/ui/issue-like-table/styled.js +21 -2
- package/dist/esm/ui/issue-like-table/table-cell-content/index.js +98 -23
- package/dist/types/state/actions/index.d.ts +87 -0
- package/dist/types/state/index.d.ts +10 -5
- package/dist/types/ui/issue-like-table/styled.d.ts +4 -0
- package/dist/types/ui/issue-like-table/table-cell-content/index.d.ts +3 -2
- package/dist/types-ts4.5/state/actions/index.d.ts +87 -0
- package/dist/types-ts4.5/state/index.d.ts +10 -5
- package/dist/types-ts4.5/ui/issue-like-table/styled.d.ts +4 -0
- package/dist/types-ts4.5/ui/issue-like-table/table-cell-content/index.d.ts +3 -2
- package/package.json +7 -4
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
3
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
6
|
import { useDatasourceItem } from '../../../state';
|
|
5
7
|
import { stringifyType } from '../render-type';
|
|
6
8
|
import { TruncateTextTag } from '../truncate-text-tag';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
var truncateTextStyles = xcss({
|
|
10
|
+
textOverflow: 'ellipsis',
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
width: '100%'
|
|
13
|
+
});
|
|
14
|
+
var TooltipWrapper = function TooltipWrapper(_ref) {
|
|
9
15
|
var columnKey = _ref.columnKey,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
wrappedColumnKeys = _ref.wrappedColumnKeys
|
|
16
|
+
_ref$datasourceTypeWi = _ref.datasourceTypeWithValues,
|
|
17
|
+
type = _ref$datasourceTypeWi.type,
|
|
18
|
+
values = _ref$datasourceTypeWi.values,
|
|
19
|
+
wrappedColumnKeys = _ref.wrappedColumnKeys,
|
|
20
|
+
children = _ref.children;
|
|
14
21
|
var intl = useIntl();
|
|
15
|
-
var rowData = useDatasourceItem({
|
|
16
|
-
id: id
|
|
17
|
-
});
|
|
18
|
-
if (!rowData || !columnKey || !rowData[columnKey]) {
|
|
19
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
23
|
-
var value = (_rowData$columnKey = rowData[columnKey]) === null || _rowData$columnKey === void 0 ? void 0 : _rowData$columnKey.data;
|
|
24
|
-
var values = Array.isArray(value) ? value : [value];
|
|
25
|
-
var renderedValues = renderItem({
|
|
26
|
-
type: columnType,
|
|
27
|
-
values: values
|
|
28
|
-
});
|
|
29
22
|
var stringifiedContent = values.map(function (value) {
|
|
30
23
|
return stringifyType({
|
|
31
|
-
type:
|
|
24
|
+
type: type,
|
|
32
25
|
value: value
|
|
33
26
|
}, intl.formatMessage, intl.formatDate);
|
|
34
27
|
}).filter(function (value) {
|
|
@@ -41,7 +34,89 @@ export var TableCellContent = function TableCellContent(_ref) {
|
|
|
41
34
|
tag: TruncateTextTag,
|
|
42
35
|
content: stringifiedContent,
|
|
43
36
|
testId: "issues-table-cell-tooltip"
|
|
44
|
-
},
|
|
37
|
+
}, children);
|
|
45
38
|
}
|
|
46
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
39
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
40
|
+
};
|
|
41
|
+
var ReadOnlyCell = function ReadOnlyCell(_ref2) {
|
|
42
|
+
var _rowData$columnKey;
|
|
43
|
+
var id = _ref2.id,
|
|
44
|
+
columnType = _ref2.columnType,
|
|
45
|
+
_ref2$wrappedColumnKe = _ref2.wrappedColumnKeys,
|
|
46
|
+
wrappedColumnKeys = _ref2$wrappedColumnKe === void 0 ? [] : _ref2$wrappedColumnKe,
|
|
47
|
+
renderItem = _ref2.renderItem,
|
|
48
|
+
columnKey = _ref2.columnKey;
|
|
49
|
+
var rowData = useDatasourceItem({
|
|
50
|
+
id: id
|
|
51
|
+
});
|
|
52
|
+
if (!rowData || !columnKey || !rowData[columnKey]) {
|
|
53
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
57
|
+
var value = (_rowData$columnKey = rowData[columnKey]) === null || _rowData$columnKey === void 0 ? void 0 : _rowData$columnKey.data;
|
|
58
|
+
var values = Array.isArray(value) ? value : [value];
|
|
59
|
+
var datasourceTypeWithValues = {
|
|
60
|
+
type: columnType,
|
|
61
|
+
values: values
|
|
62
|
+
};
|
|
63
|
+
return /*#__PURE__*/React.createElement(TooltipWrapper, {
|
|
64
|
+
columnKey: columnKey,
|
|
65
|
+
datasourceTypeWithValues: datasourceTypeWithValues,
|
|
66
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
67
|
+
}, renderItem(datasourceTypeWithValues));
|
|
68
|
+
};
|
|
69
|
+
var InlineEditableCell = function InlineEditableCell(_ref3) {
|
|
70
|
+
var _rowData$columnKey2;
|
|
71
|
+
var id = _ref3.id,
|
|
72
|
+
columnKey = _ref3.columnKey,
|
|
73
|
+
columnType = _ref3.columnType,
|
|
74
|
+
renderItem = _ref3.renderItem,
|
|
75
|
+
wrappedColumnKeys = _ref3.wrappedColumnKeys;
|
|
76
|
+
var rowData = useDatasourceItem({
|
|
77
|
+
id: id
|
|
78
|
+
});
|
|
79
|
+
if (!rowData || !columnKey || !rowData[columnKey]) {
|
|
80
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
84
|
+
var value = (_rowData$columnKey2 = rowData[columnKey]) === null || _rowData$columnKey2 === void 0 ? void 0 : _rowData$columnKey2.data;
|
|
85
|
+
var values = Array.isArray(value) ? value : [value];
|
|
86
|
+
var datasourceTypeWithValues = {
|
|
87
|
+
type: columnType,
|
|
88
|
+
values: values
|
|
89
|
+
};
|
|
90
|
+
return /*#__PURE__*/React.createElement(TooltipWrapper, {
|
|
91
|
+
columnKey: columnKey,
|
|
92
|
+
datasourceTypeWithValues: datasourceTypeWithValues,
|
|
93
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
95
|
+
testId: 'inline-edit-read-view',
|
|
96
|
+
paddingInline: 'space.100',
|
|
97
|
+
paddingBlock: 'space.050',
|
|
98
|
+
xcss: truncateTextStyles
|
|
99
|
+
}, renderItem(datasourceTypeWithValues)));
|
|
100
|
+
};
|
|
101
|
+
export var TableCellContent = function TableCellContent(_ref4) {
|
|
102
|
+
var columnKey = _ref4.columnKey,
|
|
103
|
+
columnType = _ref4.columnType,
|
|
104
|
+
id = _ref4.id,
|
|
105
|
+
renderItem = _ref4.renderItem,
|
|
106
|
+
wrappedColumnKeys = _ref4.wrappedColumnKeys;
|
|
107
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
108
|
+
var renderedContent = fg('platform-datasources-enable-two-way-sync') ? /*#__PURE__*/React.createElement(InlineEditableCell, {
|
|
109
|
+
id: id,
|
|
110
|
+
columnKey: columnKey,
|
|
111
|
+
columnType: columnType,
|
|
112
|
+
renderItem: renderItem,
|
|
113
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
114
|
+
}) : /*#__PURE__*/React.createElement(ReadOnlyCell, {
|
|
115
|
+
id: id,
|
|
116
|
+
columnKey: columnKey,
|
|
117
|
+
columnType: columnType,
|
|
118
|
+
wrappedColumnKeys: wrappedColumnKeys,
|
|
119
|
+
renderItem: renderItem
|
|
120
|
+
});
|
|
121
|
+
return renderedContent;
|
|
47
122
|
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type Action } from 'react-sweet-state';
|
|
2
|
+
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
3
|
+
import type { ActionsDiscoveryRequest, AtomicActionInterface } from '@atlaskit/linking-types';
|
|
4
|
+
type IntegrationKey = string;
|
|
5
|
+
type FieldKey = string;
|
|
6
|
+
/**
|
|
7
|
+
* Atomic actions available for an integration (by field)
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* {
|
|
11
|
+
* jira: {
|
|
12
|
+
* summary: {
|
|
13
|
+
* actionKey: 'atlassian:issue:update:summary',
|
|
14
|
+
* type: 'string',
|
|
15
|
+
* description: 'Update issue summary',
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
type IntegrationActions = Record<IntegrationKey, Record<FieldKey, Pick<AtomicActionInterface, 'actionKey' | 'type' | 'description'>>>;
|
|
22
|
+
/**
|
|
23
|
+
* Permissions available for a target
|
|
24
|
+
*/
|
|
25
|
+
type TargetPermissions = Record<FieldKey, {
|
|
26
|
+
isEditable: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* User permissions for actions on target (ARI) properties
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* {
|
|
33
|
+
* 'ari:cloud:jira:63cecfe3-16fa-4ee1-8e8d-047cc4b18980:issue/1': {
|
|
34
|
+
* summary: {
|
|
35
|
+
* isEditable: true
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
type ARI = string;
|
|
42
|
+
type Permissions = Record<ARI, TargetPermissions>;
|
|
43
|
+
export interface ActionsStoreState {
|
|
44
|
+
actionsByIntegration: IntegrationActions;
|
|
45
|
+
permissions: Permissions;
|
|
46
|
+
}
|
|
47
|
+
interface Client {
|
|
48
|
+
getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
|
|
49
|
+
}
|
|
50
|
+
export declare const actions: {
|
|
51
|
+
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
52
|
+
};
|
|
53
|
+
export declare const ActionsStore: import("react-sweet-state").Store<ActionsStoreState, {
|
|
54
|
+
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
55
|
+
}>;
|
|
56
|
+
export declare const useDiscoverActions: () => {
|
|
57
|
+
discoverActions: (request: ActionsDiscoveryRequest) => void | Promise<void>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Retrieves the action schema for a given ARI + fieldKey + integrationKey
|
|
61
|
+
*/
|
|
62
|
+
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description"> | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
|
|
63
|
+
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
64
|
+
}>, {
|
|
65
|
+
ari: string;
|
|
66
|
+
fieldKey: string;
|
|
67
|
+
integrationKey: string;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Given an ARI + fieldKey + integrationKey
|
|
71
|
+
* Returns an executable action that updates a field on the entity if the user has permissions to do so
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* const { execute } = useExecuteAtomicAction({ ari, fieldKey: 'summary', integrationKey: 'jira' });
|
|
76
|
+
*
|
|
77
|
+
* return <button onClick={() => execute('New summary')}>Update summary</button>;
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare const useExecuteAtomicAction: ({ ari, fieldKey, integrationKey, }: {
|
|
81
|
+
ari: string;
|
|
82
|
+
fieldKey: string;
|
|
83
|
+
integrationKey: string;
|
|
84
|
+
}) => {
|
|
85
|
+
execute: (value: AtomicActionInterface['type']) => void;
|
|
86
|
+
} | null;
|
|
87
|
+
export {};
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type Action } from 'react-sweet-state';
|
|
3
|
-
import {
|
|
3
|
+
import type { DatasourceDataResponseItem } from '@atlaskit/linking-types';
|
|
4
|
+
type UniqueIdentifier = string;
|
|
4
5
|
export interface State {
|
|
5
|
-
items: Record<
|
|
6
|
+
items: Record<UniqueIdentifier, {
|
|
7
|
+
integrationKey: string | undefined;
|
|
8
|
+
data: DatasourceDataResponseItem;
|
|
9
|
+
}>;
|
|
6
10
|
}
|
|
7
11
|
export declare const actions: {
|
|
8
|
-
onAddItems: (items: DatasourceDataResponseItem[]) => Action<State, void, string[]>;
|
|
12
|
+
onAddItems: (items: DatasourceDataResponseItem[], integrationKey: string | undefined) => Action<State, void, string[]>;
|
|
9
13
|
};
|
|
10
14
|
export declare const Store: import("react-sweet-state").Store<State, {
|
|
11
|
-
onAddItems: (items: DatasourceDataResponseItem[]) => Action<State, void, string[]>;
|
|
15
|
+
onAddItems: (items: DatasourceDataResponseItem[], integrationKey: string | undefined) => Action<State, void, string[]>;
|
|
12
16
|
}>;
|
|
13
17
|
export declare const useDatasourceItem: import("react-sweet-state").HookStateFunction<DatasourceDataResponseItem | undefined, {
|
|
14
18
|
id: string;
|
|
15
19
|
}>;
|
|
16
20
|
export declare const useDatasourceActions: import("react-sweet-state").HookActionsFunction<import("react-sweet-state").BoundActions<State, {
|
|
17
|
-
onAddItems: (items: DatasourceDataResponseItem[]) => Action<State, void, string[]>;
|
|
21
|
+
onAddItems: (items: DatasourceDataResponseItem[], integrationKey: string | undefined) => Action<State, void, string[]>;
|
|
18
22
|
}>>;
|
|
19
23
|
export declare const StoreContainer: ({ children }: {
|
|
20
24
|
children: JSX.Element;
|
|
21
25
|
}) => JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -22,3 +22,7 @@ export declare const TableCell: import("@emotion/styled").StyledComponent<{
|
|
|
22
22
|
theme?: import("@emotion/react").Theme | undefined;
|
|
23
23
|
as?: import("react").ElementType<any> | undefined;
|
|
24
24
|
}, import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {}>;
|
|
25
|
+
export declare const InlineEditableTableCell: import("@emotion/styled").StyledComponent<{
|
|
26
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
27
|
+
as?: import("react").ElementType<any> | undefined;
|
|
28
|
+
}, import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {}>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { type DatasourceType } from '@atlaskit/linking-types';
|
|
2
3
|
import { type TableViewPropsRenderType } from '../types';
|
|
3
4
|
interface TableCellContentProps {
|
|
4
5
|
id: string;
|
|
5
|
-
columnKey: string
|
|
6
|
-
columnType:
|
|
6
|
+
columnKey: string;
|
|
7
|
+
columnType: DatasourceType['type'];
|
|
7
8
|
/** Used to retrieve cell content from the store */
|
|
8
9
|
renderItem: TableViewPropsRenderType;
|
|
9
10
|
wrappedColumnKeys: string[] | undefined;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type Action } from 'react-sweet-state';
|
|
2
|
+
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
3
|
+
import type { ActionsDiscoveryRequest, AtomicActionInterface } from '@atlaskit/linking-types';
|
|
4
|
+
type IntegrationKey = string;
|
|
5
|
+
type FieldKey = string;
|
|
6
|
+
/**
|
|
7
|
+
* Atomic actions available for an integration (by field)
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* {
|
|
11
|
+
* jira: {
|
|
12
|
+
* summary: {
|
|
13
|
+
* actionKey: 'atlassian:issue:update:summary',
|
|
14
|
+
* type: 'string',
|
|
15
|
+
* description: 'Update issue summary',
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
type IntegrationActions = Record<IntegrationKey, Record<FieldKey, Pick<AtomicActionInterface, 'actionKey' | 'type' | 'description'>>>;
|
|
22
|
+
/**
|
|
23
|
+
* Permissions available for a target
|
|
24
|
+
*/
|
|
25
|
+
type TargetPermissions = Record<FieldKey, {
|
|
26
|
+
isEditable: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* User permissions for actions on target (ARI) properties
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* {
|
|
33
|
+
* 'ari:cloud:jira:63cecfe3-16fa-4ee1-8e8d-047cc4b18980:issue/1': {
|
|
34
|
+
* summary: {
|
|
35
|
+
* isEditable: true
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
type ARI = string;
|
|
42
|
+
type Permissions = Record<ARI, TargetPermissions>;
|
|
43
|
+
export interface ActionsStoreState {
|
|
44
|
+
actionsByIntegration: IntegrationActions;
|
|
45
|
+
permissions: Permissions;
|
|
46
|
+
}
|
|
47
|
+
interface Client {
|
|
48
|
+
getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
|
|
49
|
+
}
|
|
50
|
+
export declare const actions: {
|
|
51
|
+
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
52
|
+
};
|
|
53
|
+
export declare const ActionsStore: import("react-sweet-state").Store<ActionsStoreState, {
|
|
54
|
+
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
55
|
+
}>;
|
|
56
|
+
export declare const useDiscoverActions: () => {
|
|
57
|
+
discoverActions: (request: ActionsDiscoveryRequest) => void | Promise<void>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Retrieves the action schema for a given ARI + fieldKey + integrationKey
|
|
61
|
+
*/
|
|
62
|
+
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description"> | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
|
|
63
|
+
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
64
|
+
}>, {
|
|
65
|
+
ari: string;
|
|
66
|
+
fieldKey: string;
|
|
67
|
+
integrationKey: string;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Given an ARI + fieldKey + integrationKey
|
|
71
|
+
* Returns an executable action that updates a field on the entity if the user has permissions to do so
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* const { execute } = useExecuteAtomicAction({ ari, fieldKey: 'summary', integrationKey: 'jira' });
|
|
76
|
+
*
|
|
77
|
+
* return <button onClick={() => execute('New summary')}>Update summary</button>;
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare const useExecuteAtomicAction: ({ ari, fieldKey, integrationKey, }: {
|
|
81
|
+
ari: string;
|
|
82
|
+
fieldKey: string;
|
|
83
|
+
integrationKey: string;
|
|
84
|
+
}) => {
|
|
85
|
+
execute: (value: AtomicActionInterface['type']) => void;
|
|
86
|
+
} | null;
|
|
87
|
+
export {};
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type Action } from 'react-sweet-state';
|
|
3
|
-
import {
|
|
3
|
+
import type { DatasourceDataResponseItem } from '@atlaskit/linking-types';
|
|
4
|
+
type UniqueIdentifier = string;
|
|
4
5
|
export interface State {
|
|
5
|
-
items: Record<
|
|
6
|
+
items: Record<UniqueIdentifier, {
|
|
7
|
+
integrationKey: string | undefined;
|
|
8
|
+
data: DatasourceDataResponseItem;
|
|
9
|
+
}>;
|
|
6
10
|
}
|
|
7
11
|
export declare const actions: {
|
|
8
|
-
onAddItems: (items: DatasourceDataResponseItem[]) => Action<State, void, string[]>;
|
|
12
|
+
onAddItems: (items: DatasourceDataResponseItem[], integrationKey: string | undefined) => Action<State, void, string[]>;
|
|
9
13
|
};
|
|
10
14
|
export declare const Store: import("react-sweet-state").Store<State, {
|
|
11
|
-
onAddItems: (items: DatasourceDataResponseItem[]) => Action<State, void, string[]>;
|
|
15
|
+
onAddItems: (items: DatasourceDataResponseItem[], integrationKey: string | undefined) => Action<State, void, string[]>;
|
|
12
16
|
}>;
|
|
13
17
|
export declare const useDatasourceItem: import("react-sweet-state").HookStateFunction<DatasourceDataResponseItem | undefined, {
|
|
14
18
|
id: string;
|
|
15
19
|
}>;
|
|
16
20
|
export declare const useDatasourceActions: import("react-sweet-state").HookActionsFunction<import("react-sweet-state").BoundActions<State, {
|
|
17
|
-
onAddItems: (items: DatasourceDataResponseItem[]) => Action<State, void, string[]>;
|
|
21
|
+
onAddItems: (items: DatasourceDataResponseItem[], integrationKey: string | undefined) => Action<State, void, string[]>;
|
|
18
22
|
}>>;
|
|
19
23
|
export declare const StoreContainer: ({ children }: {
|
|
20
24
|
children: JSX.Element;
|
|
21
25
|
}) => JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -22,3 +22,7 @@ export declare const TableCell: import("@emotion/styled").StyledComponent<{
|
|
|
22
22
|
theme?: import("@emotion/react").Theme | undefined;
|
|
23
23
|
as?: import("react").ElementType<any> | undefined;
|
|
24
24
|
}, import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {}>;
|
|
25
|
+
export declare const InlineEditableTableCell: import("@emotion/styled").StyledComponent<{
|
|
26
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
27
|
+
as?: import("react").ElementType<any> | undefined;
|
|
28
|
+
}, import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {}>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { type DatasourceType } from '@atlaskit/linking-types';
|
|
2
3
|
import { type TableViewPropsRenderType } from '../types';
|
|
3
4
|
interface TableCellContentProps {
|
|
4
5
|
id: string;
|
|
5
|
-
columnKey: string
|
|
6
|
-
columnType:
|
|
6
|
+
columnKey: string;
|
|
7
|
+
columnType: DatasourceType['type'];
|
|
7
8
|
/** Used to retrieve cell content from the store */
|
|
8
9
|
renderItem: TableViewPropsRenderType;
|
|
9
10
|
wrappedColumnKeys: string[] | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.5",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@atlaskit/avatar-group": "^9.9.0",
|
|
42
42
|
"@atlaskit/badge": "^16.3.0",
|
|
43
43
|
"@atlaskit/button": "^19.1.0",
|
|
44
|
-
"@atlaskit/datetime-picker": "^13.
|
|
44
|
+
"@atlaskit/datetime-picker": "^13.8.0",
|
|
45
45
|
"@atlaskit/dropdown-menu": "^12.15.0",
|
|
46
46
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
47
47
|
"@atlaskit/empty-state": "^7.9.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/jql-ast": "^3.3.0",
|
|
55
55
|
"@atlaskit/jql-editor": "^4.4.0",
|
|
56
56
|
"@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
|
|
57
|
-
"@atlaskit/link-client-extension": "^1.
|
|
57
|
+
"@atlaskit/link-client-extension": "^1.12.0",
|
|
58
58
|
"@atlaskit/linking-common": "^5.8.0",
|
|
59
59
|
"@atlaskit/linking-types": "^8.12.0",
|
|
60
60
|
"@atlaskit/logo": "^14.1.0",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"@af/integration-testing": "*",
|
|
99
99
|
"@af/visual-regression": "*",
|
|
100
100
|
"@atlaskit/link-provider": "^1.14.0",
|
|
101
|
-
"@atlaskit/link-test-helpers": "^7.
|
|
101
|
+
"@atlaskit/link-test-helpers": "^7.1.0",
|
|
102
102
|
"@atlaskit/ssr": "*",
|
|
103
103
|
"@atlaskit/visual-regression": "*",
|
|
104
104
|
"@atlassian/feature-flags-test-utils": "^0.2.0",
|
|
@@ -155,6 +155,9 @@
|
|
|
155
155
|
"enable_datasource_react_sweet_state": {
|
|
156
156
|
"type": "boolean"
|
|
157
157
|
},
|
|
158
|
+
"platform-datasources-enable-two-way-sync": {
|
|
159
|
+
"type": "boolean"
|
|
160
|
+
},
|
|
158
161
|
"platform.linking-platform.datasource.add-timezone-header": {
|
|
159
162
|
"type": "boolean",
|
|
160
163
|
"referenceOnly": "true"
|