@atlaskit/link-datasource 1.22.7 → 1.22.8

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.
@@ -1,5 +1,5 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  /** @jsx jsx */
5
5
  import React, { useEffect } from 'react';
@@ -21,13 +21,16 @@ export var ProviderAuthRequired = function ProviderAuthRequired(_ref) {
21
21
  auth = _ref$auth === void 0 ? [] : _ref$auth,
22
22
  onAuthSuccess = _ref.onAuthSuccess,
23
23
  onAuthError = _ref.onAuthError,
24
- extensionKey = _ref.extensionKey;
24
+ extensionKey = _ref.extensionKey,
25
+ providerName = _ref.providerName;
25
26
  var _useIntl = useIntl(),
26
27
  formatMessage = _useIntl.formatMessage;
27
28
  var _useErrorLogger = useErrorLogger(),
28
29
  captureError = _useErrorLogger.captureError;
29
30
  var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
30
31
  fireEvent = _useDatasourceAnalyti.fireEvent;
32
+ var _auth = _slicedToArray(auth, 1),
33
+ authInfo = _auth[0];
31
34
  useEffect(function () {
32
35
  fireEvent('ui.error.shown', {
33
36
  reason: 'access'
@@ -35,25 +38,23 @@ export var ProviderAuthRequired = function ProviderAuthRequired(_ref) {
35
38
  }, [fireEvent]);
36
39
  var onAuthRequest = /*#__PURE__*/function () {
37
40
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38
- var _auth, authInfo;
39
41
  return _regeneratorRuntime.wrap(function _callee$(_context) {
40
42
  while (1) switch (_context.prev = _context.next) {
41
43
  case 0:
42
- _auth = _slicedToArray(auth, 1), authInfo = _auth[0];
43
- _context.prev = 1;
44
- _context.next = 4;
44
+ _context.prev = 0;
45
+ _context.next = 3;
45
46
  return outboundAuth(authInfo.url);
46
- case 4:
47
+ case 3:
47
48
  fireEvent('operational.provider.authSuccess', {
48
49
  extensionKey: extensionKey,
49
50
  experience: 'datasource'
50
51
  });
51
52
  onAuthSuccess === null || onAuthSuccess === void 0 || onAuthSuccess();
52
- _context.next = 13;
53
+ _context.next = 12;
53
54
  break;
54
- case 8:
55
- _context.prev = 8;
56
- _context.t0 = _context["catch"](1);
55
+ case 7:
56
+ _context.prev = 7;
57
+ _context.t0 = _context["catch"](0);
57
58
  fireEvent('operational.provider.authFailure', {
58
59
  reason: _context.t0 instanceof AuthError && _context.t0.type ? _context.t0.type : null,
59
60
  extensionKey: extensionKey,
@@ -61,18 +62,20 @@ export var ProviderAuthRequired = function ProviderAuthRequired(_ref) {
61
62
  });
62
63
  captureError('ProviderOnAuthRequest', _context.t0);
63
64
  onAuthError === null || onAuthError === void 0 || onAuthError();
64
- case 13:
65
+ case 12:
65
66
  case "end":
66
67
  return _context.stop();
67
68
  }
68
- }, _callee, null, [[1, 8]]);
69
+ }, _callee, null, [[0, 7]]);
69
70
  }));
70
71
  return function onAuthRequest() {
71
72
  return _ref2.apply(this, arguments);
72
73
  };
73
74
  }();
74
75
  var renderAuthDescription = function renderAuthDescription() {
75
- return jsx(React.Fragment, null, formatMessage(loadingErrorMessages.authScreenDescriptionText), ' ', jsx("a", {
76
+ return jsx(React.Fragment, null, formatMessage(loadingErrorMessages.authScreenDescriptionText, {
77
+ providerName: providerName
78
+ }), ' ', jsx("a", {
76
79
  href: learnMoreAboutSmartLinksUrl,
77
80
  target: "_blank",
78
81
  rel: "noreferrer noopener"
@@ -87,7 +90,9 @@ export var ProviderAuthRequired = function ProviderAuthRequired(_ref) {
87
90
  };
88
91
  return jsx(EmptyState, {
89
92
  testId: "datasource--access-required-with-auth",
90
- header: formatMessage(loadingErrorMessages.authScreenHeaderText),
93
+ header: formatMessage(loadingErrorMessages.authScreenHeaderText, {
94
+ providerName: providerName
95
+ }),
91
96
  description: renderAuthDescription(),
92
97
  renderImage: ProviderAuthRequiredSVG,
93
98
  primaryAction: renderAuthConnectButton()
@@ -47,6 +47,7 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
47
47
  loadDatasourceDetails = _useDatasourceTableSt.loadDatasourceDetails,
48
48
  _useDatasourceTableSt2 = _useDatasourceTableSt.extensionKey,
49
49
  extensionKey = _useDatasourceTableSt2 === void 0 ? null : _useDatasourceTableSt2,
50
+ providerName = _useDatasourceTableSt.providerName,
50
51
  destinationObjectTypes = _useDatasourceTableSt.destinationObjectTypes,
51
52
  authDetails = _useDatasourceTableSt.authDetails;
52
53
  var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
@@ -127,6 +128,7 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
127
128
  return authDetails !== null && authDetails !== void 0 && authDetails.length && authDetails.length > 0 ? jsx(ProviderAuthRequired, {
128
129
  auth: authDetails,
129
130
  extensionKey: extensionKey,
131
+ providerName: providerName,
130
132
  onAuthSuccess: forcedReset,
131
133
  onAuthError: forcedReset
132
134
  }) : jsx(AccessRequired, {
@@ -34,6 +34,8 @@ export interface DatasourceTableState {
34
34
  destinationObjectTypes: string[];
35
35
  /** Used as an indicated of which provider type is being used - originates from ORS */
36
36
  extensionKey?: string;
37
+ /** Indicates which provider name is being used - originates from ORS */
38
+ providerName?: string;
37
39
  /** Auth info used to connect to the provider account. */
38
40
  authDetails?: DatasourceMeta['auth'];
39
41
  }
@@ -5,6 +5,7 @@ interface ProviderAuthRequiredProps {
5
5
  onAuthSuccess: () => void;
6
6
  onAuthError: () => void;
7
7
  extensionKey: string | null;
8
+ providerName: DatasourceMeta['providerName'];
8
9
  }
9
- export declare const ProviderAuthRequired: ({ auth, onAuthSuccess, onAuthError, extensionKey, }: ProviderAuthRequiredProps) => jsx.JSX.Element;
10
+ export declare const ProviderAuthRequired: ({ auth, onAuthSuccess, onAuthError, extensionKey, providerName, }: ProviderAuthRequiredProps) => jsx.JSX.Element;
10
11
  export {};
@@ -34,6 +34,8 @@ export interface DatasourceTableState {
34
34
  destinationObjectTypes: string[];
35
35
  /** Used as an indicated of which provider type is being used - originates from ORS */
36
36
  extensionKey?: string;
37
+ /** Indicates which provider name is being used - originates from ORS */
38
+ providerName?: string;
37
39
  /** Auth info used to connect to the provider account. */
38
40
  authDetails?: DatasourceMeta['auth'];
39
41
  }
@@ -5,6 +5,7 @@ interface ProviderAuthRequiredProps {
5
5
  onAuthSuccess: () => void;
6
6
  onAuthError: () => void;
7
7
  extensionKey: string | null;
8
+ providerName: DatasourceMeta['providerName'];
8
9
  }
9
- export declare const ProviderAuthRequired: ({ auth, onAuthSuccess, onAuthError, extensionKey, }: ProviderAuthRequiredProps) => jsx.JSX.Element;
10
+ export declare const ProviderAuthRequired: ({ auth, onAuthSuccess, onAuthError, extensionKey, providerName, }: ProviderAuthRequiredProps) => jsx.JSX.Element;
10
11
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "1.22.7",
3
+ "version": "1.22.8",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"