@atlaskit/link-datasource 1.10.0 → 1.10.2

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.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.10.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#42063](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42063) [`74fd796c7c7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/74fd796c7c7) - Internationalisation for Assets LOL
14
+
3
15
  ## 1.10.0
4
16
 
5
17
  ### Minor 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.0"
10
+ packageVersion: "1.10.2"
11
11
  };
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.fetchMessagesForLocale = void 0;
9
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
+ var _en = _interopRequireDefault(require("../../../i18n/en"));
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ var fetchMessagesForLocale = exports.fetchMessagesForLocale = /*#__PURE__*/function () {
15
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(locale) {
16
+ var _messages, parentLocale, _messages2;
17
+ return _regenerator.default.wrap(function _callee$(_context) {
18
+ while (1) switch (_context.prev = _context.next) {
19
+ case 0:
20
+ _context.prev = 0;
21
+ _context.next = 3;
22
+ return function (specifier) {
23
+ return new Promise(function (r) {
24
+ return r(specifier);
25
+ }).then(function (s) {
26
+ return _interopRequireWildcard(require(s));
27
+ });
28
+ }( /* webpackChunkName: "@atlaskit-internal_@atlassian/link-datasource-i18n-[request]" */"../../../i18n/".concat(locale.replace('-', '_')));
29
+ case 3:
30
+ _messages = _context.sent;
31
+ return _context.abrupt("return", _messages.default);
32
+ case 7:
33
+ _context.prev = 7;
34
+ _context.t0 = _context["catch"](0);
35
+ case 9:
36
+ _context.prev = 9;
37
+ parentLocale = locale.split(/[-_]/)[0];
38
+ _context.next = 13;
39
+ return function (specifier) {
40
+ return new Promise(function (r) {
41
+ return r(specifier);
42
+ }).then(function (s) {
43
+ return _interopRequireWildcard(require(s));
44
+ });
45
+ }( /* webpackChunkName: "@atlaskit-internal_@atlassian/link-datasource-i18n-[request]" */"../../../i18n/".concat(parentLocale));
46
+ case 13:
47
+ _messages2 = _context.sent;
48
+ return _context.abrupt("return", _messages2.default);
49
+ case 17:
50
+ _context.prev = 17;
51
+ _context.t1 = _context["catch"](9);
52
+ case 19:
53
+ return _context.abrupt("return", _en.default);
54
+ case 20:
55
+ case "end":
56
+ return _context.stop();
57
+ }
58
+ }, _callee, null, [[0, 7], [9, 17]]);
59
+ }));
60
+ return function fetchMessagesForLocale(_x) {
61
+ return _ref.apply(this, arguments);
62
+ };
63
+ }();
@@ -16,10 +16,13 @@ var _react2 = require("@emotion/react");
16
16
  var _reactIntlNext = require("react-intl-next");
17
17
  var _analyticsNext = require("@atlaskit/analytics-next");
18
18
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
19
+ var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
19
20
  var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
20
21
  var _analytics = require("../../../analytics");
22
+ var _fetchMessagesForLocale = require("../../../common/utils/locale/fetch-messages-for-locale");
21
23
  var _useAssetsClient2 = require("../../../hooks/useAssetsClient");
22
24
  var _useDatasourceTableState = require("../../../hooks/useDatasourceTableState");
25
+ var _en = _interopRequireDefault(require("../../../i18n/en"));
23
26
  var _modalLoadingError = require("../../common/error-state/modal-loading-error");
24
27
  var _searchContainer = require("../search-container");
25
28
  var _loadingState = require("../search-container/loading-state");
@@ -193,7 +196,10 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
193
196
  });
194
197
  }
195
198
  }, [aql, assetsClientLoading, handleOnSearch, objectSchema, status, workspaceError, workspaceId]);
196
- return (0, _react2.jsx)(_modalDialog.ModalTransition, null, (0, _react2.jsx)(_modalDialog.default, {
199
+ return (0, _react2.jsx)(_intlMessagesProvider.IntlMessagesProvider, {
200
+ defaultMessages: _en.default,
201
+ loaderFn: _fetchMessagesForLocale.fetchMessagesForLocale
202
+ }, (0, _react2.jsx)(_modalDialog.ModalTransition, null, (0, _react2.jsx)(_modalDialog.default, {
197
203
  testId: 'asset-datasource-modal',
198
204
  onClose: onCancel,
199
205
  width: "calc(100% - 80px)",
@@ -227,14 +233,14 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
227
233
  values: {
228
234
  objectsCount: responseItems.length
229
235
  }
230
- }))))));
236
+ })))))));
231
237
  };
232
238
  var analyticsContextAttributes = {
233
239
  dataProvider: 'jsm-assets'
234
240
  };
235
241
  var analyticsContextData = {
236
242
  packageName: "@atlaskit/link-datasource",
237
- packageVersion: "1.10.0",
243
+ packageVersion: "1.10.2",
238
244
  source: 'datasourceConfigModal'
239
245
  };
240
246
  var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
@@ -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.0"
4
+ packageVersion: "1.10.2"
5
5
  };
@@ -0,0 +1,21 @@
1
+ import messages from '../../../i18n/en';
2
+ export const fetchMessagesForLocale = async locale => {
3
+ try {
4
+ const messages = await import( /* webpackChunkName: "@atlaskit-internal_@atlassian/link-datasource-i18n-[request]" */`../../../i18n/${locale.replace('-', '_')}`);
5
+ return messages.default;
6
+ } catch (e) {
7
+ // ignore
8
+ }
9
+ try {
10
+ const parentLocale = locale.split(/[-_]/)[0];
11
+ const messages = await import( /* webpackChunkName: "@atlaskit-internal_@atlassian/link-datasource-i18n-[request]" */`../../../i18n/${parentLocale}`);
12
+ return messages.default;
13
+ } catch (e) {
14
+ // ignore
15
+ }
16
+
17
+ /**
18
+ * English bundled by default as this is the majority of users
19
+ */
20
+ return messages;
21
+ };
@@ -5,10 +5,13 @@ import { css, jsx } from '@emotion/react';
5
5
  import { FormattedMessage } from 'react-intl-next';
6
6
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
7
7
  import Button from '@atlaskit/button/standard-button';
8
+ import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
8
9
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
9
10
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
11
+ import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
10
12
  import { useAssetsClient } from '../../../hooks/useAssetsClient';
11
13
  import { useDatasourceTableState } from '../../../hooks/useDatasourceTableState';
14
+ import i18nEN from '../../../i18n/en';
12
15
  import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
13
16
  import { AssetsSearchContainer } from '../search-container';
14
17
  import { AssetsSearchContainerLoading } from '../search-container/loading-state';
@@ -153,7 +156,10 @@ const PlainAssetsConfigModal = props => {
153
156
  });
154
157
  }
155
158
  }, [aql, assetsClientLoading, handleOnSearch, objectSchema, status, workspaceError, workspaceId]);
156
- return jsx(ModalTransition, null, jsx(Modal, {
159
+ return jsx(IntlMessagesProvider, {
160
+ defaultMessages: i18nEN,
161
+ loaderFn: fetchMessagesForLocale
162
+ }, jsx(ModalTransition, null, jsx(Modal, {
157
163
  testId: 'asset-datasource-modal',
158
164
  onClose: onCancel,
159
165
  width: "calc(100% - 80px)",
@@ -187,14 +193,14 @@ const PlainAssetsConfigModal = props => {
187
193
  values: {
188
194
  objectsCount: responseItems.length
189
195
  }
190
- }))))));
196
+ })))))));
191
197
  };
192
198
  const analyticsContextAttributes = {
193
199
  dataProvider: 'jsm-assets'
194
200
  };
195
201
  const analyticsContextData = {
196
202
  packageName: "@atlaskit/link-datasource",
197
- packageVersion: "1.10.0",
203
+ packageVersion: "1.10.2",
198
204
  source: 'datasourceConfigModal'
199
205
  };
200
206
  const contextData = {
@@ -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.0"
4
+ packageVersion: "1.10.2"
5
5
  };
@@ -0,0 +1,41 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import messages from '../../../i18n/en';
4
+ export var fetchMessagesForLocale = /*#__PURE__*/function () {
5
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(locale) {
6
+ var _messages, parentLocale, _messages2;
7
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
8
+ while (1) switch (_context.prev = _context.next) {
9
+ case 0:
10
+ _context.prev = 0;
11
+ _context.next = 3;
12
+ return import( /* webpackChunkName: "@atlaskit-internal_@atlassian/link-datasource-i18n-[request]" */"../../../i18n/".concat(locale.replace('-', '_')));
13
+ case 3:
14
+ _messages = _context.sent;
15
+ return _context.abrupt("return", _messages.default);
16
+ case 7:
17
+ _context.prev = 7;
18
+ _context.t0 = _context["catch"](0);
19
+ case 9:
20
+ _context.prev = 9;
21
+ parentLocale = locale.split(/[-_]/)[0];
22
+ _context.next = 13;
23
+ return import( /* webpackChunkName: "@atlaskit-internal_@atlassian/link-datasource-i18n-[request]" */"../../../i18n/".concat(parentLocale));
24
+ case 13:
25
+ _messages2 = _context.sent;
26
+ return _context.abrupt("return", _messages2.default);
27
+ case 17:
28
+ _context.prev = 17;
29
+ _context.t1 = _context["catch"](9);
30
+ case 19:
31
+ return _context.abrupt("return", messages);
32
+ case 20:
33
+ case "end":
34
+ return _context.stop();
35
+ }
36
+ }, _callee, null, [[0, 7], [9, 17]]);
37
+ }));
38
+ return function fetchMessagesForLocale(_x) {
39
+ return _ref.apply(this, arguments);
40
+ };
41
+ }();
@@ -11,10 +11,13 @@ import { css, jsx } from '@emotion/react';
11
11
  import { FormattedMessage } from 'react-intl-next';
12
12
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
13
13
  import Button from '@atlaskit/button/standard-button';
14
+ import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
14
15
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
15
16
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
17
+ import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
16
18
  import { useAssetsClient } from '../../../hooks/useAssetsClient';
17
19
  import { useDatasourceTableState } from '../../../hooks/useDatasourceTableState';
20
+ import i18nEN from '../../../i18n/en';
18
21
  import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
19
22
  import { AssetsSearchContainer } from '../search-container';
20
23
  import { AssetsSearchContainerLoading } from '../search-container/loading-state';
@@ -184,7 +187,10 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
184
187
  });
185
188
  }
186
189
  }, [aql, assetsClientLoading, handleOnSearch, objectSchema, status, workspaceError, workspaceId]);
187
- return jsx(ModalTransition, null, jsx(Modal, {
190
+ return jsx(IntlMessagesProvider, {
191
+ defaultMessages: i18nEN,
192
+ loaderFn: fetchMessagesForLocale
193
+ }, jsx(ModalTransition, null, jsx(Modal, {
188
194
  testId: 'asset-datasource-modal',
189
195
  onClose: onCancel,
190
196
  width: "calc(100% - 80px)",
@@ -218,14 +224,14 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
218
224
  values: {
219
225
  objectsCount: responseItems.length
220
226
  }
221
- }))))));
227
+ })))))));
222
228
  };
223
229
  var analyticsContextAttributes = {
224
230
  dataProvider: 'jsm-assets'
225
231
  };
226
232
  var analyticsContextData = {
227
233
  packageName: "@atlaskit/link-datasource",
228
- packageVersion: "1.10.0",
234
+ packageVersion: "1.10.2",
229
235
  source: 'datasourceConfigModal'
230
236
  };
231
237
  var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
@@ -0,0 +1,2 @@
1
+ import { I18NMessages } from '@atlaskit/intl-messages-provider';
2
+ export declare const fetchMessagesForLocale: (locale: string) => Promise<I18NMessages | undefined>;
@@ -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 {};
@@ -0,0 +1,2 @@
1
+ import { I18NMessages } from '@atlaskit/intl-messages-provider';
2
+ export declare const fetchMessagesForLocale: (locale: string) => Promise<I18NMessages | undefined>;
@@ -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.0",
3
+ "version": "1.10.2",
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",
@@ -41,21 +41,22 @@
41
41
  "@atlaskit/icon": "^21.12.0",
42
42
  "@atlaskit/icon-object": "^6.3.0",
43
43
  "@atlaskit/image": "^1.1.0",
44
+ "@atlaskit/intl-messages-provider": "^1.0.0",
44
45
  "@atlaskit/jql-ast": "^3.0.0",
45
46
  "@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
46
- "@atlaskit/link-client-extension": "^1.7.0",
47
+ "@atlaskit/link-client-extension": "^1.8.0",
47
48
  "@atlaskit/linking-common": "^4.12.0",
48
49
  "@atlaskit/linking-types": "^8.4.0",
49
50
  "@atlaskit/lozenge": "^11.4.0",
50
51
  "@atlaskit/modal-dialog": "^12.8.0",
51
52
  "@atlaskit/platform-feature-flags": "^0.2.4",
52
- "@atlaskit/pragmatic-drag-and-drop": "^0.23.0",
53
+ "@atlaskit/pragmatic-drag-and-drop": "^0.24.0",
53
54
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.11.0",
54
55
  "@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^0.6.0",
55
56
  "@atlaskit/pragmatic-drag-and-drop-react-indicator": "^0.16.0",
56
- "@atlaskit/primitives": "^1.6.7",
57
+ "@atlaskit/primitives": "^1.8.0",
57
58
  "@atlaskit/select": "^16.7.0",
58
- "@atlaskit/smart-card": "^26.37.0",
59
+ "@atlaskit/smart-card": "^26.40.0",
59
60
  "@atlaskit/spinner": "^15.6.0",
60
61
  "@atlaskit/tag": "^11.6.0",
61
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