@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
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { extractCloudIdAndProductFromSite, getSearchUrl, getInvocationUrl, performGetRequest, performPostRequest
|
|
2
|
-
export { getAutomationStackFromLocalStorage, getAutomationStack } from './stack-resolver';
|
|
1
|
+
export { extractCloudIdAndProductFromSite, getSearchUrl, getInvocationUrl, performGetRequest, performPostRequest } from './api';
|
|
@@ -13,11 +13,10 @@ import UserInputForm from './manual-triggers-form/main';
|
|
|
13
13
|
/**
|
|
14
14
|
* React hook that implements the fetch and invoke actions for manual triggers.
|
|
15
15
|
* Can be used standalone or in the HOC provided below.
|
|
16
|
-
* @param env - The environment to retrieve rules from
|
|
17
16
|
* @param site - The site to filter on. We map this to just a cloudId to resolve the manual rules API path
|
|
18
17
|
* @param query - Query object containing filter props (container, object(s))
|
|
19
18
|
*/
|
|
20
|
-
export var useManualRules = function useManualRules(
|
|
19
|
+
export var useManualRules = function useManualRules(site, query) {
|
|
21
20
|
var _useState = useState(false),
|
|
22
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
23
22
|
initialised = _useState2[0],
|
|
@@ -45,7 +44,7 @@ export var useManualRules = function useManualRules(env, site, query) {
|
|
|
45
44
|
setInitialised(false);
|
|
46
45
|
_context.prev = 1;
|
|
47
46
|
_context.next = 4;
|
|
48
|
-
return searchManuallyTriggeredRules(
|
|
47
|
+
return searchManuallyTriggeredRules(site, query);
|
|
49
48
|
case 4:
|
|
50
49
|
fetchedRules = _context.sent;
|
|
51
50
|
setError(null);
|
|
@@ -89,11 +88,10 @@ export var useManualRules = function useManualRules(env, site, query) {
|
|
|
89
88
|
* should not care about this, only how to trigger invocation and understand
|
|
90
89
|
* the invocation lifecycle.
|
|
91
90
|
*
|
|
92
|
-
* @param props -
|
|
91
|
+
* @param props - cloudId, projectId, children
|
|
93
92
|
*/
|
|
94
93
|
export var ManualRulesContainer = function ManualRulesContainer(props) {
|
|
95
|
-
var
|
|
96
|
-
site = props.site,
|
|
94
|
+
var site = props.site,
|
|
97
95
|
query = props.query,
|
|
98
96
|
children = props.children,
|
|
99
97
|
onInputsModalOpened = props.onInputsModalOpened,
|
|
@@ -103,7 +101,7 @@ export var ManualRulesContainer = function ManualRulesContainer(props) {
|
|
|
103
101
|
onRuleInvocationFailure = props.onRuleInvocationFailure,
|
|
104
102
|
onRuleInvocationLifecycleDone = props.onRuleInvocationLifecycleDone;
|
|
105
103
|
// Initial data loading state
|
|
106
|
-
var _useManualRules = useManualRules(
|
|
104
|
+
var _useManualRules = useManualRules(site, query),
|
|
107
105
|
_useManualRules2 = _slicedToArray(_useManualRules, 4),
|
|
108
106
|
triggerFetch = _useManualRules2[0],
|
|
109
107
|
initialised = _useManualRules2[1],
|
|
@@ -169,7 +167,7 @@ export var ManualRulesContainer = function ManualRulesContainer(props) {
|
|
|
169
167
|
onRuleInvocationLifecycleStarted(ruleId, objects, userInputs);
|
|
170
168
|
}
|
|
171
169
|
_context2.next = 7;
|
|
172
|
-
return invokeManuallyTriggeredRule(
|
|
170
|
+
return invokeManuallyTriggeredRule(site, ruleId, objects, userInputs);
|
|
173
171
|
case 7:
|
|
174
172
|
response = _context2.sent;
|
|
175
173
|
_failedObjects = getFailedObjects(response);
|
|
@@ -7,18 +7,18 @@ import { getInvocationUrl, getSearchUrl, performPostRequest } from './../common/
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Manual trigger rules API fetch. Fetches a list of manually triggered rules according to the context provided
|
|
10
|
-
* in
|
|
11
|
-
* @param
|
|
10
|
+
* in query.
|
|
11
|
+
* @param site - the site ARI to fetch the rules against
|
|
12
12
|
* @param query - the workspace/container/objects to fetch rules against
|
|
13
13
|
*/
|
|
14
14
|
export var searchManuallyTriggeredRules = /*#__PURE__*/function () {
|
|
15
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(
|
|
15
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(site, query) {
|
|
16
16
|
var url, response;
|
|
17
17
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
18
18
|
while (1) switch (_context.prev = _context.next) {
|
|
19
19
|
case 0:
|
|
20
20
|
_context.next = 2;
|
|
21
|
-
return getSearchUrl(
|
|
21
|
+
return getSearchUrl(site);
|
|
22
22
|
case 2:
|
|
23
23
|
url = _context.sent;
|
|
24
24
|
_context.next = 5;
|
|
@@ -27,7 +27,7 @@ export var searchManuallyTriggeredRules = /*#__PURE__*/function () {
|
|
|
27
27
|
});
|
|
28
28
|
case 5:
|
|
29
29
|
response = _context.sent;
|
|
30
|
-
return _context.abrupt("return", response.reduce(function (acc, _ref2) {
|
|
30
|
+
return _context.abrupt("return", response.data.reduce(function (acc, _ref2) {
|
|
31
31
|
var id = _ref2.id,
|
|
32
32
|
name = _ref2.name,
|
|
33
33
|
ruleScope = _ref2.ruleScope,
|
|
@@ -45,27 +45,26 @@ export var searchManuallyTriggeredRules = /*#__PURE__*/function () {
|
|
|
45
45
|
}
|
|
46
46
|
}, _callee);
|
|
47
47
|
}));
|
|
48
|
-
return function searchManuallyTriggeredRules(_x, _x2
|
|
48
|
+
return function searchManuallyTriggeredRules(_x, _x2) {
|
|
49
49
|
return _ref.apply(this, arguments);
|
|
50
50
|
};
|
|
51
51
|
}();
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Invoke a manually triggered rule via the API.
|
|
55
|
-
* @param env - the environment to use when invoking the rule
|
|
56
55
|
* @param cloudId - the site the rule belongs to
|
|
57
56
|
* @param ruleId - the identifier of the rule you want to invoke
|
|
58
57
|
* @param objects - the list of objects you wish to create an automation event for.
|
|
59
58
|
* @param userInputs - the optional user inputs if this manual trigger requires them
|
|
60
59
|
*/
|
|
61
60
|
export var invokeManuallyTriggeredRule = /*#__PURE__*/function () {
|
|
62
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(
|
|
61
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(site, ruleId, objects, userInputs) {
|
|
63
62
|
var url, bodyRaw;
|
|
64
63
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
65
64
|
while (1) switch (_context2.prev = _context2.next) {
|
|
66
65
|
case 0:
|
|
67
66
|
_context2.next = 2;
|
|
68
|
-
return getInvocationUrl(
|
|
67
|
+
return getInvocationUrl(site, ruleId);
|
|
69
68
|
case 2:
|
|
70
69
|
url = _context2.sent;
|
|
71
70
|
bodyRaw = {
|
|
@@ -83,7 +82,7 @@ export var invokeManuallyTriggeredRule = /*#__PURE__*/function () {
|
|
|
83
82
|
}
|
|
84
83
|
}, _callee2);
|
|
85
84
|
}));
|
|
86
|
-
return function invokeManuallyTriggeredRule(_x4, _x5, _x6
|
|
85
|
+
return function invokeManuallyTriggeredRule(_x3, _x4, _x5, _x6) {
|
|
87
86
|
return _ref3.apply(this, arguments);
|
|
88
87
|
};
|
|
89
88
|
}();
|
|
@@ -7,8 +7,7 @@ import { AutomationModalBody } from './sub-components/body';
|
|
|
7
7
|
import { AutomationModalFooter } from './sub-components/footer';
|
|
8
8
|
import { AutomationModalHeader } from './sub-components/header';
|
|
9
9
|
export var AutomationModal = function AutomationModal(_ref) {
|
|
10
|
-
var
|
|
11
|
-
baseAutomationUrl = _ref.baseAutomationUrl,
|
|
10
|
+
var baseAutomationUrl = _ref.baseAutomationUrl,
|
|
12
11
|
siteAri = _ref.siteAri,
|
|
13
12
|
objectAri = _ref.objectAri,
|
|
14
13
|
canManageAutomation = _ref.canManageAutomation,
|
|
@@ -34,7 +33,6 @@ export var AutomationModal = function AutomationModal(_ref) {
|
|
|
34
33
|
}).fire();
|
|
35
34
|
}, [createAnalyticsEvent, analyticsSource]);
|
|
36
35
|
return /*#__PURE__*/React.createElement(AutomationMenuContextContainer, {
|
|
37
|
-
environment: environment,
|
|
38
36
|
baseAutomationUrl: baseAutomationUrl,
|
|
39
37
|
objectAri: objectAri,
|
|
40
38
|
siteAri: siteAri,
|
|
@@ -24,8 +24,7 @@ export var useAutomationMenu = function useAutomationMenu() {
|
|
|
24
24
|
return context;
|
|
25
25
|
};
|
|
26
26
|
export var AutomationMenuContextContainer = function AutomationMenuContextContainer(_ref2) {
|
|
27
|
-
var
|
|
28
|
-
baseAutomationUrl = _ref2.baseAutomationUrl,
|
|
27
|
+
var baseAutomationUrl = _ref2.baseAutomationUrl,
|
|
29
28
|
analyticsSource = _ref2.analyticsSource,
|
|
30
29
|
objectAri = _ref2.objectAri,
|
|
31
30
|
siteAri = _ref2.siteAri,
|
|
@@ -37,7 +36,6 @@ export var AutomationMenuContextContainer = function AutomationMenuContextContai
|
|
|
37
36
|
onRuleInvocationFailure = _ref2.onRuleInvocationFailure,
|
|
38
37
|
onRuleInvocationLifecycleDone = _ref2.onRuleInvocationLifecycleDone;
|
|
39
38
|
return /*#__PURE__*/React.createElement(ManualRulesContainer, {
|
|
40
|
-
env: environment,
|
|
41
39
|
site: siteAri,
|
|
42
40
|
query: {
|
|
43
41
|
objects: [objectAri]
|
|
@@ -7,7 +7,6 @@ import Action from '../action';
|
|
|
7
7
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
8
|
import { ActionName } from '../../../../../constants';
|
|
9
9
|
import { messages } from '../../../../../messages';
|
|
10
|
-
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
11
10
|
var AutomationModal = /*#__PURE__*/lazy(function () {
|
|
12
11
|
return import( /* webpackChunkName: "@atlaskit-internal_smart-card-automation-modal" */'./automation-manual-triggers/manual-triggers-modal');
|
|
13
12
|
});
|
|
@@ -18,16 +17,13 @@ var handleAutomationActionClose = function handleAutomationActionClose(setIsModa
|
|
|
18
17
|
setIsModalOpen(false);
|
|
19
18
|
};
|
|
20
19
|
var AutomationAction = function AutomationAction(props) {
|
|
21
|
-
var
|
|
20
|
+
var _context$actions;
|
|
22
21
|
var _useState = useState(false),
|
|
23
22
|
_useState2 = _slicedToArray(_useState, 2),
|
|
24
23
|
isModalOpen = _useState2[0],
|
|
25
24
|
setIsModalOpen = _useState2[1];
|
|
26
25
|
var _useIntl = useIntl(),
|
|
27
26
|
formatMessage = _useIntl.formatMessage;
|
|
28
|
-
var smartLinkContext = useSmartLinkContext();
|
|
29
|
-
var connections = smartLinkContext.connections;
|
|
30
|
-
var environment = (_ref = connections.client.envKey) !== null && _ref !== void 0 ? _ref : 'prod';
|
|
31
27
|
var context = useFlexibleUiContext();
|
|
32
28
|
var automationActionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.AutomationAction];
|
|
33
29
|
if (!automationActionData) {
|
|
@@ -71,7 +67,6 @@ var AutomationAction = function AutomationAction(props) {
|
|
|
71
67
|
React.createElement(Suspense, {
|
|
72
68
|
fallback: false
|
|
73
69
|
}, /*#__PURE__*/React.createElement(AutomationModal, {
|
|
74
|
-
environment: environment,
|
|
75
70
|
baseAutomationUrl: baseAutomationUrl,
|
|
76
71
|
objectAri: objectAri,
|
|
77
72
|
siteAri: siteAri,
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "27.
|
|
13
|
+
packageVersion: "27.1.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -51,11 +51,13 @@ export type InvokeManualRulePayload = {
|
|
|
51
51
|
userInputs?: UserInputs;
|
|
52
52
|
};
|
|
53
53
|
export type GetManualRulesResponse = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
data: {
|
|
55
|
+
id: number;
|
|
56
|
+
name: string;
|
|
57
|
+
ruleScope: RuleScope;
|
|
58
|
+
userInputs: UserInputPrompt[];
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
59
61
|
export type ManualRuleInvoker = (ruleId: number, objects: Ari[]) => void;
|
|
60
62
|
export type RuleQuery = {
|
|
61
63
|
objects?: Ari[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ari
|
|
1
|
+
import type { Ari } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* This function will extract the cloud ID and product from a product level Site ARI.
|
|
4
4
|
* ARIs can be found at the following link: {@link https://developer.atlassian.com/platform/atlassian-resource-identifier/resource-owners/registry/#ari-registry}
|
|
@@ -20,12 +20,7 @@ export declare const extractCloudIdAndProductFromSite: (site: Ari) => {
|
|
|
20
20
|
* model language is used here, even though for the meantime we only concern ourselves with alerts.
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export declare const getSearchUrl: (
|
|
24
|
-
export declare const getInvocationUrl: (
|
|
23
|
+
export declare const getSearchUrl: (site: Ari) => Promise<string>;
|
|
24
|
+
export declare const getInvocationUrl: (site: Ari, ruleId: number) => Promise<string>;
|
|
25
25
|
export declare const performGetRequest: (url: string, options?: RequestInit) => Promise<any>;
|
|
26
26
|
export declare const performPostRequest: (url: string, options?: RequestInit) => Promise<any>;
|
|
27
|
-
export declare const getBaseAutomationUrl: ({ projectKey, projectType, isSimplified, }: {
|
|
28
|
-
isSimplified: boolean;
|
|
29
|
-
projectType: ProjectType | undefined;
|
|
30
|
-
projectKey: ProjectKey;
|
|
31
|
-
}) => string;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { extractCloudIdAndProductFromSite, getSearchUrl, getInvocationUrl, performGetRequest, performPostRequest,
|
|
2
|
-
export { getAutomationStackFromLocalStorage, getAutomationStack, } from './stack-resolver';
|
|
1
|
+
export { extractCloudIdAndProductFromSite, getSearchUrl, getInvocationUrl, performGetRequest, performPostRequest, } from './api';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { searchManuallyTriggeredRules, invokeManuallyTriggeredRule, } from './services';
|
|
2
|
-
export { getBaseAutomationUrl } from './common/utils';
|
|
3
2
|
export type { RuleScope, UserInputType, UserInputPrompt, UserInputValue, UserInputs, ManualRule, ManualRulesById, InvocationResult, InvocationResponse, InvokeManualRulePayload, GetManualRulesResponse, ManualRuleInvoker, } from './common/types';
|
|
4
3
|
export { useManualRules, ManualRulesContainer, type ManualRulesContainerProps, type ManualRulesData, } from './main';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Ari,
|
|
2
|
+
import type { Ari, ManualRule, ManualRuleInvoker, RuleQuery, UserInputs } from './common/types';
|
|
3
3
|
/**
|
|
4
4
|
* React hook that implements the fetch and invoke actions for manual triggers.
|
|
5
5
|
* Can be used standalone or in the HOC provided below.
|
|
6
|
-
* @param env - The environment to retrieve rules from
|
|
7
6
|
* @param site - The site to filter on. We map this to just a cloudId to resolve the manual rules API path
|
|
8
7
|
* @param query - Query object containing filter props (container, object(s))
|
|
9
8
|
*/
|
|
10
|
-
export declare const useManualRules: (
|
|
9
|
+
export declare const useManualRules: (site: Ari, query: RuleQuery) => any[];
|
|
11
10
|
export interface ManualRulesData {
|
|
12
11
|
triggerFetch: () => Promise<void>;
|
|
13
12
|
initialised: boolean;
|
|
@@ -17,7 +16,6 @@ export interface ManualRulesData {
|
|
|
17
16
|
invokeRuleOrShowDialog: ManualRuleInvoker;
|
|
18
17
|
}
|
|
19
18
|
export interface ManualRulesContainerProps {
|
|
20
|
-
env: Environment | null;
|
|
21
19
|
site: Ari;
|
|
22
20
|
query: RuleQuery;
|
|
23
21
|
onInputsModalOpened?: () => void;
|
|
@@ -47,6 +45,6 @@ export interface ManualRulesContainerProps {
|
|
|
47
45
|
* should not care about this, only how to trigger invocation and understand
|
|
48
46
|
* the invocation lifecycle.
|
|
49
47
|
*
|
|
50
|
-
* @param props -
|
|
48
|
+
* @param props - cloudId, projectId, children
|
|
51
49
|
*/
|
|
52
50
|
export declare const ManualRulesContainer: React.FC<ManualRulesContainerProps>;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type { Ari,
|
|
1
|
+
import type { Ari, InvocationResponse, ManualRulesById, RuleQuery, UserInputs } from './../common/types';
|
|
2
2
|
/**
|
|
3
3
|
* Manual trigger rules API fetch. Fetches a list of manually triggered rules according to the context provided
|
|
4
|
-
* in
|
|
5
|
-
* @param
|
|
4
|
+
* in query.
|
|
5
|
+
* @param site - the site ARI to fetch the rules against
|
|
6
6
|
* @param query - the workspace/container/objects to fetch rules against
|
|
7
7
|
*/
|
|
8
|
-
export declare const searchManuallyTriggeredRules: (
|
|
8
|
+
export declare const searchManuallyTriggeredRules: (site: Ari, query: RuleQuery) => Promise<ManualRulesById>;
|
|
9
9
|
/**
|
|
10
10
|
* Invoke a manually triggered rule via the API.
|
|
11
|
-
* @param env - the environment to use when invoking the rule
|
|
12
11
|
* @param cloudId - the site the rule belongs to
|
|
13
12
|
* @param ruleId - the identifier of the rule you want to invoke
|
|
14
13
|
* @param objects - the list of objects you wish to create an automation event for.
|
|
15
14
|
* @param userInputs - the optional user inputs if this manual trigger requires them
|
|
16
15
|
*/
|
|
17
|
-
export declare const invokeManuallyTriggeredRule: (
|
|
16
|
+
export declare const invokeManuallyTriggeredRule: (site: Ari, ruleId: number, objects: string[], userInputs?: UserInputs) => Promise<InvocationResponse>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Environment } from '../manual-triggers-container/common/types';
|
|
3
2
|
export type AutomationModalProps = {
|
|
4
|
-
environment: Environment;
|
|
5
3
|
baseAutomationUrl: string;
|
|
6
4
|
objectAri: string;
|
|
7
5
|
siteAri: string;
|
|
@@ -14,4 +12,4 @@ export type AutomationModalProps = {
|
|
|
14
12
|
onClose: () => void;
|
|
15
13
|
onCloseComplete?: () => void;
|
|
16
14
|
};
|
|
17
|
-
export declare const AutomationModal: ({
|
|
15
|
+
export declare const AutomationModal: ({ baseAutomationUrl, siteAri, objectAri, canManageAutomation, onClose, onCloseComplete, modalTitle, modalDescription, emptyStateDescription, emptyStateAdminDescription, analyticsSource, }: AutomationModalProps) => JSX.Element;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ManualRulesData } from '../../manual-triggers-container';
|
|
3
|
-
import { type Environment } from '../../manual-triggers-container/common/types';
|
|
4
3
|
type AutomationMenuContextContainerProps = {
|
|
5
|
-
environment: Environment;
|
|
6
4
|
baseAutomationUrl: string;
|
|
7
5
|
objectAri: string;
|
|
8
6
|
siteAri: string;
|
|
@@ -24,5 +22,5 @@ export type MenuContext = ManualRulesData & {
|
|
|
24
22
|
emptyStateAdminDescription?: React.ReactNode;
|
|
25
23
|
};
|
|
26
24
|
export declare const useAutomationMenu: () => MenuContext;
|
|
27
|
-
export declare const AutomationMenuContextContainer: ({
|
|
25
|
+
export declare const AutomationMenuContextContainer: ({ baseAutomationUrl, analyticsSource, objectAri, siteAri, canManageAutomation, children, emptyStateDescription, emptyStateAdminDescription, onRuleInvocationSuccess, onRuleInvocationFailure, onRuleInvocationLifecycleDone, }: AutomationMenuContextContainerProps) => JSX.Element;
|
|
28
26
|
export {};
|
|
@@ -51,11 +51,13 @@ export type InvokeManualRulePayload = {
|
|
|
51
51
|
userInputs?: UserInputs;
|
|
52
52
|
};
|
|
53
53
|
export type GetManualRulesResponse = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
data: {
|
|
55
|
+
id: number;
|
|
56
|
+
name: string;
|
|
57
|
+
ruleScope: RuleScope;
|
|
58
|
+
userInputs: UserInputPrompt[];
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
59
61
|
export type ManualRuleInvoker = (ruleId: number, objects: Ari[]) => void;
|
|
60
62
|
export type RuleQuery = {
|
|
61
63
|
objects?: Ari[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ari
|
|
1
|
+
import type { Ari } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* This function will extract the cloud ID and product from a product level Site ARI.
|
|
4
4
|
* ARIs can be found at the following link: {@link https://developer.atlassian.com/platform/atlassian-resource-identifier/resource-owners/registry/#ari-registry}
|
|
@@ -20,12 +20,7 @@ export declare const extractCloudIdAndProductFromSite: (site: Ari) => {
|
|
|
20
20
|
* model language is used here, even though for the meantime we only concern ourselves with alerts.
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export declare const getSearchUrl: (
|
|
24
|
-
export declare const getInvocationUrl: (
|
|
23
|
+
export declare const getSearchUrl: (site: Ari) => Promise<string>;
|
|
24
|
+
export declare const getInvocationUrl: (site: Ari, ruleId: number) => Promise<string>;
|
|
25
25
|
export declare const performGetRequest: (url: string, options?: RequestInit) => Promise<any>;
|
|
26
26
|
export declare const performPostRequest: (url: string, options?: RequestInit) => Promise<any>;
|
|
27
|
-
export declare const getBaseAutomationUrl: ({ projectKey, projectType, isSimplified, }: {
|
|
28
|
-
isSimplified: boolean;
|
|
29
|
-
projectType: ProjectType | undefined;
|
|
30
|
-
projectKey: ProjectKey;
|
|
31
|
-
}) => string;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { extractCloudIdAndProductFromSite, getSearchUrl, getInvocationUrl, performGetRequest, performPostRequest,
|
|
2
|
-
export { getAutomationStackFromLocalStorage, getAutomationStack, } from './stack-resolver';
|
|
1
|
+
export { extractCloudIdAndProductFromSite, getSearchUrl, getInvocationUrl, performGetRequest, performPostRequest, } from './api';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { searchManuallyTriggeredRules, invokeManuallyTriggeredRule, } from './services';
|
|
2
|
-
export { getBaseAutomationUrl } from './common/utils';
|
|
3
2
|
export type { RuleScope, UserInputType, UserInputPrompt, UserInputValue, UserInputs, ManualRule, ManualRulesById, InvocationResult, InvocationResponse, InvokeManualRulePayload, GetManualRulesResponse, ManualRuleInvoker, } from './common/types';
|
|
4
3
|
export { useManualRules, ManualRulesContainer, type ManualRulesContainerProps, type ManualRulesData, } from './main';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Ari,
|
|
2
|
+
import type { Ari, ManualRule, ManualRuleInvoker, RuleQuery, UserInputs } from './common/types';
|
|
3
3
|
/**
|
|
4
4
|
* React hook that implements the fetch and invoke actions for manual triggers.
|
|
5
5
|
* Can be used standalone or in the HOC provided below.
|
|
6
|
-
* @param env - The environment to retrieve rules from
|
|
7
6
|
* @param site - The site to filter on. We map this to just a cloudId to resolve the manual rules API path
|
|
8
7
|
* @param query - Query object containing filter props (container, object(s))
|
|
9
8
|
*/
|
|
10
|
-
export declare const useManualRules: (
|
|
9
|
+
export declare const useManualRules: (site: Ari, query: RuleQuery) => any[];
|
|
11
10
|
export interface ManualRulesData {
|
|
12
11
|
triggerFetch: () => Promise<void>;
|
|
13
12
|
initialised: boolean;
|
|
@@ -17,7 +16,6 @@ export interface ManualRulesData {
|
|
|
17
16
|
invokeRuleOrShowDialog: ManualRuleInvoker;
|
|
18
17
|
}
|
|
19
18
|
export interface ManualRulesContainerProps {
|
|
20
|
-
env: Environment | null;
|
|
21
19
|
site: Ari;
|
|
22
20
|
query: RuleQuery;
|
|
23
21
|
onInputsModalOpened?: () => void;
|
|
@@ -47,6 +45,6 @@ export interface ManualRulesContainerProps {
|
|
|
47
45
|
* should not care about this, only how to trigger invocation and understand
|
|
48
46
|
* the invocation lifecycle.
|
|
49
47
|
*
|
|
50
|
-
* @param props -
|
|
48
|
+
* @param props - cloudId, projectId, children
|
|
51
49
|
*/
|
|
52
50
|
export declare const ManualRulesContainer: React.FC<ManualRulesContainerProps>;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type { Ari,
|
|
1
|
+
import type { Ari, InvocationResponse, ManualRulesById, RuleQuery, UserInputs } from './../common/types';
|
|
2
2
|
/**
|
|
3
3
|
* Manual trigger rules API fetch. Fetches a list of manually triggered rules according to the context provided
|
|
4
|
-
* in
|
|
5
|
-
* @param
|
|
4
|
+
* in query.
|
|
5
|
+
* @param site - the site ARI to fetch the rules against
|
|
6
6
|
* @param query - the workspace/container/objects to fetch rules against
|
|
7
7
|
*/
|
|
8
|
-
export declare const searchManuallyTriggeredRules: (
|
|
8
|
+
export declare const searchManuallyTriggeredRules: (site: Ari, query: RuleQuery) => Promise<ManualRulesById>;
|
|
9
9
|
/**
|
|
10
10
|
* Invoke a manually triggered rule via the API.
|
|
11
|
-
* @param env - the environment to use when invoking the rule
|
|
12
11
|
* @param cloudId - the site the rule belongs to
|
|
13
12
|
* @param ruleId - the identifier of the rule you want to invoke
|
|
14
13
|
* @param objects - the list of objects you wish to create an automation event for.
|
|
15
14
|
* @param userInputs - the optional user inputs if this manual trigger requires them
|
|
16
15
|
*/
|
|
17
|
-
export declare const invokeManuallyTriggeredRule: (
|
|
16
|
+
export declare const invokeManuallyTriggeredRule: (site: Ari, ruleId: number, objects: string[], userInputs?: UserInputs) => Promise<InvocationResponse>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Environment } from '../manual-triggers-container/common/types';
|
|
3
2
|
export type AutomationModalProps = {
|
|
4
|
-
environment: Environment;
|
|
5
3
|
baseAutomationUrl: string;
|
|
6
4
|
objectAri: string;
|
|
7
5
|
siteAri: string;
|
|
@@ -14,4 +12,4 @@ export type AutomationModalProps = {
|
|
|
14
12
|
onClose: () => void;
|
|
15
13
|
onCloseComplete?: () => void;
|
|
16
14
|
};
|
|
17
|
-
export declare const AutomationModal: ({
|
|
15
|
+
export declare const AutomationModal: ({ baseAutomationUrl, siteAri, objectAri, canManageAutomation, onClose, onCloseComplete, modalTitle, modalDescription, emptyStateDescription, emptyStateAdminDescription, analyticsSource, }: AutomationModalProps) => JSX.Element;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ManualRulesData } from '../../manual-triggers-container';
|
|
3
|
-
import { type Environment } from '../../manual-triggers-container/common/types';
|
|
4
3
|
type AutomationMenuContextContainerProps = {
|
|
5
|
-
environment: Environment;
|
|
6
4
|
baseAutomationUrl: string;
|
|
7
5
|
objectAri: string;
|
|
8
6
|
siteAri: string;
|
|
@@ -24,5 +22,5 @@ export type MenuContext = ManualRulesData & {
|
|
|
24
22
|
emptyStateAdminDescription?: React.ReactNode;
|
|
25
23
|
};
|
|
26
24
|
export declare const useAutomationMenu: () => MenuContext;
|
|
27
|
-
export declare const AutomationMenuContextContainer: ({
|
|
25
|
+
export declare const AutomationMenuContextContainer: ({ baseAutomationUrl, analyticsSource, objectAri, siteAri, canManageAutomation, children, emptyStateDescription, emptyStateAdminDescription, onRuleInvocationSuccess, onRuleInvocationFailure, onRuleInvocationLifecycleDone, }: AutomationMenuContextContainerProps) => JSX.Element;
|
|
28
26
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.1.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/avatar": "^21.9.0",
|
|
34
34
|
"@atlaskit/avatar-group": "^9.6.0",
|
|
35
35
|
"@atlaskit/badge": "^16.1.0",
|
|
36
|
-
"@atlaskit/button": "^17.
|
|
36
|
+
"@atlaskit/button": "^17.17.0",
|
|
37
37
|
"@atlaskit/checkbox": "^13.3.0",
|
|
38
38
|
"@atlaskit/dropdown-menu": "^12.10.0",
|
|
39
39
|
"@atlaskit/form": "^10.2.0",
|