@atlaskit/link-datasource 2.1.1 → 2.1.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/ui/assets-modal/modal/index.js +4 -11
  3. package/dist/cjs/ui/common/modal/datasource-modal/index.js +34 -0
  4. package/dist/cjs/ui/confluence-search-modal/modal/index.js +4 -11
  5. package/dist/cjs/ui/issue-like-table/index.js +2 -1
  6. package/dist/cjs/ui/issue-like-table/render-type/richtext/index.js +15 -1
  7. package/dist/cjs/ui/jira-issues-modal/modal/index.js +4 -11
  8. package/dist/es2019/ui/assets-modal/modal/index.js +4 -8
  9. package/dist/es2019/ui/common/modal/datasource-modal/index.js +26 -0
  10. package/dist/es2019/ui/confluence-search-modal/modal/index.js +4 -8
  11. package/dist/es2019/ui/issue-like-table/index.js +2 -1
  12. package/dist/es2019/ui/issue-like-table/render-type/richtext/index.js +20 -5
  13. package/dist/es2019/ui/jira-issues-modal/modal/index.js +4 -8
  14. package/dist/esm/ui/assets-modal/modal/index.js +4 -8
  15. package/dist/esm/ui/common/modal/datasource-modal/index.js +24 -0
  16. package/dist/esm/ui/confluence-search-modal/modal/index.js +4 -8
  17. package/dist/esm/ui/issue-like-table/index.js +2 -1
  18. package/dist/esm/ui/issue-like-table/render-type/richtext/index.js +16 -2
  19. package/dist/esm/ui/jira-issues-modal/modal/index.js +4 -8
  20. package/dist/types/ui/common/modal/datasource-modal/index.d.ts +5 -0
  21. package/dist/types/ui/issue-like-table/render-type/index.d.ts +3 -3
  22. package/dist/types/ui/issue-like-table/render-type/number/index.d.ts +1 -1
  23. package/dist/types/ui/issue-like-table/render-type/richtext/index.d.ts +1 -1
  24. package/dist/types-ts4.5/ui/common/modal/datasource-modal/index.d.ts +5 -0
  25. package/dist/types-ts4.5/ui/issue-like-table/render-type/index.d.ts +3 -3
  26. package/dist/types-ts4.5/ui/issue-like-table/render-type/number/index.d.ts +1 -1
  27. package/dist/types-ts4.5/ui/issue-like-table/render-type/richtext/index.d.ts +1 -1
  28. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 2.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#98501](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98501)
8
+ [`9122f89de81a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9122f89de81a) -
9
+ Updated rich text rendering to support rendering smart links as plain text.
10
+ - [#98943](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98943)
11
+ [`2df6f335bb3c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2df6f335bb3c) -
12
+ Fixes issue where falsy values such as number 0 are not rendering in datasources
13
+ - [#98062](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98062)
14
+ [`4e13438bdfc0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4e13438bdfc0) -
15
+ Minor refactor to datasource modal analytics. No expected functional changes.
16
+ - Updated dependencies
17
+
18
+ ## 2.1.2
19
+
20
+ ### Patch Changes
21
+
22
+ - [#97599](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97599)
23
+ [`32c3130b08fe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32c3130b08fe) -
24
+ [ED-22282] Bump adf-schema to 36.1.0
25
+
3
26
  ## 2.1.1
4
27
 
5
28
  ### Patch Changes
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -16,7 +15,7 @@ var _uuid = require("uuid");
16
15
  var _analyticsNext = require("@atlaskit/analytics-next");
17
16
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
18
17
  var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
19
- var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
18
+ var _modalDialog = require("@atlaskit/modal-dialog");
20
19
  var _analytics = require("../../../analytics");
21
20
  var _constants = require("../../../analytics/constants");
22
21
  var _types = require("../../../analytics/types");
@@ -32,12 +31,11 @@ var _cmdbService = require("../../../services/cmdbService.utils");
32
31
  var _accessRequired = require("../../../ui/common/error-state/access-required");
33
32
  var _modalLoadingError = require("../../common/error-state/modal-loading-error");
34
33
  var _cancelButton = require("../../common/modal/cancel-button");
34
+ var _datasourceModal = require("../../common/modal/datasource-modal");
35
35
  var _searchContainer = require("../search-container");
36
36
  var _loadingState = require("../search-container/loading-state");
37
37
  var _messages = require("./messages");
38
38
  var _renderAssetsContent = require("./render-assets-content");
39
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
40
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
41
39
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
42
40
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
43
41
  var modalBodyErrorWrapperStyles = (0, _react2.css)({
@@ -161,9 +159,6 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
161
159
  });
162
160
  }
163
161
  }, [fireEvent, totalObjectSchemas]);
164
- (0, _react.useEffect)(function () {
165
- fireEvent('screen.datasourceModalDialog.viewed', {});
166
- }, [fireEvent]);
167
162
  var fireTableViewedEvent = (0, _react.useCallback)(function () {
168
163
  if (isDataReady) {
169
164
  fireEvent('ui.table.viewed.datasourceConfigModal', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
@@ -335,11 +330,9 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
335
330
  return (0, _react2.jsx)(_intlMessagesProvider.IntlMessagesProvider, {
336
331
  defaultMessages: _en.default,
337
332
  loaderFn: _fetchMessagesForLocale.fetchMessagesForLocale
338
- }, (0, _react2.jsx)(_modalDialog.ModalTransition, null, (0, _react2.jsx)(_modalDialog.default, {
339
- testId: 'asset-datasource-modal',
333
+ }, (0, _react2.jsx)(_modalDialog.ModalTransition, null, (0, _react2.jsx)(_datasourceModal.DatasourceModal, {
334
+ testId: "asset-datasource-modal",
340
335
  onClose: onCancel,
341
- width: "calc(100% - 80px)",
342
- shouldScrollInViewport: true,
343
336
  shouldCloseOnOverlayClick: false
344
337
  }, (0, _react2.jsx)(_modalDialog.ModalHeader, null, renderModalTitleContent()), (0, _react2.jsx)(_modalDialog.ModalBody, null, errorState ? (0, _react2.jsx)("div", {
345
338
  css: modalBodyErrorWrapperStyles
@@ -0,0 +1,34 @@
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.DatasourceModal = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _modalDialog = _interopRequireDefault(require("@atlaskit/modal-dialog"));
11
+ var _analytics = require("../../../../analytics");
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ var ScreenEvent = function ScreenEvent() {
15
+ var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
16
+ fireEvent = _useDatasourceAnalyti.fireEvent;
17
+ (0, _react.useEffect)(function () {
18
+ fireEvent('screen.datasourceModalDialog.viewed', {});
19
+ }, [fireEvent]);
20
+ return null;
21
+ };
22
+ var DatasourceModal = exports.DatasourceModal = function DatasourceModal(_ref) {
23
+ var testId = _ref.testId,
24
+ onClose = _ref.onClose,
25
+ shouldCloseOnOverlayClick = _ref.shouldCloseOnOverlayClick,
26
+ children = _ref.children;
27
+ return /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
28
+ testId: testId,
29
+ onClose: onClose,
30
+ width: "calc(100% - 80px)",
31
+ shouldScrollInViewport: true,
32
+ shouldCloseOnOverlayClick: shouldCloseOnOverlayClick
33
+ }, /*#__PURE__*/_react.default.createElement(ScreenEvent, null), children);
34
+ };
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -16,7 +15,7 @@ var _uuid = require("uuid");
16
15
  var _analyticsNext = require("@atlaskit/analytics-next");
17
16
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
18
17
  var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
19
- var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
18
+ var _modalDialog = require("@atlaskit/modal-dialog");
20
19
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
20
  var _primitives = require("@atlaskit/primitives");
22
21
  var _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
@@ -37,6 +36,7 @@ var _initialStateView = require("../../common/initial-state-view");
37
36
  var _cancelButton = require("../../common/modal/cancel-button");
38
37
  var _contentContainer = require("../../common/modal/content-container");
39
38
  var _countViewSmartLink = require("../../common/modal/count-view-smart-link");
39
+ var _datasourceModal = require("../../common/modal/datasource-modal");
40
40
  var _displayViewDropDown = require("../../common/modal/display-view-dropdown/display-view-drop-down");
41
41
  var _siteSelector = require("../../common/modal/site-selector");
42
42
  var _issueLikeTable = require("../../issue-like-table");
@@ -46,8 +46,6 @@ var _utils = require("../../issue-like-table/utils");
46
46
  var _confluenceSearchContainer = _interopRequireDefault(require("../confluence-search-container"));
47
47
  var _confluenceSearchInitialStateSvg = require("./confluence-search-initial-state-svg");
48
48
  var _messages = require("./messages");
49
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
50
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
51
49
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
52
50
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
53
51
  var inputContainerStyles = (0, _primitives.xcss)({
@@ -160,9 +158,6 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
160
158
  });
161
159
  }
162
160
  }, [fireEvent, availableSites]);
163
- (0, _react.useEffect)(function () {
164
- fireEvent('screen.datasourceModalDialog.viewed', {});
165
- }, [fireEvent]);
166
161
 
167
162
  // TODO: further refactoring in EDM-9573
168
163
  // https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6828283
@@ -427,11 +422,9 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
427
422
  return (0, _react2.jsx)(_intlMessagesProvider.IntlMessagesProvider, {
428
423
  defaultMessages: _en.default,
429
424
  loaderFn: _fetchMessagesForLocale.fetchMessagesForLocale
430
- }, (0, _react2.jsx)(_modalDialog.default, {
425
+ }, (0, _react2.jsx)(_datasourceModal.DatasourceModal, {
431
426
  testId: "confluence-search-datasource-modal",
432
- onClose: onCancel,
433
- width: "calc(100% - 80px)",
434
- shouldScrollInViewport: true
427
+ onClose: onCancel
435
428
  }, (0, _react2.jsx)(_modalDialog.ModalHeader, null, (0, _react2.jsx)(_modalDialog.ModalTitle, null, (0, _react2.jsx)(_siteSelector.SiteSelector, {
436
429
  availableSites: availableSites,
437
430
  onSiteSelection: onSiteSelection,
@@ -447,7 +447,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
447
447
  var _newRowData$key;
448
448
  var key = _ref11.key,
449
449
  type = _ref11.type;
450
- var value = ((_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data) || newRowData[key];
450
+ // Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
451
+ var value = (_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data;
451
452
  var values = Array.isArray(value) ? value : [value];
452
453
  var renderedValues = renderItem({
453
454
  type: type,
@@ -17,11 +17,25 @@ var rootStyles = (0, _react2.css)({
17
17
  position: 'relative',
18
18
  display: 'block'
19
19
  });
20
+ var smartLinkNodeToUrl = function smartLinkNodeToUrl(node) {
21
+ var _node$attrs$url;
22
+ return (_node$attrs$url = node.attrs.url) !== null && _node$attrs$url !== void 0 ? _node$attrs$url : '';
23
+ };
24
+ var schemaSmartLinkOverride = new _model.Schema({
25
+ nodes: _schemaDefault.defaultSchema.spec.nodes.update('inlineCard', _objectSpread(_objectSpread({}, _schemaDefault.defaultSchema.spec.nodes.get('inlineCard')), {}, {
26
+ leafText: smartLinkNodeToUrl
27
+ })).update('blockCard', _objectSpread(_objectSpread({}, _schemaDefault.defaultSchema.spec.nodes.get('blockCard')), {}, {
28
+ leafText: smartLinkNodeToUrl
29
+ })).update('embedCard', _objectSpread(_objectSpread({}, _schemaDefault.defaultSchema.spec.nodes.get('embedCard')), {}, {
30
+ leafText: smartLinkNodeToUrl
31
+ })),
32
+ marks: _schemaDefault.defaultSchema.spec.marks
33
+ });
20
34
  var parseRichText = exports.parseRichText = function parseRichText(value) {
21
35
  try {
22
36
  if (value.type === 'adf') {
23
37
  var adf = JSON.parse(value.text);
24
- return _model.Node.fromJSON(_schemaDefault.defaultSchema, _objectSpread(_objectSpread({}, adf), {}, {
38
+ return _model.Node.fromJSON(schemaSmartLinkOverride, _objectSpread(_objectSpread({}, adf), {}, {
25
39
  content: (0, _toConsumableArray2.default)(adf.content.slice(0, 2))
26
40
  })).textContent;
27
41
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -16,7 +15,7 @@ var _uuid = require("uuid");
16
15
  var _analyticsNext = require("@atlaskit/analytics-next");
17
16
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
18
17
  var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
19
- var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
18
+ var _modalDialog = require("@atlaskit/modal-dialog");
20
19
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
20
  var _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
22
21
  var _colors = require("@atlaskit/theme/colors");
@@ -42,6 +41,7 @@ var _messages2 = require("../../common/initial-state-view/messages");
42
41
  var _cancelButton = require("../../common/modal/cancel-button");
43
42
  var _contentContainer = require("../../common/modal/content-container");
44
43
  var _countViewSmartLink = require("../../common/modal/count-view-smart-link");
44
+ var _datasourceModal = require("../../common/modal/datasource-modal");
45
45
  var _displayViewDropDown = require("../../common/modal/display-view-dropdown/display-view-drop-down");
46
46
  var _siteSelector = require("../../common/modal/site-selector");
47
47
  var _issueLikeTable = require("../../issue-like-table");
@@ -53,8 +53,6 @@ var _isQueryTooComplex = require("../basic-filters/utils/isQueryTooComplex");
53
53
  var _jiraSearchContainer = require("../jira-search-container");
54
54
  var _jiraIssuesInitialStateSvg = require("./jira-issues-initial-state-svg");
55
55
  var _messages3 = require("./messages");
56
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
57
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
58
56
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
59
57
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
60
58
  var issueCountStyles = (0, _react2.css)({
@@ -184,9 +182,6 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
184
182
  canBeLink: currentViewMode === 'inline',
185
183
  extensionKey: extensionKey
186
184
  });
187
- (0, _react.useEffect)(function () {
188
- fireEvent('screen.datasourceModalDialog.viewed', {});
189
- }, [fireEvent]);
190
185
  (0, _react.useEffect)(function () {
191
186
  var newVisibleColumnKeys = !initialVisibleColumnKeys || (initialVisibleColumnKeys || []).length === 0 ? defaultVisibleColumnKeys : initialVisibleColumnKeys;
192
187
  visibleColumnCount.current = newVisibleColumnKeys.length;
@@ -462,11 +457,9 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
462
457
  return (0, _react2.jsx)(_intlMessagesProvider.IntlMessagesProvider, {
463
458
  defaultMessages: _en.default,
464
459
  loaderFn: _fetchMessagesForLocale.fetchMessagesForLocale
465
- }, (0, _react2.jsx)(_modalDialog.ModalTransition, null, (0, _react2.jsx)(_modalDialog.default, {
460
+ }, (0, _react2.jsx)(_modalDialog.ModalTransition, null, (0, _react2.jsx)(_datasourceModal.DatasourceModal, {
466
461
  testId: "jira-datasource-modal",
467
- onClose: onCancel,
468
- width: "calc(100% - 80px)",
469
- shouldScrollInViewport: true
462
+ onClose: onCancel
470
463
  }, (0, _react2.jsx)(_modalDialog.ModalHeader, null, (0, _react2.jsx)(_modalDialog.ModalTitle, null, (0, _react2.jsx)(_siteSelector.SiteSelector, {
471
464
  availableSites: availableSites,
472
465
  onSiteSelection: onSiteSelection,
@@ -7,7 +7,7 @@ import { v4 as uuidv4 } from 'uuid';
7
7
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
8
8
  import Button from '@atlaskit/button/standard-button';
9
9
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
10
- import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
10
+ import { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
11
11
  import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
12
12
  import { componentMetadata } from '../../../analytics/constants';
13
13
  import { DatasourceAction, DatasourceDisplay, DatasourceSearchMethod } from '../../../analytics/types';
@@ -23,6 +23,7 @@ import { PermissionError } from '../../../services/cmdbService.utils';
23
23
  import { AccessRequired } from '../../../ui/common/error-state/access-required';
24
24
  import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
25
25
  import { CancelButton } from '../../common/modal/cancel-button';
26
+ import { DatasourceModal } from '../../common/modal/datasource-modal';
26
27
  import { AssetsSearchContainer } from '../search-container';
27
28
  import { AssetsSearchContainerLoading } from '../search-container/loading-state';
28
29
  import { modalMessages } from './messages';
@@ -136,9 +137,6 @@ const PlainAssetsConfigModal = props => {
136
137
  });
137
138
  }
138
139
  }, [fireEvent, totalObjectSchemas]);
139
- useEffect(() => {
140
- fireEvent('screen.datasourceModalDialog.viewed', {});
141
- }, [fireEvent]);
142
140
  const fireTableViewedEvent = useCallback(() => {
143
141
  if (isDataReady) {
144
142
  fireEvent('ui.table.viewed.datasourceConfigModal', {
@@ -310,11 +308,9 @@ const PlainAssetsConfigModal = props => {
310
308
  return jsx(IntlMessagesProvider, {
311
309
  defaultMessages: i18nEN,
312
310
  loaderFn: fetchMessagesForLocale
313
- }, jsx(ModalTransition, null, jsx(Modal, {
314
- testId: 'asset-datasource-modal',
311
+ }, jsx(ModalTransition, null, jsx(DatasourceModal, {
312
+ testId: "asset-datasource-modal",
315
313
  onClose: onCancel,
316
- width: "calc(100% - 80px)",
317
- shouldScrollInViewport: true,
318
314
  shouldCloseOnOverlayClick: false
319
315
  }, jsx(ModalHeader, null, renderModalTitleContent()), jsx(ModalBody, null, errorState ? jsx("div", {
320
316
  css: modalBodyErrorWrapperStyles
@@ -0,0 +1,26 @@
1
+ import React, { useEffect } from 'react';
2
+ import Modal from '@atlaskit/modal-dialog';
3
+ import { useDatasourceAnalyticsEvents } from '../../../../analytics';
4
+ const ScreenEvent = () => {
5
+ const {
6
+ fireEvent
7
+ } = useDatasourceAnalyticsEvents();
8
+ useEffect(() => {
9
+ fireEvent('screen.datasourceModalDialog.viewed', {});
10
+ }, [fireEvent]);
11
+ return null;
12
+ };
13
+ export const DatasourceModal = ({
14
+ testId,
15
+ onClose,
16
+ shouldCloseOnOverlayClick,
17
+ children
18
+ }) => {
19
+ return /*#__PURE__*/React.createElement(Modal, {
20
+ testId: testId,
21
+ onClose: onClose,
22
+ width: "calc(100% - 80px)",
23
+ shouldScrollInViewport: true,
24
+ shouldCloseOnOverlayClick: shouldCloseOnOverlayClick
25
+ }, /*#__PURE__*/React.createElement(ScreenEvent, null), children);
26
+ };
@@ -7,7 +7,7 @@ import { v4 as uuidv4 } from 'uuid';
7
7
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
8
8
  import Button from '@atlaskit/button/standard-button';
9
9
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
10
- import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
10
+ import { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
11
11
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
12
12
  import { Box, xcss } from '@atlaskit/primitives';
13
13
  import LinkUrl from '@atlaskit/smart-card/link-url';
@@ -28,6 +28,7 @@ import { InitialStateView } from '../../common/initial-state-view';
28
28
  import { CancelButton } from '../../common/modal/cancel-button';
29
29
  import { ContentContainer } from '../../common/modal/content-container';
30
30
  import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-smart-link';
31
+ import { DatasourceModal } from '../../common/modal/datasource-modal';
31
32
  import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
32
33
  import { SiteSelector } from '../../common/modal/site-selector';
33
34
  import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
@@ -130,9 +131,6 @@ export const PlainConfluenceSearchConfigModal = props => {
130
131
  });
131
132
  }
132
133
  }, [fireEvent, availableSites]);
133
- useEffect(() => {
134
- fireEvent('screen.datasourceModalDialog.viewed', {});
135
- }, [fireEvent]);
136
134
 
137
135
  // TODO: further refactoring in EDM-9573
138
136
  // https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6828283
@@ -398,11 +396,9 @@ export const PlainConfluenceSearchConfigModal = props => {
398
396
  return jsx(IntlMessagesProvider, {
399
397
  defaultMessages: i18nEN,
400
398
  loaderFn: fetchMessagesForLocale
401
- }, jsx(Modal, {
399
+ }, jsx(DatasourceModal, {
402
400
  testId: "confluence-search-datasource-modal",
403
- onClose: onCancel,
404
- width: "calc(100% - 80px)",
405
- shouldScrollInViewport: true
401
+ onClose: onCancel
406
402
  }, jsx(ModalHeader, null, jsx(ModalTitle, null, jsx(SiteSelector, {
407
403
  availableSites: availableSites,
408
404
  onSiteSelection: onSiteSelection,
@@ -452,7 +452,8 @@ export const IssueLikeDataTableView = ({
452
452
  type
453
453
  }) => {
454
454
  var _newRowData$key;
455
- const value = ((_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data) || newRowData[key];
455
+ // Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
456
+ const value = (_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data;
456
457
  const values = Array.isArray(value) ? value : [value];
457
458
  const renderedValues = renderItem({
458
459
  type,
@@ -2,16 +2,33 @@
2
2
  import { useMemo } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
5
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
+ import { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
6
6
  const rootStyles = css({
7
7
  position: 'relative',
8
8
  display: 'block'
9
9
  });
10
+ const smartLinkNodeToUrl = node => {
11
+ var _node$attrs$url;
12
+ return (_node$attrs$url = node.attrs.url) !== null && _node$attrs$url !== void 0 ? _node$attrs$url : '';
13
+ };
14
+ const schemaSmartLinkOverride = new Schema({
15
+ nodes: defaultSchema.spec.nodes.update('inlineCard', {
16
+ ...defaultSchema.spec.nodes.get('inlineCard'),
17
+ leafText: smartLinkNodeToUrl
18
+ }).update('blockCard', {
19
+ ...defaultSchema.spec.nodes.get('blockCard'),
20
+ leafText: smartLinkNodeToUrl
21
+ }).update('embedCard', {
22
+ ...defaultSchema.spec.nodes.get('embedCard'),
23
+ leafText: smartLinkNodeToUrl
24
+ }),
25
+ marks: defaultSchema.spec.marks
26
+ });
10
27
  export const parseRichText = value => {
11
28
  try {
12
29
  if (value.type === 'adf') {
13
30
  const adf = JSON.parse(value.text);
14
- return PMNode.fromJSON(defaultSchema, {
31
+ return PMNode.fromJSON(schemaSmartLinkOverride, {
15
32
  ...adf,
16
33
  content: [...adf.content.slice(0, 2)]
17
34
  }).textContent;
@@ -26,9 +43,7 @@ export const parseRichText = value => {
26
43
  const RichTextType = ({
27
44
  value
28
45
  }) => {
29
- const adfPlainText = useMemo(() => {
30
- return parseRichText(value);
31
- }, [value]);
46
+ const adfPlainText = useMemo(() => parseRichText(value), [value]);
32
47
  if (adfPlainText) {
33
48
  return jsx("div", {
34
49
  css: rootStyles,
@@ -7,7 +7,7 @@ import { v4 as uuidv4 } from 'uuid';
7
7
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
8
8
  import Button from '@atlaskit/button/standard-button';
9
9
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
10
- import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
10
+ import { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
11
11
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
12
12
  import LinkUrl from '@atlaskit/smart-card/link-url';
13
13
  import { N800 } from '@atlaskit/theme/colors';
@@ -33,6 +33,7 @@ import { initialStateViewMessages } from '../../common/initial-state-view/messag
33
33
  import { CancelButton } from '../../common/modal/cancel-button';
34
34
  import { ContentContainer } from '../../common/modal/content-container';
35
35
  import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-smart-link';
36
+ import { DatasourceModal } from '../../common/modal/datasource-modal';
36
37
  import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
37
38
  import { SiteSelector } from '../../common/modal/site-selector';
38
39
  import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
@@ -155,9 +156,6 @@ export const PlainJiraIssuesConfigModal = props => {
155
156
  canBeLink: currentViewMode === 'inline',
156
157
  extensionKey
157
158
  });
158
- useEffect(() => {
159
- fireEvent('screen.datasourceModalDialog.viewed', {});
160
- }, [fireEvent]);
161
159
  useEffect(() => {
162
160
  const newVisibleColumnKeys = !initialVisibleColumnKeys || (initialVisibleColumnKeys || []).length === 0 ? defaultVisibleColumnKeys : initialVisibleColumnKeys;
163
161
  visibleColumnCount.current = newVisibleColumnKeys.length;
@@ -441,11 +439,9 @@ export const PlainJiraIssuesConfigModal = props => {
441
439
  return jsx(IntlMessagesProvider, {
442
440
  defaultMessages: i18nEN,
443
441
  loaderFn: fetchMessagesForLocale
444
- }, jsx(ModalTransition, null, jsx(Modal, {
442
+ }, jsx(ModalTransition, null, jsx(DatasourceModal, {
445
443
  testId: "jira-datasource-modal",
446
- onClose: onCancel,
447
- width: "calc(100% - 80px)",
448
- shouldScrollInViewport: true
444
+ onClose: onCancel
449
445
  }, jsx(ModalHeader, null, jsx(ModalTitle, null, jsx(SiteSelector, {
450
446
  availableSites: availableSites,
451
447
  onSiteSelection: onSiteSelection,
@@ -11,7 +11,7 @@ import { v4 as uuidv4 } from 'uuid';
11
11
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
12
12
  import Button from '@atlaskit/button/standard-button';
13
13
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
14
- import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
14
+ import { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
15
15
  import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
16
16
  import { componentMetadata } from '../../../analytics/constants';
17
17
  import { DatasourceAction, DatasourceDisplay, DatasourceSearchMethod } from '../../../analytics/types';
@@ -27,6 +27,7 @@ import { PermissionError } from '../../../services/cmdbService.utils';
27
27
  import { AccessRequired } from '../../../ui/common/error-state/access-required';
28
28
  import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
29
29
  import { CancelButton } from '../../common/modal/cancel-button';
30
+ import { DatasourceModal } from '../../common/modal/datasource-modal';
30
31
  import { AssetsSearchContainer } from '../search-container';
31
32
  import { AssetsSearchContainerLoading } from '../search-container/loading-state';
32
33
  import { modalMessages } from './messages';
@@ -152,9 +153,6 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
152
153
  });
153
154
  }
154
155
  }, [fireEvent, totalObjectSchemas]);
155
- useEffect(function () {
156
- fireEvent('screen.datasourceModalDialog.viewed', {});
157
- }, [fireEvent]);
158
156
  var fireTableViewedEvent = useCallback(function () {
159
157
  if (isDataReady) {
160
158
  fireEvent('ui.table.viewed.datasourceConfigModal', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
@@ -326,11 +324,9 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
326
324
  return jsx(IntlMessagesProvider, {
327
325
  defaultMessages: i18nEN,
328
326
  loaderFn: fetchMessagesForLocale
329
- }, jsx(ModalTransition, null, jsx(Modal, {
330
- testId: 'asset-datasource-modal',
327
+ }, jsx(ModalTransition, null, jsx(DatasourceModal, {
328
+ testId: "asset-datasource-modal",
331
329
  onClose: onCancel,
332
- width: "calc(100% - 80px)",
333
- shouldScrollInViewport: true,
334
330
  shouldCloseOnOverlayClick: false
335
331
  }, jsx(ModalHeader, null, renderModalTitleContent()), jsx(ModalBody, null, errorState ? jsx("div", {
336
332
  css: modalBodyErrorWrapperStyles
@@ -0,0 +1,24 @@
1
+ import React, { useEffect } from 'react';
2
+ import Modal from '@atlaskit/modal-dialog';
3
+ import { useDatasourceAnalyticsEvents } from '../../../../analytics';
4
+ var ScreenEvent = function ScreenEvent() {
5
+ var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
6
+ fireEvent = _useDatasourceAnalyti.fireEvent;
7
+ useEffect(function () {
8
+ fireEvent('screen.datasourceModalDialog.viewed', {});
9
+ }, [fireEvent]);
10
+ return null;
11
+ };
12
+ export var DatasourceModal = function DatasourceModal(_ref) {
13
+ var testId = _ref.testId,
14
+ onClose = _ref.onClose,
15
+ shouldCloseOnOverlayClick = _ref.shouldCloseOnOverlayClick,
16
+ children = _ref.children;
17
+ return /*#__PURE__*/React.createElement(Modal, {
18
+ testId: testId,
19
+ onClose: onClose,
20
+ width: "calc(100% - 80px)",
21
+ shouldScrollInViewport: true,
22
+ shouldCloseOnOverlayClick: shouldCloseOnOverlayClick
23
+ }, /*#__PURE__*/React.createElement(ScreenEvent, null), children);
24
+ };
@@ -11,7 +11,7 @@ import { v4 as uuidv4 } from 'uuid';
11
11
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
12
12
  import Button from '@atlaskit/button/standard-button';
13
13
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
14
- import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
14
+ import { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
15
15
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
16
  import { Box, xcss } from '@atlaskit/primitives';
17
17
  import LinkUrl from '@atlaskit/smart-card/link-url';
@@ -32,6 +32,7 @@ import { InitialStateView } from '../../common/initial-state-view';
32
32
  import { CancelButton } from '../../common/modal/cancel-button';
33
33
  import { ContentContainer } from '../../common/modal/content-container';
34
34
  import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-smart-link';
35
+ import { DatasourceModal } from '../../common/modal/datasource-modal';
35
36
  import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
36
37
  import { SiteSelector } from '../../common/modal/site-selector';
37
38
  import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
@@ -151,9 +152,6 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
151
152
  });
152
153
  }
153
154
  }, [fireEvent, availableSites]);
154
- useEffect(function () {
155
- fireEvent('screen.datasourceModalDialog.viewed', {});
156
- }, [fireEvent]);
157
155
 
158
156
  // TODO: further refactoring in EDM-9573
159
157
  // https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6828283
@@ -418,11 +416,9 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
418
416
  return jsx(IntlMessagesProvider, {
419
417
  defaultMessages: i18nEN,
420
418
  loaderFn: fetchMessagesForLocale
421
- }, jsx(Modal, {
419
+ }, jsx(DatasourceModal, {
422
420
  testId: "confluence-search-datasource-modal",
423
- onClose: onCancel,
424
- width: "calc(100% - 80px)",
425
- shouldScrollInViewport: true
421
+ onClose: onCancel
426
422
  }, jsx(ModalHeader, null, jsx(ModalTitle, null, jsx(SiteSelector, {
427
423
  availableSites: availableSites,
428
424
  onSiteSelection: onSiteSelection,
@@ -440,7 +440,8 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
440
440
  var _newRowData$key;
441
441
  var key = _ref11.key,
442
442
  type = _ref11.type;
443
- var value = ((_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data) || newRowData[key];
443
+ // Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
444
+ var value = (_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data;
444
445
  var values = Array.isArray(value) ? value : [value];
445
446
  var renderedValues = renderItem({
446
447
  type: type,
@@ -6,16 +6,30 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
6
6
  import { useMemo } from 'react';
7
7
  import { css, jsx } from '@emotion/react';
8
8
  import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
9
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
9
+ import { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
10
10
  var rootStyles = css({
11
11
  position: 'relative',
12
12
  display: 'block'
13
13
  });
14
+ var smartLinkNodeToUrl = function smartLinkNodeToUrl(node) {
15
+ var _node$attrs$url;
16
+ return (_node$attrs$url = node.attrs.url) !== null && _node$attrs$url !== void 0 ? _node$attrs$url : '';
17
+ };
18
+ var schemaSmartLinkOverride = new Schema({
19
+ nodes: defaultSchema.spec.nodes.update('inlineCard', _objectSpread(_objectSpread({}, defaultSchema.spec.nodes.get('inlineCard')), {}, {
20
+ leafText: smartLinkNodeToUrl
21
+ })).update('blockCard', _objectSpread(_objectSpread({}, defaultSchema.spec.nodes.get('blockCard')), {}, {
22
+ leafText: smartLinkNodeToUrl
23
+ })).update('embedCard', _objectSpread(_objectSpread({}, defaultSchema.spec.nodes.get('embedCard')), {}, {
24
+ leafText: smartLinkNodeToUrl
25
+ })),
26
+ marks: defaultSchema.spec.marks
27
+ });
14
28
  export var parseRichText = function parseRichText(value) {
15
29
  try {
16
30
  if (value.type === 'adf') {
17
31
  var adf = JSON.parse(value.text);
18
- return PMNode.fromJSON(defaultSchema, _objectSpread(_objectSpread({}, adf), {}, {
32
+ return PMNode.fromJSON(schemaSmartLinkOverride, _objectSpread(_objectSpread({}, adf), {}, {
19
33
  content: _toConsumableArray(adf.content.slice(0, 2))
20
34
  })).textContent;
21
35
  }
@@ -11,7 +11,7 @@ import { v4 as uuidv4 } from 'uuid';
11
11
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
12
12
  import Button from '@atlaskit/button/standard-button';
13
13
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
14
- import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
14
+ import { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
15
15
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
16
  import LinkUrl from '@atlaskit/smart-card/link-url';
17
17
  import { N800 } from '@atlaskit/theme/colors';
@@ -37,6 +37,7 @@ import { initialStateViewMessages } from '../../common/initial-state-view/messag
37
37
  import { CancelButton } from '../../common/modal/cancel-button';
38
38
  import { ContentContainer } from '../../common/modal/content-container';
39
39
  import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-smart-link';
40
+ import { DatasourceModal } from '../../common/modal/datasource-modal';
40
41
  import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
41
42
  import { SiteSelector } from '../../common/modal/site-selector';
42
43
  import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
@@ -175,9 +176,6 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
175
176
  canBeLink: currentViewMode === 'inline',
176
177
  extensionKey: extensionKey
177
178
  });
178
- useEffect(function () {
179
- fireEvent('screen.datasourceModalDialog.viewed', {});
180
- }, [fireEvent]);
181
179
  useEffect(function () {
182
180
  var newVisibleColumnKeys = !initialVisibleColumnKeys || (initialVisibleColumnKeys || []).length === 0 ? defaultVisibleColumnKeys : initialVisibleColumnKeys;
183
181
  visibleColumnCount.current = newVisibleColumnKeys.length;
@@ -453,11 +451,9 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
453
451
  return jsx(IntlMessagesProvider, {
454
452
  defaultMessages: i18nEN,
455
453
  loaderFn: fetchMessagesForLocale
456
- }, jsx(ModalTransition, null, jsx(Modal, {
454
+ }, jsx(ModalTransition, null, jsx(DatasourceModal, {
457
455
  testId: "jira-datasource-modal",
458
- onClose: onCancel,
459
- width: "calc(100% - 80px)",
460
- shouldScrollInViewport: true
456
+ onClose: onCancel
461
457
  }, jsx(ModalHeader, null, jsx(ModalTitle, null, jsx(SiteSelector, {
462
458
  availableSites: availableSites,
463
459
  onSiteSelection: onSiteSelection,
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { type ModalDialogProps } from '@atlaskit/modal-dialog';
3
+ type DatasourceModalProps = Pick<ModalDialogProps, 'testId' | 'onClose' | 'children' | 'shouldCloseOnOverlayClick'>;
4
+ export declare const DatasourceModal: ({ testId, onClose, shouldCloseOnOverlayClick, children, }: DatasourceModalProps) => JSX.Element;
5
+ export {};
@@ -1,5 +1,5 @@
1
- import { IntlShape } from 'react-intl-next';
2
- import { DatasourceType } from '@atlaskit/linking-types';
3
- import { TableViewPropsRenderType } from '../types';
1
+ import { type IntlShape } from 'react-intl-next';
2
+ import { type DatasourceType } from '@atlaskit/linking-types';
3
+ import { type TableViewPropsRenderType } from '../types';
4
4
  export declare const stringifyType: ({ type, value }: DatasourceType, formatMessage: IntlShape['formatMessage'], formatDate: IntlShape['formatDate']) => string;
5
5
  export declare const renderType: TableViewPropsRenderType;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { NumberType } from '@atlaskit/linking-types';
2
+ import { type NumberType } from '@atlaskit/linking-types';
3
3
  interface NumberProps {
4
4
  testId?: string;
5
5
  number: NumberType['value'];
@@ -1,5 +1,5 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { RichText } from '@atlaskit/linking-types';
2
+ import { type RichText } from '@atlaskit/linking-types';
3
3
  export declare const parseRichText: (value: RichText) => string | null;
4
4
  declare const RichTextType: ({ value }: {
5
5
  value: RichText;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { type ModalDialogProps } from '@atlaskit/modal-dialog';
3
+ type DatasourceModalProps = Pick<ModalDialogProps, 'testId' | 'onClose' | 'children' | 'shouldCloseOnOverlayClick'>;
4
+ export declare const DatasourceModal: ({ testId, onClose, shouldCloseOnOverlayClick, children, }: DatasourceModalProps) => JSX.Element;
5
+ export {};
@@ -1,5 +1,5 @@
1
- import { IntlShape } from 'react-intl-next';
2
- import { DatasourceType } from '@atlaskit/linking-types';
3
- import { TableViewPropsRenderType } from '../types';
1
+ import { type IntlShape } from 'react-intl-next';
2
+ import { type DatasourceType } from '@atlaskit/linking-types';
3
+ import { type TableViewPropsRenderType } from '../types';
4
4
  export declare const stringifyType: ({ type, value }: DatasourceType, formatMessage: IntlShape['formatMessage'], formatDate: IntlShape['formatDate']) => string;
5
5
  export declare const renderType: TableViewPropsRenderType;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { NumberType } from '@atlaskit/linking-types';
2
+ import { type NumberType } from '@atlaskit/linking-types';
3
3
  interface NumberProps {
4
4
  testId?: string;
5
5
  number: NumberType['value'];
@@ -1,5 +1,5 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { RichText } from '@atlaskit/linking-types';
2
+ import { type RichText } from '@atlaskit/linking-types';
3
3
  export declare const parseRichText: (value: RichText) => string | null;
4
4
  declare const RichTextType: ({ value }: {
5
5
  value: RichText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  "analytics:codegen": "yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource --output ./src/analytics/generated"
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/adf-schema": "^35.12.2",
35
+ "@atlaskit/adf-schema": "^36.1.0",
36
36
  "@atlaskit/analytics-next": "^9.3.0",
37
37
  "@atlaskit/avatar": "^21.8.0",
38
38
  "@atlaskit/avatar-group": "^9.6.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/dropdown-menu": "^12.10.0",
43
43
  "@atlaskit/editor-prosemirror": "4.0.1",
44
44
  "@atlaskit/empty-state": "^7.8.0",
45
- "@atlaskit/form": "^9.3.0",
45
+ "@atlaskit/form": "^10.0.0",
46
46
  "@atlaskit/heading": "^2.3.0",
47
47
  "@atlaskit/icon": "^22.1.0",
48
48
  "@atlaskit/icon-object": "^6.4.0",
@@ -66,13 +66,13 @@
66
66
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
67
67
  "@atlaskit/primitives": "^6.1.0",
68
68
  "@atlaskit/select": "^17.9.0",
69
- "@atlaskit/smart-card": "^26.62.0",
69
+ "@atlaskit/smart-card": "^26.63.0",
70
70
  "@atlaskit/smart-user-picker": "6.9.3",
71
71
  "@atlaskit/spinner": "^16.1.0",
72
72
  "@atlaskit/tag": "^12.2.0",
73
73
  "@atlaskit/textfield": "6.3.1",
74
74
  "@atlaskit/theme": "^12.8.0",
75
- "@atlaskit/tokens": "^1.46.0",
75
+ "@atlaskit/tokens": "^1.47.0",
76
76
  "@atlaskit/tooltip": "^18.3.0",
77
77
  "@atlaskit/ufo": "^0.2.4",
78
78
  "@atlaskit/width-detector": "^4.2.0",