Skip to content

Commit 581eef5

Browse files
frano-mclaude
andcommitted
chore: drop unused superseded prop and SupersededTag styled (#949)
Audit while landing #949 revealed superseded was always passed as false from every call site (filters.tsx, FilterTag/utils.ts, stories args, filterTags.stories.tsx) and the SupersededTag styled component was therefore never rendered. Strips the prop from CategoryTag, FilterTag, FilterTags, and the two stories files. Deletes filterTag.styles.ts (only contained SupersededTag). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 94a08ae commit 581eef5

8 files changed

Lines changed: 4 additions & 35 deletions

File tree

src/common/entities.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export type ClearAll = typeof CLEAR_ALL;
4040
export interface CategoryTag {
4141
label: string;
4242
onRemove: () => void;
43-
superseded: boolean;
4443
}
4544

4645
/**

src/components/Filter/components/FilterTag/filterTag.styles.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/components/Filter/components/FilterTag/filterTag.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { CloseRounded } from "@mui/icons-material";
22
import { Chip, Tooltip } from "@mui/material";
33
import { JSX } from "react";
4-
import { SupersededTag } from "./filterTag.styles";
54
import { useTooltipTitle } from "./hooks/UseTooltipTitle/hook";
65

76
export interface FilterTagProps {
87
label: string;
98
onRemove: () => void;
10-
superseded: boolean;
119
}
1210

1311
const DEFAULT_SLOT_PROPS = {
@@ -27,12 +25,7 @@ const DEFAULT_SLOT_PROPS = {
2725
},
2826
};
2927

30-
export const FilterTag = ({
31-
label,
32-
onRemove,
33-
superseded,
34-
}: FilterTagProps): JSX.Element => {
35-
const Tag = superseded ? SupersededTag : Chip;
28+
export const FilterTag = ({ label, onRemove }: FilterTagProps): JSX.Element => {
3629
const { ref, title } = useTooltipTitle(label);
3730

3831
return (
@@ -42,7 +35,7 @@ export const FilterTag = ({
4235
slotProps={DEFAULT_SLOT_PROPS}
4336
title={title}
4437
>
45-
<Tag
38+
<Chip
4639
clickable={false} // removes unwanted active and hover ui; "pointer" cursor added to "filterTag" variant in theme.
4740
color="primary"
4841
deleteIcon={<CloseRounded color="inherit" />}

src/components/Filter/components/FilterTag/stories/args.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ import { FilterTag } from "../filterTag";
66
export const DEFAULT_ARGS: ComponentProps<typeof FilterTag> = {
77
label: "male",
88
onRemove: fn(),
9-
superseded: false,
109
};
1110

1211
export const WITH_ELLIPSIS_ARGS: ComponentProps<typeof FilterTag> = {
1312
label: LOREM_IPSUM.LONG,
1413
onRemove: fn(),
15-
superseded: false,
1614
};
1715

1816
export const WITH_RANGE_ARGS: ComponentProps<typeof FilterTag> = {
1917
label: "10 - 34",
2018
onRemove: fn(),
21-
superseded: false,
2219
};

src/components/Filter/components/FilterTag/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export function buildRangeTag(
2828
undefined,
2929
VIEW_KIND.RANGE,
3030
),
31-
superseded: false,
3231
},
3332
];
3433
}

src/components/Filter/components/FilterTags/filterTags.stories.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,26 @@ export const FilterTagsStory: Story = {
3131
{
3232
label: "Normal",
3333
onRemove: onRemove,
34-
superseded: false,
3534
},
3635
{
3736
label: "abscess",
3837
onRemove: onRemove,
39-
superseded: true,
4038
},
4139
{
4240
label: "acoustic neuroma",
4341
onRemove: onRemove,
44-
superseded: false,
4542
},
4643
{
4744
label: "acute kidney failure",
4845
onRemove: onRemove,
49-
superseded: false,
5046
},
5147
{
5248
label: "acute kidney tubular necrosis",
5349
onRemove: onRemove,
54-
superseded: false,
5550
},
5651
{
5752
label: "alcohol abuse",
5853
onRemove: onRemove,
59-
superseded: false,
6054
},
6155
],
6256
},

src/components/Filter/components/FilterTags/filterTags.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ export interface FilterTagsProps {
1010
export const FilterTags = ({ tags }: FilterTagsProps): JSX.Element | null => {
1111
return tags && tags.length ? (
1212
<Tags>
13-
{tags.map(({ label, onRemove, superseded }, t) => (
14-
<Tag
15-
key={`${label}${t}`}
16-
label={label}
17-
onRemove={onRemove}
18-
superseded={superseded}
19-
/>
13+
{tags.map(({ label, onRemove }, t) => (
14+
<Tag key={`${label}${t}`} label={label} onRemove={onRemove} />
2015
))}
2116
</Tags>
2217
) : null;

src/components/Filter/components/Filters/filters.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ function buildFilterTags(
5252
return {
5353
label: label,
5454
onRemove: () => onFilter(categoryKey, categoryValueKey, !selected),
55-
superseded: false,
5655
};
5756
});
5857
}

0 commit comments

Comments
 (0)