@atlaskit/link-datasource 1.22.1 → 1.22.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,13 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 1.22.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#70489](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70489) [`8bf6a93203db`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8bf6a93203db) - Define analytics events to fire when provider Authentication succeeds or fail.
8
+ - [#70400](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70400) [`933b3c1e55d4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/933b3c1e55d4) - [ux] css styling for Avatar group styles is increased in specificity for inserting and rendering from Jira Issues modal to ensure that editor css does not apply to the component
9
+ - Updated dependencies
10
+
3
11
  ## 1.22.1
4
12
 
5
13
  ### Patch Changes
@@ -54,19 +54,28 @@ var ProviderAuthRequired = exports.ProviderAuthRequired = function ProviderAuthR
54
54
  _context.next = 4;
55
55
  return (0, _outboundAuthFlowClient.auth)(authInfo.url);
56
56
  case 4:
57
+ fireEvent('operational.provider.authSuccess', {
58
+ extensionKey: authInfo.key,
59
+ experience: 'datasource'
60
+ });
57
61
  onAuthSuccess === null || onAuthSuccess === void 0 || onAuthSuccess();
58
- _context.next = 11;
62
+ _context.next = 13;
59
63
  break;
60
- case 7:
61
- _context.prev = 7;
64
+ case 8:
65
+ _context.prev = 8;
62
66
  _context.t0 = _context["catch"](1);
63
- onAuthError === null || onAuthError === void 0 || onAuthError();
67
+ fireEvent('operational.provider.authFailure', {
68
+ reason: _context.t0 instanceof _outboundAuthFlowClient.AuthError && _context.t0.type ? _context.t0.type : null,
69
+ extensionKey: authInfo.key,
70
+ experience: 'datasource'
71
+ });
64
72
  captureError('ProviderOnAuthRequest', _context.t0);
65
- case 11:
73
+ onAuthError === null || onAuthError === void 0 || onAuthError();
74
+ case 13:
66
75
  case "end":
67
76
  return _context.stop();
68
77
  }
69
- }, _callee, null, [[1, 7]]);
78
+ }, _callee, null, [[1, 8]]);
70
79
  }));
71
80
  return function onAuthRequest() {
72
81
  return _ref2.apply(this, arguments);
@@ -33,7 +33,7 @@ var avatarWrapperStyles = (0, _primitives.xcss)({
33
33
  var widthObserverWrapperStyles = (0, _primitives.xcss)({
34
34
  position: 'relative'
35
35
  });
36
- var AvatarGroupWrapperStyles = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /*\n The css from editor core package affects the padding of the AvatarGroup\n The & refers to the parent selector (.<generated className>),\n so && becomes .<generated className>.<generated className> which increases its specificity\n */\n && ul {\n padding-left: 0px;\n }\n"])));
36
+ var AvatarGroupWrapperStyles = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ul {\n padding-left: 0px !important;\n }\n"])));
37
37
  var getMaxUserCount = function getMaxUserCount(userCount, availableWidth) {
38
38
  if (availableWidth <= 28) {
39
39
  // If width is less than or equal to 28px, we should only display the user count
@@ -4,7 +4,7 @@ import { css, jsx } from '@emotion/react';
4
4
  import { useIntl } from 'react-intl-next';
5
5
  import Button from '@atlaskit/button';
6
6
  import EmptyState from '@atlaskit/empty-state';
7
- import { auth as outboundAuth } from '@atlaskit/outbound-auth-flow-client';
7
+ import { AuthError, auth as outboundAuth } from '@atlaskit/outbound-auth-flow-client';
8
8
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
9
9
  import useErrorLogger from '../../../hooks/useErrorLogger';
10
10
  import { loadingErrorMessages } from './messages';
@@ -36,10 +36,19 @@ export const ProviderAuthRequired = ({
36
36
  const [authInfo] = auth;
37
37
  try {
38
38
  await outboundAuth(authInfo.url);
39
+ fireEvent('operational.provider.authSuccess', {
40
+ extensionKey: authInfo.key,
41
+ experience: 'datasource'
42
+ });
39
43
  onAuthSuccess === null || onAuthSuccess === void 0 ? void 0 : onAuthSuccess();
40
44
  } catch (error) {
41
- onAuthError === null || onAuthError === void 0 ? void 0 : onAuthError();
45
+ fireEvent('operational.provider.authFailure', {
46
+ reason: error instanceof AuthError && error.type ? error.type : null,
47
+ extensionKey: authInfo.key,
48
+ experience: 'datasource'
49
+ });
42
50
  captureError('ProviderOnAuthRequest', error);
51
+ onAuthError === null || onAuthError === void 0 ? void 0 : onAuthError();
43
52
  }
44
53
  };
45
54
  const renderAuthDescription = () => jsx(React.Fragment, null, formatMessage(loadingErrorMessages.authScreenDescriptionText), ' ', jsx("a", {
@@ -21,13 +21,8 @@ const widthObserverWrapperStyles = xcss({
21
21
  position: 'relative'
22
22
  });
23
23
  const AvatarGroupWrapperStyles = styled.div`
24
- /*
25
- The css from editor core package affects the padding of the AvatarGroup
26
- The & refers to the parent selector (.<generated className>),
27
- so && becomes .<generated className>.<generated className> which increases its specificity
28
- */
29
- && ul {
30
- padding-left: 0px;
24
+ ul {
25
+ padding-left: 0px !important;
31
26
  }
32
27
  `;
33
28
  const getMaxUserCount = (userCount, availableWidth) => {
@@ -7,7 +7,7 @@ import { css, jsx } from '@emotion/react';
7
7
  import { useIntl } from 'react-intl-next';
8
8
  import Button from '@atlaskit/button';
9
9
  import EmptyState from '@atlaskit/empty-state';
10
- import { auth as outboundAuth } from '@atlaskit/outbound-auth-flow-client';
10
+ import { AuthError, auth as outboundAuth } from '@atlaskit/outbound-auth-flow-client';
11
11
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
12
12
  import useErrorLogger from '../../../hooks/useErrorLogger';
13
13
  import { loadingErrorMessages } from './messages';
@@ -43,19 +43,28 @@ export var ProviderAuthRequired = function ProviderAuthRequired(_ref) {
43
43
  _context.next = 4;
44
44
  return outboundAuth(authInfo.url);
45
45
  case 4:
46
+ fireEvent('operational.provider.authSuccess', {
47
+ extensionKey: authInfo.key,
48
+ experience: 'datasource'
49
+ });
46
50
  onAuthSuccess === null || onAuthSuccess === void 0 || onAuthSuccess();
47
- _context.next = 11;
51
+ _context.next = 13;
48
52
  break;
49
- case 7:
50
- _context.prev = 7;
53
+ case 8:
54
+ _context.prev = 8;
51
55
  _context.t0 = _context["catch"](1);
52
- onAuthError === null || onAuthError === void 0 || onAuthError();
56
+ fireEvent('operational.provider.authFailure', {
57
+ reason: _context.t0 instanceof AuthError && _context.t0.type ? _context.t0.type : null,
58
+ extensionKey: authInfo.key,
59
+ experience: 'datasource'
60
+ });
53
61
  captureError('ProviderOnAuthRequest', _context.t0);
54
- case 11:
62
+ onAuthError === null || onAuthError === void 0 || onAuthError();
63
+ case 13:
55
64
  case "end":
56
65
  return _context.stop();
57
66
  }
58
- }, _callee, null, [[1, 7]]);
67
+ }, _callee, null, [[1, 8]]);
59
68
  }));
60
69
  return function onAuthRequest() {
61
70
  return _ref2.apply(this, arguments);
@@ -23,7 +23,7 @@ var avatarWrapperStyles = xcss({
23
23
  var widthObserverWrapperStyles = xcss({
24
24
  position: 'relative'
25
25
  });
26
- var AvatarGroupWrapperStyles = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /*\n The css from editor core package affects the padding of the AvatarGroup\n The & refers to the parent selector (.<generated className>),\n so && becomes .<generated className>.<generated className> which increases its specificity\n */\n && ul {\n padding-left: 0px;\n }\n"])));
26
+ var AvatarGroupWrapperStyles = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ul {\n padding-left: 0px !important;\n }\n"])));
27
27
  var getMaxUserCount = function getMaxUserCount(userCount, availableWidth) {
28
28
  if (availableWidth <= 28) {
29
29
  // If width is less than or equal to 28px, we should only display the user count
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::c9cb39dfcf360ccc71b740ba1353dc6b>>
6
+ * @codegen <<SignedSource::e9179418960d1cbfd58428448cf63c82>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -70,6 +70,15 @@ export type DatasourceOperationFailedAttributesType = {
70
70
  traceId: string | null;
71
71
  status: number | null;
72
72
  };
73
+ export type ProviderAuthSuccessAttributesType = {
74
+ extensionKey: string | null;
75
+ experience: 'datasource';
76
+ };
77
+ export type ProviderAuthFailureAttributesType = {
78
+ extensionKey: string | null;
79
+ reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
80
+ experience: 'datasource';
81
+ };
73
82
  export type NextItemLoadedAttributesType = {
74
83
  destinationObjectTypes: unknown[];
75
84
  extensionKey: string | null;
@@ -169,6 +178,12 @@ export type AnalyticsEventAttributes = {
169
178
  /**
170
179
  * Fired when a generic operation failed */
171
180
  'operational.datasource.operationFailed': DatasourceOperationFailedAttributesType;
181
+ /**
182
+ * Fired when an auth provider connection is successful. */
183
+ 'operational.provider.authSuccess': ProviderAuthSuccessAttributesType;
184
+ /**
185
+ * Fired when an auth provider connection failed to complete. */
186
+ 'operational.provider.authFailure': ProviderAuthFailureAttributesType;
172
187
  /**
173
188
  * Fired when user scrolls to the next page/list of the objects */
174
189
  'track.nextItem.loaded': NextItemLoadedAttributesType;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::c9cb39dfcf360ccc71b740ba1353dc6b>>
6
+ * @codegen <<SignedSource::e9179418960d1cbfd58428448cf63c82>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -70,6 +70,15 @@ export type DatasourceOperationFailedAttributesType = {
70
70
  traceId: string | null;
71
71
  status: number | null;
72
72
  };
73
+ export type ProviderAuthSuccessAttributesType = {
74
+ extensionKey: string | null;
75
+ experience: 'datasource';
76
+ };
77
+ export type ProviderAuthFailureAttributesType = {
78
+ extensionKey: string | null;
79
+ reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
80
+ experience: 'datasource';
81
+ };
73
82
  export type NextItemLoadedAttributesType = {
74
83
  destinationObjectTypes: unknown[];
75
84
  extensionKey: string | null;
@@ -169,6 +178,12 @@ export type AnalyticsEventAttributes = {
169
178
  /**
170
179
  * Fired when a generic operation failed */
171
180
  'operational.datasource.operationFailed': DatasourceOperationFailedAttributesType;
181
+ /**
182
+ * Fired when an auth provider connection is successful. */
183
+ 'operational.provider.authSuccess': ProviderAuthSuccessAttributesType;
184
+ /**
185
+ * Fired when an auth provider connection failed to complete. */
186
+ 'operational.provider.authFailure': ProviderAuthFailureAttributesType;
172
187
  /**
173
188
  * Fired when user scrolls to the next page/list of the objects */
174
189
  'track.nextItem.loaded': NextItemLoadedAttributesType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "1.22.1",
3
+ "version": "1.22.2",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,12 +31,12 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@atlaskit/adf-schema": "^35.5.1",
34
- "@atlaskit/analytics-next": "^9.1.3",
34
+ "@atlaskit/analytics-next": "^9.2.0",
35
35
  "@atlaskit/avatar": "^21.4.0",
36
36
  "@atlaskit/avatar-group": "^9.5.0",
37
37
  "@atlaskit/badge": "^15.2.0",
38
38
  "@atlaskit/button": "^17.3.0",
39
- "@atlaskit/dropdown-menu": "^12.3.0",
39
+ "@atlaskit/dropdown-menu": "^12.4.0",
40
40
  "@atlaskit/editor-prosemirror": "1.1.0",
41
41
  "@atlaskit/empty-state": "^7.5.0",
42
42
  "@atlaskit/form": "^9.0.3",