@atlaskit/editor-plugin-synced-block 6.0.40 → 6.0.41

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,15 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 6.0.41
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5421779d09855`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5421779d09855) -
8
+ [ux] Fix error state shown in the locations dropdown on a reference sync block when no references
9
+ are registered yet. When the block hasn't been saved, the dropdown now shows the source page and
10
+ the current page instead of an error. An 'Untitled' placeholder is shown when a page has no title.
11
+ - Updated dependencies
12
+
3
13
  ## 6.0.40
4
14
 
5
15
  ### Patch Changes
@@ -31,6 +31,7 @@ var _quotationMark = _interopRequireDefault(require("@atlaskit/icon/core/quotati
31
31
  var _statusError = _interopRequireDefault(require("@atlaskit/icon/core/status-error"));
32
32
  var _logo = require("@atlaskit/logo");
33
33
  var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
34
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
34
35
  var _compiled = require("@atlaskit/primitives/compiled");
35
36
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
36
37
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
@@ -156,7 +157,7 @@ var processReferenceData = exports.processReferenceData = function processRefere
156
157
  var references = _step.value;
157
158
  if (references.length > 1) {
158
159
  references.forEach(function (reference, index) {
159
- return reference.title = "".concat(reference.title, ": ").concat(formatMessage(_messages.syncBlockMessages.syncedLocationDropdownTitleBlockIndex, {
160
+ return reference.title = "".concat(reference.title === '' && reference.hasAccess && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_8') ? formatMessage(_messages.syncBlockMessages.syncedLocationDropdownUntitledPage) : reference.title, ": ").concat(formatMessage(_messages.syncBlockMessages.syncedLocationDropdownTitleBlockIndex, {
160
161
  index: index + 1
161
162
  }));
162
163
  });
@@ -306,11 +307,12 @@ var DropdownContent = function DropdownContent(_ref7) {
306
307
  count: "".concat(referenceData.length > 99 ? '99+' : referenceData.length)
307
308
  })
308
309
  }, referenceData.map(function (reference) {
310
+ var title = reference.title === '' && reference.hasAccess && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_8') ? formatMessage(_messages.syncBlockMessages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
309
311
  return /*#__PURE__*/React.createElement("div", {
310
312
  key: reference.title,
311
313
  className: (0, _runtime.ax)(["_2ll012x7"])
312
314
  }, /*#__PURE__*/React.createElement(_tooltip.default, {
313
- content: reference.title || reference.url || ''
315
+ content: title
314
316
  }, /*#__PURE__*/React.createElement(_dropdownMenu.DropdownItem, {
315
317
  elemBefore: /*#__PURE__*/React.createElement(ItemIcon, {
316
318
  reference: reference
@@ -325,7 +327,7 @@ var DropdownContent = function DropdownContent(_ref7) {
325
327
  return handleLocationClick();
326
328
  }
327
329
  }, /*#__PURE__*/React.createElement(ItemTitle, {
328
- title: reference.title || reference.url || '',
330
+ title: title,
329
331
  formatMessage: formatMessage,
330
332
  onSameDocument: reference.onSameDocument,
331
333
  isSource: reference.isSource,
@@ -19,6 +19,7 @@ import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
19
19
  import StatusErrorIcon from '@atlaskit/icon/core/status-error';
20
20
  import { ConfluenceIcon, JiraIcon, AtlassianIcon } from '@atlaskit/logo';
21
21
  import Lozenge from '@atlaskit/lozenge';
22
+ import { fg } from '@atlaskit/platform-feature-flags';
22
23
  import { Box, Text, Inline, Anchor, Stack } from '@atlaskit/primitives/compiled';
23
24
  import Spinner from '@atlaskit/spinner';
24
25
  import Tooltip from '@atlaskit/tooltip';
@@ -142,7 +143,7 @@ export const processReferenceData = (referenceData, intl) => {
142
143
  });
143
144
  for (const references of sourceInfoMap.values()) {
144
145
  if (references.length > 1) {
145
- references.forEach((reference, index) => reference.title = `${reference.title}: ${formatMessage(messages.syncedLocationDropdownTitleBlockIndex, {
146
+ references.forEach((reference, index) => reference.title = `${reference.title === '' && reference.hasAccess && fg('platform_synced_block_patch_8') ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title}: ${formatMessage(messages.syncedLocationDropdownTitleBlockIndex, {
146
147
  index: index + 1
147
148
  })}`);
148
149
  }
@@ -260,30 +261,33 @@ const DropdownContent = ({
260
261
  title: formatMessage(messages.syncedLocationDropdownHeading, {
261
262
  count: `${referenceData.length > 99 ? '99+' : referenceData.length}`
262
263
  })
263
- }, referenceData.map(reference => /*#__PURE__*/React.createElement("div", {
264
- key: reference.title,
265
- className: ax(["_2ll012x7"])
266
- }, /*#__PURE__*/React.createElement(Tooltip, {
267
- content: reference.title || reference.url || ''
268
- }, /*#__PURE__*/React.createElement(DropdownItem, {
269
- elemBefore: /*#__PURE__*/React.createElement(ItemIcon, {
270
- reference: reference
271
- }),
272
- href: reference.url,
273
- target: "_blank",
274
- key: reference.title,
275
- rel: "noopener noreferrer"
276
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
277
- ,
278
- onClick: () => handleLocationClick()
279
- }, /*#__PURE__*/React.createElement(ItemTitle, {
280
- title: reference.title || reference.url || '',
281
- formatMessage: formatMessage,
282
- onSameDocument: reference.onSameDocument,
283
- isSource: reference.isSource,
284
- hasAccess: reference.hasAccess,
285
- productType: reference.productType
286
- })))))));
264
+ }, referenceData.map(reference => {
265
+ const title = reference.title === '' && reference.hasAccess && fg('platform_synced_block_patch_8') ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
266
+ return /*#__PURE__*/React.createElement("div", {
267
+ key: reference.title,
268
+ className: ax(["_2ll012x7"])
269
+ }, /*#__PURE__*/React.createElement(Tooltip, {
270
+ content: title
271
+ }, /*#__PURE__*/React.createElement(DropdownItem, {
272
+ elemBefore: /*#__PURE__*/React.createElement(ItemIcon, {
273
+ reference: reference
274
+ }),
275
+ href: reference.url,
276
+ target: "_blank",
277
+ key: reference.title,
278
+ rel: "noopener noreferrer"
279
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
280
+ ,
281
+ onClick: () => handleLocationClick()
282
+ }, /*#__PURE__*/React.createElement(ItemTitle, {
283
+ title: title,
284
+ formatMessage: formatMessage,
285
+ onSameDocument: reference.onSameDocument,
286
+ isSource: reference.isSource,
287
+ hasAccess: reference.hasAccess,
288
+ productType: reference.productType
289
+ }))));
290
+ })));
287
291
  } else {
288
292
  return /*#__PURE__*/React.createElement(NoResultScreen, {
289
293
  formatMessage: formatMessage
@@ -27,6 +27,7 @@ import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
27
27
  import StatusErrorIcon from '@atlaskit/icon/core/status-error';
28
28
  import { ConfluenceIcon, JiraIcon, AtlassianIcon } from '@atlaskit/logo';
29
29
  import Lozenge from '@atlaskit/lozenge';
30
+ import { fg } from '@atlaskit/platform-feature-flags';
30
31
  import { Box, Text, Inline, Anchor, Stack } from '@atlaskit/primitives/compiled';
31
32
  import Spinner from '@atlaskit/spinner';
32
33
  import Tooltip from '@atlaskit/tooltip';
@@ -147,7 +148,7 @@ export var processReferenceData = function processReferenceData(referenceData, i
147
148
  var references = _step.value;
148
149
  if (references.length > 1) {
149
150
  references.forEach(function (reference, index) {
150
- return reference.title = "".concat(reference.title, ": ").concat(formatMessage(messages.syncedLocationDropdownTitleBlockIndex, {
151
+ return reference.title = "".concat(reference.title === '' && reference.hasAccess && fg('platform_synced_block_patch_8') ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title, ": ").concat(formatMessage(messages.syncedLocationDropdownTitleBlockIndex, {
151
152
  index: index + 1
152
153
  }));
153
154
  });
@@ -297,11 +298,12 @@ var DropdownContent = function DropdownContent(_ref7) {
297
298
  count: "".concat(referenceData.length > 99 ? '99+' : referenceData.length)
298
299
  })
299
300
  }, referenceData.map(function (reference) {
301
+ var title = reference.title === '' && reference.hasAccess && fg('platform_synced_block_patch_8') ? formatMessage(messages.syncedLocationDropdownUntitledPage) : reference.title || reference.url || '';
300
302
  return /*#__PURE__*/React.createElement("div", {
301
303
  key: reference.title,
302
304
  className: ax(["_2ll012x7"])
303
305
  }, /*#__PURE__*/React.createElement(Tooltip, {
304
- content: reference.title || reference.url || ''
306
+ content: title
305
307
  }, /*#__PURE__*/React.createElement(DropdownItem, {
306
308
  elemBefore: /*#__PURE__*/React.createElement(ItemIcon, {
307
309
  reference: reference
@@ -316,7 +318,7 @@ var DropdownContent = function DropdownContent(_ref7) {
316
318
  return handleLocationClick();
317
319
  }
318
320
  }, /*#__PURE__*/React.createElement(ItemTitle, {
319
- title: reference.title || reference.url || '',
321
+ title: title,
320
322
  formatMessage: formatMessage,
321
323
  onSameDocument: reference.onSameDocument,
322
324
  isSource: reference.isSource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "6.0.40",
3
+ "version": "6.0.41",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/editor-plugin-user-intent": "^6.0.0",
44
44
  "@atlaskit/editor-prosemirror": "^7.3.0",
45
45
  "@atlaskit/editor-shared-styles": "^3.10.0",
46
- "@atlaskit/editor-synced-block-provider": "^4.2.0",
46
+ "@atlaskit/editor-synced-block-provider": "^4.3.0",
47
47
  "@atlaskit/editor-toolbar": "^0.20.0",
48
48
  "@atlaskit/flag": "^17.9.0",
49
49
  "@atlaskit/icon": "34.0.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/platform-feature-flags": "^1.1.0",
55
55
  "@atlaskit/primitives": "^18.1.0",
56
56
  "@atlaskit/spinner": "19.0.13",
57
- "@atlaskit/tmp-editor-statsig": "^53.0.0",
57
+ "@atlaskit/tmp-editor-statsig": "^53.1.0",
58
58
  "@atlaskit/tokens": "11.4.2",
59
59
  "@atlaskit/tooltip": "^21.1.0",
60
60
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -65,7 +65,7 @@
65
65
  "react-intl-next": "npm:react-intl@^5.18.1"
66
66
  },
67
67
  "peerDependencies": {
68
- "@atlaskit/editor-common": "^112.15.0",
68
+ "@atlaskit/editor-common": "^112.16.0",
69
69
  "react": "^18.2.0"
70
70
  },
71
71
  "devDependencies": {