@atlaskit/link-datasource 7.0.2 → 7.0.3
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 +12 -0
- package/dist/cjs/services/getAvailableSites.js +27 -32
- package/dist/es2019/services/getAvailableSites.js +6 -3
- package/dist/esm/services/getAvailableSites.js +27 -32
- package/package.json +5 -8
- package/dist/cjs/services/isLinkDatasourceInUnitsRollout.js +0 -25
- package/dist/es2019/services/isLinkDatasourceInUnitsRollout.js +0 -20
- package/dist/esm/services/isLinkDatasourceInUnitsRollout.js +0 -20
- package/dist/types/services/isLinkDatasourceInUnitsRollout.d.ts +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 7.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ffe3187520151`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ffe3187520151) -
|
|
8
|
+
Remove the redundant `linking_platform_site_picker_api_unit_compliant_cloud_id` and
|
|
9
|
+
`linking_platform_link_datasource_unit_compliant_cloud_id` feature gates. Both duplicated the
|
|
10
|
+
targeting of the existing `linking_platform_site_picker_api_unit_compliant` and
|
|
11
|
+
`linking_platform_link_datasource_unit_compliant` gates, which now solely drive the units
|
|
12
|
+
isolation rollout for the site picker and link datasource. No behaviour change.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 7.0.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -9,10 +9,10 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _mapAccessibleProductsToAvailableSites = require("@atlaskit/linking-common/map-accessible-products-to-available-sites");
|
|
11
11
|
var _unitsRollout = require("@atlaskit/linking-common/units-rollout");
|
|
12
|
-
var
|
|
12
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
13
|
var getAccessibleProducts = exports.getAccessibleProducts = /*#__PURE__*/function () {
|
|
14
14
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(product) {
|
|
15
|
-
var requestConfig, endpoint, response, res, _t, _t2, _t3
|
|
15
|
+
var requestConfig, isUnitCompliant, endpoint, response, res, _t, _t2, _t3;
|
|
16
16
|
return _regenerator.default.wrap(function (_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
@@ -28,49 +28,44 @@ var getAccessibleProducts = exports.getAccessibleProducts = /*#__PURE__*/functio
|
|
|
28
28
|
productIds: product === 'confluence' ? ['confluence.ondemand'] : ['jira-software.ondemand', 'jira-core.ondemand', 'jira-incident-manager.ondemand', 'jira-product-discovery', 'jira-servicedesk.ondemand']
|
|
29
29
|
})
|
|
30
30
|
}; // Organisations with units isolation in effect must be served the unit compliant endpoint,
|
|
31
|
-
// which filters the products down to the unit the user belongs to.
|
|
31
|
+
// which filters the products down to the unit the user belongs to. The gate is passed as a
|
|
32
|
+
// callback so it is only evaluated - and only records exposure - once the units GA killswitch
|
|
33
|
+
// has already let the check through.
|
|
32
34
|
_context.next = 1;
|
|
33
|
-
return (0, _unitsRollout.shouldUseUnitCompliantApi)(
|
|
35
|
+
return (0, _unitsRollout.shouldUseUnitCompliantApi)(function () {
|
|
36
|
+
return (0, _fg.fg)('linking_platform_link_datasource_unit_compliant');
|
|
37
|
+
});
|
|
34
38
|
case 1:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
_t = '/gateway/api/experimental/v2/accessible-products';
|
|
40
|
-
_context.next = 3;
|
|
41
|
-
break;
|
|
42
|
-
case 2:
|
|
43
|
-
_t = '/gateway/api/v2/accessible-products';
|
|
44
|
-
case 3:
|
|
45
|
-
endpoint = _t;
|
|
46
|
-
_context.next = 4;
|
|
39
|
+
isUnitCompliant = _context.sent;
|
|
40
|
+
endpoint = isUnitCompliant ? '/gateway/api/experimental/v2/accessible-products' : '/gateway/api/v2/accessible-products';
|
|
41
|
+
_context.next = 2;
|
|
47
42
|
return fetch(endpoint, requestConfig);
|
|
48
|
-
case
|
|
43
|
+
case 2:
|
|
49
44
|
response = _context.sent;
|
|
50
45
|
if (!response.ok) {
|
|
51
|
-
_context.next =
|
|
46
|
+
_context.next = 4;
|
|
52
47
|
break;
|
|
53
48
|
}
|
|
54
|
-
_context.next =
|
|
49
|
+
_context.next = 3;
|
|
55
50
|
return response.json();
|
|
56
|
-
case
|
|
51
|
+
case 3:
|
|
57
52
|
res = _context.sent;
|
|
58
53
|
return _context.abrupt("return", (0, _mapAccessibleProductsToAvailableSites.mapAccessibleProductsToAvailableSites)(res.data));
|
|
59
|
-
case
|
|
60
|
-
|
|
61
|
-
_context.next =
|
|
54
|
+
case 4:
|
|
55
|
+
_t = Error;
|
|
56
|
+
_context.next = 5;
|
|
62
57
|
return response.text();
|
|
63
|
-
case
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
_context.next =
|
|
58
|
+
case 5:
|
|
59
|
+
_t2 = _context.sent;
|
|
60
|
+
if (_t2) {
|
|
61
|
+
_context.next = 6;
|
|
67
62
|
break;
|
|
68
63
|
}
|
|
69
|
-
|
|
70
|
-
case
|
|
71
|
-
|
|
72
|
-
throw new
|
|
73
|
-
case
|
|
64
|
+
_t2 = 'Something went wrong';
|
|
65
|
+
case 6:
|
|
66
|
+
_t3 = _t2;
|
|
67
|
+
throw new _t(_t3);
|
|
68
|
+
case 7:
|
|
74
69
|
case "end":
|
|
75
70
|
return _context.stop();
|
|
76
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mapAccessibleProductsToAvailableSites } from '@atlaskit/linking-common/map-accessible-products-to-available-sites';
|
|
2
2
|
import { shouldUseUnitCompliantApi } from '@atlaskit/linking-common/units-rollout';
|
|
3
|
-
import {
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
4
|
export const getAccessibleProducts = async product => {
|
|
5
5
|
const requestConfig = {
|
|
6
6
|
method: 'POST',
|
|
@@ -16,8 +16,11 @@ export const getAccessibleProducts = async product => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
// Organisations with units isolation in effect must be served the unit compliant endpoint,
|
|
19
|
-
// which filters the products down to the unit the user belongs to.
|
|
20
|
-
|
|
19
|
+
// which filters the products down to the unit the user belongs to. The gate is passed as a
|
|
20
|
+
// callback so it is only evaluated - and only records exposure - once the units GA killswitch
|
|
21
|
+
// has already let the check through.
|
|
22
|
+
const isUnitCompliant = await shouldUseUnitCompliantApi(() => fg('linking_platform_link_datasource_unit_compliant'));
|
|
23
|
+
const endpoint = isUnitCompliant ? '/gateway/api/experimental/v2/accessible-products' : '/gateway/api/v2/accessible-products';
|
|
21
24
|
const response = await fetch(endpoint, requestConfig);
|
|
22
25
|
if (response.ok) {
|
|
23
26
|
const res = await response.json();
|
|
@@ -2,10 +2,10 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { mapAccessibleProductsToAvailableSites } from '@atlaskit/linking-common/map-accessible-products-to-available-sites';
|
|
4
4
|
import { shouldUseUnitCompliantApi } from '@atlaskit/linking-common/units-rollout';
|
|
5
|
-
import {
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
6
6
|
export var getAccessibleProducts = /*#__PURE__*/function () {
|
|
7
7
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(product) {
|
|
8
|
-
var requestConfig, endpoint, response, res, _t, _t2, _t3
|
|
8
|
+
var requestConfig, isUnitCompliant, endpoint, response, res, _t, _t2, _t3;
|
|
9
9
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
10
10
|
while (1) switch (_context.prev = _context.next) {
|
|
11
11
|
case 0:
|
|
@@ -21,49 +21,44 @@ export var getAccessibleProducts = /*#__PURE__*/function () {
|
|
|
21
21
|
productIds: product === 'confluence' ? ['confluence.ondemand'] : ['jira-software.ondemand', 'jira-core.ondemand', 'jira-incident-manager.ondemand', 'jira-product-discovery', 'jira-servicedesk.ondemand']
|
|
22
22
|
})
|
|
23
23
|
}; // Organisations with units isolation in effect must be served the unit compliant endpoint,
|
|
24
|
-
// which filters the products down to the unit the user belongs to.
|
|
24
|
+
// which filters the products down to the unit the user belongs to. The gate is passed as a
|
|
25
|
+
// callback so it is only evaluated - and only records exposure - once the units GA killswitch
|
|
26
|
+
// has already let the check through.
|
|
25
27
|
_context.next = 1;
|
|
26
|
-
return shouldUseUnitCompliantApi(
|
|
28
|
+
return shouldUseUnitCompliantApi(function () {
|
|
29
|
+
return fg('linking_platform_link_datasource_unit_compliant');
|
|
30
|
+
});
|
|
27
31
|
case 1:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
_t = '/gateway/api/experimental/v2/accessible-products';
|
|
33
|
-
_context.next = 3;
|
|
34
|
-
break;
|
|
35
|
-
case 2:
|
|
36
|
-
_t = '/gateway/api/v2/accessible-products';
|
|
37
|
-
case 3:
|
|
38
|
-
endpoint = _t;
|
|
39
|
-
_context.next = 4;
|
|
32
|
+
isUnitCompliant = _context.sent;
|
|
33
|
+
endpoint = isUnitCompliant ? '/gateway/api/experimental/v2/accessible-products' : '/gateway/api/v2/accessible-products';
|
|
34
|
+
_context.next = 2;
|
|
40
35
|
return fetch(endpoint, requestConfig);
|
|
41
|
-
case
|
|
36
|
+
case 2:
|
|
42
37
|
response = _context.sent;
|
|
43
38
|
if (!response.ok) {
|
|
44
|
-
_context.next =
|
|
39
|
+
_context.next = 4;
|
|
45
40
|
break;
|
|
46
41
|
}
|
|
47
|
-
_context.next =
|
|
42
|
+
_context.next = 3;
|
|
48
43
|
return response.json();
|
|
49
|
-
case
|
|
44
|
+
case 3:
|
|
50
45
|
res = _context.sent;
|
|
51
46
|
return _context.abrupt("return", mapAccessibleProductsToAvailableSites(res.data));
|
|
52
|
-
case
|
|
53
|
-
|
|
54
|
-
_context.next =
|
|
47
|
+
case 4:
|
|
48
|
+
_t = Error;
|
|
49
|
+
_context.next = 5;
|
|
55
50
|
return response.text();
|
|
56
|
-
case
|
|
57
|
-
|
|
58
|
-
if (
|
|
59
|
-
_context.next =
|
|
51
|
+
case 5:
|
|
52
|
+
_t2 = _context.sent;
|
|
53
|
+
if (_t2) {
|
|
54
|
+
_context.next = 6;
|
|
60
55
|
break;
|
|
61
56
|
}
|
|
62
|
-
|
|
63
|
-
case
|
|
64
|
-
|
|
65
|
-
throw new
|
|
66
|
-
case
|
|
57
|
+
_t2 = 'Something went wrong';
|
|
58
|
+
case 6:
|
|
59
|
+
_t3 = _t2;
|
|
60
|
+
throw new _t(_t3);
|
|
61
|
+
case 7:
|
|
67
62
|
case "end":
|
|
68
63
|
return _context.stop();
|
|
69
64
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@atlaskit/analytics-cross-product": "^2.2.0",
|
|
44
44
|
"@atlaskit/analytics-next": "^12.5.0",
|
|
45
45
|
"@atlaskit/atlassian-context": "^2.0.0",
|
|
46
|
-
"@atlaskit/avatar": "^29.
|
|
47
|
-
"@atlaskit/avatar-group": "^14.
|
|
46
|
+
"@atlaskit/avatar": "^29.1.0",
|
|
47
|
+
"@atlaskit/avatar-group": "^14.4.0",
|
|
48
48
|
"@atlaskit/badge": "^22.0.0",
|
|
49
49
|
"@atlaskit/button": "^25.4.0",
|
|
50
50
|
"@atlaskit/css": "^1.1.0",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^4.2.0",
|
|
85
85
|
"@atlaskit/primitives": "^22.5.0",
|
|
86
86
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
87
|
-
"@atlaskit/react-select": "^4.
|
|
87
|
+
"@atlaskit/react-select": "^4.12.0",
|
|
88
88
|
"@atlaskit/select": "^23.1.0",
|
|
89
|
-
"@atlaskit/smart-card": "^46.
|
|
89
|
+
"@atlaskit/smart-card": "^46.1.0",
|
|
90
90
|
"@atlaskit/smart-user-picker": "^12.0.0",
|
|
91
91
|
"@atlaskit/spinner": "^20.4.0",
|
|
92
92
|
"@atlaskit/tag": "^16.0.0",
|
|
@@ -171,9 +171,6 @@
|
|
|
171
171
|
"linking_platform_link_datasource_unit_compliant": {
|
|
172
172
|
"type": "boolean"
|
|
173
173
|
},
|
|
174
|
-
"linking_platform_link_datasource_unit_compliant_cloud_id": {
|
|
175
|
-
"type": "boolean"
|
|
176
|
-
},
|
|
177
174
|
"platform_lp_sllv_richtext_margin_reset": {
|
|
178
175
|
"type": "boolean"
|
|
179
176
|
},
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isLinkDatasourceInUnitsRollout = void 0;
|
|
7
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
8
|
-
/**
|
|
9
|
-
* Whether link datasource is in the units isolation rollout.
|
|
10
|
-
*
|
|
11
|
-
* Two gates drive the same rollout so it can be turned on for either an organisation or a single
|
|
12
|
-
* site: `..._unit_compliant` targets org id, `..._unit_compliant_cloud_id` targets cloud id.
|
|
13
|
-
* Either one being on opts link datasource in, and both are always evaluated so that exposure is
|
|
14
|
-
* recorded for the two of them.
|
|
15
|
-
*
|
|
16
|
-
* Being in the rollout is not on its own enough to change behaviour - the organisation also has to
|
|
17
|
-
* have launched units with boundary enforcement on. Pass this to `shouldUseUnitCompliantApi` from
|
|
18
|
-
* `@atlaskit/linking-common/units-rollout`, which owns that decision, rather than calling it
|
|
19
|
-
* directly.
|
|
20
|
-
*/
|
|
21
|
-
var isLinkDatasourceInUnitsRollout = exports.isLinkDatasourceInUnitsRollout = function isLinkDatasourceInUnitsRollout() {
|
|
22
|
-
var isOrgInRollout = (0, _fg.fg)('linking_platform_link_datasource_unit_compliant');
|
|
23
|
-
var isSiteInRollout = (0, _fg.fg)('linking_platform_link_datasource_unit_compliant_cloud_id');
|
|
24
|
-
return isOrgInRollout || isSiteInRollout;
|
|
25
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Whether link datasource is in the units isolation rollout.
|
|
5
|
-
*
|
|
6
|
-
* Two gates drive the same rollout so it can be turned on for either an organisation or a single
|
|
7
|
-
* site: `..._unit_compliant` targets org id, `..._unit_compliant_cloud_id` targets cloud id.
|
|
8
|
-
* Either one being on opts link datasource in, and both are always evaluated so that exposure is
|
|
9
|
-
* recorded for the two of them.
|
|
10
|
-
*
|
|
11
|
-
* Being in the rollout is not on its own enough to change behaviour - the organisation also has to
|
|
12
|
-
* have launched units with boundary enforcement on. Pass this to `shouldUseUnitCompliantApi` from
|
|
13
|
-
* `@atlaskit/linking-common/units-rollout`, which owns that decision, rather than calling it
|
|
14
|
-
* directly.
|
|
15
|
-
*/
|
|
16
|
-
export const isLinkDatasourceInUnitsRollout = () => {
|
|
17
|
-
const isOrgInRollout = fg('linking_platform_link_datasource_unit_compliant');
|
|
18
|
-
const isSiteInRollout = fg('linking_platform_link_datasource_unit_compliant_cloud_id');
|
|
19
|
-
return isOrgInRollout || isSiteInRollout;
|
|
20
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Whether link datasource is in the units isolation rollout.
|
|
5
|
-
*
|
|
6
|
-
* Two gates drive the same rollout so it can be turned on for either an organisation or a single
|
|
7
|
-
* site: `..._unit_compliant` targets org id, `..._unit_compliant_cloud_id` targets cloud id.
|
|
8
|
-
* Either one being on opts link datasource in, and both are always evaluated so that exposure is
|
|
9
|
-
* recorded for the two of them.
|
|
10
|
-
*
|
|
11
|
-
* Being in the rollout is not on its own enough to change behaviour - the organisation also has to
|
|
12
|
-
* have launched units with boundary enforcement on. Pass this to `shouldUseUnitCompliantApi` from
|
|
13
|
-
* `@atlaskit/linking-common/units-rollout`, which owns that decision, rather than calling it
|
|
14
|
-
* directly.
|
|
15
|
-
*/
|
|
16
|
-
export var isLinkDatasourceInUnitsRollout = function isLinkDatasourceInUnitsRollout() {
|
|
17
|
-
var isOrgInRollout = fg('linking_platform_link_datasource_unit_compliant');
|
|
18
|
-
var isSiteInRollout = fg('linking_platform_link_datasource_unit_compliant_cloud_id');
|
|
19
|
-
return isOrgInRollout || isSiteInRollout;
|
|
20
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Whether link datasource is in the units isolation rollout.
|
|
3
|
-
*
|
|
4
|
-
* Two gates drive the same rollout so it can be turned on for either an organisation or a single
|
|
5
|
-
* site: `..._unit_compliant` targets org id, `..._unit_compliant_cloud_id` targets cloud id.
|
|
6
|
-
* Either one being on opts link datasource in, and both are always evaluated so that exposure is
|
|
7
|
-
* recorded for the two of them.
|
|
8
|
-
*
|
|
9
|
-
* Being in the rollout is not on its own enough to change behaviour - the organisation also has to
|
|
10
|
-
* have launched units with boundary enforcement on. Pass this to `shouldUseUnitCompliantApi` from
|
|
11
|
-
* `@atlaskit/linking-common/units-rollout`, which owns that decision, rather than calling it
|
|
12
|
-
* directly.
|
|
13
|
-
*/
|
|
14
|
-
export declare const isLinkDatasourceInUnitsRollout: () => boolean;
|