From f7ef3962fafe5c4d301d5e5aebe9f7ed9b72308e Mon Sep 17 00:00:00 2001 From: Sam Van Campenhout Date: Thu, 7 Nov 2024 18:42:50 +0100 Subject: [PATCH] Add a `@newTab` argument to the `AuLinkExternal` component --- addon/components/au-link-external.gts | 9 +++- .../Links/AuLinkExternal.stories.js | 6 +++ .../components/au-link-external-test.gts | 44 +++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/addon/components/au-link-external.gts b/addon/components/au-link-external.gts index 94cc4780a..1585ade1e 100644 --- a/addon/components/au-link-external.gts +++ b/addon/components/au-link-external.gts @@ -14,6 +14,7 @@ export interface AuLinkExternalSignature { hideText?: boolean; icon?: AuIconSignature['Args']['icon']; iconAlignment?: 'left' | 'right'; + newTab?: boolean; skin?: | 'primary' | 'secondary' @@ -61,12 +62,16 @@ export default class AuLinkExternal extends Component { return ''; } + get newTab() { + return typeof this.args.newTab === 'boolean' ? this.args.newTab : true; + } + // We don't want whitespace between our component and the outer template tag since that's visible in the app (inline element): https://github.com/emberjs/rfcs/issues/982 // prettier-ignore