From 38f1a85b1fb448c59a62c92ea43c4edda4e3ec62 Mon Sep 17 00:00:00 2001 From: Sam Van Campenhout Date: Wed, 6 Mar 2024 18:43:50 +0100 Subject: [PATCH] Add Glint support to the `AuMainHeader` component --- ...{au-main-header.gjs => au-main-header.gts} | 27 +++-- addon/template-registry.ts | 2 + .../components/au-main-header-test.gts | 98 +++++++++++++++++++ .../components/au-main-header-test.js | 26 ----- .../integration/components/loose-mode-test.ts | 7 ++ 5 files changed, 128 insertions(+), 32 deletions(-) rename addon/components/{au-main-header.gjs => au-main-header.gts} (73%) create mode 100644 tests/integration/components/au-main-header-test.gts delete mode 100644 tests/integration/components/au-main-header-test.js diff --git a/addon/components/au-main-header.gjs b/addon/components/au-main-header.gts similarity index 73% rename from addon/components/au-main-header.gjs rename to addon/components/au-main-header.gts index 85ef9b99b..4bf598122 100644 --- a/addon/components/au-main-header.gjs +++ b/addon/components/au-main-header.gts @@ -1,18 +1,33 @@ -import { AuBrand, AuLink } from '@appuniversum/ember-appuniversum'; import { on } from '@ember/modifier'; import { action } from '@ember/object'; import { LinkTo } from '@ember/routing'; -import { inject as service } from '@ember/service'; +import type RouterService from '@ember/routing/router-service'; +import { service } from '@ember/service'; import Component from '@glimmer/component'; +import AuBrand from './au-brand'; +import AuLink from './au-link'; -export default class AuMainHeader extends Component { +export interface AuMainHeaderSignature { + Args: { + appTitle: string; + brandLink?: string; + contactRoute?: string; + homeRoute?: string; + }; + Blocks: { + default: []; + }; + Element: HTMLElement; +} + +export default class AuMainHeader extends Component { @action headerLinkFocus() { - document.querySelector('#main')?.focus(); + (document.querySelector('#main') as HTMLElement | null)?.focus(); }