@atlaskit/link-datasource 0.14.4 → 0.15.1

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +5 -1
  3. package/dist/cjs/ui/issue-like-table/index.js +78 -31
  4. package/dist/cjs/ui/issue-like-table/styled.js +5 -3
  5. package/dist/cjs/version.json +1 -1
  6. package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +5 -1
  7. package/dist/es2019/ui/issue-like-table/index.js +60 -14
  8. package/dist/es2019/ui/issue-like-table/styled.js +3 -0
  9. package/dist/es2019/version.json +1 -1
  10. package/dist/esm/ui/issue-like-table/draggable-table-heading.js +5 -1
  11. package/dist/esm/ui/issue-like-table/index.js +79 -32
  12. package/dist/esm/ui/issue-like-table/styled.js +3 -2
  13. package/dist/esm/version.json +1 -1
  14. package/dist/types/ui/issue-like-table/draggable-table-heading.d.ts +2 -1
  15. package/dist/types/ui/issue-like-table/index.d.ts +1 -0
  16. package/dist/types/ui/issue-like-table/styled.d.ts +4 -0
  17. package/dist/types-ts4.5/ui/issue-like-table/draggable-table-heading.d.ts +2 -1
  18. package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +1 -0
  19. package/dist/types-ts4.5/ui/issue-like-table/styled.d.ts +4 -0
  20. package/examples-helpers/buildIssueLikeTable.tsx +4 -2
  21. package/examples-helpers/buildJiraIssuesTable.tsx +4 -2
  22. package/package.json +4 -4
  23. package/examples-helpers/mockAutocompleteData.ts +0 -54
  24. package/examples-helpers/mockJiraAvailableSites.ts +0 -27
  25. package/examples-helpers/mockJiraData.ts +0 -546
  26. package/examples-helpers/mockSuggestionData.ts +0 -17
  27. package/examples-helpers/setupDatasourcesMocks.ts +0 -199
  28. package/examples-helpers/setupModalExampleMocks.ts +0 -32
@@ -1,4 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject;
2
+ var _templateObject, _templateObject2;
3
3
  import styled from '@emotion/styled';
4
- export var TableHeading = styled.th(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n padding-block: ", ";\n line-height: ", ";\n"])), "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 24px)");
4
+ export var Table = styled.table(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: auto;\n"])));
5
+ export var TableHeading = styled.th(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding-block: ", ";\n line-height: ", ";\n"])), "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 24px)");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.14.4",
3
+ "version": "0.15.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,12 +1,13 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- export declare const DraggableTableHeading: ({ children, id, index, tableId, dndPreviewHeight, onDragPreviewStart, onDragPreviewEnd, }: {
4
+ export declare const DraggableTableHeading: ({ children, id, index, tableId, dndPreviewHeight, maxWidth, onDragPreviewStart, onDragPreviewEnd, }: {
5
5
  children: ReactNode;
6
6
  id: string;
7
7
  index: number;
8
8
  tableId: Symbol;
9
9
  dndPreviewHeight: number;
10
+ maxWidth?: number | undefined;
10
11
  onDragPreviewStart: () => void;
11
12
  onDragPreviewEnd: () => void;
12
13
  }) => jsx.JSX.Element;
@@ -10,6 +10,7 @@ export interface RowType {
10
10
  export interface RowCellType {
11
11
  key: string;
12
12
  content?: React.ReactNode | string;
13
+ maxWidth?: number;
13
14
  }
14
15
  export declare const IssueLikeDataTableView: ({ testId, onNextPage, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, status, hasNextPage, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
15
16
  export declare const EmptyState: (props: import("./empty-state").Props) => jsx.JSX.Element;
@@ -1,4 +1,8 @@
1
1
  /// <reference types="react" />
2
+ export declare const Table: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {}>;
2
6
  export declare const TableHeading: import("@emotion/styled").StyledComponent<{
3
7
  theme?: import("@emotion/react").Theme | undefined;
4
8
  as?: import("react").ElementType<any> | undefined;
@@ -1,12 +1,13 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- export declare const DraggableTableHeading: ({ children, id, index, tableId, dndPreviewHeight, onDragPreviewStart, onDragPreviewEnd, }: {
4
+ export declare const DraggableTableHeading: ({ children, id, index, tableId, dndPreviewHeight, maxWidth, onDragPreviewStart, onDragPreviewEnd, }: {
5
5
  children: ReactNode;
6
6
  id: string;
7
7
  index: number;
8
8
  tableId: Symbol;
9
9
  dndPreviewHeight: number;
10
+ maxWidth?: number | undefined;
10
11
  onDragPreviewStart: () => void;
11
12
  onDragPreviewEnd: () => void;
12
13
  }) => jsx.JSX.Element;
@@ -10,6 +10,7 @@ export interface RowType {
10
10
  export interface RowCellType {
11
11
  key: string;
12
12
  content?: React.ReactNode | string;
13
+ maxWidth?: number;
13
14
  }
14
15
  export declare const IssueLikeDataTableView: ({ testId, onNextPage, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, status, hasNextPage, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
15
16
  export declare const EmptyState: (props: import("./empty-state").Props) => jsx.JSX.Element;
@@ -1,4 +1,8 @@
1
1
  /// <reference types="react" />
2
+ export declare const Table: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {}>;
2
6
  export declare const TableHeading: import("@emotion/styled").StyledComponent<{
3
7
  theme?: import("@emotion/react").Theme | undefined;
4
8
  as?: import("react").ElementType<any> | undefined;
@@ -6,14 +6,16 @@ import styled from '@emotion/styled';
6
6
  import { IntlProvider } from 'react-intl-next';
7
7
 
8
8
  import { SmartCardProvider } from '@atlaskit/link-provider';
9
+ import { mockDatasourceFetchRequests } from '@atlaskit/link-test-helpers/datasource';
9
10
 
10
11
  import { useDatasourceTableState } from '../src/hooks/useDatasourceTableState';
11
12
  import { IssueLikeDataTableView } from '../src/ui/issue-like-table';
12
13
  import { JiraIssueDatasourceParameters } from '../src/ui/jira-issues/types';
13
14
 
14
- import { MOCK_DATASOURCE_ID } from './setupDatasourcesMocks';
15
15
  import SmartLinkClient from './smartLinkCustomClient';
16
16
 
17
+ mockDatasourceFetchRequests();
18
+
17
19
  interface Props {
18
20
  isReadonly?: boolean;
19
21
  }
@@ -43,7 +45,7 @@ const ExampleBody = ({ isReadonly }: Props) => {
43
45
  hasNextPage,
44
46
  defaultVisibleColumnKeys,
45
47
  columns,
46
- } = useDatasourceTableState(MOCK_DATASOURCE_ID, parameters);
48
+ } = useDatasourceTableState('some-datasource-id', parameters);
47
49
 
48
50
  const [visibleColumnKeys, setVisibleColumnKeys] = useState<string[]>(
49
51
  defaultVisibleColumnKeys,
@@ -1,9 +1,11 @@
1
1
  import React, { useMemo, useState } from 'react';
2
2
 
3
+ import { mockDatasourceFetchRequests } from '@atlaskit/link-test-helpers/datasource';
4
+
3
5
  import { JiraIssuesTableView } from '../src/ui/jira-issues/tableView';
4
6
  import { JiraIssueDatasourceParameters } from '../src/ui/jira-issues/types';
5
7
 
6
- import { MOCK_DATASOURCE_ID } from './setupDatasourcesMocks';
8
+ mockDatasourceFetchRequests();
7
9
 
8
10
  export const ExampleJiraIssuesTableView = () => {
9
11
  const cloudId = 'some-cloud-id';
@@ -22,7 +24,7 @@ export const ExampleJiraIssuesTableView = () => {
22
24
 
23
25
  return (
24
26
  <JiraIssuesTableView
25
- datasourceId={MOCK_DATASOURCE_ID}
27
+ datasourceId={'some-datasource-id'}
26
28
  parameters={parameters}
27
29
  visibleColumnKeys={visibleColumnKeys}
28
30
  onVisibleColumnKeysChange={setVisibleColumnKeys}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.14.4",
3
+ "version": "0.15.1",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -35,7 +35,7 @@
35
35
  "@atlaskit/icon-object": "^6.3.0",
36
36
  "@atlaskit/image": "^1.1.0",
37
37
  "@atlaskit/link-client-extension": "^1.1.0",
38
- "@atlaskit/linking-common": "^2.10.0",
38
+ "@atlaskit/linking-common": "^2.12.0",
39
39
  "@atlaskit/linking-types": "^1.6.0",
40
40
  "@atlaskit/lozenge": "^11.4.0",
41
41
  "@atlaskit/modal-dialog": "^12.5.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.11.0",
45
45
  "@atlaskit/pragmatic-drag-and-drop-react-indicator": "^0.14.0",
46
46
  "@atlaskit/select": "^16.2.0",
47
- "@atlaskit/smart-card": "^26.1.0",
47
+ "@atlaskit/smart-card": "^26.2.0",
48
48
  "@atlaskit/spinner": "^15.5.0",
49
49
  "@atlaskit/tag": "^11.5.0",
50
50
  "@atlaskit/textfield": "5.4.2",
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/code": "^14.6.0",
67
67
  "@atlaskit/docs": "*",
68
68
  "@atlaskit/link-provider": "^1.6.0",
69
- "@atlaskit/link-test-helpers": "^2.3.0",
69
+ "@atlaskit/link-test-helpers": "^2.4.0",
70
70
  "@atlaskit/ssr": "*",
71
71
  "@atlaskit/visual-regression": "*",
72
72
  "@atlaskit/webdriver-runner": "*",
@@ -1,54 +0,0 @@
1
- // https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-autocompletedata-post
2
- export const mockAutoCompleteData = {
3
- visibleFieldNames: [
4
- {
5
- value: 'status',
6
- displayName: 'status',
7
- operators: ['=', '!=', 'in', 'not in', 'is', 'is not'],
8
- searchable: 'true',
9
- auto: 'true',
10
- orderable: 'true',
11
- types: ['com.atlassian.jira.issue.status.Status'],
12
- },
13
- {
14
- value: 'issuetype',
15
- displayName: 'issuetype',
16
- operators: ['=', '!=', 'in', 'not in', 'is', 'is not'],
17
- searchable: 'true',
18
- auto: 'true',
19
- orderable: 'true',
20
- types: ['com.atlassian.jira.issue.issuetype.IssueType'],
21
- },
22
- {
23
- value: 'cf[10062]',
24
- displayName: 'Component - cf[10062]',
25
- orderable: 'true',
26
- auto: 'true',
27
- cfid: 'cf[10062]',
28
- operators: ['=', '!=', 'in', 'not in', 'is', 'is not'],
29
- types: ['com.atlassian.jira.issue.customfields.option.Option'],
30
- },
31
- {
32
- value: '"Component[Dropdown]"',
33
- displayName: 'Component - Component[Dropdown]',
34
- searchable: 'true',
35
- auto: 'true',
36
- operators: ['=', '!=', 'in', 'not in', 'is', 'is not'],
37
- types: ['com.atlassian.jira.issue.customfields.option.Option'],
38
- },
39
- ],
40
- visibleFunctionNames: [
41
- {
42
- value: 'standardIssueTypes()',
43
- displayName: 'standardIssueTypes()',
44
- isList: 'true',
45
- types: ['com.atlassian.jira.issue.issuetype.IssueType'],
46
- },
47
- {
48
- value: 'currentUser()',
49
- displayName: 'currentUser()',
50
- types: ['com.atlassian.jira.user.ApplicationUser'],
51
- },
52
- ],
53
- jqlReservedWords: ['empty', 'and', 'or', 'in', 'distinct'],
54
- };
@@ -1,27 +0,0 @@
1
- export const mockSiteData = [
2
- {
3
- cloudId: '12345',
4
- url: 'https://test1.atlassian.net',
5
- displayName: 'test1',
6
- },
7
- {
8
- cloudId: '45678',
9
- url: 'https://test2.atlassian.net',
10
- displayName: 'test2',
11
- },
12
- {
13
- cloudId: '67899',
14
- url: 'https://hello.atlassian.net',
15
- displayName: 'hello',
16
- },
17
- {
18
- cloudId: '78911',
19
- url: 'https://test4.atlassian.net',
20
- displayName: 'test4',
21
- },
22
- {
23
- cloudId: '11111',
24
- url: 'https://test5.atlassian.net',
25
- displayName: 'testSingleIssue',
26
- },
27
- ];