@atlaskit/editor-synced-block-provider 2.13.0 → 2.13.1

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,12 @@
1
1
  # @atlaskit/editor-synced-block-provider
2
2
 
3
+ ## 2.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d04179e359d44`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d04179e359d44) -
8
+ EDITOR-2484 fix flush return on error
9
+
3
10
  ## 2.13.0
4
11
 
5
12
  ### Minor Changes
@@ -23,7 +23,7 @@ var generateBlockAri = exports.generateBlockAri = function generateBlockAri(sour
23
23
  };
24
24
 
25
25
  /**
26
- *
26
+ *
27
27
  * @param sourceAri - the ARI of the document. E.G ari:cloud:confluence:cloudId:page/pageId
28
28
  * @param resourceId - the resource ID of the reference synced block. E.G confluence-page/pageId/sourceResourceId
29
29
  * @returns the block ARI. E.G ari:cloud:blocks:<cloudId>:synced-block/<product>/<pageId>/<resourceId>
@@ -117,7 +117,7 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
117
117
  case 10:
118
118
  writeResults = _context.sent;
119
119
  if (!writeResults.every(function (result) {
120
- return result.resourceId !== undefined;
120
+ return !result.error;
121
121
  })) {
122
122
  _context.next = 15;
123
123
  break;
@@ -125,7 +125,7 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
125
125
  return _context.abrupt("return", true);
126
126
  case 15:
127
127
  writeResults.filter(function (result) {
128
- return result.resourceId === undefined;
128
+ return result.error;
129
129
  }).forEach(function (result) {
130
130
  var _this2$fireAnalyticsE;
131
131
  (_this2$fireAnalyticsE = _this2.fireAnalyticsEvent) === null || _this2$fireAnalyticsE === void 0 || _this2$fireAnalyticsE.call(_this2, (0, _errorHandling.updateErrorPayload)(result.error || 'Failed to write data'));
@@ -17,7 +17,7 @@ export const generateBlockAri = (sourceAri, resourceId, product) => {
17
17
  };
18
18
 
19
19
  /**
20
- *
20
+ *
21
21
  * @param sourceAri - the ARI of the document. E.G ari:cloud:confluence:cloudId:page/pageId
22
22
  * @param resourceId - the resource ID of the reference synced block. E.G confluence-page/pageId/sourceResourceId
23
23
  * @returns the block ARI. E.G ari:cloud:blocks:<cloudId>:synced-block/<product>/<pageId>/<resourceId>
@@ -83,10 +83,10 @@ export class SourceSyncBlockStoreManager {
83
83
  return Promise.resolve(true);
84
84
  }
85
85
  const writeResults = await this.dataProvider.writeNodesData(bodiedSyncBlockNodes, bodiedSyncBlockData);
86
- if (writeResults.every(result => result.resourceId !== undefined)) {
86
+ if (writeResults.every(result => !result.error)) {
87
87
  return true;
88
88
  } else {
89
- writeResults.filter(result => result.resourceId === undefined).forEach(result => {
89
+ writeResults.filter(result => result.error).forEach(result => {
90
90
  var _this$fireAnalyticsEv2;
91
91
  (_this$fireAnalyticsEv2 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv2 === void 0 ? void 0 : _this$fireAnalyticsEv2.call(this, updateErrorPayload(result.error || 'Failed to write data'));
92
92
  });
@@ -17,7 +17,7 @@ export var generateBlockAri = function generateBlockAri(sourceAri, resourceId, p
17
17
  };
18
18
 
19
19
  /**
20
- *
20
+ *
21
21
  * @param sourceAri - the ARI of the document. E.G ari:cloud:confluence:cloudId:page/pageId
22
22
  * @param resourceId - the resource ID of the reference synced block. E.G confluence-page/pageId/sourceResourceId
23
23
  * @returns the block ARI. E.G ari:cloud:blocks:<cloudId>:synced-block/<product>/<pageId>/<resourceId>
@@ -110,7 +110,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
110
110
  case 10:
111
111
  writeResults = _context.sent;
112
112
  if (!writeResults.every(function (result) {
113
- return result.resourceId !== undefined;
113
+ return !result.error;
114
114
  })) {
115
115
  _context.next = 15;
116
116
  break;
@@ -118,7 +118,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
118
118
  return _context.abrupt("return", true);
119
119
  case 15:
120
120
  writeResults.filter(function (result) {
121
- return result.resourceId === undefined;
121
+ return result.error;
122
122
  }).forEach(function (result) {
123
123
  var _this2$fireAnalyticsE;
124
124
  (_this2$fireAnalyticsE = _this2.fireAnalyticsEvent) === null || _this2$fireAnalyticsE === void 0 || _this2$fireAnalyticsE.call(_this2, updateErrorPayload(result.error || 'Failed to write data'));
@@ -1,4 +1,4 @@
1
- import { type SyncBlockProduct } from "../../common/types";
1
+ import { type SyncBlockProduct } from '../../common/types';
2
2
  /**
3
3
  * Generates the block ARI from the source page ARI and the source block's resource ID.
4
4
  * @param sourceAri - the ARI of the document. E.G ari:cloud:confluence:cloudId:page/pageId
@@ -1,4 +1,4 @@
1
- import { type SyncBlockProduct } from "../../common/types";
1
+ import { type SyncBlockProduct } from '../../common/types';
2
2
  /**
3
3
  * Generates the block ARI from the source page ARI and the source block's resource ID.
4
4
  * @param sourceAri - the ARI of the document. E.G ari:cloud:confluence:cloudId:page/pageId
package/package.json CHANGED
@@ -77,7 +77,7 @@
77
77
  }
78
78
  },
79
79
  "name": "@atlaskit/editor-synced-block-provider",
80
- "version": "2.13.0",
80
+ "version": "2.13.1",
81
81
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
82
82
  "author": "Atlassian Pty Ltd",
83
83
  "license": "Apache-2.0",