@atlaskit/link-datasource 2.3.3 → 2.3.4
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 +9 -0
- package/dist/cjs/contexts/datasource-experience-id/index.js +28 -0
- package/dist/cjs/ui/assets-modal/modal/index.js +11 -10
- package/dist/cjs/ui/assets-modal/modal/render-assets-content/index.js +2 -4
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +8 -7
- package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +9 -9
- package/dist/cjs/ui/issue-like-table/column-picker/index.js +6 -5
- package/dist/cjs/ui/issue-like-table/index.js +9 -9
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +15 -13
- package/dist/es2019/contexts/datasource-experience-id/index.js +19 -0
- package/dist/es2019/ui/assets-modal/modal/index.js +9 -11
- package/dist/es2019/ui/assets-modal/modal/render-assets-content/index.js +2 -4
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +6 -8
- package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +7 -10
- package/dist/es2019/ui/issue-like-table/column-picker/index.js +6 -5
- package/dist/es2019/ui/issue-like-table/index.js +9 -9
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +12 -13
- package/dist/esm/contexts/datasource-experience-id/index.js +20 -0
- package/dist/esm/ui/assets-modal/modal/index.js +11 -10
- package/dist/esm/ui/assets-modal/modal/render-assets-content/index.js +2 -4
- package/dist/esm/ui/confluence-search-modal/modal/index.js +8 -7
- package/dist/esm/ui/datasource-table-view/datasourceTableView.js +9 -9
- package/dist/esm/ui/issue-like-table/column-picker/index.js +6 -5
- package/dist/esm/ui/issue-like-table/index.js +9 -9
- package/dist/esm/ui/jira-issues-modal/modal/index.js +14 -12
- package/dist/types/contexts/datasource-experience-id/index.d.ts +4 -0
- package/dist/types/ui/assets-modal/modal/render-assets-content/index.d.ts +0 -1
- package/dist/types/ui/issue-like-table/column-picker/index.d.ts +1 -1
- package/dist/types/ui/issue-like-table/column-picker/types.d.ts +0 -1
- package/dist/types/ui/issue-like-table/index.d.ts +1 -1
- package/dist/types/ui/issue-like-table/types.d.ts +0 -4
- package/dist/types/ui/jira-issues-modal/modal/index.d.ts +0 -2
- package/dist/types-ts4.5/contexts/datasource-experience-id/index.d.ts +4 -0
- package/dist/types-ts4.5/ui/assets-modal/modal/render-assets-content/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/issue-like-table/column-picker/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/issue-like-table/column-picker/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/issue-like-table/types.d.ts +0 -4
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/index.d.ts +0 -2
- package/examples-helpers/buildIssueLikeTable.tsx +12 -9
- package/examples-helpers/buildJiraIssuesTable.tsx +8 -5
- package/package.json +2 -2
|
@@ -7,7 +7,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { FormattedMessage, FormattedNumber } from 'react-intl-next';
|
|
10
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
11
10
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
12
11
|
import Button from '@atlaskit/button/standard-button';
|
|
13
12
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
@@ -24,6 +23,7 @@ import { useDataRenderedUfoExperience } from '../../../analytics/ufoExperiences/
|
|
|
24
23
|
import { mapSearchMethod } from '../../../analytics/utils';
|
|
25
24
|
import { buildDatasourceAdf } from '../../../common/utils/adf';
|
|
26
25
|
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
26
|
+
import { DatasourceExperienceIdProvider, useDatasourceExperienceId } from '../../../contexts/datasource-experience-id';
|
|
27
27
|
import { useDatasourceTableState } from '../../../hooks/useDatasourceTableState';
|
|
28
28
|
import i18nEN from '../../../i18n/en';
|
|
29
29
|
import { useAvailableSites } from '../../../services/useAvailableSites';
|
|
@@ -60,7 +60,7 @@ var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
|
60
60
|
return itemCount === 1 ? DatasourceDisplay.INLINE : DatasourceDisplay.DATASOURCE_INLINE;
|
|
61
61
|
};
|
|
62
62
|
var jqlSupportDocumentLink = 'https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/';
|
|
63
|
-
|
|
63
|
+
var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
64
64
|
var datasourceId = props.datasourceId,
|
|
65
65
|
initialColumnCustomSizes = props.columnCustomSizes,
|
|
66
66
|
initialWrappedColumnKeys = props.wrappedColumnKeys,
|
|
@@ -139,8 +139,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
139
139
|
destinationObjectTypes = _useDatasourceTableSt.destinationObjectTypes;
|
|
140
140
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
141
141
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
142
|
-
var
|
|
143
|
-
modalRenderInstanceId = _useRef.current;
|
|
142
|
+
var experienceId = useDatasourceExperienceId();
|
|
144
143
|
var analyticsPayload = useMemo(function () {
|
|
145
144
|
return {
|
|
146
145
|
extensionKey: extensionKey,
|
|
@@ -166,12 +165,12 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
166
165
|
if (shouldStartUfoExperience) {
|
|
167
166
|
startUfoExperience({
|
|
168
167
|
name: 'datasource-rendered'
|
|
169
|
-
},
|
|
168
|
+
}, experienceId);
|
|
170
169
|
}
|
|
171
|
-
}, [
|
|
170
|
+
}, [experienceId, status]);
|
|
172
171
|
useDataRenderedUfoExperience({
|
|
173
172
|
status: status,
|
|
174
|
-
experienceId:
|
|
173
|
+
experienceId: experienceId,
|
|
175
174
|
itemCount: responseItems.length,
|
|
176
175
|
canBeLink: currentViewMode === 'inline',
|
|
177
176
|
extensionKey: extensionKey
|
|
@@ -229,7 +228,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
229
228
|
fireCountViewedEvent();
|
|
230
229
|
}
|
|
231
230
|
}, [currentViewMode, status, fireIssueViewAnalytics, fireCountViewedEvent]);
|
|
232
|
-
useColumnPickerRenderedFailedUfoExperience(status,
|
|
231
|
+
useColumnPickerRenderedFailedUfoExperience(status, experienceId);
|
|
233
232
|
var onSearch = useCallback(function (newParameters, _ref) {
|
|
234
233
|
var searchMethod = _ref.searchMethod,
|
|
235
234
|
basicFilterSelections = _ref.basicFilterSelections,
|
|
@@ -372,14 +371,13 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
372
371
|
onNextPage: handleOnNextPage,
|
|
373
372
|
onLoadDatasourceDetails: loadDatasourceDetails,
|
|
374
373
|
onVisibleColumnKeysChange: handleVisibleColumnKeysChange,
|
|
375
|
-
parentContainerRenderInstanceId: modalRenderInstanceId,
|
|
376
374
|
extensionKey: extensionKey,
|
|
377
375
|
columnCustomSizes: columnCustomSizes,
|
|
378
376
|
onColumnResize: onColumnResize,
|
|
379
377
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
380
378
|
onWrappedColumnChange: getBooleanFF('platform.linking-platform.datasource-word_wrap') ? onWrappedColumnChange : undefined
|
|
381
379
|
}));
|
|
382
|
-
}, [status, columns, responseItems, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, handleOnNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange,
|
|
380
|
+
}, [status, columns, responseItems, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, handleOnNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
383
381
|
var renderCountModeContent = useCallback(function () {
|
|
384
382
|
var selectedJiraSiteUrl = selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url;
|
|
385
383
|
if (status === 'unauthorized') {
|
|
@@ -482,7 +480,9 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
482
480
|
}, jsx(LinkUrl, {
|
|
483
481
|
href: jqlUrl,
|
|
484
482
|
target: "_blank",
|
|
485
|
-
testId: "item-count-url"
|
|
483
|
+
testId: "item-count-url"
|
|
484
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
485
|
+
,
|
|
486
486
|
style: {
|
|
487
487
|
color: "var(--ds-text-accent-gray, ".concat(N800, ")")
|
|
488
488
|
}
|
|
@@ -512,4 +512,6 @@ var analyticsContextData = _objectSpread(_objectSpread({}, componentMetadata.con
|
|
|
512
512
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
513
513
|
attributes: _objectSpread({}, analyticsContextAttributes)
|
|
514
514
|
});
|
|
515
|
-
export var JiraIssuesConfigModal = withAnalyticsContext(contextData)(
|
|
515
|
+
export var JiraIssuesConfigModal = withAnalyticsContext(contextData)(function (props) {
|
|
516
|
+
return jsx(DatasourceExperienceIdProvider, null, jsx(PlainJiraIssuesConfigModal, props));
|
|
517
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
declare const DatasourceExperienceIdProvider: ({ children, }: PropsWithChildren<{}>) => JSX.Element;
|
|
3
|
+
declare const useDatasourceExperienceId: () => string;
|
|
4
|
+
export { DatasourceExperienceIdProvider, useDatasourceExperienceId };
|
|
@@ -14,7 +14,6 @@ export interface RenderAssetsContentProps {
|
|
|
14
14
|
columns: DatasourceResponseSchemaProperty[];
|
|
15
15
|
defaultVisibleColumnKeys: string[];
|
|
16
16
|
onVisibleColumnKeysChange: (visibleColumnKeys: string[]) => void;
|
|
17
|
-
modalRenderInstanceId: string;
|
|
18
17
|
}
|
|
19
18
|
export declare const MODAL_HEIGHT = 420;
|
|
20
19
|
export declare const RenderAssetsContent: (props: RenderAssetsContentProps) => jsx.JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { type ColumnPickerProps } from './types';
|
|
3
|
-
export declare const ColumnPicker: ({ columns, selectedColumnKeys, onSelectedColumnKeysChange, onOpen,
|
|
3
|
+
export declare const ColumnPicker: ({ columns, selectedColumnKeys, onSelectedColumnKeysChange, onOpen, }: ColumnPickerProps) => jsx.JSX.Element;
|
|
@@ -22,5 +22,5 @@ export interface RowCellType {
|
|
|
22
22
|
content?: React.ReactNode | string;
|
|
23
23
|
}
|
|
24
24
|
export declare const getOrderedColumns: (columns: DatasourceResponseSchemaProperty[], visibleColumnKeys: string[]) => DatasourceResponseSchemaProperty[];
|
|
25
|
-
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange, status, hasNextPage, scrollableContainerHeight,
|
|
25
|
+
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange, status, hasNextPage, scrollableContainerHeight, extensionKey, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
|
|
26
26
|
export declare const EmptyState: ({ isCompact, testId }: import("./empty-state").Props) => jsx.JSX.Element;
|
|
@@ -15,10 +15,6 @@ export interface ColumnSizesMap {
|
|
|
15
15
|
}
|
|
16
16
|
export interface IssueLikeDataTableViewProps {
|
|
17
17
|
testId?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Unique ID to indicate parent component instance to be used for UFO experiences
|
|
20
|
-
*/
|
|
21
|
-
parentContainerRenderInstanceId?: string;
|
|
22
18
|
/**
|
|
23
19
|
* Datasource extension key. Optional as value may not have been returned yet
|
|
24
20
|
*/
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
2
|
import type { JiraConfigModalProps } from '../types';
|
|
4
|
-
export declare const PlainJiraIssuesConfigModal: (props: JiraConfigModalProps) => jsx.JSX.Element;
|
|
5
3
|
export declare const JiraIssuesConfigModal: import("react").ForwardRefExoticComponent<JiraConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
declare const DatasourceExperienceIdProvider: ({ children, }: PropsWithChildren<{}>) => JSX.Element;
|
|
3
|
+
declare const useDatasourceExperienceId: () => string;
|
|
4
|
+
export { DatasourceExperienceIdProvider, useDatasourceExperienceId };
|
|
@@ -14,7 +14,6 @@ export interface RenderAssetsContentProps {
|
|
|
14
14
|
columns: DatasourceResponseSchemaProperty[];
|
|
15
15
|
defaultVisibleColumnKeys: string[];
|
|
16
16
|
onVisibleColumnKeysChange: (visibleColumnKeys: string[]) => void;
|
|
17
|
-
modalRenderInstanceId: string;
|
|
18
17
|
}
|
|
19
18
|
export declare const MODAL_HEIGHT = 420;
|
|
20
19
|
export declare const RenderAssetsContent: (props: RenderAssetsContentProps) => jsx.JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { type ColumnPickerProps } from './types';
|
|
3
|
-
export declare const ColumnPicker: ({ columns, selectedColumnKeys, onSelectedColumnKeysChange, onOpen,
|
|
3
|
+
export declare const ColumnPicker: ({ columns, selectedColumnKeys, onSelectedColumnKeysChange, onOpen, }: ColumnPickerProps) => jsx.JSX.Element;
|
|
@@ -22,5 +22,5 @@ export interface RowCellType {
|
|
|
22
22
|
content?: React.ReactNode | string;
|
|
23
23
|
}
|
|
24
24
|
export declare const getOrderedColumns: (columns: DatasourceResponseSchemaProperty[], visibleColumnKeys: string[]) => DatasourceResponseSchemaProperty[];
|
|
25
|
-
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange, status, hasNextPage, scrollableContainerHeight,
|
|
25
|
+
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange, status, hasNextPage, scrollableContainerHeight, extensionKey, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
|
|
26
26
|
export declare const EmptyState: ({ isCompact, testId }: import("./empty-state").Props) => jsx.JSX.Element;
|
|
@@ -15,10 +15,6 @@ export interface ColumnSizesMap {
|
|
|
15
15
|
}
|
|
16
16
|
export interface IssueLikeDataTableViewProps {
|
|
17
17
|
testId?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Unique ID to indicate parent component instance to be used for UFO experiences
|
|
20
|
-
*/
|
|
21
|
-
parentContainerRenderInstanceId?: string;
|
|
22
18
|
/**
|
|
23
19
|
* Datasource extension key. Optional as value may not have been returned yet
|
|
24
20
|
*/
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
2
|
import type { JiraConfigModalProps } from '../types';
|
|
4
|
-
export declare const PlainJiraIssuesConfigModal: (props: JiraConfigModalProps) => jsx.JSX.Element;
|
|
5
3
|
export declare const JiraIssuesConfigModal: import("react").ForwardRefExoticComponent<JiraConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -9,6 +9,7 @@ import { SmartCardProvider } from '@atlaskit/link-provider';
|
|
|
9
9
|
import { mockDatasourceFetchRequests } from '@atlaskit/link-test-helpers/datasource';
|
|
10
10
|
|
|
11
11
|
import { fetchMessagesForLocale } from '../src/common/utils/locale/fetch-messages-for-locale';
|
|
12
|
+
import { DatasourceExperienceIdProvider } from '../src/contexts/datasource-experience-id';
|
|
12
13
|
import { useDatasourceTableState } from '../src/hooks/useDatasourceTableState';
|
|
13
14
|
import { IssueLikeDataTableView } from '../src/ui/issue-like-table';
|
|
14
15
|
import { type JiraIssueDatasourceParameters } from '../src/ui/jira-issues-modal/types';
|
|
@@ -113,14 +114,16 @@ export const ExampleIssueLikeTable = ({
|
|
|
113
114
|
skipIntl,
|
|
114
115
|
}: Props) => {
|
|
115
116
|
return (
|
|
116
|
-
<
|
|
117
|
-
<
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
117
|
+
<DatasourceExperienceIdProvider>
|
|
118
|
+
<IntlMessagesProvider loaderFn={fetchMessagesForLocale}>
|
|
119
|
+
<SmartCardProvider client={new SmartLinkClient()}>
|
|
120
|
+
<ExampleBody
|
|
121
|
+
isReadonly={isReadonly}
|
|
122
|
+
canResizeColumns={canResizeColumns}
|
|
123
|
+
canControlWrapping={canControlWrapping}
|
|
124
|
+
/>
|
|
125
|
+
</SmartCardProvider>
|
|
126
|
+
</IntlMessagesProvider>
|
|
127
|
+
</DatasourceExperienceIdProvider>
|
|
125
128
|
);
|
|
126
129
|
};
|
|
@@ -7,6 +7,7 @@ import { type DatasourceParameters } from '@atlaskit/linking-types';
|
|
|
7
7
|
|
|
8
8
|
import { DatasourceTableView } from '../src';
|
|
9
9
|
import { fetchMessagesForLocale } from '../src/common/utils/locale/fetch-messages-for-locale';
|
|
10
|
+
import { DatasourceExperienceIdProvider } from '../src/contexts/datasource-experience-id';
|
|
10
11
|
import { type JiraIssueDatasourceParameters } from '../src/ui/jira-issues-modal/types';
|
|
11
12
|
|
|
12
13
|
import SmartLinkClient from './smartLinkCustomClient';
|
|
@@ -66,10 +67,12 @@ export const ExampleJiraIssuesTableView = ({
|
|
|
66
67
|
}, [mockDatasourceFetchRequest]);
|
|
67
68
|
|
|
68
69
|
return (
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
<DatasourceExperienceIdProvider>
|
|
71
|
+
<IntlMessagesProvider loaderFn={fetchMessagesForLocale}>
|
|
72
|
+
<SmartCardProvider client={new SmartLinkClient()}>
|
|
73
|
+
<JiraIssuesTableView parameters={parameters} />
|
|
74
|
+
</SmartCardProvider>
|
|
75
|
+
</IntlMessagesProvider>
|
|
76
|
+
</DatasourceExperienceIdProvider>
|
|
74
77
|
);
|
|
75
78
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.4",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/avatar": "^21.9.0",
|
|
41
41
|
"@atlaskit/avatar-group": "^9.6.0",
|
|
42
42
|
"@atlaskit/badge": "^16.1.0",
|
|
43
|
-
"@atlaskit/button": "^17.
|
|
43
|
+
"@atlaskit/button": "^17.17.0",
|
|
44
44
|
"@atlaskit/datetime-picker": "^13.5.0",
|
|
45
45
|
"@atlaskit/dropdown-menu": "^12.10.0",
|
|
46
46
|
"@atlaskit/editor-prosemirror": "4.0.1",
|