Skip to content

Commit

Permalink
refactor(components): rename app file to match our usual convention
Browse files Browse the repository at this point in the history
* The file name should match the custom HTLM tag name
* The component class is called <component without gs->Component
  • Loading branch information
fengelniederhammer committed Jan 29, 2025
1 parent 0a22115 commit 62b7a43
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Meta, StoryObj } from '@storybook/web-components';
import { html, LitElement } from 'lit';
import { customElement } from 'lit/decorators.js';

import './app';
import './gs-app';

import { lapisContext } from './lapis-context';
import { referenceGenomeContext } from './reference-genome-context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const lapisUrlSchema = z.string().url();
* This component does __not__ use a shadow DOM. Children of this component will be rendered directly in the light DOM.
*/
@customElement('gs-app')
export class App extends LitElement {
export class AppComponent extends LitElement {
/**
* Required.
*
Expand Down Expand Up @@ -84,7 +84,7 @@ function GsAppError(error: string) {

declare global {
interface HTMLElementTagNameMap {
'gs-app': App;
'gs-app': AppComponent;
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/src/web-components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { App } from './app.js';
export { AppComponent } from './gs-app';
export * from './visualization';
export * from './wastewaterVisualization';
export * from './input';
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { previewHandles } from '../../../.storybook/preview';
import { LAPIS_URL } from '../../constants';
import { type DateRangeSelectorProps } from '../../preact/dateRangeSelector/date-range-selector';
import './gs-date-range-selector';
import '../app';
import '../gs-app';
import { toYYYYMMDD } from '../../preact/dateRangeSelector/dateConversion';
import { dateRangeOptionPresets } from '../../preact/dateRangeSelector/dateRangeOption';
import { withinShadowRoot } from '../withinShadowRoot.story';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { html } from 'lit';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { previewHandles } from '../../../.storybook/preview';
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
import '../app';
import '../gs-app';
import './gs-lineage-filter';
import aggregatedData from '../../preact/lineageFilter/__mockData__/aggregated.json';
import { type LineageFilterProps } from '../../preact/lineageFilter/lineage-filter';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ifDefined } from 'lit/directives/if-defined.js';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { previewHandles } from '../../../.storybook/preview';
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
import '../app';
import '../gs-app';
import './gs-location-filter';
import data from '../../preact/locationFilter/__mockData__/aggregated.json';
import { type LocationFilterProps } from '../../preact/locationFilter/location-filter';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { html } from 'lit';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { previewHandles } from '../../../.storybook/preview';
import { LAPIS_URL, REFERENCE_GENOME_ENDPOINT } from '../../constants';
import '../app';
import '../gs-app';
import { type MutationFilterProps } from '../../preact/mutationFilter/mutation-filter';
import { withinShadowRoot } from '../withinShadowRoot.story';
import './gs-mutation-filter';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { html } from 'lit';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { previewHandles } from '../../../.storybook/preview';
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
import '../app';
import '../gs-app';
import './gs-text-input';
import data from '../../preact/textInput/__mockData__/aggregated_hosts.json';
import type { TextInputProps } from '../../preact/textInput/text-input';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import aggregatedDataWith2Fields from '../../preact/aggregatedData/__mockData__/
import type { AggregateProps } from '../../preact/aggregatedData/aggregate';

import './gs-aggregate';
import '../app';
import '../gs-app';

const codeExample = `
<gs-aggregate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/web-components';
import { html } from 'lit';

import './gs-mutation-comparison';
import '../app';
import '../gs-app';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { LAPIS_URL, NUCLEOTIDE_MUTATIONS_ENDPOINT } from '../../constants';
import nucleotideMutationsOtherDataset from '../../preact/mutationComparison/__mockData__/nucleotideMutationsOtherDataset.json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components';
import { html } from 'lit';

import './gs-mutations-over-time';
import '../app';
import '../gs-app';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { LAPIS_URL } from '../../constants';
import { type MutationsOverTimeProps } from '../../preact/mutationsOverTime/mutations-over-time';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { type MutationsProps } from '../../preact/mutations/mutations';
import { withinShadowRoot } from '../withinShadowRoot.story';

import './gs-mutations';
import '../app';
import '../gs-app';

const codeExample = String.raw`
<gs-mutations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, fireEvent, waitFor } from '@storybook/test';
import type { Meta, StoryObj } from '@storybook/web-components';
import { html } from 'lit';

import '../app';
import '../gs-app';
import './gs-number-sequences-over-time';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, fireEvent, waitFor } from '@storybook/test';
import type { Meta, StoryObj } from '@storybook/web-components';
import { html } from 'lit';

import '../app';
import '../gs-app';
import './gs-prevalence-over-time';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components';
import { html } from 'lit';

import './gs-relative-growth-advantage';
import '../app';
import '../gs-app';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
import denominatorFilter from '../../preact/relativeGrowthAdvantage/__mockData__/denominatorFilter.json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { type SequencesByLocationProps } from '../../preact/map/sequences-by-loc
import { withinShadowRoot } from '../withinShadowRoot.story';

import './gs-sequences-by-location';
import '../app';
import '../gs-app';

const codeExample = `<gs-sequences-by-location
lapisFilter='{"dateFrom":"2022-01-01","dateTo":"2022-04-01"}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import numeratorData from '../../preact/statistic/__mockData__/numerator.json';
import { type StatisticsProps } from '../../preact/statistic/statistics';

import './gs-statistics';
import '../app';
import '../gs-app';

const codeExample = `
<gs-statistics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components';
import { html } from 'lit';

import './gs-wastewater-mutations-over-time';
import '../app';
import '../gs-app';
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
import { WISE_DETAILS_ENDPOINT, WISE_LAPIS_URL } from '../../constants';
import details from '../../preact/wastewater/mutationsOverTime/__mockData__/details.json';
Expand Down

0 comments on commit 62b7a43

Please sign in to comment.