@atlaskit/editor-card-provider 6.2.1 → 6.2.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/editor-card-provider
2
2
 
3
+ ## 6.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`da38c8bc48aed`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/da38c8bc48aed) -
8
+ Correct how experiment value is read. Fixing problem where exposure for an experiment is not sent
9
+ for one of the variants
10
+
3
11
  ## 6.2.1
4
12
 
5
13
  ### Patch Changes
@@ -18,7 +18,6 @@ var _setPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/se
18
18
  var _linkExtractors = require("@atlaskit/link-extractors");
19
19
  var _nodeDataProvider = require("@atlaskit/node-data-provider");
20
20
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
21
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
22
21
  var _linkingCommon = require("@atlaskit/linking-common");
23
22
  var _dataloader = _interopRequireDefault(require("dataloader"));
24
23
  var _transformer = require("./transformer");
@@ -487,10 +486,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_re
487
486
  value: function getHardCodedAppearance(url) {
488
487
  // Replace directly with isJiraPlan(url) on cleanup
489
488
  var isJiraPlanEvaluated = isJiraPlan(url);
490
- var isJiraFormEvaluated;
491
- if ((0, _platformFeatureFlags.fg)('smartlink_jira_software_form')) {
492
- isJiraFormEvaluated = isJiraForm(url);
493
- }
489
+ var isJiraFormEvaluated = isJiraForm(url);
494
490
  var isJiraSummaryEvaluated = isJiraSummary(url);
495
491
  var isConfluenceTeamCalendarsEvaluated;
496
492
  if ((0, _platformFeatureFlags.fg)('tc_smart_link_embed_view')) {
@@ -673,7 +669,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_re
673
669
  key: "resolve",
674
670
  value: function () {
675
671
  var _resolve = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
676
- var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, data, issueAri, _this$onResolve, isSupported, providerDefaultAppearance, isEmbedFriendlyLocationEvaluated, preferredAppearance, canItBeEmbed, datasource, id, parameters, isUnauthPasteAsBlockCardEnabledNoExposure, authStatus, access, isUnauthPasteAsBlockCardEnabled;
672
+ var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, data, issueAri, _this$onResolve, isSupported, providerDefaultAppearance, isEmbedFriendlyLocationEvaluated, preferredAppearance, canItBeEmbed, datasource, id, parameters, authStatus, access, isUnauthPasteAsBlockCardEnabled;
677
673
  return _regenerator.default.wrap(function _callee11$(_context11) {
678
674
  while (1) switch (_context11.prev = _context11.next) {
679
675
  case 0:
@@ -729,7 +725,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_re
729
725
  case 23:
730
726
  isSupported = _context11.t0;
731
727
  if (!isSupported) {
732
- _context11.next = 51;
728
+ _context11.next = 50;
733
729
  break;
734
730
  }
735
731
  providerDefaultAppearance = matchedProviderPattern === null || matchedProviderPattern === void 0 ? void 0 : matchedProviderPattern.defaultView;
@@ -778,47 +774,46 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_re
778
774
  }]
779
775
  }, url));
780
776
  case 39:
781
- isUnauthPasteAsBlockCardEnabledNoExposure = !(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_sl_3p_unauth_paste_as_block_card', 'cohort', 'control', 'control');
782
- if (!(isUnauthPasteAsBlockCardEnabledNoExposure && isEmbedFriendlyLocationEvaluated && !userPreference)) {
783
- _context11.next = 50;
777
+ if (!(isEmbedFriendlyLocationEvaluated && !userPreference && (0, _platformFeatureFlags.fg)('platform_sl_3p_unauth_experiment_gate'))) {
778
+ _context11.next = 49;
784
779
  break;
785
780
  }
786
- _context11.next = 43;
781
+ _context11.next = 42;
787
782
  return this.getAuthStatusFromResolveResponse(url);
788
- case 43:
783
+ case 42:
789
784
  authStatus = _context11.sent;
790
785
  if (!authStatus) {
791
- _context11.next = 50;
786
+ _context11.next = 49;
792
787
  break;
793
788
  }
794
789
  access = authStatus.access;
795
790
  if (!(access === 'unauthorized')) {
796
- _context11.next = 50;
791
+ _context11.next = 49;
797
792
  break;
798
793
  }
799
794
  isUnauthPasteAsBlockCardEnabled = !(0, _expValEquals.expValEquals)('platform_sl_3p_unauth_paste_as_block_card', 'cohort', 'control', 'control');
800
795
  if (!isUnauthPasteAsBlockCardEnabled) {
801
- _context11.next = 50;
796
+ _context11.next = 49;
802
797
  break;
803
798
  }
804
799
  return _context11.abrupt("return", this.transformer.toSmartlinkAdf(url, 'block'));
805
- case 50:
800
+ case 49:
806
801
  return _context11.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
807
- case 51:
808
- _context11.next = 56;
802
+ case 50:
803
+ _context11.next = 55;
809
804
  break;
810
- case 53:
811
- _context11.prev = 53;
805
+ case 52:
806
+ _context11.prev = 52;
812
807
  _context11.t1 = _context11["catch"](0);
813
808
  // eslint-disable-next-line
814
809
  console.warn("Error when trying to check Smart Card url \"".concat(url, "\"").concat(_context11.t1 instanceof Error ? " - ".concat(_context11.t1.name, " ").concat(_context11.t1.message) : ''), _context11.t1);
815
- case 56:
810
+ case 55:
816
811
  return _context11.abrupt("return", Promise.reject(undefined));
817
- case 57:
812
+ case 56:
818
813
  case "end":
819
814
  return _context11.stop();
820
815
  }
821
- }, _callee11, this, [[0, 53]]);
816
+ }, _callee11, this, [[0, 52]]);
822
817
  }));
823
818
  function resolve(_x1, _x10, _x11, _x12) {
824
819
  return _resolve.apply(this, arguments);
@@ -3,7 +3,6 @@
3
3
  import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
4
4
  import { NodeDataProvider } from '@atlaskit/node-data-provider';
5
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
7
6
  import { getStatus, getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
8
7
  import DataLoader from 'dataloader';
9
8
  import { Transformer } from './transformer';
@@ -208,10 +207,7 @@ export class EditorCardProvider extends NodeDataProvider {
208
207
  getHardCodedAppearance(url) {
209
208
  // Replace directly with isJiraPlan(url) on cleanup
210
209
  const isJiraPlanEvaluated = isJiraPlan(url);
211
- let isJiraFormEvaluated;
212
- if (fg('smartlink_jira_software_form')) {
213
- isJiraFormEvaluated = isJiraForm(url);
214
- }
210
+ const isJiraFormEvaluated = isJiraForm(url);
215
211
  const isJiraSummaryEvaluated = isJiraSummary(url);
216
212
  let isConfluenceTeamCalendarsEvaluated;
217
213
  if (fg('tc_smart_link_embed_view')) {
@@ -360,8 +356,7 @@ export class EditorCardProvider extends NodeDataProvider {
360
356
  }]
361
357
  }, url);
362
358
  }
363
- const isUnauthPasteAsBlockCardEnabledNoExposure = !expValEqualsNoExposure('platform_sl_3p_unauth_paste_as_block_card', 'cohort', 'control', 'control');
364
- if (isUnauthPasteAsBlockCardEnabledNoExposure && isEmbedFriendlyLocationEvaluated && !userPreference) {
359
+ if (isEmbedFriendlyLocationEvaluated && !userPreference && fg('platform_sl_3p_unauth_experiment_gate')) {
365
360
  const authStatus = await this.getAuthStatusFromResolveResponse(url);
366
361
  if (authStatus) {
367
362
  const {
@@ -16,7 +16,6 @@ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new B
16
16
  import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
17
17
  import { NodeDataProvider } from '@atlaskit/node-data-provider';
18
18
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
20
19
  import { getStatus, getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
21
20
  import DataLoader from 'dataloader';
22
21
  import { Transformer } from './transformer';
@@ -482,10 +481,7 @@ export var EditorCardProvider = /*#__PURE__*/function (_ref) {
482
481
  value: function getHardCodedAppearance(url) {
483
482
  // Replace directly with isJiraPlan(url) on cleanup
484
483
  var isJiraPlanEvaluated = isJiraPlan(url);
485
- var isJiraFormEvaluated;
486
- if (fg('smartlink_jira_software_form')) {
487
- isJiraFormEvaluated = isJiraForm(url);
488
- }
484
+ var isJiraFormEvaluated = isJiraForm(url);
489
485
  var isJiraSummaryEvaluated = isJiraSummary(url);
490
486
  var isConfluenceTeamCalendarsEvaluated;
491
487
  if (fg('tc_smart_link_embed_view')) {
@@ -668,7 +664,7 @@ export var EditorCardProvider = /*#__PURE__*/function (_ref) {
668
664
  key: "resolve",
669
665
  value: function () {
670
666
  var _resolve = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
671
- var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, data, issueAri, _this$onResolve, isSupported, providerDefaultAppearance, isEmbedFriendlyLocationEvaluated, preferredAppearance, canItBeEmbed, datasource, id, parameters, isUnauthPasteAsBlockCardEnabledNoExposure, authStatus, access, isUnauthPasteAsBlockCardEnabled;
667
+ var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, data, issueAri, _this$onResolve, isSupported, providerDefaultAppearance, isEmbedFriendlyLocationEvaluated, preferredAppearance, canItBeEmbed, datasource, id, parameters, authStatus, access, isUnauthPasteAsBlockCardEnabled;
672
668
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
673
669
  while (1) switch (_context11.prev = _context11.next) {
674
670
  case 0:
@@ -724,7 +720,7 @@ export var EditorCardProvider = /*#__PURE__*/function (_ref) {
724
720
  case 23:
725
721
  isSupported = _context11.t0;
726
722
  if (!isSupported) {
727
- _context11.next = 51;
723
+ _context11.next = 50;
728
724
  break;
729
725
  }
730
726
  providerDefaultAppearance = matchedProviderPattern === null || matchedProviderPattern === void 0 ? void 0 : matchedProviderPattern.defaultView;
@@ -773,47 +769,46 @@ export var EditorCardProvider = /*#__PURE__*/function (_ref) {
773
769
  }]
774
770
  }, url));
775
771
  case 39:
776
- isUnauthPasteAsBlockCardEnabledNoExposure = !expValEqualsNoExposure('platform_sl_3p_unauth_paste_as_block_card', 'cohort', 'control', 'control');
777
- if (!(isUnauthPasteAsBlockCardEnabledNoExposure && isEmbedFriendlyLocationEvaluated && !userPreference)) {
778
- _context11.next = 50;
772
+ if (!(isEmbedFriendlyLocationEvaluated && !userPreference && fg('platform_sl_3p_unauth_experiment_gate'))) {
773
+ _context11.next = 49;
779
774
  break;
780
775
  }
781
- _context11.next = 43;
776
+ _context11.next = 42;
782
777
  return this.getAuthStatusFromResolveResponse(url);
783
- case 43:
778
+ case 42:
784
779
  authStatus = _context11.sent;
785
780
  if (!authStatus) {
786
- _context11.next = 50;
781
+ _context11.next = 49;
787
782
  break;
788
783
  }
789
784
  access = authStatus.access;
790
785
  if (!(access === 'unauthorized')) {
791
- _context11.next = 50;
786
+ _context11.next = 49;
792
787
  break;
793
788
  }
794
789
  isUnauthPasteAsBlockCardEnabled = !expValEquals('platform_sl_3p_unauth_paste_as_block_card', 'cohort', 'control', 'control');
795
790
  if (!isUnauthPasteAsBlockCardEnabled) {
796
- _context11.next = 50;
791
+ _context11.next = 49;
797
792
  break;
798
793
  }
799
794
  return _context11.abrupt("return", this.transformer.toSmartlinkAdf(url, 'block'));
800
- case 50:
795
+ case 49:
801
796
  return _context11.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
802
- case 51:
803
- _context11.next = 56;
797
+ case 50:
798
+ _context11.next = 55;
804
799
  break;
805
- case 53:
806
- _context11.prev = 53;
800
+ case 52:
801
+ _context11.prev = 52;
807
802
  _context11.t1 = _context11["catch"](0);
808
803
  // eslint-disable-next-line
809
804
  console.warn("Error when trying to check Smart Card url \"".concat(url, "\"").concat(_context11.t1 instanceof Error ? " - ".concat(_context11.t1.name, " ").concat(_context11.t1.message) : ''), _context11.t1);
810
- case 56:
805
+ case 55:
811
806
  return _context11.abrupt("return", Promise.reject(undefined));
812
- case 57:
807
+ case 56:
813
808
  case "end":
814
809
  return _context11.stop();
815
810
  }
816
- }, _callee11, this, [[0, 53]]);
811
+ }, _callee11, this, [[0, 52]]);
817
812
  }));
818
813
  function resolve(_x1, _x10, _x11, _x12) {
819
814
  return _resolve.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "6.2.1",
3
+ "version": "6.2.2",
4
4
  "description": "Contains the EditorCardProvider, for determining smart card behaviour in the editor.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/linking-types": "^14.2.0",
39
39
  "@atlaskit/node-data-provider": "^7.5.0",
40
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
41
- "@atlaskit/tmp-editor-statsig": "^15.0.0",
41
+ "@atlaskit/tmp-editor-statsig": "^15.7.0",
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "dataloader": "^2.1.0"
44
44
  },
@@ -50,15 +50,15 @@
50
50
  "@atlassian/feature-flags-test-utils": "^1.0.0"
51
51
  },
52
52
  "platform-feature-flags": {
53
- "smartlink_jira_software_form": {
54
- "type": "boolean"
55
- },
56
53
  "tc_smart_link_embed_view": {
57
54
  "type": "boolean"
58
55
  },
59
56
  "issue-link-suggestions-in-comments": {
60
57
  "type": "boolean"
61
58
  },
59
+ "platform_sl_3p_unauth_experiment_gate": {
60
+ "type": "boolean"
61
+ },
62
62
  "avp_unfurl_shared_charts_embed_by_default_2": {
63
63
  "type": "boolean"
64
64
  }