Skip to content

Commit

Permalink
feat(components): gs-lineage-filter: rename initialValue to value
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Rename initialValue to value for gs-lineage-filter
  • Loading branch information
Jonas Zarzalis (TNG) authored and JonasKellerer committed Jan 21, 2025
1 parent e66d526 commit 1ff38e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const meta: Meta = {
args: {
lapisField: 'pangoLineage',
placeholderText: 'Enter a lineage',
initialValue: 'A.1',
value: 'A.1',
width: '100%',
},
};
Expand All @@ -50,7 +50,7 @@ export const Default: StoryObj<LineageFilterProps> = {
<LineageFilter
lapisField={args.lapisField}
placeholderText={args.placeholderText}
initialValue={args.initialValue}
value={args.value}
width={args.width}
/>
</LapisUrlContext.Provider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const codeExample = String.raw`
<gs-lineage-filter
lapisField="pangoLineage"
placeholderText="Enter lineage"
initialValue="B.1.1.7"
value="B.1.1.7"
width="50%">
</gs-lineage-filter>`;

Expand Down Expand Up @@ -61,7 +61,7 @@ const Template: StoryObj<Required<LineageFilterProps>> = {
<gs-lineage-filter
.lapisField=${args.lapisField}
.placeholderText=${args.placeholderText}
.initialValue=${args.initialValue}
.value=${args.value}
.width=${args.width}
></gs-lineage-filter>
</div>
Expand All @@ -70,7 +70,7 @@ const Template: StoryObj<Required<LineageFilterProps>> = {
args: {
lapisField: 'pangoLineage',
placeholderText: 'Enter a lineage',
initialValue: 'B.1.1.7',
value: 'B.1.1.7',
width: '100%',
},
};
Expand Down Expand Up @@ -185,6 +185,6 @@ export const FiresEvent: StoryObj<Required<LineageFilterProps>> = {
},
args: {
...LineageFilter.args,
initialValue: '',
value: '',
},
};
8 changes: 3 additions & 5 deletions components/src/web-components/input/gs-lineage-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class LineageFilterComponent extends PreactLitAdapter {
* The initial value to use for this lineage filter.
*/
@property()
initialValue: string = '';
value: string = '';

/**
* Required.
Expand Down Expand Up @@ -64,7 +64,7 @@ export class LineageFilterComponent extends PreactLitAdapter {
<LineageFilter
lapisField={this.lapisField}
placeholderText={this.placeholderText}
initialValue={this.initialValue}
value={this.value}
width={this.width}
/>
);
Expand All @@ -91,9 +91,7 @@ declare global {
}

/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
type InitialValueMatches = Expect<
Equals<typeof LineageFilterComponent.prototype.initialValue, LineageFilterProps['initialValue']>
>;
type InitialValueMatches = Expect<Equals<typeof LineageFilterComponent.prototype.value, LineageFilterProps['value']>>;
type LapisFieldMatches = Expect<
Equals<typeof LineageFilterComponent.prototype.lapisField, LineageFilterProps['lapisField']>
>;
Expand Down

0 comments on commit 1ff38e4

Please sign in to comment.