@atlaskit/link-datasource 1.10.1 → 1.10.3

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 1.10.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#42390](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42390) [`d1aa333bfce`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d1aa333bfce) - [ux] Enabled count view smart link preview in jira config modal to open in new tab on click
8
+
9
+ ## 1.10.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 1.10.1
4
16
 
5
17
  ### Patch Changes
@@ -7,5 +7,5 @@ exports.packageMetaData = exports.EVENT_CHANNEL = void 0;
7
7
  var EVENT_CHANNEL = exports.EVENT_CHANNEL = 'media';
8
8
  var packageMetaData = exports.packageMetaData = {
9
9
  packageName: "@atlaskit/link-datasource",
10
- packageVersion: "1.10.1"
10
+ packageVersion: "1.10.3"
11
11
  };
@@ -240,7 +240,7 @@ var analyticsContextAttributes = {
240
240
  };
241
241
  var analyticsContextData = {
242
242
  packageName: "@atlaskit/link-datasource",
243
- packageVersion: "1.10.1",
243
+ packageVersion: "1.10.3",
244
244
  source: 'datasourceConfigModal'
245
245
  };
246
246
  var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
@@ -49,8 +49,13 @@ var LinkRenderType = function LinkRenderType(_ref) {
49
49
  }, text || url));
50
50
  }, [linkStyle, url, text, testId]);
51
51
  var SmartCard = function SmartCard() {
52
+ var handleClick = function handleClick(e) {
53
+ e.preventDefault();
54
+ window.open(url, '_blank', 'noopener, noreferrer');
55
+ };
52
56
  return /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
53
57
  appearance: "inline",
58
+ onClick: handleClick,
54
59
  url: url,
55
60
  testId: testId,
56
61
  fallbackComponent: function fallbackComponent() {
@@ -1,5 +1,5 @@
1
1
  export const EVENT_CHANNEL = 'media';
2
2
  export const packageMetaData = {
3
3
  packageName: "@atlaskit/link-datasource",
4
- packageVersion: "1.10.1"
4
+ packageVersion: "1.10.3"
5
5
  };
@@ -200,7 +200,7 @@ const analyticsContextAttributes = {
200
200
  };
201
201
  const analyticsContextData = {
202
202
  packageName: "@atlaskit/link-datasource",
203
- packageVersion: "1.10.1",
203
+ packageVersion: "1.10.3",
204
204
  source: 'datasourceConfigModal'
205
205
  };
206
206
  const contextData = {
@@ -35,12 +35,19 @@ const LinkRenderType = ({
35
35
  "data-testid": testId,
36
36
  target: "_blank"
37
37
  }, text || url)), [linkStyle, url, text, testId]);
38
- const SmartCard = () => /*#__PURE__*/React.createElement(Card, {
39
- appearance: "inline",
40
- url: url,
41
- testId: testId,
42
- fallbackComponent: () => anchor
43
- });
38
+ const SmartCard = () => {
39
+ const handleClick = e => {
40
+ e.preventDefault();
41
+ window.open(url, '_blank', 'noopener, noreferrer');
42
+ };
43
+ return /*#__PURE__*/React.createElement(Card, {
44
+ appearance: "inline",
45
+ onClick: handleClick,
46
+ url: url,
47
+ testId: testId,
48
+ fallbackComponent: () => anchor
49
+ });
50
+ };
44
51
 
45
52
  // url can be undefined before data is fetched whilst adding new link column to display
46
53
  if (!url) {
@@ -1,5 +1,5 @@
1
1
  export var EVENT_CHANNEL = 'media';
2
2
  export var packageMetaData = {
3
3
  packageName: "@atlaskit/link-datasource",
4
- packageVersion: "1.10.1"
4
+ packageVersion: "1.10.3"
5
5
  };
@@ -231,7 +231,7 @@ var analyticsContextAttributes = {
231
231
  };
232
232
  var analyticsContextData = {
233
233
  packageName: "@atlaskit/link-datasource",
234
- packageVersion: "1.10.1",
234
+ packageVersion: "1.10.3",
235
235
  source: 'datasourceConfigModal'
236
236
  };
237
237
  var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
@@ -39,8 +39,13 @@ var LinkRenderType = function LinkRenderType(_ref) {
39
39
  }, text || url));
40
40
  }, [linkStyle, url, text, testId]);
41
41
  var SmartCard = function SmartCard() {
42
+ var handleClick = function handleClick(e) {
43
+ e.preventDefault();
44
+ window.open(url, '_blank', 'noopener, noreferrer');
45
+ };
42
46
  return /*#__PURE__*/React.createElement(Card, {
43
47
  appearance: "inline",
48
+ onClick: handleClick,
44
49
  url: url,
45
50
  testId: testId,
46
51
  fallbackComponent: function fallbackComponent() {
@@ -6,25 +6,41 @@ export interface onNextPageProps {
6
6
  }
7
7
  export type NextPageType = (requestInfo?: onNextPageProps) => void;
8
8
  interface ResetOptions {
9
+ /** Used to force a request to be made even if a cache already exists for it */
9
10
  shouldForceRequest?: boolean;
11
+ /** Resets current column data from a datasource table when issuing the new request */
10
12
  shouldResetColumns?: boolean;
11
13
  }
12
14
  export interface DatasourceTableState {
15
+ /** The current status of the table for rendering of the different UI states (e.g.: loading, error, etc). */
13
16
  status: DatasourceTableStatusType;
17
+ /** Requests the available data with pagination and also sets column headers if not already available */
14
18
  onNextPage: NextPageType;
19
+ /** Resets state of the hook to be as if it is a first time it is being called. */
15
20
  reset: (options?: ResetOptions) => void;
21
+ /** Requests the available column schemas that can be displayed within the table */
16
22
  loadDatasourceDetails: () => void;
23
+ /** Items to be rendered within the table */
17
24
  responseItems: DatasourceDataResponseItem[];
25
+ /** Indicates whether there is still more data that can be paginated */
18
26
  hasNextPage: boolean;
27
+ /** All available columns for a datasource table to display */
19
28
  columns: DatasourceResponseSchemaProperty[];
29
+ /** The keys belonging to all of the currently visible columns in a table */
20
30
  defaultVisibleColumnKeys: string[];
31
+ /** Total count of response items available for pagination in a query */
21
32
  totalCount?: number;
33
+ /** List of objects types that will be included in the reponse (e.g. 'issues' for Jira) */
22
34
  destinationObjectTypes: string[];
35
+ /** Used as an indicated of which provider type is being used - originates from ORS */
23
36
  extensionKey?: string;
24
37
  }
25
38
  export interface DatasourceTableStateProps {
39
+ /** Unique identifier for which type of datasource is being rendered and for making its requests */
26
40
  datasourceId: string;
41
+ /** Parameters for making the data requests necessary to render data within the table */
27
42
  parameters?: DatasourceParameters;
43
+ /** Keys for each of the columns to be shown in the table */
28
44
  fieldKeys?: string[];
29
45
  }
30
46
  export declare const useDatasourceTableState: ({ datasourceId, parameters, fieldKeys, }: DatasourceTableStateProps) => DatasourceTableState;
@@ -1,5 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  interface AccessRequiredProps {
3
+ /** The url to be displayed to the user when they are unauthorized to query */
3
4
  url?: string;
4
5
  }
5
6
  export declare const AccessRequired: ({ url }: AccessRequiredProps) => jsx.JSX.Element;
@@ -1,8 +1,17 @@
1
1
  export interface DatasourceTableViewProps {
2
+ /** Unique identifier for which type of datasource is being rendered and for making its requests */
2
3
  datasourceId: string;
4
+ /** Parameters for making the data requests necessary to render data within the table */
3
5
  parameters: object;
4
6
  fields?: string[];
7
+ /**
8
+ * Callback to be invoked whenever a user changes the visible columns in a datasource table
9
+ *
10
+ * @param visibleColumnKeys the array of keys for all of the selected columns
11
+ */
5
12
  onVisibleColumnKeysChange?: (visibleColumnKeys: string[]) => void;
13
+ /** The array of keys for all of the columns to be shown in the table */
6
14
  visibleColumnKeys?: string[];
15
+ /** Url for an existing datasource, initially used for displaying to a user unauthorized to query that site */
7
16
  url?: string;
8
17
  }
@@ -34,13 +34,21 @@ export interface JiraIssuesDatasourceAdf extends DatasourceAdf {
34
34
  };
35
35
  }
36
36
  export interface JiraIssuesConfigModalProps {
37
+ /** Unique identifier for which type of datasource is being rendered and for making its requests */
37
38
  datasourceId: string;
39
+ /** The keys for each of the visible columns to the shown in the rendered table */
38
40
  visibleColumnKeys?: string[];
39
41
  /** The url that was used to insert a Jira List of Links */
40
42
  url?: string;
43
+ /** Parameters for making the data requests necessary to render data within the table */
41
44
  parameters?: JiraIssueDatasourceParameters;
45
+ /** Callback function to be invoked when the modal is closed either via cancel button click, esc keydown, or modal blanket click */
42
46
  onCancel: () => void;
47
+ /** Callback function to be invoked when the insert issues button is clicked */
43
48
  onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
49
+ /** The view mode that the modal will show on open:
50
+ * - issues = list of links table
51
+ * - count = smart link showing query results count */
44
52
  viewMode?: JiraIssueViewModes;
45
53
  }
46
54
  export {};
@@ -6,25 +6,41 @@ export interface onNextPageProps {
6
6
  }
7
7
  export type NextPageType = (requestInfo?: onNextPageProps) => void;
8
8
  interface ResetOptions {
9
+ /** Used to force a request to be made even if a cache already exists for it */
9
10
  shouldForceRequest?: boolean;
11
+ /** Resets current column data from a datasource table when issuing the new request */
10
12
  shouldResetColumns?: boolean;
11
13
  }
12
14
  export interface DatasourceTableState {
15
+ /** The current status of the table for rendering of the different UI states (e.g.: loading, error, etc). */
13
16
  status: DatasourceTableStatusType;
17
+ /** Requests the available data with pagination and also sets column headers if not already available */
14
18
  onNextPage: NextPageType;
19
+ /** Resets state of the hook to be as if it is a first time it is being called. */
15
20
  reset: (options?: ResetOptions) => void;
21
+ /** Requests the available column schemas that can be displayed within the table */
16
22
  loadDatasourceDetails: () => void;
23
+ /** Items to be rendered within the table */
17
24
  responseItems: DatasourceDataResponseItem[];
25
+ /** Indicates whether there is still more data that can be paginated */
18
26
  hasNextPage: boolean;
27
+ /** All available columns for a datasource table to display */
19
28
  columns: DatasourceResponseSchemaProperty[];
29
+ /** The keys belonging to all of the currently visible columns in a table */
20
30
  defaultVisibleColumnKeys: string[];
31
+ /** Total count of response items available for pagination in a query */
21
32
  totalCount?: number;
33
+ /** List of objects types that will be included in the reponse (e.g. 'issues' for Jira) */
22
34
  destinationObjectTypes: string[];
35
+ /** Used as an indicated of which provider type is being used - originates from ORS */
23
36
  extensionKey?: string;
24
37
  }
25
38
  export interface DatasourceTableStateProps {
39
+ /** Unique identifier for which type of datasource is being rendered and for making its requests */
26
40
  datasourceId: string;
41
+ /** Parameters for making the data requests necessary to render data within the table */
27
42
  parameters?: DatasourceParameters;
43
+ /** Keys for each of the columns to be shown in the table */
28
44
  fieldKeys?: string[];
29
45
  }
30
46
  export declare const useDatasourceTableState: ({ datasourceId, parameters, fieldKeys, }: DatasourceTableStateProps) => DatasourceTableState;
@@ -1,5 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  interface AccessRequiredProps {
3
+ /** The url to be displayed to the user when they are unauthorized to query */
3
4
  url?: string;
4
5
  }
5
6
  export declare const AccessRequired: ({ url }: AccessRequiredProps) => jsx.JSX.Element;
@@ -1,8 +1,17 @@
1
1
  export interface DatasourceTableViewProps {
2
+ /** Unique identifier for which type of datasource is being rendered and for making its requests */
2
3
  datasourceId: string;
4
+ /** Parameters for making the data requests necessary to render data within the table */
3
5
  parameters: object;
4
6
  fields?: string[];
7
+ /**
8
+ * Callback to be invoked whenever a user changes the visible columns in a datasource table
9
+ *
10
+ * @param visibleColumnKeys the array of keys for all of the selected columns
11
+ */
5
12
  onVisibleColumnKeysChange?: (visibleColumnKeys: string[]) => void;
13
+ /** The array of keys for all of the columns to be shown in the table */
6
14
  visibleColumnKeys?: string[];
15
+ /** Url for an existing datasource, initially used for displaying to a user unauthorized to query that site */
7
16
  url?: string;
8
17
  }
@@ -34,13 +34,21 @@ export interface JiraIssuesDatasourceAdf extends DatasourceAdf {
34
34
  };
35
35
  }
36
36
  export interface JiraIssuesConfigModalProps {
37
+ /** Unique identifier for which type of datasource is being rendered and for making its requests */
37
38
  datasourceId: string;
39
+ /** The keys for each of the visible columns to the shown in the rendered table */
38
40
  visibleColumnKeys?: string[];
39
41
  /** The url that was used to insert a Jira List of Links */
40
42
  url?: string;
43
+ /** Parameters for making the data requests necessary to render data within the table */
41
44
  parameters?: JiraIssueDatasourceParameters;
45
+ /** Callback function to be invoked when the modal is closed either via cancel button click, esc keydown, or modal blanket click */
42
46
  onCancel: () => void;
47
+ /** Callback function to be invoked when the insert issues button is clicked */
43
48
  onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
49
+ /** The view mode that the modal will show on open:
50
+ * - issues = list of links table
51
+ * - count = smart link showing query results count */
44
52
  viewMode?: JiraIssueViewModes;
45
53
  }
46
54
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "1.10.1",
3
+ "version": "1.10.3",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -33,7 +33,7 @@
33
33
  "@atlaskit/adf-schema": "^32.0.0",
34
34
  "@atlaskit/analytics-next": "^9.1.3",
35
35
  "@atlaskit/avatar": "^21.4.0",
36
- "@atlaskit/button": "^16.11.0",
36
+ "@atlaskit/button": "^16.12.0",
37
37
  "@atlaskit/editor-prosemirror": "1.1.0",
38
38
  "@atlaskit/empty-state": "^7.5.0",
39
39
  "@atlaskit/form": "^8.11.0",
@@ -44,19 +44,19 @@
44
44
  "@atlaskit/intl-messages-provider": "^1.0.0",
45
45
  "@atlaskit/jql-ast": "^3.0.0",
46
46
  "@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
47
- "@atlaskit/link-client-extension": "^1.7.0",
48
- "@atlaskit/linking-common": "^4.12.0",
47
+ "@atlaskit/link-client-extension": "^1.8.0",
48
+ "@atlaskit/linking-common": "^4.13.0",
49
49
  "@atlaskit/linking-types": "^8.4.0",
50
50
  "@atlaskit/lozenge": "^11.4.0",
51
51
  "@atlaskit/modal-dialog": "^12.8.0",
52
52
  "@atlaskit/platform-feature-flags": "^0.2.4",
53
- "@atlaskit/pragmatic-drag-and-drop": "^0.23.0",
53
+ "@atlaskit/pragmatic-drag-and-drop": "^0.24.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.11.0",
55
55
  "@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^0.6.0",
56
56
  "@atlaskit/pragmatic-drag-and-drop-react-indicator": "^0.16.0",
57
- "@atlaskit/primitives": "^1.6.7",
57
+ "@atlaskit/primitives": "^1.8.0",
58
58
  "@atlaskit/select": "^16.7.0",
59
- "@atlaskit/smart-card": "^26.37.0",
59
+ "@atlaskit/smart-card": "^26.41.0",
60
60
  "@atlaskit/spinner": "^15.6.0",
61
61
  "@atlaskit/tag": "^11.6.0",
62
62
  "@atlaskit/textfield": "5.6.8",
package/report.api.md CHANGED
@@ -84,17 +84,12 @@ export const DatasourceTableView: (
84
84
 
85
85
  // @public (undocumented)
86
86
  interface DatasourceTableViewProps {
87
- // (undocumented)
88
87
  datasourceId: string;
89
88
  // (undocumented)
90
89
  fields?: string[];
91
- // (undocumented)
92
90
  onVisibleColumnKeysChange?: (visibleColumnKeys: string[]) => void;
93
- // (undocumented)
94
91
  parameters: object;
95
- // (undocumented)
96
92
  url?: string;
97
- // (undocumented)
98
93
  visibleColumnKeys?: string[];
99
94
  }
100
95
 
@@ -124,21 +119,15 @@ export const JiraIssuesConfigModal: (
124
119
 
125
120
  // @public (undocumented)
126
121
  interface JiraIssuesConfigModalProps {
127
- // (undocumented)
128
122
  datasourceId: string;
129
- // (undocumented)
130
123
  onCancel: () => void;
131
- // (undocumented)
132
124
  onInsert: (
133
125
  adf: InlineCardAdf | JiraIssuesDatasourceAdf,
134
126
  analyticsEvent?: UIAnalyticsEvent,
135
127
  ) => void;
136
- // (undocumented)
137
128
  parameters?: JiraIssueDatasourceParameters;
138
129
  url?: string;
139
- // (undocumented)
140
130
  viewMode?: JiraIssueViewModes;
141
- // (undocumented)
142
131
  visibleColumnKeys?: string[];
143
132
  }
144
133
 
@@ -68,17 +68,12 @@ export const DatasourceTableView: (props: DatasourceTableViewProps) => JSX.Eleme
68
68
 
69
69
  // @public (undocumented)
70
70
  interface DatasourceTableViewProps {
71
- // (undocumented)
72
71
  datasourceId: string;
73
72
  // (undocumented)
74
73
  fields?: string[];
75
- // (undocumented)
76
74
  onVisibleColumnKeysChange?: (visibleColumnKeys: string[]) => void;
77
- // (undocumented)
78
75
  parameters: object;
79
- // (undocumented)
80
76
  url?: string;
81
- // (undocumented)
82
77
  visibleColumnKeys?: string[];
83
78
  }
84
79
 
@@ -102,18 +97,12 @@ export const JiraIssuesConfigModal: (props: JiraIssuesConfigModalProps) => JSX.E
102
97
 
103
98
  // @public (undocumented)
104
99
  interface JiraIssuesConfigModalProps {
105
- // (undocumented)
106
100
  datasourceId: string;
107
- // (undocumented)
108
101
  onCancel: () => void;
109
- // (undocumented)
110
102
  onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
111
- // (undocumented)
112
103
  parameters?: JiraIssueDatasourceParameters;
113
104
  url?: string;
114
- // (undocumented)
115
105
  viewMode?: JiraIssueViewModes;
116
- // (undocumented)
117
106
  visibleColumnKeys?: string[];
118
107
  }
119
108