@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.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +19 -11
- package/dist/cjs/ui/common/error-state/messages.js +2 -2
- package/dist/cjs/ui/common/error-state/provider-auth-required-svg.js +148 -430
- package/dist/cjs/ui/common/error-state/provider-auth-required.js +20 -15
- package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +2 -0
- package/dist/es2019/hooks/useDatasourceTableState.js +5 -1
- package/dist/es2019/ui/common/error-state/messages.js +2 -2
- package/dist/es2019/ui/common/error-state/provider-auth-required-svg.js +148 -430
- package/dist/es2019/ui/common/error-state/provider-auth-required.js +9 -4
- package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +2 -0
- package/dist/esm/hooks/useDatasourceTableState.js +19 -11
- package/dist/esm/ui/common/error-state/messages.js +2 -2
- package/dist/esm/ui/common/error-state/provider-auth-required-svg.js +148 -430
- package/dist/esm/ui/common/error-state/provider-auth-required.js +20 -15
- package/dist/esm/ui/datasource-table-view/datasourceTableView.js +2 -0
- package/dist/types/hooks/useDatasourceTableState.d.ts +2 -0
- package/dist/types/ui/common/error-state/provider-auth-required.d.ts +2 -1
- package/dist/types-ts4.5/hooks/useDatasourceTableState.d.ts +2 -0
- package/dist/types-ts4.5/ui/common/error-state/provider-auth-required.d.ts +2 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
43
|
-
_context.
|
|
44
|
-
_context.next = 4;
|
|
44
|
+
_context.prev = 0;
|
|
45
|
+
_context.next = 3;
|
|
45
46
|
return outboundAuth(authInfo.url);
|
|
46
|
-
case
|
|
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 =
|
|
53
|
+
_context.next = 12;
|
|
53
54
|
break;
|
|
54
|
-
case
|
|
55
|
-
_context.prev =
|
|
56
|
-
_context.t0 = _context["catch"](
|
|
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
|
|
65
|
+
case 12:
|
|
65
66
|
case "end":
|
|
66
67
|
return _context.stop();
|
|
67
68
|
}
|
|
68
|
-
}, _callee, null, [[
|
|
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
|
|
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 {};
|