@atlaskit/smart-card 27.0.0 → 27.1.0
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 +8 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.js +57 -55
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +25 -57
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.js +1 -20
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.js +0 -7
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +6 -8
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +9 -10
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.js +1 -3
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.js +1 -3
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +1 -6
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.js +57 -55
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +6 -34
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.js +0 -1
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +5 -7
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +7 -8
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +1 -8
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.js +57 -55
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +24 -57
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.js +0 -1
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +6 -8
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +9 -10
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.js +1 -3
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.js +1 -3
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +1 -6
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.d.ts +7 -5
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.d.ts +3 -8
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.d.ts +1 -2
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.d.ts +0 -1
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.d.ts +3 -5
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.d.ts +5 -6
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.d.ts +1 -3
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.d.ts +1 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.d.ts +7 -5
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.d.ts +3 -8
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.d.ts +1 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.d.ts +0 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.d.ts +3 -5
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.d.ts +5 -6
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.d.ts +1 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.d.ts +1 -3
- package/package.json +2 -2
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.js +0 -138
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.js +0 -51
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.js +0 -131
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.d.ts +0 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 27.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#103506](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103506)
|
|
8
|
+
[`651f63e757d1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/651f63e757d1) -
|
|
9
|
+
Converted to the public api for manual triggers in the automation action.
|
|
10
|
+
|
|
3
11
|
## 27.0.0
|
|
4
12
|
|
|
5
13
|
### Major Changes
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "27.
|
|
25
|
+
packageVersion: "27.1.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,64 +12,66 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
12
|
var mockScope = {
|
|
13
13
|
resources: []
|
|
14
14
|
};
|
|
15
|
-
var mockRules = exports.mockRules =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
id: 1,
|
|
22
|
-
name: 'Test rule 1 (has inputs)',
|
|
23
|
-
ruleScope: mockScope,
|
|
24
|
-
userInputs: [{
|
|
25
|
-
defaultValue: '',
|
|
26
|
-
displayName: 'Test user input',
|
|
27
|
-
inputType: _types.UserInputType.TEXT,
|
|
28
|
-
required: false,
|
|
29
|
-
variableName: 'testUserInput'
|
|
30
|
-
}]
|
|
31
|
-
}, {
|
|
32
|
-
id: 2,
|
|
33
|
-
name: 'Test rule 2 (has multiple inputs)',
|
|
34
|
-
ruleScope: mockScope,
|
|
35
|
-
userInputs: [{
|
|
36
|
-
defaultValue: '',
|
|
37
|
-
displayName: 'Text user input',
|
|
38
|
-
inputType: _types.UserInputType.TEXT,
|
|
39
|
-
required: false,
|
|
40
|
-
variableName: 'textUserInput'
|
|
41
|
-
}, {
|
|
42
|
-
defaultValue: '',
|
|
43
|
-
displayName: 'Number user input',
|
|
44
|
-
inputType: _types.UserInputType.NUMBER,
|
|
45
|
-
required: false,
|
|
46
|
-
variableName: 'numberUserInput'
|
|
15
|
+
var mockRules = exports.mockRules = {
|
|
16
|
+
data: [{
|
|
17
|
+
id: 0,
|
|
18
|
+
name: 'Test rule 0 (no inputs)',
|
|
19
|
+
ruleScope: mockScope,
|
|
20
|
+
userInputs: []
|
|
47
21
|
}, {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
22
|
+
id: 1,
|
|
23
|
+
name: 'Test rule 1 (has inputs)',
|
|
24
|
+
ruleScope: mockScope,
|
|
25
|
+
userInputs: [{
|
|
26
|
+
defaultValue: '',
|
|
27
|
+
displayName: 'Test user input',
|
|
28
|
+
inputType: _types.UserInputType.TEXT,
|
|
29
|
+
required: false,
|
|
30
|
+
variableName: 'testUserInput'
|
|
31
|
+
}]
|
|
53
32
|
}, {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
33
|
+
id: 2,
|
|
34
|
+
name: 'Test rule 2 (has multiple inputs)',
|
|
35
|
+
ruleScope: mockScope,
|
|
36
|
+
userInputs: [{
|
|
37
|
+
defaultValue: '',
|
|
38
|
+
displayName: 'Text user input',
|
|
39
|
+
inputType: _types.UserInputType.TEXT,
|
|
40
|
+
required: false,
|
|
41
|
+
variableName: 'textUserInput'
|
|
42
|
+
}, {
|
|
43
|
+
defaultValue: '',
|
|
44
|
+
displayName: 'Number user input',
|
|
45
|
+
inputType: _types.UserInputType.NUMBER,
|
|
46
|
+
required: false,
|
|
47
|
+
variableName: 'numberUserInput'
|
|
48
|
+
}, {
|
|
49
|
+
defaultValue: true,
|
|
50
|
+
displayName: 'Boolean user input',
|
|
51
|
+
inputType: _types.UserInputType.BOOLEAN,
|
|
52
|
+
required: false,
|
|
53
|
+
variableName: 'booleanUserInput'
|
|
54
|
+
}, {
|
|
55
|
+
defaultValue: [''],
|
|
56
|
+
displayName: 'Dropdown user input',
|
|
57
|
+
inputType: _types.UserInputType.DROPDOWN,
|
|
58
|
+
required: false,
|
|
59
|
+
variableName: 'dropdownUserInput'
|
|
60
|
+
}, {
|
|
61
|
+
defaultValue: '',
|
|
62
|
+
displayName: 'Paragraph user input',
|
|
63
|
+
inputType: _types.UserInputType.PARAGRAPH,
|
|
64
|
+
required: false,
|
|
65
|
+
variableName: 'paragraphUserInput'
|
|
66
|
+
}]
|
|
65
67
|
}]
|
|
66
|
-
}
|
|
67
|
-
var mockTransformedRules = exports.mockTransformedRules = [_objectSpread(_objectSpread({}, mockRules[0]), {}, {
|
|
68
|
-
userInputPrompts: mockRules[0].userInputs
|
|
69
|
-
}), _objectSpread(_objectSpread({}, mockRules[1]), {}, {
|
|
70
|
-
userInputPrompts: mockRules[1].userInputs
|
|
71
|
-
}), _objectSpread(_objectSpread({}, mockRules[2]), {}, {
|
|
72
|
-
userInputPrompts: mockRules[2].userInputs
|
|
68
|
+
};
|
|
69
|
+
var mockTransformedRules = exports.mockTransformedRules = [_objectSpread(_objectSpread({}, mockRules.data[0]), {}, {
|
|
70
|
+
userInputPrompts: mockRules.data[0].userInputs
|
|
71
|
+
}), _objectSpread(_objectSpread({}, mockRules.data[1]), {}, {
|
|
72
|
+
userInputPrompts: mockRules.data[1].userInputs
|
|
73
|
+
}), _objectSpread(_objectSpread({}, mockRules.data[2]), {}, {
|
|
74
|
+
userInputPrompts: mockRules.data[2].userInputs
|
|
73
75
|
})];
|
|
74
76
|
var mockInvocationResponse = exports.mockInvocationResponse = {
|
|
75
77
|
'TEST-1': 'SUCCESS'
|
|
@@ -4,11 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.performPostRequest = exports.performGetRequest = exports.getSearchUrl = exports.getInvocationUrl = exports.
|
|
7
|
+
exports.performPostRequest = exports.performGetRequest = exports.getSearchUrl = exports.getInvocationUrl = exports.extractCloudIdAndProductFromSite = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _stackResolver = require("./stack-resolver");
|
|
12
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
13
|
/**
|
|
@@ -53,46 +52,40 @@ var extractCloudIdAndProductFromSite = exports.extractCloudIdAndProductFromSite
|
|
|
53
52
|
*
|
|
54
53
|
*/
|
|
55
54
|
var getSearchUrl = exports.getSearchUrl = /*#__PURE__*/function () {
|
|
56
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(
|
|
57
|
-
var _extractCloudIdAndPro, product, cloudId
|
|
55
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(site) {
|
|
56
|
+
var _extractCloudIdAndPro, product, cloudId;
|
|
58
57
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
59
58
|
while (1) switch (_context.prev = _context.next) {
|
|
60
59
|
case 0:
|
|
61
|
-
_extractCloudIdAndPro = extractCloudIdAndProductFromSite(site), product = _extractCloudIdAndPro.product, cloudId = _extractCloudIdAndPro.cloudId;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return _context.abrupt("return", "/gateway/api/automation/internal-api/".concat(product, "/").concat(cloudId, "/").concat(automationStack, "/rest/v1/rules/manual/search"));
|
|
67
|
-
case 5:
|
|
60
|
+
_extractCloudIdAndPro = extractCloudIdAndProductFromSite(site), product = _extractCloudIdAndPro.product, cloudId = _extractCloudIdAndPro.cloudId; // TODO in the unified API, GET requests as according to Atlassian API standards will destructure the whole query into
|
|
61
|
+
// query parameters as part of the URL. For now, this is considered a POST request instead and thus the query is used
|
|
62
|
+
// later on as the request body.
|
|
63
|
+
return _context.abrupt("return", "/gateway/api/automation/public/".concat(product, "/").concat(cloudId, "/rest/v1/rule/manual/search"));
|
|
64
|
+
case 2:
|
|
68
65
|
case "end":
|
|
69
66
|
return _context.stop();
|
|
70
67
|
}
|
|
71
68
|
}, _callee);
|
|
72
69
|
}));
|
|
73
|
-
return function getSearchUrl(_x
|
|
70
|
+
return function getSearchUrl(_x) {
|
|
74
71
|
return _ref.apply(this, arguments);
|
|
75
72
|
};
|
|
76
73
|
}();
|
|
77
74
|
var getInvocationUrl = exports.getInvocationUrl = /*#__PURE__*/function () {
|
|
78
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(
|
|
79
|
-
var _extractCloudIdAndPro2, product, cloudId
|
|
75
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(site, ruleId) {
|
|
76
|
+
var _extractCloudIdAndPro2, product, cloudId;
|
|
80
77
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
81
78
|
while (1) switch (_context2.prev = _context2.next) {
|
|
82
79
|
case 0:
|
|
83
80
|
_extractCloudIdAndPro2 = extractCloudIdAndProductFromSite(site), product = _extractCloudIdAndPro2.product, cloudId = _extractCloudIdAndPro2.cloudId;
|
|
84
|
-
_context2.
|
|
85
|
-
|
|
86
|
-
case 3:
|
|
87
|
-
automationStack = _context2.sent;
|
|
88
|
-
return _context2.abrupt("return", "/gateway/api/automation/internal-api/".concat(product, "/").concat(cloudId, "/").concat(automationStack, "/rest/v1/rules/manual/invocation/").concat(ruleId));
|
|
89
|
-
case 5:
|
|
81
|
+
return _context2.abrupt("return", "/gateway/api/automation/public/".concat(product, "/").concat(cloudId, "/rest/v1/rule/manual/").concat(ruleId, "/invocation"));
|
|
82
|
+
case 2:
|
|
90
83
|
case "end":
|
|
91
84
|
return _context2.stop();
|
|
92
85
|
}
|
|
93
86
|
}, _callee2);
|
|
94
87
|
}));
|
|
95
|
-
return function getInvocationUrl(
|
|
88
|
+
return function getInvocationUrl(_x2, _x3) {
|
|
96
89
|
return _ref2.apply(this, arguments);
|
|
97
90
|
};
|
|
98
91
|
}();
|
|
@@ -100,30 +93,27 @@ var DEFAULT_HEADER = {
|
|
|
100
93
|
'Content-Type': 'application/json'
|
|
101
94
|
};
|
|
102
95
|
var _performRequest = /*#__PURE__*/function () {
|
|
103
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(url, method) {
|
|
104
|
-
var
|
|
105
|
-
response,
|
|
106
|
-
_args3 = arguments;
|
|
96
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(url, method, options) {
|
|
97
|
+
var response;
|
|
107
98
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
108
99
|
while (1) switch (_context3.prev = _context3.next) {
|
|
109
100
|
case 0:
|
|
110
|
-
|
|
101
|
+
_context3.next = 2;
|
|
102
|
+
return fetch(url, _objectSpread(_objectSpread({
|
|
111
103
|
headers: DEFAULT_HEADER
|
|
112
|
-
}
|
|
113
|
-
_context3.next = 3;
|
|
114
|
-
return fetch(url, _objectSpread(_objectSpread({}, options), {}, {
|
|
104
|
+
}, options), {}, {
|
|
115
105
|
method: method
|
|
116
106
|
}));
|
|
117
|
-
case
|
|
107
|
+
case 2:
|
|
118
108
|
response = _context3.sent;
|
|
119
109
|
return _context3.abrupt("return", response.json());
|
|
120
|
-
case
|
|
110
|
+
case 4:
|
|
121
111
|
case "end":
|
|
122
112
|
return _context3.stop();
|
|
123
113
|
}
|
|
124
114
|
}, _callee3);
|
|
125
115
|
}));
|
|
126
|
-
return function _performRequest(
|
|
116
|
+
return function _performRequest(_x4, _x5, _x6) {
|
|
127
117
|
return _ref3.apply(this, arguments);
|
|
128
118
|
};
|
|
129
119
|
}();
|
|
@@ -139,7 +129,7 @@ var performGetRequest = exports.performGetRequest = /*#__PURE__*/function () {
|
|
|
139
129
|
}
|
|
140
130
|
}, _callee4);
|
|
141
131
|
}));
|
|
142
|
-
return function performGetRequest(
|
|
132
|
+
return function performGetRequest(_x7, _x8) {
|
|
143
133
|
return _ref4.apply(this, arguments);
|
|
144
134
|
};
|
|
145
135
|
}();
|
|
@@ -155,29 +145,7 @@ var performPostRequest = exports.performPostRequest = /*#__PURE__*/function () {
|
|
|
155
145
|
}
|
|
156
146
|
}, _callee5);
|
|
157
147
|
}));
|
|
158
|
-
return function performPostRequest(
|
|
148
|
+
return function performPostRequest(_x9, _x10) {
|
|
159
149
|
return _ref5.apply(this, arguments);
|
|
160
150
|
};
|
|
161
|
-
}();
|
|
162
|
-
|
|
163
|
-
// TODO this will need to be expanded to resolve the correct product URL, too.
|
|
164
|
-
// TODO for instance this will need to support Alerts UI URL resolution in the
|
|
165
|
-
// TODO short term
|
|
166
|
-
var getBaseAutomationUrl = exports.getBaseAutomationUrl = function getBaseAutomationUrl(_ref6) {
|
|
167
|
-
var projectKey = _ref6.projectKey,
|
|
168
|
-
projectType = _ref6.projectType,
|
|
169
|
-
isSimplified = _ref6.isSimplified;
|
|
170
|
-
/**
|
|
171
|
-
* Confusing mapping of urls here.
|
|
172
|
-
* Classic Projects - always under /automate
|
|
173
|
-
* Next Gen Projects - under /automation for all project types except JSD
|
|
174
|
-
*/
|
|
175
|
-
switch (projectType) {
|
|
176
|
-
case 'service_desk':
|
|
177
|
-
return "/jira/servicedesk/projects/".concat(projectKey, "/settings/automate");
|
|
178
|
-
case 'business':
|
|
179
|
-
return "/jira/core/projects/".concat(projectKey, "/settings/").concat(isSimplified ? 'automation' : 'automate');
|
|
180
|
-
default:
|
|
181
|
-
return "/jira/software/".concat(isSimplified ? '' : 'c/', "projects/").concat(projectKey, "/settings/").concat(isSimplified ? 'automation' : 'automate');
|
|
182
|
-
}
|
|
183
|
-
};
|
|
151
|
+
}();
|
|
@@ -9,24 +9,6 @@ Object.defineProperty(exports, "extractCloudIdAndProductFromSite", {
|
|
|
9
9
|
return _api.extractCloudIdAndProductFromSite;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "getAutomationStack", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _stackResolver.getAutomationStack;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "getAutomationStackFromLocalStorage", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _stackResolver.getAutomationStackFromLocalStorage;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "getBaseAutomationUrl", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _api.getBaseAutomationUrl;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
12
|
Object.defineProperty(exports, "getInvocationUrl", {
|
|
31
13
|
enumerable: true,
|
|
32
14
|
get: function get() {
|
|
@@ -51,5 +33,4 @@ Object.defineProperty(exports, "performPostRequest", {
|
|
|
51
33
|
return _api.performPostRequest;
|
|
52
34
|
}
|
|
53
35
|
});
|
|
54
|
-
var _api = require("./api");
|
|
55
|
-
var _stackResolver = require("./stack-resolver");
|
|
36
|
+
var _api = require("./api");
|
|
@@ -9,12 +9,6 @@ Object.defineProperty(exports, "ManualRulesContainer", {
|
|
|
9
9
|
return _main.ManualRulesContainer;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "getBaseAutomationUrl", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _utils.getBaseAutomationUrl;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
12
|
Object.defineProperty(exports, "invokeManuallyTriggeredRule", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function get() {
|
|
@@ -34,5 +28,4 @@ Object.defineProperty(exports, "useManualRules", {
|
|
|
34
28
|
}
|
|
35
29
|
});
|
|
36
30
|
var _services = require("./services");
|
|
37
|
-
var _utils = require("./common/utils");
|
|
38
31
|
var _main = require("./main");
|
|
@@ -22,11 +22,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
22
22
|
/**
|
|
23
23
|
* React hook that implements the fetch and invoke actions for manual triggers.
|
|
24
24
|
* Can be used standalone or in the HOC provided below.
|
|
25
|
-
* @param env - The environment to retrieve rules from
|
|
26
25
|
* @param site - The site to filter on. We map this to just a cloudId to resolve the manual rules API path
|
|
27
26
|
* @param query - Query object containing filter props (container, object(s))
|
|
28
27
|
*/
|
|
29
|
-
var useManualRules = exports.useManualRules = function useManualRules(
|
|
28
|
+
var useManualRules = exports.useManualRules = function useManualRules(site, query) {
|
|
30
29
|
var _useState = (0, _react.useState)(false),
|
|
31
30
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
32
31
|
initialised = _useState2[0],
|
|
@@ -54,7 +53,7 @@ var useManualRules = exports.useManualRules = function useManualRules(env, site,
|
|
|
54
53
|
setInitialised(false);
|
|
55
54
|
_context.prev = 1;
|
|
56
55
|
_context.next = 4;
|
|
57
|
-
return (0, _services.searchManuallyTriggeredRules)(
|
|
56
|
+
return (0, _services.searchManuallyTriggeredRules)(site, query);
|
|
58
57
|
case 4:
|
|
59
58
|
fetchedRules = _context.sent;
|
|
60
59
|
setError(null);
|
|
@@ -98,11 +97,10 @@ var useManualRules = exports.useManualRules = function useManualRules(env, site,
|
|
|
98
97
|
* should not care about this, only how to trigger invocation and understand
|
|
99
98
|
* the invocation lifecycle.
|
|
100
99
|
*
|
|
101
|
-
* @param props -
|
|
100
|
+
* @param props - cloudId, projectId, children
|
|
102
101
|
*/
|
|
103
102
|
var ManualRulesContainer = exports.ManualRulesContainer = function ManualRulesContainer(props) {
|
|
104
|
-
var
|
|
105
|
-
site = props.site,
|
|
103
|
+
var site = props.site,
|
|
106
104
|
query = props.query,
|
|
107
105
|
children = props.children,
|
|
108
106
|
onInputsModalOpened = props.onInputsModalOpened,
|
|
@@ -112,7 +110,7 @@ var ManualRulesContainer = exports.ManualRulesContainer = function ManualRulesCo
|
|
|
112
110
|
onRuleInvocationFailure = props.onRuleInvocationFailure,
|
|
113
111
|
onRuleInvocationLifecycleDone = props.onRuleInvocationLifecycleDone;
|
|
114
112
|
// Initial data loading state
|
|
115
|
-
var _useManualRules = useManualRules(
|
|
113
|
+
var _useManualRules = useManualRules(site, query),
|
|
116
114
|
_useManualRules2 = (0, _slicedToArray2.default)(_useManualRules, 4),
|
|
117
115
|
triggerFetch = _useManualRules2[0],
|
|
118
116
|
initialised = _useManualRules2[1],
|
|
@@ -178,7 +176,7 @@ var ManualRulesContainer = exports.ManualRulesContainer = function ManualRulesCo
|
|
|
178
176
|
onRuleInvocationLifecycleStarted(ruleId, objects, userInputs);
|
|
179
177
|
}
|
|
180
178
|
_context2.next = 7;
|
|
181
|
-
return (0, _services.invokeManuallyTriggeredRule)(
|
|
179
|
+
return (0, _services.invokeManuallyTriggeredRule)(site, ruleId, objects, userInputs);
|
|
182
180
|
case 7:
|
|
183
181
|
response = _context2.sent;
|
|
184
182
|
_failedObjects = getFailedObjects(response);
|
|
@@ -13,18 +13,18 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
/**
|
|
15
15
|
* Manual trigger rules API fetch. Fetches a list of manually triggered rules according to the context provided
|
|
16
|
-
* in
|
|
17
|
-
* @param
|
|
16
|
+
* in query.
|
|
17
|
+
* @param site - the site ARI to fetch the rules against
|
|
18
18
|
* @param query - the workspace/container/objects to fetch rules against
|
|
19
19
|
*/
|
|
20
20
|
var searchManuallyTriggeredRules = exports.searchManuallyTriggeredRules = /*#__PURE__*/function () {
|
|
21
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(
|
|
21
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(site, query) {
|
|
22
22
|
var url, response;
|
|
23
23
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
24
24
|
while (1) switch (_context.prev = _context.next) {
|
|
25
25
|
case 0:
|
|
26
26
|
_context.next = 2;
|
|
27
|
-
return (0, _utils.getSearchUrl)(
|
|
27
|
+
return (0, _utils.getSearchUrl)(site);
|
|
28
28
|
case 2:
|
|
29
29
|
url = _context.sent;
|
|
30
30
|
_context.next = 5;
|
|
@@ -33,7 +33,7 @@ var searchManuallyTriggeredRules = exports.searchManuallyTriggeredRules = /*#__P
|
|
|
33
33
|
});
|
|
34
34
|
case 5:
|
|
35
35
|
response = _context.sent;
|
|
36
|
-
return _context.abrupt("return", response.reduce(function (acc, _ref2) {
|
|
36
|
+
return _context.abrupt("return", response.data.reduce(function (acc, _ref2) {
|
|
37
37
|
var id = _ref2.id,
|
|
38
38
|
name = _ref2.name,
|
|
39
39
|
ruleScope = _ref2.ruleScope,
|
|
@@ -51,27 +51,26 @@ var searchManuallyTriggeredRules = exports.searchManuallyTriggeredRules = /*#__P
|
|
|
51
51
|
}
|
|
52
52
|
}, _callee);
|
|
53
53
|
}));
|
|
54
|
-
return function searchManuallyTriggeredRules(_x, _x2
|
|
54
|
+
return function searchManuallyTriggeredRules(_x, _x2) {
|
|
55
55
|
return _ref.apply(this, arguments);
|
|
56
56
|
};
|
|
57
57
|
}();
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Invoke a manually triggered rule via the API.
|
|
61
|
-
* @param env - the environment to use when invoking the rule
|
|
62
61
|
* @param cloudId - the site the rule belongs to
|
|
63
62
|
* @param ruleId - the identifier of the rule you want to invoke
|
|
64
63
|
* @param objects - the list of objects you wish to create an automation event for.
|
|
65
64
|
* @param userInputs - the optional user inputs if this manual trigger requires them
|
|
66
65
|
*/
|
|
67
66
|
var invokeManuallyTriggeredRule = exports.invokeManuallyTriggeredRule = /*#__PURE__*/function () {
|
|
68
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(
|
|
67
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(site, ruleId, objects, userInputs) {
|
|
69
68
|
var url, bodyRaw;
|
|
70
69
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
71
70
|
while (1) switch (_context2.prev = _context2.next) {
|
|
72
71
|
case 0:
|
|
73
72
|
_context2.next = 2;
|
|
74
|
-
return (0, _utils.getInvocationUrl)(
|
|
73
|
+
return (0, _utils.getInvocationUrl)(site, ruleId);
|
|
75
74
|
case 2:
|
|
76
75
|
url = _context2.sent;
|
|
77
76
|
bodyRaw = {
|
|
@@ -89,7 +88,7 @@ var invokeManuallyTriggeredRule = exports.invokeManuallyTriggeredRule = /*#__PUR
|
|
|
89
88
|
}
|
|
90
89
|
}, _callee2);
|
|
91
90
|
}));
|
|
92
|
-
return function invokeManuallyTriggeredRule(_x4, _x5, _x6
|
|
91
|
+
return function invokeManuallyTriggeredRule(_x3, _x4, _x5, _x6) {
|
|
93
92
|
return _ref3.apply(this, arguments);
|
|
94
93
|
};
|
|
95
94
|
}();
|
|
@@ -17,8 +17,7 @@ var _header = require("./sub-components/header");
|
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
var AutomationModal = exports.AutomationModal = function AutomationModal(_ref) {
|
|
20
|
-
var
|
|
21
|
-
baseAutomationUrl = _ref.baseAutomationUrl,
|
|
20
|
+
var baseAutomationUrl = _ref.baseAutomationUrl,
|
|
22
21
|
siteAri = _ref.siteAri,
|
|
23
22
|
objectAri = _ref.objectAri,
|
|
24
23
|
canManageAutomation = _ref.canManageAutomation,
|
|
@@ -44,7 +43,6 @@ var AutomationModal = exports.AutomationModal = function AutomationModal(_ref) {
|
|
|
44
43
|
}).fire();
|
|
45
44
|
}, [createAnalyticsEvent, analyticsSource]);
|
|
46
45
|
return /*#__PURE__*/_react.default.createElement(_menuContext.AutomationMenuContextContainer, {
|
|
47
|
-
environment: environment,
|
|
48
46
|
baseAutomationUrl: baseAutomationUrl,
|
|
49
47
|
objectAri: objectAri,
|
|
50
48
|
siteAri: siteAri,
|
|
@@ -33,8 +33,7 @@ var useAutomationMenu = exports.useAutomationMenu = function useAutomationMenu()
|
|
|
33
33
|
return context;
|
|
34
34
|
};
|
|
35
35
|
var AutomationMenuContextContainer = exports.AutomationMenuContextContainer = function AutomationMenuContextContainer(_ref2) {
|
|
36
|
-
var
|
|
37
|
-
baseAutomationUrl = _ref2.baseAutomationUrl,
|
|
36
|
+
var baseAutomationUrl = _ref2.baseAutomationUrl,
|
|
38
37
|
analyticsSource = _ref2.analyticsSource,
|
|
39
38
|
objectAri = _ref2.objectAri,
|
|
40
39
|
siteAri = _ref2.siteAri,
|
|
@@ -46,7 +45,6 @@ var AutomationMenuContextContainer = exports.AutomationMenuContextContainer = fu
|
|
|
46
45
|
onRuleInvocationFailure = _ref2.onRuleInvocationFailure,
|
|
47
46
|
onRuleInvocationLifecycleDone = _ref2.onRuleInvocationLifecycleDone;
|
|
48
47
|
return /*#__PURE__*/_react.default.createElement(_manualTriggersContainer.ManualRulesContainer, {
|
|
49
|
-
env: environment,
|
|
50
48
|
site: siteAri,
|
|
51
49
|
query: {
|
|
52
50
|
objects: [objectAri]
|
|
@@ -15,7 +15,6 @@ var _action = _interopRequireDefault(require("../action"));
|
|
|
15
15
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
16
16
|
var _constants = require("../../../../../constants");
|
|
17
17
|
var _messages = require("../../../../../messages");
|
|
18
|
-
var _linkProvider = require("@atlaskit/link-provider");
|
|
19
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
20
|
var AutomationModal = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
@@ -30,16 +29,13 @@ var handleAutomationActionClose = function handleAutomationActionClose(setIsModa
|
|
|
30
29
|
setIsModalOpen(false);
|
|
31
30
|
};
|
|
32
31
|
var AutomationAction = function AutomationAction(props) {
|
|
33
|
-
var
|
|
32
|
+
var _context$actions;
|
|
34
33
|
var _useState = (0, _react.useState)(false),
|
|
35
34
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
36
35
|
isModalOpen = _useState2[0],
|
|
37
36
|
setIsModalOpen = _useState2[1];
|
|
38
37
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
39
38
|
formatMessage = _useIntl.formatMessage;
|
|
40
|
-
var smartLinkContext = (0, _linkProvider.useSmartLinkContext)();
|
|
41
|
-
var connections = smartLinkContext.connections;
|
|
42
|
-
var environment = (_ref = connections.client.envKey) !== null && _ref !== void 0 ? _ref : 'prod';
|
|
43
39
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
44
40
|
var automationActionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.AutomationAction];
|
|
45
41
|
if (!automationActionData) {
|
|
@@ -83,7 +79,6 @@ var AutomationAction = function AutomationAction(props) {
|
|
|
83
79
|
_react.default.createElement(_react.Suspense, {
|
|
84
80
|
fallback: false
|
|
85
81
|
}, /*#__PURE__*/_react.default.createElement(AutomationModal, {
|
|
86
|
-
environment: environment,
|
|
87
82
|
baseAutomationUrl: baseAutomationUrl,
|
|
88
83
|
objectAri: objectAri,
|
|
89
84
|
siteAri: siteAri,
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "27.
|
|
20
|
+
packageVersion: "27.1.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "27.
|
|
7
|
+
packageVersion: "27.1.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|