@atlaskit/smart-card 27.0.0 → 27.2.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 +23 -0
- package/dist/cjs/extractors/flexible/extract-state.js +1 -2
- package/dist/cjs/messages.js +17 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/components/ActionIcon.js +22 -14
- package/dist/cjs/view/BlockCard/components/Content.js +3 -1
- package/dist/cjs/view/BlockCard/components/ContentFooter.js +3 -1
- package/dist/cjs/view/BlockCard/components/ContentHeader.js +3 -1
- package/dist/cjs/view/BlockCard/components/Frame.js +6 -2
- package/dist/cjs/view/BlockCard/components/Link.js +3 -1
- package/dist/cjs/view/BlockCard/components/Name.js +3 -1
- package/dist/cjs/view/BlockCard/components/Provider.js +1 -0
- package/dist/cjs/view/BlockCard/views/ErroredView.js +3 -1
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +6 -2
- package/dist/cjs/view/BlockCard/views/NotFoundView.js +3 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +6 -2
- package/dist/cjs/view/BlockCard/views/ResolvingView.js +3 -1
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -0
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -1
- package/dist/cjs/view/CardWithUrl/component-lazy/LoadingCardLink.js +3 -1
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +41 -29
- package/dist/cjs/view/EmbedCard/components/ImageIcon.js +3 -1
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +11 -8
- 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/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/common/motion-wrapper/index.js +3 -0
- package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +3 -1
- package/dist/cjs/view/HoverCard/components/ContentContainer.js +2 -0
- package/dist/cjs/view/InlineCard/Frame/index.js +3 -1
- package/dist/cjs/view/InlineCard/Icon.js +3 -1
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +23 -13
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +10 -7
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +56 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-links-list/index.js +41 -0
- package/dist/cjs/view/RelatedLinksModal/views/resolved/index.js +31 -0
- package/dist/cjs/view/RelatedLinksModal/views/resolved/types.js +1 -0
- package/dist/cjs/view/common/Byline.js +3 -1
- package/dist/cjs/view/common/Icon.js +3 -1
- package/dist/cjs/view/common/MetadataList.js +3 -1
- package/dist/es2019/extractors/flexible/extract-state.js +1 -2
- package/dist/es2019/messages.js +17 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/components/ActionIcon.js +22 -14
- package/dist/es2019/view/BlockCard/components/Content.js +3 -1
- package/dist/es2019/view/BlockCard/components/ContentFooter.js +3 -1
- package/dist/es2019/view/BlockCard/components/ContentHeader.js +3 -1
- package/dist/es2019/view/BlockCard/components/Frame.js +6 -2
- package/dist/es2019/view/BlockCard/components/Link.js +3 -1
- package/dist/es2019/view/BlockCard/components/Name.js +3 -1
- package/dist/es2019/view/BlockCard/components/Provider.js +1 -0
- package/dist/es2019/view/BlockCard/views/ErroredView.js +3 -1
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +6 -2
- package/dist/es2019/view/BlockCard/views/NotFoundView.js +3 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +6 -2
- package/dist/es2019/view/BlockCard/views/ResolvingView.js +3 -1
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -0
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -1
- package/dist/es2019/view/CardWithUrl/component-lazy/LoadingCardLink.js +3 -1
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +14 -4
- package/dist/es2019/view/EmbedCard/components/ImageIcon.js +3 -1
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +11 -8
- 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/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/common/motion-wrapper/index.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +3 -1
- package/dist/es2019/view/HoverCard/components/ContentContainer.js +2 -0
- package/dist/es2019/view/InlineCard/Frame/index.js +3 -1
- package/dist/es2019/view/InlineCard/Icon.js +3 -1
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +23 -13
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +10 -7
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +50 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-links-list/index.js +33 -0
- package/dist/es2019/view/RelatedLinksModal/views/resolved/index.js +23 -0
- package/dist/es2019/view/RelatedLinksModal/views/resolved/types.js +0 -0
- package/dist/es2019/view/common/Byline.js +3 -1
- package/dist/es2019/view/common/Icon.js +3 -1
- package/dist/es2019/view/common/MetadataList.js +3 -1
- package/dist/esm/extractors/flexible/extract-state.js +1 -2
- package/dist/esm/messages.js +17 -2
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/components/ActionIcon.js +22 -14
- package/dist/esm/view/BlockCard/components/Content.js +3 -1
- package/dist/esm/view/BlockCard/components/ContentFooter.js +3 -1
- package/dist/esm/view/BlockCard/components/ContentHeader.js +3 -1
- package/dist/esm/view/BlockCard/components/Frame.js +6 -2
- package/dist/esm/view/BlockCard/components/Link.js +3 -1
- package/dist/esm/view/BlockCard/components/Name.js +3 -1
- package/dist/esm/view/BlockCard/components/Provider.js +1 -0
- package/dist/esm/view/BlockCard/views/ErroredView.js +3 -1
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +6 -2
- package/dist/esm/view/BlockCard/views/NotFoundView.js +3 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +6 -2
- package/dist/esm/view/BlockCard/views/ResolvingView.js +3 -1
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -0
- package/dist/esm/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -1
- package/dist/esm/view/CardWithUrl/component-lazy/LoadingCardLink.js +3 -1
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +41 -29
- package/dist/esm/view/EmbedCard/components/ImageIcon.js +3 -1
- package/dist/esm/view/EmbedModal/components/link-info/index.js +11 -8
- 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/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/common/motion-wrapper/index.js +3 -0
- package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +3 -1
- package/dist/esm/view/HoverCard/components/ContentContainer.js +2 -0
- package/dist/esm/view/InlineCard/Frame/index.js +3 -1
- package/dist/esm/view/InlineCard/Icon.js +3 -1
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +23 -13
- package/dist/esm/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +10 -7
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +49 -0
- package/dist/esm/view/RelatedLinksModal/components/related-links-list/index.js +34 -0
- package/dist/esm/view/RelatedLinksModal/views/resolved/index.js +24 -0
- package/dist/esm/view/RelatedLinksModal/views/resolved/types.js +0 -0
- package/dist/esm/view/common/Byline.js +3 -1
- package/dist/esm/view/common/Icon.js +3 -1
- package/dist/esm/view/common/MetadataList.js +3 -1
- package/dist/types/messages.d.ts +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/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +5 -4
- package/dist/types/view/RelatedLinksModal/components/related-link-item/index.d.ts +5 -0
- package/dist/types/view/RelatedLinksModal/components/related-links-list/index.d.ts +5 -0
- package/dist/types/view/RelatedLinksModal/components/types.d.ts +16 -0
- package/dist/types/view/RelatedLinksModal/views/resolved/index.d.ts +5 -0
- package/dist/types/view/RelatedLinksModal/views/resolved/types.d.ts +4 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- 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/dist/types-ts4.5/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +5 -4
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-link-item/index.d.ts +5 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-links-list/index.d.ts +5 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/types.d.ts +16 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/index.d.ts +5 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/types.d.ts +4 -0
- package/package.json +3 -6
- 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/view/RelatedLinksModal/types.d.ts +0 -6
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/stack-resolver.d.ts +0 -3
- package/dist/types-ts4.5/view/RelatedLinksModal/types.d.ts +0 -6
- /package/dist/cjs/view/RelatedLinksModal/{types.js → components/types.js} +0 -0
- /package/dist/es2019/view/RelatedLinksModal/{types.js → components/types.js} +0 -0
- /package/dist/esm/view/RelatedLinksModal/{types.js → components/types.js} +0 -0
|
@@ -2,67 +2,69 @@ import { UserInputType } from './types';
|
|
|
2
2
|
const mockScope = {
|
|
3
3
|
resources: []
|
|
4
4
|
};
|
|
5
|
-
export const mockRules =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
id: 1,
|
|
12
|
-
name: 'Test rule 1 (has inputs)',
|
|
13
|
-
ruleScope: mockScope,
|
|
14
|
-
userInputs: [{
|
|
15
|
-
defaultValue: '',
|
|
16
|
-
displayName: 'Test user input',
|
|
17
|
-
inputType: UserInputType.TEXT,
|
|
18
|
-
required: false,
|
|
19
|
-
variableName: 'testUserInput'
|
|
20
|
-
}]
|
|
21
|
-
}, {
|
|
22
|
-
id: 2,
|
|
23
|
-
name: 'Test rule 2 (has multiple inputs)',
|
|
24
|
-
ruleScope: mockScope,
|
|
25
|
-
userInputs: [{
|
|
26
|
-
defaultValue: '',
|
|
27
|
-
displayName: 'Text user input',
|
|
28
|
-
inputType: UserInputType.TEXT,
|
|
29
|
-
required: false,
|
|
30
|
-
variableName: 'textUserInput'
|
|
31
|
-
}, {
|
|
32
|
-
defaultValue: '',
|
|
33
|
-
displayName: 'Number user input',
|
|
34
|
-
inputType: UserInputType.NUMBER,
|
|
35
|
-
required: false,
|
|
36
|
-
variableName: 'numberUserInput'
|
|
5
|
+
export const mockRules = {
|
|
6
|
+
data: [{
|
|
7
|
+
id: 0,
|
|
8
|
+
name: 'Test rule 0 (no inputs)',
|
|
9
|
+
ruleScope: mockScope,
|
|
10
|
+
userInputs: []
|
|
37
11
|
}, {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
12
|
+
id: 1,
|
|
13
|
+
name: 'Test rule 1 (has inputs)',
|
|
14
|
+
ruleScope: mockScope,
|
|
15
|
+
userInputs: [{
|
|
16
|
+
defaultValue: '',
|
|
17
|
+
displayName: 'Test user input',
|
|
18
|
+
inputType: UserInputType.TEXT,
|
|
19
|
+
required: false,
|
|
20
|
+
variableName: 'testUserInput'
|
|
21
|
+
}]
|
|
43
22
|
}, {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
23
|
+
id: 2,
|
|
24
|
+
name: 'Test rule 2 (has multiple inputs)',
|
|
25
|
+
ruleScope: mockScope,
|
|
26
|
+
userInputs: [{
|
|
27
|
+
defaultValue: '',
|
|
28
|
+
displayName: 'Text user input',
|
|
29
|
+
inputType: UserInputType.TEXT,
|
|
30
|
+
required: false,
|
|
31
|
+
variableName: 'textUserInput'
|
|
32
|
+
}, {
|
|
33
|
+
defaultValue: '',
|
|
34
|
+
displayName: 'Number user input',
|
|
35
|
+
inputType: UserInputType.NUMBER,
|
|
36
|
+
required: false,
|
|
37
|
+
variableName: 'numberUserInput'
|
|
38
|
+
}, {
|
|
39
|
+
defaultValue: true,
|
|
40
|
+
displayName: 'Boolean user input',
|
|
41
|
+
inputType: UserInputType.BOOLEAN,
|
|
42
|
+
required: false,
|
|
43
|
+
variableName: 'booleanUserInput'
|
|
44
|
+
}, {
|
|
45
|
+
defaultValue: [''],
|
|
46
|
+
displayName: 'Dropdown user input',
|
|
47
|
+
inputType: UserInputType.DROPDOWN,
|
|
48
|
+
required: false,
|
|
49
|
+
variableName: 'dropdownUserInput'
|
|
50
|
+
}, {
|
|
51
|
+
defaultValue: '',
|
|
52
|
+
displayName: 'Paragraph user input',
|
|
53
|
+
inputType: UserInputType.PARAGRAPH,
|
|
54
|
+
required: false,
|
|
55
|
+
variableName: 'paragraphUserInput'
|
|
56
|
+
}]
|
|
55
57
|
}]
|
|
56
|
-
}
|
|
58
|
+
};
|
|
57
59
|
export const mockTransformedRules = [{
|
|
58
|
-
...mockRules[0],
|
|
59
|
-
userInputPrompts: mockRules[0].userInputs
|
|
60
|
+
...mockRules.data[0],
|
|
61
|
+
userInputPrompts: mockRules.data[0].userInputs
|
|
60
62
|
}, {
|
|
61
|
-
...mockRules[1],
|
|
62
|
-
userInputPrompts: mockRules[1].userInputs
|
|
63
|
+
...mockRules.data[1],
|
|
64
|
+
userInputPrompts: mockRules.data[1].userInputs
|
|
63
65
|
}, {
|
|
64
|
-
...mockRules[2],
|
|
65
|
-
userInputPrompts: mockRules[2].userInputs
|
|
66
|
+
...mockRules.data[2],
|
|
67
|
+
userInputPrompts: mockRules.data[2].userInputs
|
|
66
68
|
}];
|
|
67
69
|
export const mockInvocationResponse = {
|
|
68
70
|
'TEST-1': 'SUCCESS'
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { getAutomationStack } from './stack-resolver';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* This function will extract the cloud ID and product from a product level Site ARI.
|
|
5
3
|
* ARIs can be found at the following link: {@link https://developer.atlassian.com/platform/atlassian-resource-identifier/resource-owners/registry/#ari-registry}
|
|
@@ -41,32 +39,29 @@ export const extractCloudIdAndProductFromSite = site => {
|
|
|
41
39
|
* model language is used here, even though for the meantime we only concern ourselves with alerts.
|
|
42
40
|
*
|
|
43
41
|
*/
|
|
44
|
-
export const getSearchUrl = async
|
|
42
|
+
export const getSearchUrl = async site => {
|
|
45
43
|
const {
|
|
46
44
|
product,
|
|
47
45
|
cloudId
|
|
48
46
|
} = extractCloudIdAndProductFromSite(site);
|
|
49
|
-
const automationStack = await getAutomationStack(env, cloudId);
|
|
50
47
|
// TODO in the unified API, GET requests as according to Atlassian API standards will destructure the whole query into
|
|
51
48
|
// query parameters as part of the URL. For now, this is considered a POST request instead and thus the query is used
|
|
52
49
|
// later on as the request body.
|
|
53
|
-
return `/gateway/api/automation/
|
|
50
|
+
return `/gateway/api/automation/public/${product}/${cloudId}/rest/v1/rule/manual/search`;
|
|
54
51
|
};
|
|
55
|
-
export const getInvocationUrl = async (
|
|
52
|
+
export const getInvocationUrl = async (site, ruleId) => {
|
|
56
53
|
const {
|
|
57
54
|
product,
|
|
58
55
|
cloudId
|
|
59
56
|
} = extractCloudIdAndProductFromSite(site);
|
|
60
|
-
|
|
61
|
-
return `/gateway/api/automation/internal-api/${product}/${cloudId}/${automationStack}/rest/v1/rules/manual/invocation/${ruleId}`;
|
|
57
|
+
return `/gateway/api/automation/public/${product}/${cloudId}/rest/v1/rule/manual/${ruleId}/invocation`;
|
|
62
58
|
};
|
|
63
59
|
const DEFAULT_HEADER = {
|
|
64
60
|
'Content-Type': 'application/json'
|
|
65
61
|
};
|
|
66
|
-
const _performRequest = async (url, method, options
|
|
67
|
-
headers: DEFAULT_HEADER
|
|
68
|
-
}) => {
|
|
62
|
+
const _performRequest = async (url, method, options) => {
|
|
69
63
|
const response = await fetch(url, {
|
|
64
|
+
headers: DEFAULT_HEADER,
|
|
70
65
|
...options,
|
|
71
66
|
method
|
|
72
67
|
});
|
|
@@ -77,27 +72,4 @@ export const performGetRequest = async (url, options) => {
|
|
|
77
72
|
};
|
|
78
73
|
export const performPostRequest = async (url, options) => {
|
|
79
74
|
return _performRequest(url, 'POST', options);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// TODO this will need to be expanded to resolve the correct product URL, too.
|
|
83
|
-
// TODO for instance this will need to support Alerts UI URL resolution in the
|
|
84
|
-
// TODO short term
|
|
85
|
-
export const getBaseAutomationUrl = ({
|
|
86
|
-
projectKey,
|
|
87
|
-
projectType,
|
|
88
|
-
isSimplified
|
|
89
|
-
}) => {
|
|
90
|
-
/**
|
|
91
|
-
* Confusing mapping of urls here.
|
|
92
|
-
* Classic Projects - always under /automate
|
|
93
|
-
* Next Gen Projects - under /automation for all project types except JSD
|
|
94
|
-
*/
|
|
95
|
-
switch (projectType) {
|
|
96
|
-
case 'service_desk':
|
|
97
|
-
return `/jira/servicedesk/projects/${projectKey}/settings/automate`;
|
|
98
|
-
case 'business':
|
|
99
|
-
return `/jira/core/projects/${projectKey}/settings/${isSimplified ? 'automation' : 'automate'}`;
|
|
100
|
-
default:
|
|
101
|
-
return `/jira/software/${isSimplified ? '' : 'c/'}projects/${projectKey}/settings/${isSimplified ? 'automation' : 'automate'}`;
|
|
102
|
-
}
|
|
103
75
|
};
|
|
@@ -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';
|
|
@@ -7,11 +7,10 @@ import UserInputForm from './manual-triggers-form/main';
|
|
|
7
7
|
/**
|
|
8
8
|
* React hook that implements the fetch and invoke actions for manual triggers.
|
|
9
9
|
* Can be used standalone or in the HOC provided below.
|
|
10
|
-
* @param env - The environment to retrieve rules from
|
|
11
10
|
* @param site - The site to filter on. We map this to just a cloudId to resolve the manual rules API path
|
|
12
11
|
* @param query - Query object containing filter props (container, object(s))
|
|
13
12
|
*/
|
|
14
|
-
export const useManualRules = (
|
|
13
|
+
export const useManualRules = (site, query) => {
|
|
15
14
|
const [initialised, setInitialised] = useState(false);
|
|
16
15
|
const [error, setError] = useState(null);
|
|
17
16
|
const [rules, setRules] = useState([]);
|
|
@@ -22,7 +21,7 @@ export const useManualRules = (env, site, query) => {
|
|
|
22
21
|
const triggerFetch = async () => {
|
|
23
22
|
setInitialised(false);
|
|
24
23
|
try {
|
|
25
|
-
const fetchedRules = await searchManuallyTriggeredRules(
|
|
24
|
+
const fetchedRules = await searchManuallyTriggeredRules(site, query);
|
|
26
25
|
setError(null);
|
|
27
26
|
setRules(transformRules(fetchedRules));
|
|
28
27
|
} catch (e) {
|
|
@@ -50,11 +49,10 @@ export const useManualRules = (env, site, query) => {
|
|
|
50
49
|
* should not care about this, only how to trigger invocation and understand
|
|
51
50
|
* the invocation lifecycle.
|
|
52
51
|
*
|
|
53
|
-
* @param props -
|
|
52
|
+
* @param props - cloudId, projectId, children
|
|
54
53
|
*/
|
|
55
54
|
export const ManualRulesContainer = props => {
|
|
56
55
|
const {
|
|
57
|
-
env,
|
|
58
56
|
site,
|
|
59
57
|
query,
|
|
60
58
|
children,
|
|
@@ -66,7 +64,7 @@ export const ManualRulesContainer = props => {
|
|
|
66
64
|
onRuleInvocationLifecycleDone
|
|
67
65
|
} = props;
|
|
68
66
|
// Initial data loading state
|
|
69
|
-
const [triggerFetch, initialised, error, rules] = useManualRules(
|
|
67
|
+
const [triggerFetch, initialised, error, rules] = useManualRules(site, query);
|
|
70
68
|
// We store a rule in state here if and only if a rule has user inputs, and thus
|
|
71
69
|
// we need to preserve state while the input dialog is open.
|
|
72
70
|
const [selectedRule, setSelectedRule] = useState(null);
|
|
@@ -102,7 +100,7 @@ export const ManualRulesContainer = props => {
|
|
|
102
100
|
if (onRuleInvocationLifecycleStarted) {
|
|
103
101
|
onRuleInvocationLifecycleStarted(ruleId, objects, userInputs);
|
|
104
102
|
}
|
|
105
|
-
const response = await invokeManuallyTriggeredRule(
|
|
103
|
+
const response = await invokeManuallyTriggeredRule(site, ruleId, objects, userInputs);
|
|
106
104
|
const failedObjects = getFailedObjects(response);
|
|
107
105
|
setInvokingRuleId(null);
|
|
108
106
|
if (failedObjects.length === 0) {
|
|
@@ -2,19 +2,19 @@ import { getInvocationUrl, getSearchUrl, performPostRequest } from './../common/
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Manual trigger rules API fetch. Fetches a list of manually triggered rules according to the context provided
|
|
5
|
-
* in
|
|
6
|
-
* @param
|
|
5
|
+
* in query.
|
|
6
|
+
* @param site - the site ARI to fetch the rules against
|
|
7
7
|
* @param query - the workspace/container/objects to fetch rules against
|
|
8
8
|
*/
|
|
9
|
-
export const searchManuallyTriggeredRules = async (
|
|
10
|
-
const url = await getSearchUrl(
|
|
9
|
+
export const searchManuallyTriggeredRules = async (site, query) => {
|
|
10
|
+
const url = await getSearchUrl(site);
|
|
11
11
|
// TODO this will in the new API be a GET request instead, with the above getSearchUrl method
|
|
12
12
|
// constructing a URL with the appropriate query parameters. For now, instead, we pass the
|
|
13
13
|
// destructured query through as a POST body.
|
|
14
14
|
const response = await performPostRequest(url, {
|
|
15
15
|
body: JSON.stringify(query)
|
|
16
16
|
});
|
|
17
|
-
return response.reduce((acc, {
|
|
17
|
+
return response.data.reduce((acc, {
|
|
18
18
|
id,
|
|
19
19
|
name,
|
|
20
20
|
ruleScope,
|
|
@@ -33,14 +33,13 @@ export const searchManuallyTriggeredRules = async (env, site, query) => {
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Invoke a manually triggered rule via the API.
|
|
36
|
-
* @param env - the environment to use when invoking the rule
|
|
37
36
|
* @param cloudId - the site the rule belongs to
|
|
38
37
|
* @param ruleId - the identifier of the rule you want to invoke
|
|
39
38
|
* @param objects - the list of objects you wish to create an automation event for.
|
|
40
39
|
* @param userInputs - the optional user inputs if this manual trigger requires them
|
|
41
40
|
*/
|
|
42
|
-
export const invokeManuallyTriggeredRule = async (
|
|
43
|
-
const url = await getInvocationUrl(
|
|
41
|
+
export const invokeManuallyTriggeredRule = async (site, ruleId, objects, userInputs) => {
|
|
42
|
+
const url = await getInvocationUrl(site, ruleId);
|
|
44
43
|
const bodyRaw = {
|
|
45
44
|
objects
|
|
46
45
|
};
|
|
@@ -6,7 +6,6 @@ import { AutomationModalBody } from './sub-components/body';
|
|
|
6
6
|
import { AutomationModalFooter } from './sub-components/footer';
|
|
7
7
|
import { AutomationModalHeader } from './sub-components/header';
|
|
8
8
|
export const AutomationModal = ({
|
|
9
|
-
environment,
|
|
10
9
|
baseAutomationUrl,
|
|
11
10
|
siteAri,
|
|
12
11
|
objectAri,
|
|
@@ -32,7 +31,6 @@ export const AutomationModal = ({
|
|
|
32
31
|
}).fire();
|
|
33
32
|
}, [createAnalyticsEvent, analyticsSource]);
|
|
34
33
|
return /*#__PURE__*/React.createElement(AutomationMenuContextContainer, {
|
|
35
|
-
environment: environment,
|
|
36
34
|
baseAutomationUrl: baseAutomationUrl,
|
|
37
35
|
objectAri: objectAri,
|
|
38
36
|
siteAri: siteAri,
|
|
@@ -22,7 +22,6 @@ export const useAutomationMenu = () => {
|
|
|
22
22
|
return context;
|
|
23
23
|
};
|
|
24
24
|
export const AutomationMenuContextContainer = ({
|
|
25
|
-
environment,
|
|
26
25
|
baseAutomationUrl,
|
|
27
26
|
analyticsSource,
|
|
28
27
|
objectAri,
|
|
@@ -36,7 +35,6 @@ export const AutomationMenuContextContainer = ({
|
|
|
36
35
|
onRuleInvocationLifecycleDone
|
|
37
36
|
}) => {
|
|
38
37
|
return /*#__PURE__*/React.createElement(ManualRulesContainer, {
|
|
39
|
-
env: environment,
|
|
40
38
|
site: siteAri,
|
|
41
39
|
query: {
|
|
42
40
|
objects: [objectAri]
|
|
@@ -6,7 +6,6 @@ import Action from '../action';
|
|
|
6
6
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
7
7
|
import { ActionName } from '../../../../../constants';
|
|
8
8
|
import { messages } from '../../../../../messages';
|
|
9
|
-
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
10
9
|
const AutomationModal = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-internal_smart-card-automation-modal" */'./automation-manual-triggers/manual-triggers-modal'));
|
|
11
10
|
const handleAutomateActionClick = setIsModalOpen => {
|
|
12
11
|
setIsModalOpen(true);
|
|
@@ -15,16 +14,11 @@ const handleAutomationActionClose = setIsModalOpen => {
|
|
|
15
14
|
setIsModalOpen(false);
|
|
16
15
|
};
|
|
17
16
|
const AutomationAction = props => {
|
|
18
|
-
var
|
|
17
|
+
var _context$actions;
|
|
19
18
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
20
19
|
const {
|
|
21
20
|
formatMessage
|
|
22
21
|
} = useIntl();
|
|
23
|
-
const smartLinkContext = useSmartLinkContext();
|
|
24
|
-
const {
|
|
25
|
-
connections
|
|
26
|
-
} = smartLinkContext;
|
|
27
|
-
const environment = (_ref = connections.client.envKey) !== null && _ref !== void 0 ? _ref : 'prod';
|
|
28
22
|
const context = useFlexibleUiContext();
|
|
29
23
|
const automationActionData = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.AutomationAction];
|
|
30
24
|
if (!automationActionData) {
|
|
@@ -66,7 +60,6 @@ const AutomationAction = props => {
|
|
|
66
60
|
React.createElement(Suspense, {
|
|
67
61
|
fallback: false
|
|
68
62
|
}, /*#__PURE__*/React.createElement(AutomationModal, {
|
|
69
|
-
environment: environment,
|
|
70
63
|
baseAutomationUrl: baseAutomationUrl,
|
|
71
64
|
objectAri: objectAri,
|
|
72
65
|
siteAri: siteAri,
|
package/dist/es2019/view/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js
CHANGED
|
@@ -6,7 +6,9 @@ const UnfollowGlyph = props => /*#__PURE__*/React.createElement("svg", {
|
|
|
6
6
|
height: "16",
|
|
7
7
|
viewBox: "0 0 16 16",
|
|
8
8
|
"data-testid": props['data-testid'],
|
|
9
|
-
"aria-label": props['aria-label']
|
|
9
|
+
"aria-label": props['aria-label']
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
11
|
+
,
|
|
10
12
|
className: props.className,
|
|
11
13
|
role: "presentation",
|
|
12
14
|
xmlns: "http://www.w3.org/2000/svg"
|
|
@@ -103,7 +103,9 @@ const ActionGroup = ({
|
|
|
103
103
|
return null;
|
|
104
104
|
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum]);
|
|
105
105
|
return renderableActionItems.length > 0 ? jsx("div", {
|
|
106
|
-
css: styles
|
|
106
|
+
css: styles
|
|
107
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
108
|
+
,
|
|
107
109
|
className: "actions-button-group",
|
|
108
110
|
"data-action-open": isOpen
|
|
109
111
|
}, jsx(ButtonGroup, null, actionButtons, moreActionDropdown)) : null;
|
|
@@ -63,6 +63,7 @@ const TitleBlockErroredView = ({
|
|
|
63
63
|
direction: SmartLinkDirection.Horizontal,
|
|
64
64
|
align: SmartLinkAlignment.Right
|
|
65
65
|
}, jsx("span", {
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
66
67
|
className: hasAction ? 'has-action' : '',
|
|
67
68
|
css: getMessageStyles(size, hasAction),
|
|
68
69
|
onClick: onClick,
|
|
@@ -24,13 +24,16 @@ export const MotionWrapper = ({
|
|
|
24
24
|
style: {
|
|
25
25
|
height,
|
|
26
26
|
minHeight,
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
27
28
|
lineHeight: 0,
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
28
30
|
overflow: 'hidden',
|
|
29
31
|
// a fit for purpose state variable to control when the 'visible' styles should be appled
|
|
30
32
|
opacity: height > 0 ? 1 : 0,
|
|
31
33
|
// we only want to transition opacity and height when the error message is initially shown
|
|
32
34
|
// not if its to be shown on mount
|
|
33
35
|
transitionProperty: showTransition ? transition : 'none',
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
34
37
|
transitionDuration: '0.3s'
|
|
35
38
|
},
|
|
36
39
|
ref: ref
|
|
@@ -49,6 +49,7 @@ const LayeredLink = ({
|
|
|
49
49
|
}) => {
|
|
50
50
|
const onMouseDown = useMouseDownEvent();
|
|
51
51
|
return jsx("a", {
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
52
53
|
className: "layered-link",
|
|
53
54
|
css: styles,
|
|
54
55
|
"data-testid": `${testId}-layered-link`,
|
|
@@ -35,7 +35,9 @@ const Lozenge = ({
|
|
|
35
35
|
text: text,
|
|
36
36
|
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
37
37
|
}) : jsx(AtlaskitLozenge, {
|
|
38
|
-
appearance: appearance
|
|
38
|
+
appearance: appearance
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
40
|
+
,
|
|
39
41
|
style: style,
|
|
40
42
|
testId: `${testId}-lozenge`
|
|
41
43
|
}, text);
|
|
@@ -45,6 +45,7 @@ const ConnectedAIPrismContainer = ({
|
|
|
45
45
|
setShowPrism(status === 'loading');
|
|
46
46
|
}, [status]);
|
|
47
47
|
const container = jsx("div", _extends({
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
48
49
|
className: hoverCardClassName,
|
|
49
50
|
css: [HoverCardContainer, !isAIEnabled ? popupContainerStyles : undefined],
|
|
50
51
|
"data-testid": testId
|
|
@@ -69,6 +70,7 @@ const ContentContainer = ({
|
|
|
69
70
|
}, props), children);
|
|
70
71
|
}
|
|
71
72
|
return jsx("div", _extends({
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
72
74
|
className: hoverCardClassName,
|
|
73
75
|
css: HoverCardContainer,
|
|
74
76
|
"data-testid": testId
|
|
@@ -44,7 +44,9 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
44
44
|
onClick: handleClick,
|
|
45
45
|
onMouseDown: handleMouseDown,
|
|
46
46
|
onKeyPress: handleKeyPress,
|
|
47
|
-
"data-testid": testId
|
|
47
|
+
"data-testid": testId
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
49
|
+
,
|
|
48
50
|
className: className,
|
|
49
51
|
ref: ref,
|
|
50
52
|
isHovered: isHovered
|
|
@@ -43,7 +43,9 @@ export const Shimmer = ({
|
|
|
43
43
|
width: 14,
|
|
44
44
|
height: 14,
|
|
45
45
|
borderRadius: 2,
|
|
46
|
-
testId: testId
|
|
46
|
+
testId: testId
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
48
|
+
,
|
|
47
49
|
style: skeletonCustomStyles
|
|
48
50
|
});
|
|
49
51
|
};
|
|
@@ -54,7 +54,9 @@ export class IconAndTitleLayout extends React.Component {
|
|
|
54
54
|
}
|
|
55
55
|
return /*#__PURE__*/React.createElement(ImageLoader, {
|
|
56
56
|
src: url,
|
|
57
|
-
loaded: /*#__PURE__*/React.createElement(Icon
|
|
57
|
+
loaded: /*#__PURE__*/React.createElement(Icon
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
59
|
+
, {
|
|
58
60
|
className: "smart-link-icon",
|
|
59
61
|
src: url,
|
|
60
62
|
"data-testid": `${testId}-image`
|
|
@@ -101,22 +103,30 @@ export class IconAndTitleLayout extends React.Component {
|
|
|
101
103
|
rightSide,
|
|
102
104
|
testId = 'inline-card-icon-and-title'
|
|
103
105
|
} = this.props;
|
|
104
|
-
const titlePart = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper
|
|
106
|
+
const titlePart = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper
|
|
107
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
108
|
+
, {
|
|
105
109
|
style: {
|
|
106
110
|
color: titleTextColor
|
|
107
|
-
}
|
|
111
|
+
}
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
113
|
+
,
|
|
108
114
|
className: TitleWrapperClassName
|
|
109
115
|
}, title));
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
return (
|
|
117
|
+
/*#__PURE__*/
|
|
118
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
119
|
+
React.createElement(IconTitleWrapper, {
|
|
120
|
+
style: {
|
|
121
|
+
color: titleColor
|
|
122
|
+
},
|
|
123
|
+
"data-testid": testId
|
|
124
|
+
}, link ? /*#__PURE__*/React.createElement(LinkAppearance, {
|
|
125
|
+
href: link,
|
|
126
|
+
onClick: this.handleClick,
|
|
127
|
+
onKeyPress: this.handleKeyPress
|
|
128
|
+
}, titlePart) : titlePart, rightSide ? /*#__PURE__*/React.createElement(NoLinkAppearance, null, rightSide) : null)
|
|
129
|
+
);
|
|
120
130
|
}
|
|
121
131
|
}
|
|
122
132
|
_defineProperty(IconAndTitleLayout, "defaultProps", {
|
|
@@ -15,7 +15,9 @@ export class InlineCardResolvedView extends React.Component {
|
|
|
15
15
|
const appearance = lozenge.appearance || 'default';
|
|
16
16
|
return /*#__PURE__*/React.createElement(LozengeWrapper, null, /*#__PURE__*/React.createElement(Lozenge, {
|
|
17
17
|
testId: "inline-card-resolved-view-lozenge",
|
|
18
|
-
appearance: appearance
|
|
18
|
+
appearance: appearance
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
20
|
+
,
|
|
19
21
|
style: lozenge.style,
|
|
20
22
|
isBold: lozenge.isBold
|
|
21
23
|
}, lozenge.text));
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "27.
|
|
10
|
+
packageVersion: "27.2.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
5
|
import Button from '@atlaskit/button/new';
|
|
4
6
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
5
7
|
import { messages } from '../../../messages';
|
|
6
|
-
const
|
|
8
|
+
const RelatedLinksBaseModal = ({
|
|
7
9
|
onClose,
|
|
8
10
|
showModal,
|
|
9
11
|
children
|
|
10
12
|
}) => {
|
|
11
|
-
return
|
|
12
|
-
onClose: onClose
|
|
13
|
-
|
|
13
|
+
return jsx(ModalTransition, null, showModal && jsx(Modal, {
|
|
14
|
+
onClose: onClose,
|
|
15
|
+
width: "small"
|
|
16
|
+
}, jsx(ModalHeader, null, jsx(ModalTitle, null, jsx(FormattedMessage, messages.related_links_modal_title))), jsx(ModalBody, null, children), jsx(ModalFooter, null, jsx(Button, {
|
|
14
17
|
appearance: "primary",
|
|
15
18
|
onClick: onClose
|
|
16
|
-
},
|
|
19
|
+
}, jsx(FormattedMessage, messages.close)))));
|
|
17
20
|
};
|
|
18
|
-
export default
|
|
21
|
+
export default RelatedLinksBaseModal;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
4
|
+
import { Card, ElementName, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, TitleBlock } from '../../../../index';
|
|
5
|
+
const hoverStyles = xcss({
|
|
6
|
+
':hover': {
|
|
7
|
+
backgroundColor: 'color.background.input.hovered',
|
|
8
|
+
borderRadius: 'border.radius.100',
|
|
9
|
+
marginInline: 'space.negative.100',
|
|
10
|
+
paddingInline: 'space.100'
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const relatedLinkItemStyles = css({
|
|
14
|
+
paddingTop: "var(--ds-space-100, 8px)",
|
|
15
|
+
paddingBottom: "var(--ds-space-100, 8px)",
|
|
16
|
+
gap: "var(--ds-space-150, 12px)",
|
|
17
|
+
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
18
|
+
});
|
|
19
|
+
const RelatedLinkItem = ({
|
|
20
|
+
url,
|
|
21
|
+
testId
|
|
22
|
+
}) => {
|
|
23
|
+
const subtitle = [{
|
|
24
|
+
name: ElementName.Provider
|
|
25
|
+
}];
|
|
26
|
+
const ui = {
|
|
27
|
+
hideElevation: true,
|
|
28
|
+
hidePadding: true,
|
|
29
|
+
hideBackground: true,
|
|
30
|
+
theme: SmartLinkTheme.Black,
|
|
31
|
+
clickableContainer: true,
|
|
32
|
+
size: SmartLinkSize.Large
|
|
33
|
+
};
|
|
34
|
+
return jsx(Box, {
|
|
35
|
+
testId: testId,
|
|
36
|
+
xcss: hoverStyles
|
|
37
|
+
}, jsx(Card, {
|
|
38
|
+
appearance: "block",
|
|
39
|
+
ui: ui,
|
|
40
|
+
url: url
|
|
41
|
+
}, jsx(TitleBlock, {
|
|
42
|
+
maxLines: 1,
|
|
43
|
+
hideTitleTooltip: true,
|
|
44
|
+
position: SmartLinkPosition.Center,
|
|
45
|
+
subtitle: subtitle,
|
|
46
|
+
overrideCss: relatedLinkItemStyles,
|
|
47
|
+
anchorTarget: "_blank"
|
|
48
|
+
})));
|
|
49
|
+
};
|
|
50
|
+
export default RelatedLinkItem;
|