@atlaskit/link-datasource 1.24.6 → 1.24.8
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 +13 -0
- package/dist/cjs/ui/assets-modal/modal/render-assets-content/initial-state-view/index.js +2 -1
- package/dist/cjs/ui/common/error-state/access-required.js +2 -1
- package/dist/cjs/ui/common/error-state/loading-error.js +2 -1
- package/dist/cjs/ui/common/error-state/messages.js +0 -11
- package/dist/cjs/ui/common/error-state/modal-loading-error.js +5 -13
- package/dist/cjs/ui/common/error-state/no-instances.js +2 -1
- package/dist/cjs/ui/common/error-state/no-results.js +2 -1
- package/dist/cjs/ui/common/initial-state-view/index.js +2 -1
- package/dist/cjs/ui/common/modal/content-container/index.js +35 -0
- package/dist/cjs/ui/confluence-search-modal/confluence-search-container/index.js +48 -0
- package/dist/cjs/ui/confluence-search-modal/confluence-search-container/messages.js +14 -0
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +206 -42
- package/dist/cjs/ui/confluence-search-modal/modal/messages.js +4 -4
- package/dist/cjs/ui/confluence-search-modal/types.js +5 -0
- package/dist/cjs/ui/issue-like-table/column-picker/concatenated-menu-list.js +2 -1
- package/dist/cjs/ui/issue-like-table/drag-column-preview.js +2 -1
- package/dist/cjs/ui/issue-like-table/index.js +4 -1
- package/dist/cjs/ui/issue-like-table/styled.js +2 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +14 -21
- package/dist/cjs/ui/jira-issues-modal/modal/messages.js +5 -0
- package/dist/cjs/ui/jira-issues-modal/mode-switcher/index.js +1 -0
- package/dist/es2019/ui/assets-modal/modal/render-assets-content/initial-state-view/index.js +2 -1
- package/dist/es2019/ui/common/error-state/access-required.js +2 -1
- package/dist/es2019/ui/common/error-state/loading-error.js +2 -1
- package/dist/es2019/ui/common/error-state/messages.js +0 -11
- package/dist/es2019/ui/common/error-state/modal-loading-error.js +4 -10
- package/dist/es2019/ui/common/error-state/no-instances.js +2 -1
- package/dist/es2019/ui/common/error-state/no-results.js +2 -1
- package/dist/es2019/ui/common/initial-state-view/index.js +2 -1
- package/dist/es2019/ui/common/modal/content-container/index.js +30 -0
- package/dist/es2019/ui/confluence-search-modal/confluence-search-container/index.js +35 -0
- package/dist/es2019/ui/confluence-search-modal/confluence-search-container/messages.js +8 -0
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +191 -41
- package/dist/es2019/ui/confluence-search-modal/modal/messages.js +4 -4
- package/dist/es2019/ui/confluence-search-modal/types.js +1 -0
- package/dist/es2019/ui/issue-like-table/column-picker/concatenated-menu-list.js +2 -1
- package/dist/es2019/ui/issue-like-table/drag-column-preview.js +2 -1
- package/dist/es2019/ui/issue-like-table/index.js +7 -1
- package/dist/es2019/ui/issue-like-table/styled.js +2 -1
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +14 -23
- package/dist/es2019/ui/jira-issues-modal/modal/messages.js +5 -0
- package/dist/es2019/ui/jira-issues-modal/mode-switcher/index.js +1 -0
- package/dist/esm/ui/assets-modal/modal/render-assets-content/initial-state-view/index.js +2 -1
- package/dist/esm/ui/common/error-state/access-required.js +2 -1
- package/dist/esm/ui/common/error-state/loading-error.js +2 -1
- package/dist/esm/ui/common/error-state/messages.js +0 -11
- package/dist/esm/ui/common/error-state/modal-loading-error.js +5 -12
- package/dist/esm/ui/common/error-state/no-instances.js +2 -1
- package/dist/esm/ui/common/error-state/no-results.js +2 -1
- package/dist/esm/ui/common/initial-state-view/index.js +2 -1
- package/dist/esm/ui/common/modal/content-container/index.js +29 -0
- package/dist/esm/ui/confluence-search-modal/confluence-search-container/index.js +38 -0
- package/dist/esm/ui/confluence-search-modal/confluence-search-container/messages.js +8 -0
- package/dist/esm/ui/confluence-search-modal/modal/index.js +210 -44
- package/dist/esm/ui/confluence-search-modal/modal/messages.js +4 -4
- package/dist/esm/ui/confluence-search-modal/types.js +1 -0
- package/dist/esm/ui/issue-like-table/column-picker/concatenated-menu-list.js +2 -1
- package/dist/esm/ui/issue-like-table/drag-column-preview.js +2 -1
- package/dist/esm/ui/issue-like-table/index.js +4 -1
- package/dist/esm/ui/issue-like-table/styled.js +2 -1
- package/dist/esm/ui/jira-issues-modal/modal/index.js +16 -23
- package/dist/esm/ui/jira-issues-modal/modal/messages.js +5 -0
- package/dist/esm/ui/jira-issues-modal/mode-switcher/index.js +1 -0
- package/dist/types/common/types.d.ts +3 -6
- package/dist/types/ui/common/error-state/messages.d.ts +0 -10
- package/dist/types/ui/common/error-state/modal-loading-error.d.ts +3 -2
- package/dist/types/ui/common/modal/content-container/index.d.ts +8 -0
- package/dist/types/ui/confluence-search-modal/confluence-search-container/index.d.ts +9 -0
- package/dist/types/ui/confluence-search-modal/confluence-search-container/messages.d.ts +7 -0
- package/dist/types/ui/confluence-search-modal/index.d.ts +2 -2
- package/dist/types/ui/confluence-search-modal/modal/index.d.ts +2 -2
- package/dist/types/ui/confluence-search-modal/modal/messages.d.ts +1 -1
- package/dist/types/ui/confluence-search-modal/types.d.ts +12 -0
- package/dist/types/ui/jira-issues-modal/index.d.ts +2 -2
- package/dist/types/ui/jira-issues-modal/modal/index.d.ts +3 -13
- package/dist/types/ui/jira-issues-modal/modal/messages.d.ts +5 -0
- package/dist/types/ui/jira-issues-modal/types.d.ts +5 -1
- package/dist/types-ts4.5/common/types.d.ts +3 -6
- package/dist/types-ts4.5/ui/common/error-state/messages.d.ts +0 -10
- package/dist/types-ts4.5/ui/common/error-state/modal-loading-error.d.ts +3 -2
- package/dist/types-ts4.5/ui/common/modal/content-container/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/confluence-search-modal/confluence-search-container/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/confluence-search-modal/confluence-search-container/messages.d.ts +7 -0
- package/dist/types-ts4.5/ui/confluence-search-modal/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/messages.d.ts +1 -1
- package/dist/types-ts4.5/ui/confluence-search-modal/types.d.ts +12 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/index.d.ts +3 -13
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/messages.d.ts +5 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/types.d.ts +5 -1
- package/examples-helpers/buildConfluenceSearchTable.tsx +77 -0
- package/examples-helpers/mockSmartLinkData.ts +44 -0
- package/examples-helpers/smartLinkCustomClient.ts +31 -20
- package/package.json +3 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export interface ContentContainerProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
withTableBorder?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ContentContainer: ({ children, withTableBorder, }: ContentContainerProps) => jsx.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
cloudId?: string;
|
|
4
|
+
initialSearchValue?: string;
|
|
5
|
+
isSearching: boolean;
|
|
6
|
+
onSearch: (searchTerm: string) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const ConfluenceSearchContainer: ({ cloudId, initialSearchValue, isSearching, onSearch, }: Props) => JSX.Element;
|
|
9
|
+
export default ConfluenceSearchContainer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ConfluenceSearchConfigModalProps } from './types';
|
|
3
3
|
export declare const CONFLUENCE_SEARCH_DATASOURCE_ID = "768fc736-3af4-4a8f-b27e-203602bff8ca";
|
|
4
|
-
declare const ConfluenceSearchConfigModalWithWrappers: (props:
|
|
4
|
+
declare const ConfluenceSearchConfigModalWithWrappers: (props: ConfluenceSearchConfigModalProps) => JSX.Element;
|
|
5
5
|
export default ConfluenceSearchConfigModalWithWrappers;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
-
import {
|
|
3
|
-
export declare const ConfluenceSearchConfigModal: (props:
|
|
2
|
+
import { ConfluenceSearchConfigModalProps } from '../types';
|
|
3
|
+
export declare const ConfluenceSearchConfigModal: (props: ConfluenceSearchConfigModalProps) => jsx.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
2
|
+
import { ConfigModalProps } from '../../common/types';
|
|
3
|
+
export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<ConfluenceSearchDatasourceAdf, {
|
|
4
|
+
cloudId: string;
|
|
5
|
+
searchString?: string;
|
|
6
|
+
}> {
|
|
7
|
+
}
|
|
8
|
+
export type ConfluenceSearchDatasourceParameters = {
|
|
9
|
+
cloudId: string;
|
|
10
|
+
searchString?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ConfluenceSearchDatasourceAdf = DatasourceAdf<ConfluenceSearchDatasourceParameters>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { JiraConfigModalProps } from './types';
|
|
3
3
|
export declare const JIRA_LIST_OF_LINKS_DATASOURCE_ID = "d8b75300-dfda-4519-b6cd-e49abbd50401";
|
|
4
|
-
declare const JiraIssuesConfigModalWithWrappers: (props:
|
|
4
|
+
declare const JiraIssuesConfigModalWithWrappers: (props: JiraConfigModalProps) => JSX.Element;
|
|
5
5
|
export default JiraIssuesConfigModalWithWrappers;
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
import { InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
5
3
|
import { DatasourceAction } from '../../../analytics/types';
|
|
6
|
-
import
|
|
7
|
-
import { JiraIssueDatasourceParameters } from '../types';
|
|
4
|
+
import { JiraConfigModalProps } from '../types';
|
|
8
5
|
/**
|
|
9
6
|
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
10
7
|
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
11
8
|
*/
|
|
12
9
|
export declare const getColumnAction: (oldVisibleColumnKeys: string[], newVisibleColumnKeys: string[]) => DatasourceAction;
|
|
13
|
-
export declare const PlainJiraIssuesConfigModal: (props:
|
|
14
|
-
export declare const JiraIssuesConfigModal: import("react").ForwardRefExoticComponent<
|
|
15
|
-
datasourceId: string;
|
|
16
|
-
url?: string | undefined;
|
|
17
|
-
parameters?: import("@atlaskit/linking-types").DatasourceParameters | JiraIssueDatasourceParameters | undefined;
|
|
18
|
-
onCancel: () => void;
|
|
19
|
-
onInsert: (adf: InlineCardAdf | import("@atlaskit/linking-common/types").DatasourceAdf<Record<string, unknown>>, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
|
|
20
|
-
viewMode?: IssueViewModes | undefined;
|
|
21
|
-
} & Partial<Pick<import("../../issue-like-table/types").IssueLikeDataTableViewProps, "visibleColumnKeys" | "wrappedColumnKeys" | "columnCustomSizes">> & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
10
|
+
export declare const PlainJiraIssuesConfigModal: (props: JiraConfigModalProps) => jsx.JSX.Element;
|
|
11
|
+
export declare const JiraIssuesConfigModal: import("react").ForwardRefExoticComponent<JiraConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
1
|
+
import { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
|
+
import { DatasourceParameters } from '@atlaskit/linking-types';
|
|
3
|
+
import { ConfigModalProps } from '../../common/types';
|
|
2
4
|
type XOR<T1, T2> = (T1 & {
|
|
3
5
|
[k in Exclude<keyof T2, keyof T1>]?: never;
|
|
4
6
|
}) | (T2 & {
|
|
@@ -13,4 +15,6 @@ export type JiraIssueDatasourceParameters = {
|
|
|
13
15
|
cloudId: string;
|
|
14
16
|
} & JiraIssueDatasourceParametersQuery;
|
|
15
17
|
export type JiraIssuesDatasourceAdf = DatasourceAdf<JiraIssueDatasourceParameters>;
|
|
18
|
+
export interface JiraConfigModalProps extends ConfigModalProps<InlineCardAdf | DatasourceAdf, DatasourceParameters | JiraIssueDatasourceParameters> {
|
|
19
|
+
}
|
|
16
20
|
export {};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
3
|
-
import { DatasourceParameters } from '@atlaskit/linking-types';
|
|
4
2
|
import { IssueLikeDataTableViewProps } from '../ui/issue-like-table/types';
|
|
5
|
-
import { JiraIssueDatasourceParameters } from '../ui/jira-issues-modal/types';
|
|
6
3
|
export type JiraSearchMethod = 'basic' | 'jql';
|
|
7
4
|
export interface Site {
|
|
8
5
|
cloudId: string;
|
|
@@ -10,17 +7,17 @@ export interface Site {
|
|
|
10
7
|
url: string;
|
|
11
8
|
}
|
|
12
9
|
export type IssueViewModes = 'issue' | 'count';
|
|
13
|
-
export type ConfigModalProps = {
|
|
10
|
+
export type ConfigModalProps<ADF, Parameters> = {
|
|
14
11
|
/** Unique identifier for which type of datasource is being rendered and for making its requests */
|
|
15
12
|
datasourceId: string;
|
|
16
13
|
/** The url that was used to insert a List of Links */
|
|
17
14
|
url?: string;
|
|
18
15
|
/** Parameters for making the data requests necessary to render data within the table */
|
|
19
|
-
parameters?:
|
|
16
|
+
parameters?: Parameters;
|
|
20
17
|
/** Callback function to be invoked when the modal is closed either via cancel button click, esc keydown, or modal blanket click */
|
|
21
18
|
onCancel: () => void;
|
|
22
19
|
/** Callback function to be invoked when the insert issues button is clicked */
|
|
23
|
-
onInsert: (adf:
|
|
20
|
+
onInsert: (adf: ADF, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
24
21
|
/** The view mode that the modal will show on open:
|
|
25
22
|
* - Table = Displays a list of links in table format
|
|
26
23
|
* - Inline link = Presents a smart link that shows the count of query results. However, if there's only one result, it converts to an inline smart link of that issue.
|
|
@@ -39,16 +39,6 @@ export declare const loadingErrorMessages: {
|
|
|
39
39
|
description: string;
|
|
40
40
|
defaultMessage: string;
|
|
41
41
|
};
|
|
42
|
-
checkConnectionWithSourceDuplicate: {
|
|
43
|
-
id: string;
|
|
44
|
-
description: string;
|
|
45
|
-
defaultMessage: string;
|
|
46
|
-
};
|
|
47
|
-
checkConnectionWithSource: {
|
|
48
|
-
id: string;
|
|
49
|
-
description: string;
|
|
50
|
-
defaultMessage: string;
|
|
51
|
-
};
|
|
52
42
|
noResultsFoundDuplicate: {
|
|
53
43
|
id: string;
|
|
54
44
|
description: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { jsx } from '@emotion/react';
|
|
2
3
|
interface ModalLoadingErrorProps {
|
|
3
|
-
|
|
4
|
+
errorMessage?: React.ReactNode;
|
|
4
5
|
}
|
|
5
|
-
export declare const ModalLoadingError: ({
|
|
6
|
+
export declare const ModalLoadingError: ({ errorMessage, }: ModalLoadingErrorProps) => jsx.JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export interface ContentContainerProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
withTableBorder?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ContentContainer: ({ children, withTableBorder, }: ContentContainerProps) => jsx.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
cloudId?: string;
|
|
4
|
+
initialSearchValue?: string;
|
|
5
|
+
isSearching: boolean;
|
|
6
|
+
onSearch: (searchTerm: string) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const ConfluenceSearchContainer: ({ cloudId, initialSearchValue, isSearching, onSearch, }: Props) => JSX.Element;
|
|
9
|
+
export default ConfluenceSearchContainer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ConfluenceSearchConfigModalProps } from './types';
|
|
3
3
|
export declare const CONFLUENCE_SEARCH_DATASOURCE_ID = "768fc736-3af4-4a8f-b27e-203602bff8ca";
|
|
4
|
-
declare const ConfluenceSearchConfigModalWithWrappers: (props:
|
|
4
|
+
declare const ConfluenceSearchConfigModalWithWrappers: (props: ConfluenceSearchConfigModalProps) => JSX.Element;
|
|
5
5
|
export default ConfluenceSearchConfigModalWithWrappers;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
-
import {
|
|
3
|
-
export declare const ConfluenceSearchConfigModal: (props:
|
|
2
|
+
import { ConfluenceSearchConfigModalProps } from '../types';
|
|
3
|
+
export declare const ConfluenceSearchConfigModal: (props: ConfluenceSearchConfigModalProps) => jsx.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
2
|
+
import { ConfigModalProps } from '../../common/types';
|
|
3
|
+
export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<ConfluenceSearchDatasourceAdf, {
|
|
4
|
+
cloudId: string;
|
|
5
|
+
searchString?: string;
|
|
6
|
+
}> {
|
|
7
|
+
}
|
|
8
|
+
export type ConfluenceSearchDatasourceParameters = {
|
|
9
|
+
cloudId: string;
|
|
10
|
+
searchString?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ConfluenceSearchDatasourceAdf = DatasourceAdf<ConfluenceSearchDatasourceParameters>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { JiraConfigModalProps } from './types';
|
|
3
3
|
export declare const JIRA_LIST_OF_LINKS_DATASOURCE_ID = "d8b75300-dfda-4519-b6cd-e49abbd50401";
|
|
4
|
-
declare const JiraIssuesConfigModalWithWrappers: (props:
|
|
4
|
+
declare const JiraIssuesConfigModalWithWrappers: (props: JiraConfigModalProps) => JSX.Element;
|
|
5
5
|
export default JiraIssuesConfigModalWithWrappers;
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
import { InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
5
3
|
import { DatasourceAction } from '../../../analytics/types';
|
|
6
|
-
import
|
|
7
|
-
import { JiraIssueDatasourceParameters } from '../types';
|
|
4
|
+
import { JiraConfigModalProps } from '../types';
|
|
8
5
|
/**
|
|
9
6
|
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
10
7
|
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
11
8
|
*/
|
|
12
9
|
export declare const getColumnAction: (oldVisibleColumnKeys: string[], newVisibleColumnKeys: string[]) => DatasourceAction;
|
|
13
|
-
export declare const PlainJiraIssuesConfigModal: (props:
|
|
14
|
-
export declare const JiraIssuesConfigModal: import("react").ForwardRefExoticComponent<
|
|
15
|
-
datasourceId: string;
|
|
16
|
-
url?: string | undefined;
|
|
17
|
-
parameters?: import("@atlaskit/linking-types").DatasourceParameters | JiraIssueDatasourceParameters | undefined;
|
|
18
|
-
onCancel: () => void;
|
|
19
|
-
onInsert: (adf: InlineCardAdf | import("@atlaskit/linking-common/types").DatasourceAdf<Record<string, unknown>>, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
|
|
20
|
-
viewMode?: IssueViewModes | undefined;
|
|
21
|
-
} & Partial<Pick<import("../../issue-like-table/types").IssueLikeDataTableViewProps, "visibleColumnKeys" | "wrappedColumnKeys" | "columnCustomSizes">> & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
10
|
+
export declare const PlainJiraIssuesConfigModal: (props: JiraConfigModalProps) => jsx.JSX.Element;
|
|
11
|
+
export declare const JiraIssuesConfigModal: import("react").ForwardRefExoticComponent<JiraConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
1
|
+
import { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
|
+
import { DatasourceParameters } from '@atlaskit/linking-types';
|
|
3
|
+
import { ConfigModalProps } from '../../common/types';
|
|
2
4
|
type XOR<T1, T2> = (T1 & {
|
|
3
5
|
[k in Exclude<keyof T2, keyof T1>]?: never;
|
|
4
6
|
}) | (T2 & {
|
|
@@ -13,4 +15,6 @@ export type JiraIssueDatasourceParameters = {
|
|
|
13
15
|
cloudId: string;
|
|
14
16
|
} & JiraIssueDatasourceParametersQuery;
|
|
15
17
|
export type JiraIssuesDatasourceAdf = DatasourceAdf<JiraIssueDatasourceParameters>;
|
|
18
|
+
export interface JiraConfigModalProps extends ConfigModalProps<InlineCardAdf | DatasourceAdf, DatasourceParameters | JiraIssueDatasourceParameters> {
|
|
19
|
+
}
|
|
16
20
|
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useEffect, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
4
|
+
import { SmartCardProvider } from '@atlaskit/link-provider';
|
|
5
|
+
import { mockDatasourceFetchRequests } from '@atlaskit/link-test-helpers/datasource';
|
|
6
|
+
import { DatasourceParameters } from '@atlaskit/linking-types';
|
|
7
|
+
|
|
8
|
+
import { DatasourceTableView } from '../src';
|
|
9
|
+
import { fetchMessagesForLocale } from '../src/common/utils/locale/fetch-messages-for-locale';
|
|
10
|
+
import { ConfluenceSearchDatasourceParameters } from '../src/ui/confluence-search-modal/types';
|
|
11
|
+
|
|
12
|
+
import SmartLinkClient from './smartLinkCustomClient';
|
|
13
|
+
import { useCommonTableProps } from './useCommonTableProps';
|
|
14
|
+
|
|
15
|
+
interface ConfluenceSearchTableViewProps {
|
|
16
|
+
parameters?: DatasourceParameters;
|
|
17
|
+
mockDatasourceFetchRequest?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const ConfluenceSearchTableView = ({
|
|
21
|
+
parameters,
|
|
22
|
+
}: ConfluenceSearchTableViewProps) => {
|
|
23
|
+
const cloudId = parameters?.cloudId || 'some-cloud-id';
|
|
24
|
+
|
|
25
|
+
const datasourceParameters = useMemo<ConfluenceSearchDatasourceParameters>(
|
|
26
|
+
() => ({
|
|
27
|
+
cloudId,
|
|
28
|
+
searchString: 'some-query',
|
|
29
|
+
}),
|
|
30
|
+
[cloudId],
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
visibleColumnKeys,
|
|
35
|
+
onVisibleColumnKeysChange,
|
|
36
|
+
columnCustomSizes,
|
|
37
|
+
onColumnResize,
|
|
38
|
+
wrappedColumnKeys,
|
|
39
|
+
onWrappedColumnChange,
|
|
40
|
+
} = useCommonTableProps({
|
|
41
|
+
defaultColumnCustomSizes: {
|
|
42
|
+
people: 100,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<DatasourceTableView
|
|
48
|
+
datasourceId={'some-datasource-id'}
|
|
49
|
+
parameters={datasourceParameters}
|
|
50
|
+
visibleColumnKeys={visibleColumnKeys}
|
|
51
|
+
onVisibleColumnKeysChange={onVisibleColumnKeysChange}
|
|
52
|
+
columnCustomSizes={columnCustomSizes}
|
|
53
|
+
onColumnResize={onColumnResize}
|
|
54
|
+
onWrappedColumnChange={onWrappedColumnChange}
|
|
55
|
+
wrappedColumnKeys={wrappedColumnKeys}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const ExampleConfluenceSearchTableView = ({
|
|
61
|
+
parameters,
|
|
62
|
+
mockDatasourceFetchRequest = true,
|
|
63
|
+
}: ConfluenceSearchTableViewProps) => {
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (mockDatasourceFetchRequest) {
|
|
66
|
+
mockDatasourceFetchRequests();
|
|
67
|
+
}
|
|
68
|
+
}, [mockDatasourceFetchRequest]);
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<IntlMessagesProvider loaderFn={fetchMessagesForLocale}>
|
|
72
|
+
<SmartCardProvider client={new SmartLinkClient()}>
|
|
73
|
+
<ConfluenceSearchTableView parameters={parameters} />
|
|
74
|
+
</SmartCardProvider>
|
|
75
|
+
</IntlMessagesProvider>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
@@ -64,4 +64,48 @@ export const mocks = {
|
|
|
64
64
|
url: 'https://product-fabric.atlassian.net/browse/EDM-5941',
|
|
65
65
|
},
|
|
66
66
|
} as JsonLd.Response,
|
|
67
|
+
notFound: {
|
|
68
|
+
meta: {
|
|
69
|
+
visibility: 'not_found',
|
|
70
|
+
access: 'forbidden',
|
|
71
|
+
auth: [],
|
|
72
|
+
definitionId: 'd1',
|
|
73
|
+
key: 'object-provider',
|
|
74
|
+
},
|
|
75
|
+
data: {
|
|
76
|
+
'@context': {
|
|
77
|
+
'@vocab': 'https://www.w3.org/ns/activitystreams#',
|
|
78
|
+
atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
|
|
79
|
+
schema: 'http://schema.org/',
|
|
80
|
+
},
|
|
81
|
+
'@type': 'Object',
|
|
82
|
+
name: 'I love cheese',
|
|
83
|
+
url: 'https://some.url',
|
|
84
|
+
},
|
|
85
|
+
} as JsonLd.Response,
|
|
86
|
+
forbidden: {
|
|
87
|
+
meta: {
|
|
88
|
+
visibility: 'restricted',
|
|
89
|
+
access: 'forbidden',
|
|
90
|
+
auth: [
|
|
91
|
+
{
|
|
92
|
+
key: 'some-flow',
|
|
93
|
+
displayName: 'Flow',
|
|
94
|
+
url: 'https://outbound-auth/flow',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
definitionId: 'd1',
|
|
98
|
+
key: 'object-provider',
|
|
99
|
+
},
|
|
100
|
+
data: {
|
|
101
|
+
'@context': {
|
|
102
|
+
'@vocab': 'https://www.w3.org/ns/activitystreams#',
|
|
103
|
+
atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
|
|
104
|
+
schema: 'http://schema.org/',
|
|
105
|
+
},
|
|
106
|
+
'@type': 'Object',
|
|
107
|
+
name: 'I love cheese',
|
|
108
|
+
url: 'https://some.url',
|
|
109
|
+
},
|
|
110
|
+
} as JsonLd.Response,
|
|
67
111
|
};
|
|
@@ -8,27 +8,38 @@ import { mocks } from './mockSmartLinkData';
|
|
|
8
8
|
|
|
9
9
|
const jqlUrlRegExp = /.+[jql=].+/;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
const mockedFetch = (url: string): Promise<JsonLd.Response> => {
|
|
12
|
+
switch (url) {
|
|
13
|
+
case 'https://product-fabric.atlassian.net/browse/EDM-5941':
|
|
14
|
+
case 'https://product-fabric.atlassian.net/browse/EDM-5591':
|
|
15
|
+
return Promise.resolve(mocks.resolved);
|
|
16
|
+
case 'https://link-that-does-not-resolve.com':
|
|
17
|
+
return Promise.reject(`Can't resolve from ${url}`);
|
|
18
|
+
case 'https://link-that-is-still-resolving.com/long-url/very-very-very-very-very-very-very-long':
|
|
19
|
+
return new Promise(() => {});
|
|
20
|
+
case 'https://link-that-is-unauthorized.com':
|
|
21
|
+
return Promise.resolve(mocks.unauthorized);
|
|
22
|
+
case 'https://link-that-is-not-found.com/long':
|
|
23
|
+
return Promise.resolve(mocks.notFound);
|
|
24
|
+
case 'https://link-that-is-forbidden.com':
|
|
25
|
+
return Promise.resolve(mocks.forbidden);
|
|
26
|
+
case 'https://link-that-is-unsupported.com':
|
|
27
|
+
throw new APIError(
|
|
28
|
+
'fatal',
|
|
29
|
+
new URL(url).hostname,
|
|
30
|
+
'received unsupported error',
|
|
31
|
+
'ResolveUnsupportedError',
|
|
32
|
+
);
|
|
33
|
+
case jqlUrlRegExp.test(url) ? url : undefined:
|
|
34
|
+
return Promise.resolve(mockJqlSmartLinkData.resolved);
|
|
35
|
+
default:
|
|
36
|
+
return Promise.resolve(mocks.unauthorized);
|
|
31
37
|
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
class SmartLinkClient extends CardClient {
|
|
41
|
+
prefetchData = mockedFetch;
|
|
42
|
+
fetchData = mockedFetch;
|
|
32
43
|
}
|
|
33
44
|
|
|
34
45
|
export default SmartLinkClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.8",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/avatar": "^21.5.0",
|
|
37
37
|
"@atlaskit/avatar-group": "^9.5.0",
|
|
38
38
|
"@atlaskit/badge": "^15.2.0",
|
|
39
|
-
"@atlaskit/button": "^17.
|
|
39
|
+
"@atlaskit/button": "^17.8.0",
|
|
40
40
|
"@atlaskit/dropdown-menu": "^12.8.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
42
42
|
"@atlaskit/empty-state": "^7.7.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
61
61
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^1.0.0",
|
|
62
62
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.0.0",
|
|
63
|
-
"@atlaskit/primitives": "^5.
|
|
63
|
+
"@atlaskit/primitives": "^5.2.0",
|
|
64
64
|
"@atlaskit/select": "^17.3.0",
|
|
65
65
|
"@atlaskit/smart-card": "^26.50.0",
|
|
66
66
|
"@atlaskit/spinner": "^16.0.0",
|