From 9f4d1c0e763e8313e21a13b8c2bfe0bcd41c5b1d Mon Sep 17 00:00:00 2001 From: Matt Walker Date: Thu, 30 Nov 2023 16:14:14 +0000 Subject: [PATCH] chore: define all custom element names inline FUI-1198 --- client/src/main/main.ts | 6 ++---- client/src/routes/analytics/analytics.ts | 4 +--- client/src/routes/home/home.ts | 6 ++---- client/src/routes/not-found/not-found.ts | 4 +--- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/client/src/main/main.ts b/client/src/main/main.ts index ac9a360..98383e7 100644 --- a/client/src/main/main.ts +++ b/client/src/main/main.ts @@ -22,8 +22,6 @@ import { HostENV, HostURL } from '../types'; import { Store, StoreEventDetailMap } from '../store'; import { logger } from '../utils'; -const name = '{{rootElement}}'; - export type EventMap = StoreEventDetailMap; // eslint-disable-next-line @@ -33,7 +31,7 @@ const hostEnv = location.host; const hostUrl = API_HOST || `wss://${hostEnv}/gwf/`; @customElement({ - name, + name: '{{rootElement}}', template, styles, }) @@ -51,7 +49,7 @@ export class MainApplication extends EventEmitter(FASTElement) { public async connectedCallback() { super.connectedCallback(); - logger.debug(`${name} is now connected to the DOM`); + logger.debug(`'{{rootElement}}' is now connected to the DOM`); this.registerDIDependencies(); await this.loadRemotes(); diff --git a/client/src/routes/analytics/analytics.ts b/client/src/routes/analytics/analytics.ts index 6fd5426..2c6cb2c 100644 --- a/client/src/routes/analytics/analytics.ts +++ b/client/src/routes/analytics/analytics.ts @@ -2,10 +2,8 @@ import { customElement, FASTElement, observable } from '@microsoft/fast-element' import { AnalyticsTemplate as template } from './analytics.template'; import { AnalyticsStyles as styles } from './analytics.styles'; -const name = 'reports-route'; - @customElement({ - name, + name: 'reports-route', template, styles, }) diff --git a/client/src/routes/home/home.ts b/client/src/routes/home/home.ts index 24f2349..bd9f4ee 100644 --- a/client/src/routes/home/home.ts +++ b/client/src/routes/home/home.ts @@ -9,11 +9,9 @@ import { HomeTemplate as template } from './home.template'; import { FoundationLayout } from '@genesislcap/foundation-layout'; import { HOME_PREDEFINED_LAYOUT } from './predefined-layouts'; -const name = 'home-route'; - export type EventMap = StoreEventDetailMap; @customElement({ - name, + name: 'home-route', template, styles, }) @@ -38,7 +36,7 @@ export class Home extends EventEmitter(FASTElement) { public connectedCallback() { super.connectedCallback(); - logger.debug(`${name} is now connected to the DOM`); + logger.debug(`home-route is now connected to the DOM`); this.store.binding('sideNavClosed', (closed) => { this.editModalVisibleChanged(closed); diff --git a/client/src/routes/not-found/not-found.ts b/client/src/routes/not-found/not-found.ts index 216ae3a..94c9441 100644 --- a/client/src/routes/not-found/not-found.ts +++ b/client/src/routes/not-found/not-found.ts @@ -3,10 +3,8 @@ import { NotFoundTemplate as template } from './not-found.template'; import { NotFoundStyles as styles } from './not-found.styles'; import { logger } from '../../utils'; -const name = 'not-found-route'; - @customElement({ - name, + name: 'not-found-route', template, styles, })