@atlaskit/link-datasource 1.20.0 → 1.21.0

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 (26) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/hooks/useDatasourceTableState.js +91 -88
  3. package/dist/cjs/ui/common/error-state/messages.js +20 -0
  4. package/dist/cjs/ui/common/error-state/provider-auth-required-svg.js +449 -0
  5. package/dist/cjs/ui/common/error-state/provider-auth-required.js +96 -0
  6. package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +16 -7
  7. package/dist/es2019/hooks/useDatasourceTableState.js +26 -24
  8. package/dist/es2019/ui/common/error-state/messages.js +20 -0
  9. package/dist/es2019/ui/common/error-state/provider-auth-required-svg.js +442 -0
  10. package/dist/es2019/ui/common/error-state/provider-auth-required.js +62 -0
  11. package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +16 -7
  12. package/dist/esm/hooks/useDatasourceTableState.js +91 -88
  13. package/dist/esm/ui/common/error-state/messages.js +20 -0
  14. package/dist/esm/ui/common/error-state/provider-auth-required-svg.js +442 -0
  15. package/dist/esm/ui/common/error-state/provider-auth-required.js +85 -0
  16. package/dist/esm/ui/datasource-table-view/datasourceTableView.js +16 -7
  17. package/dist/types/hooks/useDatasourceTableState.d.ts +3 -1
  18. package/dist/types/ui/common/error-state/messages.d.ts +20 -0
  19. package/dist/types/ui/common/error-state/provider-auth-required-svg.d.ts +3 -0
  20. package/dist/types/ui/common/error-state/provider-auth-required.d.ts +9 -0
  21. package/dist/types-ts4.5/hooks/useDatasourceTableState.d.ts +3 -1
  22. package/dist/types-ts4.5/ui/common/error-state/messages.d.ts +20 -0
  23. package/dist/types-ts4.5/ui/common/error-state/provider-auth-required-svg.d.ts +3 -0
  24. package/dist/types-ts4.5/ui/common/error-state/provider-auth-required.d.ts +9 -0
  25. package/examples-helpers/buildJiraIssuesTable.tsx +34 -6
  26. package/package.json +4 -3
@@ -54,4 +54,24 @@ export declare const loadingErrorMessages: {
54
54
  description: string;
55
55
  defaultMessage: string;
56
56
  };
57
+ authScreenHeaderText: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
62
+ authScreenDescriptionText: {
63
+ id: string;
64
+ defaultMessage: string;
65
+ description: string;
66
+ };
67
+ learnMoreAboutSmartLinks: {
68
+ id: string;
69
+ defaultMessage: string;
70
+ description: string;
71
+ };
72
+ authConnectButtonText: {
73
+ id: string;
74
+ defaultMessage: string;
75
+ description: string;
76
+ };
57
77
  };
@@ -0,0 +1,3 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ export declare const ProviderAuthRequiredSVG: () => jsx.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx } from '@emotion/react';
2
+ import { DatasourceMeta } from '@atlaskit/linking-types';
3
+ interface ProviderAuthRequiredProps {
4
+ auth: DatasourceMeta['auth'];
5
+ onAuthSuccess: () => void;
6
+ onAuthError: () => void;
7
+ }
8
+ export declare const ProviderAuthRequired: ({ auth, onAuthSuccess, onAuthError, }: ProviderAuthRequiredProps) => jsx.JSX.Element;
9
+ export {};
@@ -1,24 +1,33 @@
1
- import React, { useCallback, useMemo, useState } from 'react';
1
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
2
 
3
+ import { IntlProvider } from 'react-intl-next';
4
+
5
+ import { SmartCardProvider } from '@atlaskit/link-provider';
3
6
  import {
4
7
  defaultInitialVisibleColumnKeys,
5
8
  mockDatasourceFetchRequests,
6
9
  } from '@atlaskit/link-test-helpers/datasource';
10
+ import { DatasourceParameters } from '@atlaskit/linking-types';
7
11
 
8
12
  import { DatasourceTableView } from '../src';
9
13
  import { ColumnSizesMap } from '../src/ui/issue-like-table/types';
10
14
  import { JiraIssueDatasourceParameters } from '../src/ui/jira-issues-modal/types';
11
15
 
12
- mockDatasourceFetchRequests();
16
+ import SmartLinkClient from './smartLinkCustomClient';
17
+
18
+ interface JiraIssuesTableViewProps {
19
+ parameters?: DatasourceParameters;
20
+ mockDatasourceFetchRequest?: boolean;
21
+ }
13
22
 
14
- export const ExampleJiraIssuesTableView = () => {
15
- const cloudId = 'some-cloud-id';
23
+ const JiraIssuesTableView = ({ parameters }: JiraIssuesTableViewProps) => {
24
+ const cloudId = parameters?.cloudId || 'some-cloud-id';
16
25
 
17
26
  const [visibleColumnKeys, setVisibleColumnKeys] = useState<string[]>(
18
27
  defaultInitialVisibleColumnKeys,
19
28
  );
20
29
 
21
- const parameters = useMemo<JiraIssueDatasourceParameters>(
30
+ const datasourceParameters = useMemo<JiraIssueDatasourceParameters>(
22
31
  () => ({
23
32
  cloudId,
24
33
  jql: 'some-jql',
@@ -42,7 +51,7 @@ export const ExampleJiraIssuesTableView = () => {
42
51
  return (
43
52
  <DatasourceTableView
44
53
  datasourceId={'some-datasource-id'}
45
- parameters={parameters}
54
+ parameters={datasourceParameters}
46
55
  visibleColumnKeys={visibleColumnKeys}
47
56
  onVisibleColumnKeysChange={setVisibleColumnKeys}
48
57
  columnCustomSizes={columnCustomSizes}
@@ -50,3 +59,22 @@ export const ExampleJiraIssuesTableView = () => {
50
59
  />
51
60
  );
52
61
  };
62
+
63
+ export const ExampleJiraIssuesTableView = ({
64
+ parameters,
65
+ mockDatasourceFetchRequest = true,
66
+ }: JiraIssuesTableViewProps) => {
67
+ useEffect(() => {
68
+ if (mockDatasourceFetchRequest) {
69
+ mockDatasourceFetchRequests();
70
+ }
71
+ }, [mockDatasourceFetchRequest]);
72
+
73
+ return (
74
+ <IntlProvider locale="en">
75
+ <SmartCardProvider client={new SmartLinkClient()}>
76
+ <JiraIssuesTableView parameters={parameters} />
77
+ </SmartCardProvider>
78
+ </IntlProvider>
79
+ );
80
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -35,8 +35,8 @@
35
35
  "@atlaskit/avatar": "^21.4.0",
36
36
  "@atlaskit/avatar-group": "^9.5.0",
37
37
  "@atlaskit/badge": "^15.2.0",
38
- "@atlaskit/button": "^17.2.0",
39
- "@atlaskit/dropdown-menu": "^12.2.0",
38
+ "@atlaskit/button": "^17.3.0",
39
+ "@atlaskit/dropdown-menu": "^12.3.0",
40
40
  "@atlaskit/editor-prosemirror": "1.1.0",
41
41
  "@atlaskit/empty-state": "^7.5.0",
42
42
  "@atlaskit/form": "^9.0.3",
@@ -53,6 +53,7 @@
53
53
  "@atlaskit/linking-types": "^8.6.0",
54
54
  "@atlaskit/lozenge": "^11.6.0",
55
55
  "@atlaskit/modal-dialog": "^12.10.0",
56
+ "@atlaskit/outbound-auth-flow-client": "^3.4.5",
56
57
  "@atlaskit/platform-feature-flags": "^0.2.4",
57
58
  "@atlaskit/pragmatic-drag-and-drop": "^0.25.0",
58
59
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.12.0",