@atlaskit/link-create 1.15.2 → 1.15.4

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-create
2
2
 
3
+ ## 1.15.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#87422](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87422) [`54c6f458dbd6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/54c6f458dbd6) - Cleansup ff platform.linking-platform.link-create.enable-sentry-client, enabling sentry client to capture exceptions
8
+
9
+ ## 1.15.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#86416](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86416) [`91c59efc1417`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/91c59efc1417) - Cleans up feature flag platform.linking-platform.link-create.slo-ignore-failed-fetch permanently marking failed to fetch errors to be ignored for SLO metrics.
14
+
3
15
  ## 1.15.2
4
16
 
5
17
  ### Patch Changes
@@ -91,27 +91,20 @@ var Experience = exports.Experience = function Experience(_ref) {
91
91
  /**
92
92
  * Whether the failure should be involved when considering SLI/SLO
93
93
  */
94
- isSLOFailure: (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.slo-ignore-failed-fetch') ? isErrorSLOFailure(error) : true
94
+ isSLOFailure: isErrorSLOFailure(error)
95
95
  }, (0, _errors.getNetworkFields)(error)))).fire(_constants.ANALYTICS_CHANNEL);
96
96
  if (error instanceof Error) {
97
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.enable-sentry-client')) {
98
- // Capture exception to Sentry
99
- (0, _sentry.captureException)(error, 'link-create');
100
- }
97
+ // Capture exception to Sentry
98
+ (0, _sentry.captureException)(error, 'link-create');
101
99
  }
102
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.slo-ignore-failed-fetch')) {
103
- /**
104
- * Only consider the experience truly failed if the
105
- * failure is one we haven't correctly handled.
106
- *
107
- * In otherwords allow the experience to be "restarted" for the user to try again
108
- */
109
- if (isErrorSLOFailure(error)) {
110
- if (experience.current !== experienceStatus) {
111
- experience.current = experienceStatus;
112
- }
113
- }
114
- } else {
100
+
101
+ /**
102
+ * Only consider the experience truly failed if the
103
+ * failure is one we haven't correctly handled.
104
+ *
105
+ * In otherwords allow the experience to be "restarted" for the user to try again
106
+ */
107
+ if (isErrorSLOFailure(error)) {
115
108
  if (experience.current !== experienceStatus) {
116
109
  experience.current = experienceStatus;
117
110
  }
@@ -26,21 +26,15 @@ var ErrorBoundary = exports.ErrorBoundary = function ErrorBoundary(_ref) {
26
26
  // eslint-disable-next-line react-hooks/rules-of-hooks
27
27
  (0, _experienceTracker.useExperience)() : null;
28
28
  var handleError = (0, _react.useCallback)(function (error, info) {
29
- var _window, _window2, _info$componentStack;
29
+ var _window;
30
30
  if (!(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.better-observability')) {
31
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.enable-sentry-client')) {
32
- // Capture exception to Sentry
33
- (0, _sentry.captureException)(error, 'link-create');
34
- }
31
+ // Capture exception to Sentry
32
+ (0, _sentry.captureException)(error, 'link-create');
35
33
  }
36
- createAnalyticsEvent((0, _analytics.default)('operational.linkCreate.unhandledErrorCaught', (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.enable-sentry-client') ? {
34
+ createAnalyticsEvent((0, _analytics.default)('operational.linkCreate.unhandledErrorCaught', {
37
35
  browserInfo: ((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) || 'unknown',
38
36
  error: error.name,
39
37
  componentStack: 'unknown'
40
- } : {
41
- browserInfo: ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.userAgent) || 'unknown',
42
- error: error.toString(),
43
- componentStack: (_info$componentStack = info === null || info === void 0 ? void 0 : info.componentStack) !== null && _info$componentStack !== void 0 ? _info$componentStack : ''
44
38
  })).fire(_constants.ANALYTICS_CHANNEL);
45
39
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.better-observability')) {
46
40
  // Track experience as failed for SLO
@@ -31,7 +31,7 @@ var LinkCreateWithAnalyticsContext = (0, _analytics.withLinkCreateAnalyticsConte
31
31
  }));
32
32
  var PACKAGE_DATA = exports.PACKAGE_DATA = {
33
33
  packageName: "@atlaskit/link-create" || '',
34
- packageVersion: "1.15.2" || '',
34
+ packageVersion: "1.15.4" || '',
35
35
  component: _constants.COMPONENT_NAME,
36
36
  componentName: _constants.COMPONENT_NAME
37
37
  };
@@ -77,7 +77,7 @@ export const Experience = ({
77
77
  /**
78
78
  * Whether the failure should be involved when considering SLI/SLO
79
79
  */
80
- isSLOFailure: getBooleanFF('platform.linking-platform.link-create.slo-ignore-failed-fetch') ? isErrorSLOFailure(error) : true,
80
+ isSLOFailure: isErrorSLOFailure(error),
81
81
  /**
82
82
  * Fields related to `Response` object that can help with debugging
83
83
  * what has gone wrong
@@ -85,24 +85,17 @@ export const Experience = ({
85
85
  ...getNetworkFields(error)
86
86
  })).fire(ANALYTICS_CHANNEL);
87
87
  if (error instanceof Error) {
88
- if (getBooleanFF('platform.linking-platform.link-create.enable-sentry-client')) {
89
- // Capture exception to Sentry
90
- captureException(error, 'link-create');
91
- }
88
+ // Capture exception to Sentry
89
+ captureException(error, 'link-create');
92
90
  }
93
- if (getBooleanFF('platform.linking-platform.link-create.slo-ignore-failed-fetch')) {
94
- /**
95
- * Only consider the experience truly failed if the
96
- * failure is one we haven't correctly handled.
97
- *
98
- * In otherwords allow the experience to be "restarted" for the user to try again
99
- */
100
- if (isErrorSLOFailure(error)) {
101
- if (experience.current !== experienceStatus) {
102
- experience.current = experienceStatus;
103
- }
104
- }
105
- } else {
91
+
92
+ /**
93
+ * Only consider the experience truly failed if the
94
+ * failure is one we haven't correctly handled.
95
+ *
96
+ * In otherwords allow the experience to be "restarted" for the user to try again
97
+ */
98
+ if (isErrorSLOFailure(error)) {
106
99
  if (experience.current !== experienceStatus) {
107
100
  experience.current = experienceStatus;
108
101
  }
@@ -18,21 +18,15 @@ export const ErrorBoundary = ({
18
18
  // eslint-disable-next-line react-hooks/rules-of-hooks
19
19
  useExperience() : null;
20
20
  const handleError = useCallback((error, info) => {
21
- var _window, _window$navigator, _window2, _window2$navigator, _info$componentStack;
21
+ var _window, _window$navigator;
22
22
  if (!getBooleanFF('platform.linking-platform.link-create.better-observability')) {
23
- if (getBooleanFF('platform.linking-platform.link-create.enable-sentry-client')) {
24
- // Capture exception to Sentry
25
- captureException(error, 'link-create');
26
- }
23
+ // Capture exception to Sentry
24
+ captureException(error, 'link-create');
27
25
  }
28
- createAnalyticsEvent(createEventPayload('operational.linkCreate.unhandledErrorCaught', getBooleanFF('platform.linking-platform.link-create.enable-sentry-client') ? {
26
+ createAnalyticsEvent(createEventPayload('operational.linkCreate.unhandledErrorCaught', {
29
27
  browserInfo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$navigator = _window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userAgent) || 'unknown',
30
28
  error: error.name,
31
29
  componentStack: 'unknown'
32
- } : {
33
- browserInfo: ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$navigator = _window2.navigator) === null || _window2$navigator === void 0 ? void 0 : _window2$navigator.userAgent) || 'unknown',
34
- error: error.toString(),
35
- componentStack: (_info$componentStack = info === null || info === void 0 ? void 0 : info.componentStack) !== null && _info$componentStack !== void 0 ? _info$componentStack : ''
36
30
  })).fire(ANALYTICS_CHANNEL);
37
31
  if (getBooleanFF('platform.linking-platform.link-create.better-observability')) {
38
32
  // Track experience as failed for SLO
@@ -23,7 +23,7 @@ const LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE
23
23
  }));
24
24
  export const PACKAGE_DATA = {
25
25
  packageName: "@atlaskit/link-create" || '',
26
- packageVersion: "1.15.2" || '',
26
+ packageVersion: "1.15.4" || '',
27
27
  component: COMPONENT_NAME,
28
28
  componentName: COMPONENT_NAME
29
29
  };
@@ -81,27 +81,20 @@ export var Experience = function Experience(_ref) {
81
81
  /**
82
82
  * Whether the failure should be involved when considering SLI/SLO
83
83
  */
84
- isSLOFailure: getBooleanFF('platform.linking-platform.link-create.slo-ignore-failed-fetch') ? isErrorSLOFailure(error) : true
84
+ isSLOFailure: isErrorSLOFailure(error)
85
85
  }, getNetworkFields(error)))).fire(ANALYTICS_CHANNEL);
86
86
  if (error instanceof Error) {
87
- if (getBooleanFF('platform.linking-platform.link-create.enable-sentry-client')) {
88
- // Capture exception to Sentry
89
- captureException(error, 'link-create');
90
- }
87
+ // Capture exception to Sentry
88
+ captureException(error, 'link-create');
91
89
  }
92
- if (getBooleanFF('platform.linking-platform.link-create.slo-ignore-failed-fetch')) {
93
- /**
94
- * Only consider the experience truly failed if the
95
- * failure is one we haven't correctly handled.
96
- *
97
- * In otherwords allow the experience to be "restarted" for the user to try again
98
- */
99
- if (isErrorSLOFailure(error)) {
100
- if (experience.current !== experienceStatus) {
101
- experience.current = experienceStatus;
102
- }
103
- }
104
- } else {
90
+
91
+ /**
92
+ * Only consider the experience truly failed if the
93
+ * failure is one we haven't correctly handled.
94
+ *
95
+ * In otherwords allow the experience to be "restarted" for the user to try again
96
+ */
97
+ if (isErrorSLOFailure(error)) {
105
98
  if (experience.current !== experienceStatus) {
106
99
  experience.current = experienceStatus;
107
100
  }
@@ -16,21 +16,15 @@ export var ErrorBoundary = function ErrorBoundary(_ref) {
16
16
  // eslint-disable-next-line react-hooks/rules-of-hooks
17
17
  useExperience() : null;
18
18
  var handleError = useCallback(function (error, info) {
19
- var _window, _window2, _info$componentStack;
19
+ var _window;
20
20
  if (!getBooleanFF('platform.linking-platform.link-create.better-observability')) {
21
- if (getBooleanFF('platform.linking-platform.link-create.enable-sentry-client')) {
22
- // Capture exception to Sentry
23
- captureException(error, 'link-create');
24
- }
21
+ // Capture exception to Sentry
22
+ captureException(error, 'link-create');
25
23
  }
26
- createAnalyticsEvent(createEventPayload('operational.linkCreate.unhandledErrorCaught', getBooleanFF('platform.linking-platform.link-create.enable-sentry-client') ? {
24
+ createAnalyticsEvent(createEventPayload('operational.linkCreate.unhandledErrorCaught', {
27
25
  browserInfo: ((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) || 'unknown',
28
26
  error: error.name,
29
27
  componentStack: 'unknown'
30
- } : {
31
- browserInfo: ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.userAgent) || 'unknown',
32
- error: error.toString(),
33
- componentStack: (_info$componentStack = info === null || info === void 0 ? void 0 : info.componentStack) !== null && _info$componentStack !== void 0 ? _info$componentStack : ''
34
28
  })).fire(ANALYTICS_CHANNEL);
35
29
  if (getBooleanFF('platform.linking-platform.link-create.better-observability')) {
36
30
  // Track experience as failed for SLO
@@ -23,7 +23,7 @@ var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__
23
23
  }));
24
24
  export var PACKAGE_DATA = {
25
25
  packageName: "@atlaskit/link-create" || '',
26
- packageVersion: "1.15.2" || '',
26
+ packageVersion: "1.15.4" || '',
27
27
  component: COMPONENT_NAME,
28
28
  componentName: COMPONENT_NAME
29
29
  };
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+
3
+ import { useIntl } from 'react-intl-next';
4
+
5
+ export const MockDisclaimer = () => {
6
+ const { locale } = useIntl();
7
+ const parentLocale = locale.split(/[-_]/)[0];
8
+ const disclaimer = 'This is a mocked plugin.';
9
+
10
+ if (parentLocale !== 'en') {
11
+ return (
12
+ <p>
13
+ {disclaimer} <small>{`(locale ${locale} not available)`}</small>
14
+ </p>
15
+ );
16
+ }
17
+
18
+ return <p>{disclaimer}</p>;
19
+ };
@@ -9,6 +9,8 @@ import {
9
9
  Validator,
10
10
  } from '../src';
11
11
 
12
+ import { MockDisclaimer } from './mock-disclaimer';
13
+
12
14
  interface pluginProps {
13
15
  shouldThrowError?: boolean;
14
16
  }
@@ -62,7 +64,7 @@ export function MockPluginForm({ shouldThrowError }: pluginProps) {
62
64
 
63
65
  return (
64
66
  <div>
65
- This is a mocked plugin.
67
+ <MockDisclaimer />
66
68
  <CreateForm<CreateFormProps<FormData>>
67
69
  onSubmit={mockHandleSubmit}
68
70
  onCancel={onCancel}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "1.15.2",
3
+ "version": "1.15.4",
4
4
  "description": "The driver component of meta creation flow",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -16,7 +16,8 @@
16
16
  ],
17
17
  "website": {
18
18
  "name": "LinkCreate"
19
- }
19
+ },
20
+ "i18n": true
20
21
  },
21
22
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
22
23
  "main": "dist/cjs/index.js",
@@ -38,19 +39,19 @@
38
39
  },
39
40
  "dependencies": {
40
41
  "@atlaskit/analytics-next": "^9.2.0",
41
- "@atlaskit/button": "^17.7.0",
42
+ "@atlaskit/button": "^17.8.0",
42
43
  "@atlaskit/empty-state": "^7.7.0",
43
- "@atlaskit/form": "^9.0.3",
44
+ "@atlaskit/form": "^9.1.0",
44
45
  "@atlaskit/icon": "^22.1.0",
45
46
  "@atlaskit/intl-messages-provider": "^1.0.2",
46
- "@atlaskit/linking-common": "^5.5.0",
47
+ "@atlaskit/linking-common": "^5.6.0",
47
48
  "@atlaskit/modal-dialog": "^12.10.0",
48
49
  "@atlaskit/platform-feature-flags": "^0.2.1",
49
- "@atlaskit/primitives": "^5.1.0",
50
- "@atlaskit/select": "^17.3.0",
50
+ "@atlaskit/primitives": "^5.5.0",
51
+ "@atlaskit/select": "^17.4.0",
51
52
  "@atlaskit/spinner": "^16.0.0",
52
53
  "@atlaskit/textfield": "^6.1.0",
53
- "@atlaskit/tokens": "^1.42.0",
54
+ "@atlaskit/tokens": "^1.43.0",
54
55
  "@babel/runtime": "^7.0.0",
55
56
  "@emotion/react": "^11.7.1",
56
57
  "debounce-promise": "^3.1.2",
@@ -64,7 +65,7 @@
64
65
  "devDependencies": {
65
66
  "@af/integration-testing": "*",
66
67
  "@af/visual-regression": "*",
67
- "@atlaskit/link-test-helpers": "^6.2.0",
68
+ "@atlaskit/link-test-helpers": "^7.0.0",
68
69
  "@atlaskit/visual-regression": "*",
69
70
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
70
71
  "@atlassian/feature-flags-test-utils": "*",
@@ -117,18 +118,12 @@
117
118
  },
118
119
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
119
120
  "platform-feature-flags": {
120
- "platform.linking-platform.link-create.enable-sentry-client": {
121
- "type": "boolean"
122
- },
123
121
  "platform.linking-platform.link-create.better-observability": {
124
122
  "type": "boolean"
125
123
  },
126
124
  "platform.linking-platform.link-create.tmp-log-error-message": {
127
125
  "type": "boolean"
128
126
  },
129
- "platform.linking-platform.link-create.slo-ignore-failed-fetch": {
130
- "type": "boolean"
131
- },
132
127
  "platform.linking-platform.link-create.enable-expected-field-errors": {
133
128
  "type": "boolean"
134
129
  }