Skip to content

Commit

Permalink
fix: backwards compatibility with ember-source <3.27
Browse files Browse the repository at this point in the history
  • Loading branch information
betocantu93 committed Feb 10, 2022
1 parent b8340ca commit f3d07b2
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@type={{@iconType}}
@size="m"
@useSvg={{@useSvg}}
@useComponent={{@useComponent}}
/>
{{/if}}
<span class={{@textClasses}}>
Expand Down
2 changes: 2 additions & 0 deletions packages/core/addon/components/eui-button-empty/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@iconSide={{@iconSide}}
@iconClasses={{@iconClasses}}
@useSvg={{@useSvg}}
@useComponent={{@useComponent}}
@textClasses={{class-names "euiButtonEmpty__text" @textClasses}}
>
{{yield}}
Expand All @@ -44,6 +45,7 @@
@iconSide={{@iconSide}}
@iconClasses={{@iconClasses}}
@useSvg={{@useSvg}}
@useComponent={{@useComponent}}
@textClasses={{class-names "euiButtonEmpty__text" @textClasses}}
>
{{yield}}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/addon/components/eui-button-icon/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@type={{@iconType}}
@size={{arg-or-default @iconSize "m"}}
@useSvg={{@useSvg}}
@useComponent={{@useComponent}}
aria-hidden="true"
/>
{{/if}}
Expand All @@ -29,6 +30,7 @@
@type={{@iconType}}
@size={{@iconSize}}
@useSvg={{@useSvg}}
@useComponent={{@useComponent}}
aria-hidden="true"
/>
{{/if}}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/addon/components/eui-button/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@iconSide={{@iconSide}}
@iconClasses={{@iconClasses}}
@useSvg={{@useSvg}}
@useComponent={{@useComponent}}
@textClasses={{class-names "euiButton__text" @textClasses}}
>
{{yield}}
Expand Down Expand Up @@ -48,6 +49,7 @@
@iconSide={{@iconSide}}
@iconClasses={{@iconClasses}}
@useSvg={{@useSvg}}
@useComponent={{@useComponent}}
@textClasses={{class-names "euiButton__text" @textClasses}}
>
{{yield}}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/addon/components/eui-icon/index.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{#if this.icon.moduleName}}
{{#if @useComponent}}
{{! has the shape of a curried component }}
{{#let (component this.icon) as |IconComponent|}}
{{!template-lint-disable}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{{! pending implementation}}
<EuiButtonIcon
@iconType={{component "eui-loading-spinner"}}
@useComponent={{true}}
{{! aria-label={ariaLabels.uploadingFiles} }}
/>
{{/if}}
Expand All @@ -29,7 +30,8 @@
</div>
<EuiButtonIcon
class="euiMarkdownEditorFooter__help"
@iconType={{this.markdownLogo}}
@iconType={{component "eui-markdown-editor-footer/icons/markdown-logo"}}
@useComponent={{true}}
@color="text"
@useSvg={{true}}
{{! aria-label={ariaLabels.showMarkdownHelp} }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import MarkdownLogoComponent from './icons/markdown-logo';

export interface EuiMarkdownEditorFooterArgs {}

export default class EuiMarkdownEditorFooterComponent extends Component<EuiMarkdownEditorFooterArgs> {
@tracked isPopoverOpen = false;
@tracked isShowingHelp = false;

get markdownLogo() {
return MarkdownLogoComponent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
<EuiButtonIcon
@color="text"
{{on "click" (fn this.handleMdButtonClick item.id)}}
@iconType={{item.iconType}}
@iconType={{if
item.iconType.component
(component item.iconType.component)
item.iconType
}}
@useComponent={{item.iconType.component}}
aria-label={{item.label}}
@useSvg={{item.useSvg}}
@isDisabled={{this.isPreviewing}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { action } from '@ember/object';
import type MarkdownActions from '../../utils/markdown/markdown-actions';
import { MODE_VIEWING } from '../../utils/markdown/markdown-modes';
import { cached } from '@glimmer/tracking';
import MarkdownCheckmarkComponent from './icons/markdown-checkmark';

import { Plugin } from 'unified';

Expand Down Expand Up @@ -50,7 +49,10 @@ export default class EuiMarkdownEditorToolbarComponent extends Component<EuiMark
label: 'Task list',
name: 'tl',
useSvg: true,
iconType: MarkdownCheckmarkComponent
iconType: {
// this should't be needed when we drop support for 3.24.0
component: 'eui-markdown-editor-toolbar/icons/markdown-checkmark'
}
}
];
}
Expand Down

0 comments on commit f3d07b2

Please sign in to comment.