@atlaskit/smart-card 26.69.1 → 26.70.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/extractors/flexible/actions/extract-automation-action.js +1 -1
- package/dist/cjs/messages.js +2 -2
- 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/messages.js +64 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.js +78 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +127 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.js +18 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +183 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.js +55 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.js +138 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.js +38 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +249 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +28 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.js +136 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.js +59 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.js +49 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.js +52 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.js +38 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +95 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.js +14 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.js +74 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.js +18 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.js +70 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.js +39 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.js +136 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.js +93 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.js +66 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.js +50 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.js +121 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.js +60 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.js +29 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.js +69 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.js +32 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.js +86 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +54 -12
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/extract-automation-action.js +1 -1
- package/dist/es2019/messages.js +2 -2
- 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/messages.js +58 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.js +71 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +74 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.js +12 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +103 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.js +51 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +156 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +23 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.js +126 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.js +52 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.js +44 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.js +45 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.js +31 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +53 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.js +62 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.js +61 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.js +32 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.js +127 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.js +89 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.js +57 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.js +44 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.js +117 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.js +57 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.js +20 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.js +65 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.js +25 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.js +79 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +49 -11
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/extract-automation-action.js +1 -1
- package/dist/esm/messages.js +2 -2
- 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/messages.js +58 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.js +71 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +118 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.js +12 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +177 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.js +131 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.js +3 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +240 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +21 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.js +126 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.js +52 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.js +42 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.js +45 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.js +31 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +89 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.js +3 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.js +64 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.js +61 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.js +30 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.js +129 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.js +86 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.js +59 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.js +43 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.js +114 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.js +53 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.js +22 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.js +62 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.js +25 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.js +80 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +51 -11
- 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/messages.d.ts +58 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.d.ts +27 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.d.ts +94 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.d.ts +31 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.d.ts +52 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.d.ts +11 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.d.ts +12 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.d.ts +17 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.d.ts +17 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.d.ts +28 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.d.ts +9 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/messages.d.ts +58 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/mocks.d.ts +6 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.d.ts +27 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/types.d.ts +94 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.d.ts +31 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.d.ts +52 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/main.d.ts +11 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/number-prompt/main.d.ts +12 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/select-prompt/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/text-prompt/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.d.ts +17 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/main.d.ts +17 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/menu-context/main.d.ts +28 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/body/main.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/empty-icon/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/empty-state/main.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/error-icon/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/error-state/main.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/manual-trigger-icon/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule/main.d.ts +9 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/rule-list/main.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.d.ts +7 -0
- package/package.json +9 -2
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
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; }
|
|
4
|
+
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) { _defineProperty(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; }
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
+
import { getAutomationStack } from './stack-resolver';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This function will extract the cloud ID and product from a product level Site ARI.
|
|
10
|
+
* ARIs can be found at the following link: {@link https://developer.atlassian.com/platform/atlassian-resource-identifier/resource-owners/registry/#ari-registry}
|
|
11
|
+
* @param site The Site ARI where the manual trigger rule is executed. Should be a product level Site ARI.
|
|
12
|
+
*/
|
|
13
|
+
export var extractCloudIdAndProductFromSite = function extractCloudIdAndProductFromSite(site) {
|
|
14
|
+
var cloudId;
|
|
15
|
+
var resourceOwner;
|
|
16
|
+
var resourceType;
|
|
17
|
+
var ariRegex = new RegExp("^ari:cloud:([a-zA-Z.\\-]+)::([a-zA-Z.\\-]+)/([a-zA-Z0-9\\-]+)");
|
|
18
|
+
var parsedAri = site.match(ariRegex);
|
|
19
|
+
if (parsedAri) {
|
|
20
|
+
resourceOwner = parsedAri[1];
|
|
21
|
+
resourceType = parsedAri[2];
|
|
22
|
+
cloudId = parsedAri[3];
|
|
23
|
+
}
|
|
24
|
+
// Keep backwards compatibility for platform site ARIs
|
|
25
|
+
if (resourceOwner === 'platform') {
|
|
26
|
+
resourceOwner = 'jira';
|
|
27
|
+
}
|
|
28
|
+
if (resourceType !== 'site' || cloudId === undefined || resourceOwner === undefined) {
|
|
29
|
+
throw new Error('Not a site ARI: ' + site);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
product: resourceOwner,
|
|
33
|
+
cloudId: cloudId
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/***
|
|
38
|
+
* TODO remove when unified public API is available.
|
|
39
|
+
*
|
|
40
|
+
* Currently we're in a transitory phase where we have one API for invocation for Jira, and one for JSM. They concern themselves
|
|
41
|
+
* with issues and alerts respectively.
|
|
42
|
+
*
|
|
43
|
+
* We are working on a unified public API that only cares about product-agnostic filters like object, workspace, container as
|
|
44
|
+
* part of the collaboration model. For the meantime, you'll see two APIs instead. In this package, we're only using the
|
|
45
|
+
* alerts API. It is this API that will be expanded to retroactively support Jira, and thus the updated collaboration
|
|
46
|
+
* model language is used here, even though for the meantime we only concern ourselves with alerts.
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
export var getSearchUrl = /*#__PURE__*/function () {
|
|
50
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(env, site) {
|
|
51
|
+
var _extractCloudIdAndPro, product, cloudId, automationStack;
|
|
52
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
53
|
+
while (1) switch (_context.prev = _context.next) {
|
|
54
|
+
case 0:
|
|
55
|
+
_extractCloudIdAndPro = extractCloudIdAndProductFromSite(site), product = _extractCloudIdAndPro.product, cloudId = _extractCloudIdAndPro.cloudId;
|
|
56
|
+
_context.next = 3;
|
|
57
|
+
return getAutomationStack(env, cloudId);
|
|
58
|
+
case 3:
|
|
59
|
+
automationStack = _context.sent;
|
|
60
|
+
return _context.abrupt("return", "/gateway/api/automation/internal-api/".concat(product, "/").concat(cloudId, "/").concat(automationStack, "/rest/v1/rules/manual/search"));
|
|
61
|
+
case 5:
|
|
62
|
+
case "end":
|
|
63
|
+
return _context.stop();
|
|
64
|
+
}
|
|
65
|
+
}, _callee);
|
|
66
|
+
}));
|
|
67
|
+
return function getSearchUrl(_x, _x2) {
|
|
68
|
+
return _ref.apply(this, arguments);
|
|
69
|
+
};
|
|
70
|
+
}();
|
|
71
|
+
export var getInvocationUrl = /*#__PURE__*/function () {
|
|
72
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(env, site, ruleId) {
|
|
73
|
+
var _extractCloudIdAndPro2, product, cloudId, automationStack;
|
|
74
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
75
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
76
|
+
case 0:
|
|
77
|
+
_extractCloudIdAndPro2 = extractCloudIdAndProductFromSite(site), product = _extractCloudIdAndPro2.product, cloudId = _extractCloudIdAndPro2.cloudId;
|
|
78
|
+
_context2.next = 3;
|
|
79
|
+
return getAutomationStack(env, cloudId);
|
|
80
|
+
case 3:
|
|
81
|
+
automationStack = _context2.sent;
|
|
82
|
+
return _context2.abrupt("return", "/gateway/api/automation/internal-api/".concat(product, "/").concat(cloudId, "/").concat(automationStack, "/rest/v1/rules/manual/invocation/").concat(ruleId));
|
|
83
|
+
case 5:
|
|
84
|
+
case "end":
|
|
85
|
+
return _context2.stop();
|
|
86
|
+
}
|
|
87
|
+
}, _callee2);
|
|
88
|
+
}));
|
|
89
|
+
return function getInvocationUrl(_x3, _x4, _x5) {
|
|
90
|
+
return _ref2.apply(this, arguments);
|
|
91
|
+
};
|
|
92
|
+
}();
|
|
93
|
+
var DEFAULT_HEADER = {
|
|
94
|
+
'Content-Type': 'application/json'
|
|
95
|
+
};
|
|
96
|
+
var _performRequest = /*#__PURE__*/function () {
|
|
97
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(url, method) {
|
|
98
|
+
var options,
|
|
99
|
+
response,
|
|
100
|
+
_args3 = arguments;
|
|
101
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
102
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {
|
|
105
|
+
headers: DEFAULT_HEADER
|
|
106
|
+
};
|
|
107
|
+
_context3.next = 3;
|
|
108
|
+
return fetch(url, _objectSpread(_objectSpread({}, options), {}, {
|
|
109
|
+
method: method
|
|
110
|
+
}));
|
|
111
|
+
case 3:
|
|
112
|
+
response = _context3.sent;
|
|
113
|
+
return _context3.abrupt("return", response.json());
|
|
114
|
+
case 5:
|
|
115
|
+
case "end":
|
|
116
|
+
return _context3.stop();
|
|
117
|
+
}
|
|
118
|
+
}, _callee3);
|
|
119
|
+
}));
|
|
120
|
+
return function _performRequest(_x6, _x7) {
|
|
121
|
+
return _ref3.apply(this, arguments);
|
|
122
|
+
};
|
|
123
|
+
}();
|
|
124
|
+
export var performGetRequest = /*#__PURE__*/function () {
|
|
125
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(url, options) {
|
|
126
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
127
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
128
|
+
case 0:
|
|
129
|
+
return _context4.abrupt("return", _performRequest(url, 'GET', options));
|
|
130
|
+
case 1:
|
|
131
|
+
case "end":
|
|
132
|
+
return _context4.stop();
|
|
133
|
+
}
|
|
134
|
+
}, _callee4);
|
|
135
|
+
}));
|
|
136
|
+
return function performGetRequest(_x8, _x9) {
|
|
137
|
+
return _ref4.apply(this, arguments);
|
|
138
|
+
};
|
|
139
|
+
}();
|
|
140
|
+
export var performPostRequest = /*#__PURE__*/function () {
|
|
141
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url, options) {
|
|
142
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
143
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
144
|
+
case 0:
|
|
145
|
+
return _context5.abrupt("return", _performRequest(url, 'POST', options));
|
|
146
|
+
case 1:
|
|
147
|
+
case "end":
|
|
148
|
+
return _context5.stop();
|
|
149
|
+
}
|
|
150
|
+
}, _callee5);
|
|
151
|
+
}));
|
|
152
|
+
return function performPostRequest(_x10, _x11) {
|
|
153
|
+
return _ref5.apply(this, arguments);
|
|
154
|
+
};
|
|
155
|
+
}();
|
|
156
|
+
|
|
157
|
+
// TODO this will need to be expanded to resolve the correct product URL, too.
|
|
158
|
+
// TODO for instance this will need to support Alerts UI URL resolution in the
|
|
159
|
+
// TODO short term
|
|
160
|
+
export var getBaseAutomationUrl = function getBaseAutomationUrl(_ref6) {
|
|
161
|
+
var projectKey = _ref6.projectKey,
|
|
162
|
+
projectType = _ref6.projectType,
|
|
163
|
+
isSimplified = _ref6.isSimplified;
|
|
164
|
+
/**
|
|
165
|
+
* Confusing mapping of urls here.
|
|
166
|
+
* Classic Projects - always under /automate
|
|
167
|
+
* Next Gen Projects - under /automation for all project types except JSD
|
|
168
|
+
*/
|
|
169
|
+
switch (projectType) {
|
|
170
|
+
case 'service_desk':
|
|
171
|
+
return "/jira/servicedesk/projects/".concat(projectKey, "/settings/automate");
|
|
172
|
+
case 'business':
|
|
173
|
+
return "/jira/core/projects/".concat(projectKey, "/settings/").concat(isSimplified ? 'automation' : 'automate');
|
|
174
|
+
default:
|
|
175
|
+
return "/jira/software/".concat(isSimplified ? '' : 'c/', "projects/").concat(projectKey, "/settings/").concat(isSimplified ? 'automation' : 'automate');
|
|
176
|
+
}
|
|
177
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
+
var AUTOMATION_LOCAL_STORAGE_PREFIX = 'automationPlatform';
|
|
5
|
+
var AUTOMATION_LOCAL_STORAGE_STACK = 'automationStack';
|
|
6
|
+
var AUTOMATION_DEV_STACK_URL = 'https://localhost:8082/devStack.json';
|
|
7
|
+
var getAutomationProdStackUrl = function getAutomationProdStackUrl(cloudId) {
|
|
8
|
+
return "/gateway/api/automation/internal-api/jira/".concat(cloudId, "/pro/rest/environments");
|
|
9
|
+
};
|
|
10
|
+
var getLatestPreProdStack = /*#__PURE__*/function () {
|
|
11
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(cloudId) {
|
|
12
|
+
var response, stacksResponse, preProdStacks, _preProdStacks, _preProdStacks$, latestPreProdStack;
|
|
13
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
14
|
+
while (1) switch (_context.prev = _context.next) {
|
|
15
|
+
case 0:
|
|
16
|
+
_context.prev = 0;
|
|
17
|
+
_context.next = 3;
|
|
18
|
+
return fetch(getAutomationProdStackUrl(cloudId));
|
|
19
|
+
case 3:
|
|
20
|
+
response = _context.sent;
|
|
21
|
+
_context.next = 6;
|
|
22
|
+
return response.json();
|
|
23
|
+
case 6:
|
|
24
|
+
stacksResponse = _context.sent;
|
|
25
|
+
preProdStacks = stacksResponse.prod.otherStacks.filter(function (_ref2) {
|
|
26
|
+
var releasedSuccessfully = _ref2.releasedSuccessfully;
|
|
27
|
+
return !releasedSuccessfully;
|
|
28
|
+
}).map(function (_ref3) {
|
|
29
|
+
var stack = _ref3.stack;
|
|
30
|
+
return stack;
|
|
31
|
+
});
|
|
32
|
+
_preProdStacks = _slicedToArray(preProdStacks, 1), _preProdStacks$ = _preProdStacks[0], latestPreProdStack = _preProdStacks$ === void 0 ? null : _preProdStacks$;
|
|
33
|
+
return _context.abrupt("return", latestPreProdStack);
|
|
34
|
+
case 12:
|
|
35
|
+
_context.prev = 12;
|
|
36
|
+
_context.t0 = _context["catch"](0);
|
|
37
|
+
// eslint-disable-next-line no-console
|
|
38
|
+
console.warn("Failed to fetch pre-prod stack from ".concat(getAutomationProdStackUrl(cloudId), " with error: ").concat(_context.t0));
|
|
39
|
+
return _context.abrupt("return", null);
|
|
40
|
+
case 16:
|
|
41
|
+
case "end":
|
|
42
|
+
return _context.stop();
|
|
43
|
+
}
|
|
44
|
+
}, _callee, null, [[0, 12]]);
|
|
45
|
+
}));
|
|
46
|
+
return function getLatestPreProdStack(_x) {
|
|
47
|
+
return _ref.apply(this, arguments);
|
|
48
|
+
};
|
|
49
|
+
}();
|
|
50
|
+
var _getAutomationKeyFromLocalStorage = function _getAutomationKeyFromLocalStorage(key) {
|
|
51
|
+
return window.localStorage.getItem("".concat(AUTOMATION_LOCAL_STORAGE_PREFIX, ":").concat(key));
|
|
52
|
+
};
|
|
53
|
+
var getAutomationDevStackFromLocalServer = /*#__PURE__*/function () {
|
|
54
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
55
|
+
var devStackResponse, devStack;
|
|
56
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
57
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
58
|
+
case 0:
|
|
59
|
+
_context2.prev = 0;
|
|
60
|
+
_context2.next = 3;
|
|
61
|
+
return fetch(AUTOMATION_DEV_STACK_URL);
|
|
62
|
+
case 3:
|
|
63
|
+
devStackResponse = _context2.sent;
|
|
64
|
+
_context2.next = 6;
|
|
65
|
+
return devStackResponse.json();
|
|
66
|
+
case 6:
|
|
67
|
+
devStack = _context2.sent;
|
|
68
|
+
return _context2.abrupt("return", devStack.name);
|
|
69
|
+
case 10:
|
|
70
|
+
_context2.prev = 10;
|
|
71
|
+
_context2.t0 = _context2["catch"](0);
|
|
72
|
+
// eslint-disable-next-line no-console
|
|
73
|
+
console.warn("Failed to fetch dev stack from ".concat(AUTOMATION_DEV_STACK_URL, " with error: ").concat(_context2.t0));
|
|
74
|
+
return _context2.abrupt("return", null);
|
|
75
|
+
case 14:
|
|
76
|
+
case "end":
|
|
77
|
+
return _context2.stop();
|
|
78
|
+
}
|
|
79
|
+
}, _callee2, null, [[0, 10]]);
|
|
80
|
+
}));
|
|
81
|
+
return function getAutomationDevStackFromLocalServer() {
|
|
82
|
+
return _ref4.apply(this, arguments);
|
|
83
|
+
};
|
|
84
|
+
}();
|
|
85
|
+
export var getAutomationStackFromLocalStorage = function getAutomationStackFromLocalStorage() {
|
|
86
|
+
return _getAutomationKeyFromLocalStorage(AUTOMATION_LOCAL_STORAGE_STACK);
|
|
87
|
+
};
|
|
88
|
+
export var getAutomationStack = /*#__PURE__*/function () {
|
|
89
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(env, cloudId) {
|
|
90
|
+
var stack, stackOverride;
|
|
91
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
92
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
if (!(env === 'prod')) {
|
|
95
|
+
_context3.next = 2;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
return _context3.abrupt("return", 'pro');
|
|
99
|
+
case 2:
|
|
100
|
+
if (!(env === 'pre-prod')) {
|
|
101
|
+
_context3.next = 7;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
_context3.next = 5;
|
|
105
|
+
return getLatestPreProdStack(cloudId);
|
|
106
|
+
case 5:
|
|
107
|
+
stack = _context3.sent;
|
|
108
|
+
return _context3.abrupt("return", stack !== null && stack !== void 0 ? stack : 'pro');
|
|
109
|
+
case 7:
|
|
110
|
+
_context3.next = 9;
|
|
111
|
+
return getAutomationDevStackFromLocalServer();
|
|
112
|
+
case 9:
|
|
113
|
+
_context3.t0 = _context3.sent;
|
|
114
|
+
if (_context3.t0) {
|
|
115
|
+
_context3.next = 12;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
_context3.t0 = getAutomationStackFromLocalStorage();
|
|
119
|
+
case 12:
|
|
120
|
+
stackOverride = _context3.t0;
|
|
121
|
+
return _context3.abrupt("return", stackOverride || 'staging');
|
|
122
|
+
case 14:
|
|
123
|
+
case "end":
|
|
124
|
+
return _context3.stop();
|
|
125
|
+
}
|
|
126
|
+
}, _callee3);
|
|
127
|
+
}));
|
|
128
|
+
return function getAutomationStack(_x2, _x3) {
|
|
129
|
+
return _ref5.apply(this, arguments);
|
|
130
|
+
};
|
|
131
|
+
}();
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
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; }
|
|
5
|
+
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) { _defineProperty(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; }
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
import React, { useMemo, useState } from 'react';
|
|
8
|
+
import { di } from 'react-magnetic-di';
|
|
9
|
+
import { ModalTransition } from '@atlaskit/modal-dialog';
|
|
10
|
+
import { invokeManuallyTriggeredRule, searchManuallyTriggeredRules } from './services';
|
|
11
|
+
import UserInputForm from './manual-triggers-form/main';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* React hook that implements the fetch and invoke actions for manual triggers.
|
|
15
|
+
* Can be used standalone or in the HOC provided below.
|
|
16
|
+
* @param env - The environment to retrieve rules from
|
|
17
|
+
* @param site - The site to filter on. We map this to just a cloudId to resolve the manual rules API path
|
|
18
|
+
* @param query - Query object containing filter props (container, object(s))
|
|
19
|
+
*/
|
|
20
|
+
export var useManualRules = function useManualRules(env, site, query) {
|
|
21
|
+
var _useState = useState(false),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
initialised = _useState2[0],
|
|
24
|
+
setInitialised = _useState2[1];
|
|
25
|
+
var _useState3 = useState(null),
|
|
26
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
+
error = _useState4[0],
|
|
28
|
+
setError = _useState4[1];
|
|
29
|
+
var _useState5 = useState([]),
|
|
30
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
31
|
+
rules = _useState6[0],
|
|
32
|
+
setRules = _useState6[1];
|
|
33
|
+
var transformRules = function transformRules(ruleResponse) {
|
|
34
|
+
var rulesUnsorted = Object.values(ruleResponse);
|
|
35
|
+
return rulesUnsorted.sort(function (rule1, rule2) {
|
|
36
|
+
return rule1.name.localeCompare(rule2.name);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var triggerFetch = /*#__PURE__*/function () {
|
|
40
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
41
|
+
var fetchedRules;
|
|
42
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
43
|
+
while (1) switch (_context.prev = _context.next) {
|
|
44
|
+
case 0:
|
|
45
|
+
setInitialised(false);
|
|
46
|
+
_context.prev = 1;
|
|
47
|
+
_context.next = 4;
|
|
48
|
+
return searchManuallyTriggeredRules(env, site, query);
|
|
49
|
+
case 4:
|
|
50
|
+
fetchedRules = _context.sent;
|
|
51
|
+
setError(null);
|
|
52
|
+
setRules(transformRules(fetchedRules));
|
|
53
|
+
_context.next = 13;
|
|
54
|
+
break;
|
|
55
|
+
case 9:
|
|
56
|
+
_context.prev = 9;
|
|
57
|
+
_context.t0 = _context["catch"](1);
|
|
58
|
+
setError(_context.t0);
|
|
59
|
+
setRules([]);
|
|
60
|
+
case 13:
|
|
61
|
+
_context.prev = 13;
|
|
62
|
+
setInitialised(true);
|
|
63
|
+
return _context.finish(13);
|
|
64
|
+
case 16:
|
|
65
|
+
case "end":
|
|
66
|
+
return _context.stop();
|
|
67
|
+
}
|
|
68
|
+
}, _callee, null, [[1, 9, 13, 16]]);
|
|
69
|
+
}));
|
|
70
|
+
return function triggerFetch() {
|
|
71
|
+
return _ref.apply(this, arguments);
|
|
72
|
+
};
|
|
73
|
+
}();
|
|
74
|
+
return [triggerFetch, initialised, error, rules];
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* Container HOC that implements the above hook and behaviours.
|
|
79
|
+
*
|
|
80
|
+
* This HOC uses rendered props to allow the use of any render instructions
|
|
81
|
+
* for manual rules, while still maintaining the behaviour of invoking rules.
|
|
82
|
+
*
|
|
83
|
+
* The HOC also appends a dialog that is displayed when the {@code invokeRuleOrShowDialog}
|
|
84
|
+
* prop is called, if the underlying rule has user inputs.
|
|
85
|
+
*
|
|
86
|
+
* The component exposes the "invokingRuleId" property to the child hierarchy,
|
|
87
|
+
* because the children might care about the invocation state. It does not expose
|
|
88
|
+
* the "selected" state, or any information about the dialog, as the children
|
|
89
|
+
* should not care about this, only how to trigger invocation and understand
|
|
90
|
+
* the invocation lifecycle.
|
|
91
|
+
*
|
|
92
|
+
* @param props - environment, cloudId, projectId, children
|
|
93
|
+
*/
|
|
94
|
+
export var ManualRulesContainer = function ManualRulesContainer(props) {
|
|
95
|
+
var env = props.env,
|
|
96
|
+
site = props.site,
|
|
97
|
+
query = props.query,
|
|
98
|
+
children = props.children,
|
|
99
|
+
onInputsModalOpened = props.onInputsModalOpened,
|
|
100
|
+
onInputsModalClosed = props.onInputsModalClosed,
|
|
101
|
+
onRuleInvocationLifecycleStarted = props.onRuleInvocationLifecycleStarted,
|
|
102
|
+
onRuleInvocationSuccess = props.onRuleInvocationSuccess,
|
|
103
|
+
onRuleInvocationFailure = props.onRuleInvocationFailure,
|
|
104
|
+
onRuleInvocationLifecycleDone = props.onRuleInvocationLifecycleDone;
|
|
105
|
+
// Initial data loading state
|
|
106
|
+
var _useManualRules = useManualRules(env, site, query),
|
|
107
|
+
_useManualRules2 = _slicedToArray(_useManualRules, 4),
|
|
108
|
+
triggerFetch = _useManualRules2[0],
|
|
109
|
+
initialised = _useManualRules2[1],
|
|
110
|
+
error = _useManualRules2[2],
|
|
111
|
+
rules = _useManualRules2[3];
|
|
112
|
+
// We store a rule in state here if and only if a rule has user inputs, and thus
|
|
113
|
+
// we need to preserve state while the input dialog is open.
|
|
114
|
+
var _useState7 = useState(null),
|
|
115
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
116
|
+
selectedRule = _useState8[0],
|
|
117
|
+
setSelectedRule = _useState8[1];
|
|
118
|
+
var clearSelectedRule = function clearSelectedRule() {
|
|
119
|
+
setSelectedRule(null);
|
|
120
|
+
};
|
|
121
|
+
// Value set when a rule is invoking, either from the dialog or without dialog
|
|
122
|
+
var _useState9 = useState(null),
|
|
123
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
124
|
+
invokingRuleId = _useState10[0],
|
|
125
|
+
setInvokingRuleId = _useState10[1];
|
|
126
|
+
|
|
127
|
+
// Memoized projection of rules by id
|
|
128
|
+
var rulesById = useMemo(function () {
|
|
129
|
+
return rules.reduce(function (acc, rule) {
|
|
130
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, rule.id, rule));
|
|
131
|
+
}, {});
|
|
132
|
+
}, [rules]);
|
|
133
|
+
var getRule = function getRule(id) {
|
|
134
|
+
return rulesById[id];
|
|
135
|
+
};
|
|
136
|
+
var ruleHasInputs = function ruleHasInputs(rule) {
|
|
137
|
+
var _rule$userInputPrompt;
|
|
138
|
+
return (rule === null || rule === void 0 || (_rule$userInputPrompt = rule.userInputPrompts) === null || _rule$userInputPrompt === void 0 ? void 0 : _rule$userInputPrompt.length) > 0;
|
|
139
|
+
};
|
|
140
|
+
var getFailedObjects = function getFailedObjects(response) {
|
|
141
|
+
return Object.keys(response).filter(function (object) {
|
|
142
|
+
return response[object] !== 'SUCCESS';
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
var getSuccessfulObjects = function getSuccessfulObjects(response) {
|
|
146
|
+
return Object.keys(response).filter(function (object) {
|
|
147
|
+
return response[object] === 'SUCCESS';
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
var handleInvocationFailure = function handleInvocationFailure(ruleId, successfulObjects, failedObjects) {
|
|
151
|
+
if (onRuleInvocationFailure) {
|
|
152
|
+
onRuleInvocationFailure(ruleId, successfulObjects, failedObjects);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
var invokeRule = /*#__PURE__*/function () {
|
|
156
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(ruleId, objects, userInputs) {
|
|
157
|
+
var rule, response, _failedObjects, successfulObjects;
|
|
158
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
159
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
160
|
+
case 0:
|
|
161
|
+
rule = getRule(ruleId);
|
|
162
|
+
if (!rule) {
|
|
163
|
+
_context2.next = 19;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
setInvokingRuleId(ruleId);
|
|
167
|
+
_context2.prev = 3;
|
|
168
|
+
if (onRuleInvocationLifecycleStarted) {
|
|
169
|
+
onRuleInvocationLifecycleStarted(ruleId, objects, userInputs);
|
|
170
|
+
}
|
|
171
|
+
_context2.next = 7;
|
|
172
|
+
return invokeManuallyTriggeredRule(env, site, ruleId, objects, userInputs);
|
|
173
|
+
case 7:
|
|
174
|
+
response = _context2.sent;
|
|
175
|
+
_failedObjects = getFailedObjects(response);
|
|
176
|
+
setInvokingRuleId(null);
|
|
177
|
+
if (_failedObjects.length === 0) {
|
|
178
|
+
if (onRuleInvocationSuccess) {
|
|
179
|
+
onRuleInvocationSuccess(ruleId, objects);
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
successfulObjects = getSuccessfulObjects(response);
|
|
183
|
+
handleInvocationFailure(ruleId, successfulObjects, _failedObjects);
|
|
184
|
+
}
|
|
185
|
+
_context2.next = 17;
|
|
186
|
+
break;
|
|
187
|
+
case 13:
|
|
188
|
+
_context2.prev = 13;
|
|
189
|
+
_context2.t0 = _context2["catch"](3);
|
|
190
|
+
handleInvocationFailure(ruleId, [], objects);
|
|
191
|
+
setInvokingRuleId(null);
|
|
192
|
+
case 17:
|
|
193
|
+
_context2.next = 20;
|
|
194
|
+
break;
|
|
195
|
+
case 19:
|
|
196
|
+
handleInvocationFailure(ruleId, [], objects);
|
|
197
|
+
case 20:
|
|
198
|
+
clearSelectedRule();
|
|
199
|
+
if (onRuleInvocationLifecycleDone) {
|
|
200
|
+
onRuleInvocationLifecycleDone(ruleId, objects);
|
|
201
|
+
}
|
|
202
|
+
case 22:
|
|
203
|
+
case "end":
|
|
204
|
+
return _context2.stop();
|
|
205
|
+
}
|
|
206
|
+
}, _callee2, null, [[3, 13]]);
|
|
207
|
+
}));
|
|
208
|
+
return function invokeRule(_x, _x2, _x3) {
|
|
209
|
+
return _ref2.apply(this, arguments);
|
|
210
|
+
};
|
|
211
|
+
}();
|
|
212
|
+
var invokeRuleOrShowDialog = function invokeRuleOrShowDialog(ruleId, objects) {
|
|
213
|
+
var rule = getRule(ruleId);
|
|
214
|
+
if (!rule) {
|
|
215
|
+
return handleInvocationFailure(ruleId, [], objects);
|
|
216
|
+
}
|
|
217
|
+
if (ruleHasInputs(rule)) {
|
|
218
|
+
setSelectedRule({
|
|
219
|
+
rule: rule,
|
|
220
|
+
objects: objects
|
|
221
|
+
});
|
|
222
|
+
} else {
|
|
223
|
+
invokeRule(ruleId, objects);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children({
|
|
227
|
+
triggerFetch: triggerFetch,
|
|
228
|
+
initialised: initialised,
|
|
229
|
+
error: error,
|
|
230
|
+
rules: rules,
|
|
231
|
+
invokingRuleId: invokingRuleId,
|
|
232
|
+
invokeRuleOrShowDialog: invokeRuleOrShowDialog
|
|
233
|
+
}), /*#__PURE__*/React.createElement(ModalTransition, null, selectedRule && /*#__PURE__*/React.createElement(UserInputForm, {
|
|
234
|
+
onInputsModalOpened: onInputsModalOpened,
|
|
235
|
+
onInputsModalClosed: onInputsModalClosed,
|
|
236
|
+
clearSelectedRule: clearSelectedRule,
|
|
237
|
+
selectedRule: selectedRule,
|
|
238
|
+
invokeRule: invokeRule
|
|
239
|
+
})));
|
|
240
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { di } from 'react-magnetic-di';
|
|
4
|
+
import Checkbox from '@atlaskit/checkbox';
|
|
5
|
+
import { CheckboxField } from '@atlaskit/form';
|
|
6
|
+
var BooleanInputPrompt = function BooleanInputPrompt(_ref) {
|
|
7
|
+
var userInputPrompt = _ref.userInputPrompt;
|
|
8
|
+
var variableName = userInputPrompt.variableName,
|
|
9
|
+
displayName = userInputPrompt.displayName,
|
|
10
|
+
defaultValue = userInputPrompt.defaultValue;
|
|
11
|
+
return /*#__PURE__*/React.createElement(CheckboxField, {
|
|
12
|
+
name: variableName,
|
|
13
|
+
defaultIsChecked: defaultValue || false
|
|
14
|
+
}, function (_ref2) {
|
|
15
|
+
var fieldProps = _ref2.fieldProps;
|
|
16
|
+
return /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
|
|
17
|
+
label: displayName
|
|
18
|
+
}));
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export default BooleanInputPrompt;
|