@atlaskit/smart-card 35.0.3 → 35.1.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,25 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 35.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 35.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#116662](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/116662)
14
+ [`323ed1cdbef54`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/323ed1cdbef54) -
15
+ Remove linking_platform_show_lozenge_atlassian_state flag
16
+
17
+ ### Patch Changes
18
+
19
+ - [#119127](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/119127)
20
+ [`3b91cbd29a8b9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b91cbd29a8b9) -
21
+ Exclude UnsupportedError unresolved events from FE reliability SLO
22
+
3
23
  ## 35.0.3
4
24
 
5
25
  ### Patch Changes
@@ -5,61 +5,29 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.extractLozenge = void 0;
7
7
  var _linkExtractors = require("@atlaskit/link-extractors");
8
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
8
  var _extractState = require("./extractState");
10
9
  var _extractTag = require("./extractTag");
11
10
  var _extractTaskStatus = require("./extractTaskStatus");
12
11
  var _extractTaskType = require("./extractTaskType");
13
- var DOC_TYPES = ['schema:BlogPosting', 'schema:TextDigitalDocument', 'schema:DigitalDocument', 'schema:PresentationDigitalDocument', 'schema:SpreadsheetDigitalDocument'];
14
12
  var extractLozenge = exports.extractLozenge = function extractLozenge(jsonLd) {
15
13
  var type = (0, _linkExtractors.extractType)(jsonLd);
16
14
  if (type) {
17
- if ((0, _platformFeatureFlags.fg)('linking_platform_show_lozenge_atlassian_state')) {
18
- if (type.includes('atlassian:Task')) {
19
- var jsonLdTask = jsonLd;
20
- var lozengeFromTag = (0, _extractTag.extractTag)(jsonLdTask);
21
- var lozengeFromStatus = (0, _extractTaskStatus.extractTaskStatus)(jsonLdTask);
22
- var lozengeFromTaskType = extractLozengeFromTaskType(jsonLdTask);
23
- return lozengeFromTag || lozengeFromStatus || lozengeFromTaskType;
24
- }
25
- if (type.includes('atlassian:UndefinedLink')) {
26
- return {
27
- text: 'UNDEFINED',
28
- appearance: 'inprogress'
29
- };
30
- }
31
-
32
- // casting it because `extractState` can safely handle missing properties
33
- return (0, _extractState.extractState)(jsonLd);
15
+ if (type.includes('atlassian:Task')) {
16
+ var jsonLdTask = jsonLd;
17
+ var lozengeFromTag = (0, _extractTag.extractTag)(jsonLdTask);
18
+ var lozengeFromStatus = (0, _extractTaskStatus.extractTaskStatus)(jsonLdTask);
19
+ var lozengeFromTaskType = extractLozengeFromTaskType(jsonLdTask);
20
+ return lozengeFromTag || lozengeFromStatus || lozengeFromTaskType;
34
21
  }
35
- if (type.includes('atlassian:SourceCodePullRequest')) {
36
- return (0, _extractState.extractState)(jsonLd);
37
- } else if (type.includes('atlassian:Task')) {
38
- var _jsonLdTask = jsonLd;
39
- var _lozengeFromTag = (0, _extractTag.extractTag)(_jsonLdTask);
40
- var _lozengeFromStatus = (0, _extractTaskStatus.extractTaskStatus)(_jsonLdTask);
41
- var _lozengeFromTaskType = extractLozengeFromTaskType(_jsonLdTask);
42
- return _lozengeFromTag || _lozengeFromStatus || _lozengeFromTaskType;
43
- } else if (type.some(function (types) {
44
- return DOC_TYPES.includes(types);
45
- })) {
46
- var jsonLdDocument = jsonLd;
47
- var lozengeFromState = (0, _extractState.extractState)(jsonLdDocument);
48
- return lozengeFromState;
49
- } else if (type.includes('atlassian:Goal')) {
50
- var jsonLdProject = jsonLd;
51
- var _lozengeFromState = (0, _extractState.extractState)(jsonLdProject);
52
- return _lozengeFromState;
53
- } else if (type.includes('atlassian:Project')) {
54
- var _jsonLdProject = jsonLd;
55
- var _lozengeFromState2 = (0, _extractState.extractState)(_jsonLdProject);
56
- return _lozengeFromState2;
57
- } else if (type.includes('atlassian:UndefinedLink')) {
22
+ if (type.includes('atlassian:UndefinedLink')) {
58
23
  return {
59
24
  text: 'UNDEFINED',
60
25
  appearance: 'inprogress'
61
26
  };
62
27
  }
28
+
29
+ // casting it because `extractState` can safely handle missing properties
30
+ return (0, _extractState.extractState)(jsonLd);
63
31
  }
64
32
  };
65
33
  var extractLozengeFromTaskType = function extractLozengeFromTaskType(jsonLdTask) {
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "35.0.3"
14
+ packageVersion: "35.1.1"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -118,7 +118,7 @@ function Component(_ref) {
118
118
  (0, _react.useEffect)(function () {
119
119
  measure.mark(id, state.status);
120
120
  if (state.status !== 'pending' && state.status !== 'resolving') {
121
- var _state$error;
121
+ var _state$error, _state$error2;
122
122
  measure.create(id, state.status);
123
123
  if (state.status === 'resolved') {
124
124
  var _measure$getMeasure$d, _measure$getMeasure;
@@ -126,7 +126,7 @@ function Component(_ref) {
126
126
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
127
127
  duration: (_measure$getMeasure$d = (_measure$getMeasure = measure.getMeasure(id, state.status)) === null || _measure$getMeasure === void 0 ? void 0 : _measure$getMeasure.duration) !== null && _measure$getMeasure$d !== void 0 ? _measure$getMeasure$d : null
128
128
  });
129
- } else if (((_state$error = state.error) === null || _state$error === void 0 ? void 0 : _state$error.type) !== 'ResolveUnsupportedError') {
129
+ } else if (((_state$error = state.error) === null || _state$error === void 0 ? void 0 : _state$error.type) !== 'ResolveUnsupportedError' && ((_state$error2 = state.error) === null || _state$error2 === void 0 ? void 0 : _state$error2.type) !== 'UnsupportedError') {
130
130
  fireEvent('operational.smartLink.unresolved', {
131
131
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
132
132
  reason: state.status,
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
20
20
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
21
21
  var PACKAGE_DATA = {
22
22
  packageName: "@atlaskit/smart-card",
23
- packageVersion: "35.0.3",
23
+ packageVersion: "35.1.1",
24
24
  componentName: 'linkUrl'
25
25
  };
26
26
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -1,57 +1,27 @@
1
1
  import { extractType } from '@atlaskit/link-extractors';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { extractState } from './extractState';
4
3
  import { extractTag } from './extractTag';
5
4
  import { extractTaskStatus } from './extractTaskStatus';
6
5
  import { extractTaskType } from './extractTaskType';
7
- const DOC_TYPES = ['schema:BlogPosting', 'schema:TextDigitalDocument', 'schema:DigitalDocument', 'schema:PresentationDigitalDocument', 'schema:SpreadsheetDigitalDocument'];
8
6
  export const extractLozenge = jsonLd => {
9
7
  const type = extractType(jsonLd);
10
8
  if (type) {
11
- if (fg('linking_platform_show_lozenge_atlassian_state')) {
12
- if (type.includes('atlassian:Task')) {
13
- const jsonLdTask = jsonLd;
14
- const lozengeFromTag = extractTag(jsonLdTask);
15
- const lozengeFromStatus = extractTaskStatus(jsonLdTask);
16
- const lozengeFromTaskType = extractLozengeFromTaskType(jsonLdTask);
17
- return lozengeFromTag || lozengeFromStatus || lozengeFromTaskType;
18
- }
19
- if (type.includes('atlassian:UndefinedLink')) {
20
- return {
21
- text: 'UNDEFINED',
22
- appearance: 'inprogress'
23
- };
24
- }
25
-
26
- // casting it because `extractState` can safely handle missing properties
27
- return extractState(jsonLd);
28
- }
29
- if (type.includes('atlassian:SourceCodePullRequest')) {
30
- return extractState(jsonLd);
31
- } else if (type.includes('atlassian:Task')) {
9
+ if (type.includes('atlassian:Task')) {
32
10
  const jsonLdTask = jsonLd;
33
11
  const lozengeFromTag = extractTag(jsonLdTask);
34
12
  const lozengeFromStatus = extractTaskStatus(jsonLdTask);
35
13
  const lozengeFromTaskType = extractLozengeFromTaskType(jsonLdTask);
36
14
  return lozengeFromTag || lozengeFromStatus || lozengeFromTaskType;
37
- } else if (type.some(types => DOC_TYPES.includes(types))) {
38
- const jsonLdDocument = jsonLd;
39
- const lozengeFromState = extractState(jsonLdDocument);
40
- return lozengeFromState;
41
- } else if (type.includes('atlassian:Goal')) {
42
- const jsonLdProject = jsonLd;
43
- const lozengeFromState = extractState(jsonLdProject);
44
- return lozengeFromState;
45
- } else if (type.includes('atlassian:Project')) {
46
- const jsonLdProject = jsonLd;
47
- const lozengeFromState = extractState(jsonLdProject);
48
- return lozengeFromState;
49
- } else if (type.includes('atlassian:UndefinedLink')) {
15
+ }
16
+ if (type.includes('atlassian:UndefinedLink')) {
50
17
  return {
51
18
  text: 'UNDEFINED',
52
19
  appearance: 'inprogress'
53
20
  };
54
21
  }
22
+
23
+ // casting it because `extractState` can safely handle missing properties
24
+ return extractState(jsonLd);
55
25
  }
56
26
  };
57
27
  const extractLozengeFromTaskType = jsonLdTask => {
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card",
5
- packageVersion: "35.0.3"
5
+ packageVersion: "35.1.1"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -106,7 +106,7 @@ function Component({
106
106
  useEffect(() => {
107
107
  measure.mark(id, state.status);
108
108
  if (state.status !== 'pending' && state.status !== 'resolving') {
109
- var _state$error;
109
+ var _state$error, _state$error2;
110
110
  measure.create(id, state.status);
111
111
  if (state.status === 'resolved') {
112
112
  var _measure$getMeasure$d, _measure$getMeasure;
@@ -114,7 +114,7 @@ function Component({
114
114
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
115
115
  duration: (_measure$getMeasure$d = (_measure$getMeasure = measure.getMeasure(id, state.status)) === null || _measure$getMeasure === void 0 ? void 0 : _measure$getMeasure.duration) !== null && _measure$getMeasure$d !== void 0 ? _measure$getMeasure$d : null
116
116
  });
117
- } else if (((_state$error = state.error) === null || _state$error === void 0 ? void 0 : _state$error.type) !== 'ResolveUnsupportedError') {
117
+ } else if (((_state$error = state.error) === null || _state$error === void 0 ? void 0 : _state$error.type) !== 'ResolveUnsupportedError' && ((_state$error2 = state.error) === null || _state$error2 === void 0 ? void 0 : _state$error2.type) !== 'UnsupportedError') {
118
118
  fireEvent('operational.smartLink.unresolved', {
119
119
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
120
120
  reason: state.status,
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  const PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "35.0.3",
13
+ packageVersion: "35.1.1",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
@@ -1,59 +1,27 @@
1
1
  import { extractType } from '@atlaskit/link-extractors';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { extractState } from './extractState';
4
3
  import { extractTag } from './extractTag';
5
4
  import { extractTaskStatus } from './extractTaskStatus';
6
5
  import { extractTaskType } from './extractTaskType';
7
- var DOC_TYPES = ['schema:BlogPosting', 'schema:TextDigitalDocument', 'schema:DigitalDocument', 'schema:PresentationDigitalDocument', 'schema:SpreadsheetDigitalDocument'];
8
6
  export var extractLozenge = function extractLozenge(jsonLd) {
9
7
  var type = extractType(jsonLd);
10
8
  if (type) {
11
- if (fg('linking_platform_show_lozenge_atlassian_state')) {
12
- if (type.includes('atlassian:Task')) {
13
- var jsonLdTask = jsonLd;
14
- var lozengeFromTag = extractTag(jsonLdTask);
15
- var lozengeFromStatus = extractTaskStatus(jsonLdTask);
16
- var lozengeFromTaskType = extractLozengeFromTaskType(jsonLdTask);
17
- return lozengeFromTag || lozengeFromStatus || lozengeFromTaskType;
18
- }
19
- if (type.includes('atlassian:UndefinedLink')) {
20
- return {
21
- text: 'UNDEFINED',
22
- appearance: 'inprogress'
23
- };
24
- }
25
-
26
- // casting it because `extractState` can safely handle missing properties
27
- return extractState(jsonLd);
9
+ if (type.includes('atlassian:Task')) {
10
+ var jsonLdTask = jsonLd;
11
+ var lozengeFromTag = extractTag(jsonLdTask);
12
+ var lozengeFromStatus = extractTaskStatus(jsonLdTask);
13
+ var lozengeFromTaskType = extractLozengeFromTaskType(jsonLdTask);
14
+ return lozengeFromTag || lozengeFromStatus || lozengeFromTaskType;
28
15
  }
29
- if (type.includes('atlassian:SourceCodePullRequest')) {
30
- return extractState(jsonLd);
31
- } else if (type.includes('atlassian:Task')) {
32
- var _jsonLdTask = jsonLd;
33
- var _lozengeFromTag = extractTag(_jsonLdTask);
34
- var _lozengeFromStatus = extractTaskStatus(_jsonLdTask);
35
- var _lozengeFromTaskType = extractLozengeFromTaskType(_jsonLdTask);
36
- return _lozengeFromTag || _lozengeFromStatus || _lozengeFromTaskType;
37
- } else if (type.some(function (types) {
38
- return DOC_TYPES.includes(types);
39
- })) {
40
- var jsonLdDocument = jsonLd;
41
- var lozengeFromState = extractState(jsonLdDocument);
42
- return lozengeFromState;
43
- } else if (type.includes('atlassian:Goal')) {
44
- var jsonLdProject = jsonLd;
45
- var _lozengeFromState = extractState(jsonLdProject);
46
- return _lozengeFromState;
47
- } else if (type.includes('atlassian:Project')) {
48
- var _jsonLdProject = jsonLd;
49
- var _lozengeFromState2 = extractState(_jsonLdProject);
50
- return _lozengeFromState2;
51
- } else if (type.includes('atlassian:UndefinedLink')) {
16
+ if (type.includes('atlassian:UndefinedLink')) {
52
17
  return {
53
18
  text: 'UNDEFINED',
54
19
  appearance: 'inprogress'
55
20
  };
56
21
  }
22
+
23
+ // casting it because `extractState` can safely handle missing properties
24
+ return extractState(jsonLd);
57
25
  }
58
26
  };
59
27
  var extractLozengeFromTaskType = function extractLozengeFromTaskType(jsonLdTask) {
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "35.0.3"
7
+ packageVersion: "35.1.1"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -108,7 +108,7 @@ function Component(_ref) {
108
108
  useEffect(function () {
109
109
  measure.mark(id, state.status);
110
110
  if (state.status !== 'pending' && state.status !== 'resolving') {
111
- var _state$error;
111
+ var _state$error, _state$error2;
112
112
  measure.create(id, state.status);
113
113
  if (state.status === 'resolved') {
114
114
  var _measure$getMeasure$d, _measure$getMeasure;
@@ -116,7 +116,7 @@ function Component(_ref) {
116
116
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
117
117
  duration: (_measure$getMeasure$d = (_measure$getMeasure = measure.getMeasure(id, state.status)) === null || _measure$getMeasure === void 0 ? void 0 : _measure$getMeasure.duration) !== null && _measure$getMeasure$d !== void 0 ? _measure$getMeasure$d : null
118
118
  });
119
- } else if (((_state$error = state.error) === null || _state$error === void 0 ? void 0 : _state$error.type) !== 'ResolveUnsupportedError') {
119
+ } else if (((_state$error = state.error) === null || _state$error === void 0 ? void 0 : _state$error.type) !== 'ResolveUnsupportedError' && ((_state$error2 = state.error) === null || _state$error2 === void 0 ? void 0 : _state$error2.type) !== 'UnsupportedError') {
120
120
  fireEvent('operational.smartLink.unresolved', {
121
121
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
122
122
  reason: state.status,
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
13
13
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
14
14
  var PACKAGE_DATA = {
15
15
  packageName: "@atlaskit/smart-card",
16
- packageVersion: "35.0.3",
16
+ packageVersion: "35.1.1",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "35.0.3",
3
+ "version": "35.1.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -33,7 +33,7 @@
33
33
  "@atlaskit/avatar-group": "^12.0.0",
34
34
  "@atlaskit/badge": "^18.0.0",
35
35
  "@atlaskit/button": "^21.1.0",
36
- "@atlaskit/checkbox": "^16.0.0",
36
+ "@atlaskit/checkbox": "^17.0.0",
37
37
  "@atlaskit/css": "^0.10.0",
38
38
  "@atlaskit/dropdown-menu": "^13.0.0",
39
39
  "@atlaskit/form": "^12.0.0",
@@ -103,7 +103,7 @@
103
103
  "@atlaskit/visual-regression": "*",
104
104
  "@atlassian/analytics-tooling": "*",
105
105
  "@atlassian/feature-flags-test-utils": "^0.3.0",
106
- "@atlassian/gemini": "1.16.3",
106
+ "@atlassian/gemini": "1.16.4",
107
107
  "@testing-library/dom": "^10.1.0",
108
108
  "@testing-library/jest-dom": "^6.4.5",
109
109
  "@testing-library/react": "^13.4.0",
@@ -183,9 +183,6 @@
183
183
  "type": "boolean",
184
184
  "showOnWebsiteForTransitiveDependencies": true
185
185
  },
186
- "linking_platform_show_lozenge_atlassian_state": {
187
- "type": "boolean"
188
- },
189
186
  "smart_links_for_plans_platform": {
190
187
  "type": "boolean"
191
188
  },