Skip to content

Commit f3d07b2

Browse files
committed
fix: backwards compatibility with ember-source <3.27
1 parent b8340ca commit f3d07b2

File tree

9 files changed

+21
-10
lines changed

9 files changed

+21
-10
lines changed

packages/core/addon/components/eui-button-content/index.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
@type={{@iconType}}
1414
@size="m"
1515
@useSvg={{@useSvg}}
16+
@useComponent={{@useComponent}}
1617
/>
1718
{{/if}}
1819
<span class={{@textClasses}}>

packages/core/addon/components/eui-button-empty/index.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
@iconSide={{@iconSide}}
1919
@iconClasses={{@iconClasses}}
2020
@useSvg={{@useSvg}}
21+
@useComponent={{@useComponent}}
2122
@textClasses={{class-names "euiButtonEmpty__text" @textClasses}}
2223
>
2324
{{yield}}
@@ -44,6 +45,7 @@
4445
@iconSide={{@iconSide}}
4546
@iconClasses={{@iconClasses}}
4647
@useSvg={{@useSvg}}
48+
@useComponent={{@useComponent}}
4749
@textClasses={{class-names "euiButtonEmpty__text" @textClasses}}
4850
>
4951
{{yield}}

packages/core/addon/components/eui-button-icon/index.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
@type={{@iconType}}
1212
@size={{arg-or-default @iconSize "m"}}
1313
@useSvg={{@useSvg}}
14+
@useComponent={{@useComponent}}
1415
aria-hidden="true"
1516
/>
1617
{{/if}}
@@ -29,6 +30,7 @@
2930
@type={{@iconType}}
3031
@size={{@iconSize}}
3132
@useSvg={{@useSvg}}
33+
@useComponent={{@useComponent}}
3234
aria-hidden="true"
3335
/>
3436
{{/if}}

packages/core/addon/components/eui-button/index.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
@iconSide={{@iconSide}}
2222
@iconClasses={{@iconClasses}}
2323
@useSvg={{@useSvg}}
24+
@useComponent={{@useComponent}}
2425
@textClasses={{class-names "euiButton__text" @textClasses}}
2526
>
2627
{{yield}}
@@ -48,6 +49,7 @@
4849
@iconSide={{@iconSide}}
4950
@iconClasses={{@iconClasses}}
5051
@useSvg={{@useSvg}}
52+
@useComponent={{@useComponent}}
5153
@textClasses={{class-names "euiButton__text" @textClasses}}
5254
>
5355
{{yield}}

packages/core/addon/components/eui-icon/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{#if this.icon.moduleName}}
1+
{{#if @useComponent}}
22
{{! has the shape of a curried component }}
33
{{#let (component this.icon) as |IconComponent|}}
44
{{!template-lint-disable}}

packages/core/addon/components/eui-markdown-editor-footer/index.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{{! pending implementation}}
66
<EuiButtonIcon
77
@iconType={{component "eui-loading-spinner"}}
8+
@useComponent={{true}}
89
{{! aria-label={ariaLabels.uploadingFiles} }}
910
/>
1011
{{/if}}
@@ -29,7 +30,8 @@
2930
</div>
3031
<EuiButtonIcon
3132
class="euiMarkdownEditorFooter__help"
32-
@iconType={{this.markdownLogo}}
33+
@iconType={{component "eui-markdown-editor-footer/icons/markdown-logo"}}
34+
@useComponent={{true}}
3335
@color="text"
3436
@useSvg={{true}}
3537
{{! aria-label={ariaLabels.showMarkdownHelp} }}
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import Component from '@glimmer/component';
22
import { tracked } from '@glimmer/tracking';
3-
import MarkdownLogoComponent from './icons/markdown-logo';
43

54
export interface EuiMarkdownEditorFooterArgs {}
65

76
export default class EuiMarkdownEditorFooterComponent extends Component<EuiMarkdownEditorFooterArgs> {
87
@tracked isPopoverOpen = false;
98
@tracked isShowingHelp = false;
10-
11-
get markdownLogo() {
12-
return MarkdownLogoComponent;
13-
}
149
}

packages/core/addon/components/eui-markdown-editor-toolbar/index.hbs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
<EuiButtonIcon
1919
@color="text"
2020
{{on "click" (fn this.handleMdButtonClick item.id)}}
21-
@iconType={{item.iconType}}
21+
@iconType={{if
22+
item.iconType.component
23+
(component item.iconType.component)
24+
item.iconType
25+
}}
26+
@useComponent={{item.iconType.component}}
2227
aria-label={{item.label}}
2328
@useSvg={{item.useSvg}}
2429
@isDisabled={{this.isPreviewing}}

packages/core/addon/components/eui-markdown-editor-toolbar/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { action } from '@ember/object';
33
import type MarkdownActions from '../../utils/markdown/markdown-actions';
44
import { MODE_VIEWING } from '../../utils/markdown/markdown-modes';
55
import { cached } from '@glimmer/tracking';
6-
import MarkdownCheckmarkComponent from './icons/markdown-checkmark';
76

87
import { Plugin } from 'unified';
98

@@ -50,7 +49,10 @@ export default class EuiMarkdownEditorToolbarComponent extends Component<EuiMark
5049
label: 'Task list',
5150
name: 'tl',
5251
useSvg: true,
53-
iconType: MarkdownCheckmarkComponent
52+
iconType: {
53+
// this should't be needed when we drop support for 3.24.0
54+
component: 'eui-markdown-editor-toolbar/icons/markdown-checkmark'
55+
}
5456
}
5557
];
5658
}

0 commit comments

Comments
 (0)