Skip to content

Commit 7e93191

Browse files
lkostrowskiclaude
andauthored
refactor: migrate Button and Accordion to macaw-ui-next, delete legacy filter ui (#6922)
* refactor: migrate Button and Accordion to macaw-ui-next Replace the last Material-UI / legacy macaw-ui `Button`, `Accordion` and `AccordionSummary` usages with their macaw-ui-next equivalents. Legacy macaw `Button` defaulted to `variant="tertiary"`; macaw-ui-next defaults to `primary`, so bare `<Button>` call sites now pass the variant explicitly to keep their appearance. `components/Button/Button` existed only to turn `href` into a react-router `Link`. Its single consumer (NotFoundPage) always received internal URLs, so the wrapper is dropped in favour of `as={Link}`. FilterContent's accordion now relies on Radix single+collapsible behaviour, which removes the manual open/close handler and the two makeStyles blocks that only existed to strip Material-UI's default styling. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: use secondary variant for migrated legacy Buttons Screenshot comparison against main showed legacy macaw's default variant ("tertiary") renders as a bordered button, not a borderless one. macaw-ui-next's "tertiary" has no border, so the first pass silently flattened Remove/Unassign/Edit/Discard into bare text. "secondary" is the bordered equivalent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * refactor: remove the legacy filter-select UI Every <ListFilters> call site passes type="expression-filter", so the "old-filter-select" branch — FiltersSelect and the FilterContent tree below it — has been unreachable since the expression filters rollout finished. Last functional change to it was #1995 (Apr 2022); everything after that was sweeping refactors. knip does not flag this on its own: .knip.json sets storybook and jest as entry points, so the tree's own stories and tests kept it alive in the graph. Deleting those first and re-running knip to convergence yields the 24 files removed here, including Alert/InlineAlert whose only consumer was FilterErrorsList. Filter/types.ts and Filter/utils.ts stay: list views still build a filterStructure and pass filterDependency into their datagrids. FilterProps loses its export for the same reason — nothing imports it now that ListFilters is single-shape, but FilterPageProps still extends it. Verified: tsc clean, knip clean, and all nine list pages render their filter bar with no page errors. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * chore: extract messages, drop orphaned filter types, add changeset Removing the legacy filter UI orphaned 12 translation messages (key-value field labels, filter range separators, filter validation errors) — dropped by re-running extract-messages. The live Filters button keeps its own id (FNpv6K) and is unaffected. ValidationErrorCode and InvalidFilters only surfaced as unused once the commit hook stripped the now-dead imports from Filter/utils.ts, so knip caught them a round late. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent c1315d4 commit 7e93191

49 files changed

Lines changed: 70 additions & 2290 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"saleor-dashboard": patch
3+
---
4+
5+
Buttons and accordions across the dashboard now use the current design system instead of the legacy one. The change is visual only — some buttons are slightly smaller with rounder corners, and their labels are a touch bolder. Affected surfaces: the 404 page, translation field rows, list toolbars (Remove/Unassign), and the product export dialog.

locale/defaultMessages.json

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,10 +1308,6 @@
13081308
"context": "price or ordered products",
13091309
"string": "Price"
13101310
},
1311-
"34F7Jk": {
1312-
"context": "filter range separator",
1313-
"string": "and"
1314-
},
13151311
"34QbG4": {
13161312
"context": "hint under returns and refunds card on order settings",
13171313
"string": "Choose model types used as refund and return reason references."
@@ -5238,10 +5234,6 @@
52385234
"HlEpii": {
52395235
"string": "Search Engine Title"
52405236
},
5241-
"HnVtSS": {
5242-
"context": "search",
5243-
"string": "No results"
5244-
},
52455237
"HnZCl7": {
52465238
"context": "search input placeholder",
52475239
"string": "Search tax countries"
@@ -5296,10 +5288,6 @@
52965288
"context": "tab name",
52975289
"string": "All attributes"
52985290
},
5299-
"I+UwqI": {
5300-
"context": "is filter range or value",
5301-
"string": "equal to"
5302-
},
53035291
"I+XcO2": {
53045292
"context": "voucher save composition segment for staged country assignments",
53055293
"string": "Countries"
@@ -5415,10 +5403,6 @@
54155403
"context": "Amount error message",
54165404
"string": "Amount must be bigger than 0"
54175405
},
5418-
"ILgbKN": {
5419-
"context": "key-value field button add more key-value pairs",
5420-
"string": "Add more"
5421-
},
54225406
"ILhY5I": {
54235407
"context": "voucher save composition segment for start/end availability window",
54245408
"string": "Schedule"
@@ -7255,10 +7239,6 @@
72557239
"PKjitS": {
72567240
"string": "{count, plural, one {Warehouse assigned} other {# warehouses assigned}}"
72577241
},
7258-
"PLCwT/": {
7259-
"context": "search results",
7260-
"string": "Show more"
7261-
},
72627242
"PLX6FH": {
72637243
"context": "sum of all manual refunds for transaction",
72647244
"string": "Manual refund"
@@ -7359,10 +7339,6 @@
73597339
"context": "Button to remove all staged generator creates",
73607340
"string": "Clear all"
73617341
},
7362-
"Pnj+JH": {
7363-
"context": "key-value field input",
7364-
"string": "Value"
7365-
},
73667342
"Pp/7T7": {
73677343
"string": "{counter,plural,one{Are you sure you want to delete this category?} other{Are you sure you want to delete {displayQuantity} categories?}}"
73687344
},
@@ -7511,10 +7487,6 @@
75117487
"context": "link label in usage empty state",
75127488
"string": "model type"
75137489
},
7514-
"QBxN6z": {
7515-
"context": "is filter range or value",
7516-
"string": "between"
7517-
},
75187490
"QDxJib": {
75197491
"string": "Fulfill"
75207492
},
@@ -8606,10 +8578,6 @@
86068578
"US3IPU": {
86078579
"string": "Search Engine Description"
86088580
},
8609-
"USS3Q7": {
8610-
"context": "filters error messages unknown error",
8611-
"string": "Unknown error occurred"
8612-
},
86138581
"UVDfTs": {
86148582
"context": "discount type shipping",
86158583
"string": "Shipping"
@@ -9516,10 +9484,6 @@
95169484
"context": "PDP schematic full-bleed legend section header",
95179485
"string": "Where attributes show"
95189486
},
9519-
"XkX56I": {
9520-
"context": "filters error messages value required",
9521-
"string": "Choose a value"
9522-
},
95239487
"XkqRxe": {
95249488
"context": "Save composition segment for a pending customer type change",
95259489
"string": "customer type"
@@ -11396,10 +11360,6 @@
1139611360
"context": "customer types section name",
1139711361
"string": "Customer Types"
1139811362
},
11399-
"erC44f": {
11400-
"context": "filters error messages dependencies missing",
11401-
"string": "Filter requires other filters: {dependencies}"
11402-
},
1140311363
"erZXUi": {
1140411364
"context": "channel order setting label",
1140511365
"string": "Confirm new orders automatically"
@@ -14529,10 +14489,6 @@
1452914489
"context": "no countries found in assign countries dialog",
1453014490
"string": "No countries found"
1453114491
},
14532-
"q1shey": {
14533-
"context": "key-value field input",
14534-
"string": "Key"
14535-
},
1453614492
"q3IT3J": {
1453714493
"context": "extensions list has been removed",
1453814494
"string": "Extension removed"
@@ -17270,9 +17226,6 @@
1727017226
"zSDfq0": {
1727117227
"string": "Use flat tax rate"
1727217228
},
17273-
"zSOvI0": {
17274-
"string": "Filters"
17275-
},
1727617229
"zT1CvH": {
1727717230
"string": "Learn more about {extendingSaleor}"
1727817231
},

src/attributes/components/AttributeListPage/AttributeListPage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ const AttributeListPage = ({
159159
</TopNav>
160160
<Box display="flex" flexDirection="column" __minWidth={0} __minHeight={0}>
161161
<Box paddingTop={4}>
162-
<ListFilters<AttributeFilterKeys>
163-
type="expression-filter"
162+
<ListFilters
164163
initialSearch={initialSearch}
165164
onSearchChange={onSearchChange}
166165
searchPlaceholder={intl.formatMessage({

src/collections/components/CollectionListPage/CollectionListPage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ const CollectionListPage = ({
144144
<DashboardCard>
145145
{
146146
<ListFilters
147-
type="expression-filter"
148147
initialSearch={initialSearch}
149148
onSearchChange={onSearchChange}
150149
searchPlaceholder={intl.formatMessage({

src/components/Alert/InlineAlert.tsx

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 24 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,46 @@
1-
import { type FilterErrorMessages, type IFilter } from "@dashboard/components/Filter/types";
2-
import { type FilterProps, type SearchPageProps } from "@dashboard/types";
1+
import { type SearchPageProps } from "@dashboard/types";
32
import { Box } from "@saleor/macaw-ui-next";
43
import { type ReactNode } from "react";
54

65
import { ExpressionFilterPanel, ExpressionFilters } from "./components/ExpressionFilters";
7-
import { FiltersSelect } from "./components/FiltersSelect";
86
import { LegacyFiltersPresetsAlert } from "./components/LegacyFiltersPresetsAlert";
97
import SearchInput from "./components/SearchInput";
108

11-
interface NewFilterProps extends SearchPageProps {
12-
type: "expression-filter";
9+
interface ListFiltersProps extends SearchPageProps {
1310
searchPlaceholder: string;
1411
actions?: ReactNode;
1512
showSearchTooltip?: boolean;
1613
}
1714

18-
interface OldFiltersProps<TKeys extends string = string>
19-
extends FilterProps<TKeys>,
20-
SearchPageProps {
21-
type?: "old-filter-select";
22-
searchPlaceholder: string;
23-
actions?: ReactNode;
24-
showSearchTooltip?: boolean;
25-
filterStructure?: IFilter<TKeys>;
26-
errorMessages?: FilterErrorMessages<TKeys>;
27-
}
28-
29-
type ListFiltersProps<TKeys extends string = string> = NewFilterProps | OldFiltersProps<TKeys>;
30-
31-
export const ListFilters = <TFilterKeys extends string = string>({
15+
export const ListFilters = ({
3216
initialSearch,
3317
searchPlaceholder,
3418
onSearchChange,
3519
actions,
3620
showSearchTooltip,
37-
...props
38-
}: ListFiltersProps<TFilterKeys>) => {
39-
const isExpressionFilter = props.type === "expression-filter";
40-
41-
return (
42-
<>
43-
{isExpressionFilter && <LegacyFiltersPresetsAlert />}
44-
<Box display="flex" flexDirection="column" gap={3} paddingBottom={2} paddingX={6}>
45-
<Box display="grid" __gridTemplateColumns="auto 1fr" gap={4}>
46-
<Box display="flex" alignItems="center" gap={4}>
47-
{isExpressionFilter ? (
48-
<ExpressionFilters />
49-
) : (
50-
<FiltersSelect<TFilterKeys>
51-
errorMessages={props.errorMessages}
52-
menu={props.filterStructure!}
53-
currencySymbol={props.currencySymbol}
54-
onFilterAdd={props.onFilterChange!}
55-
onFilterAttributeFocus={props.onFilterAttributeFocus}
56-
/>
57-
)}
58-
<Box __width="360px">
59-
<SearchInput
60-
initialSearch={initialSearch}
61-
placeholder={searchPlaceholder}
62-
onSearchChange={onSearchChange}
63-
showSearchTooltip={showSearchTooltip}
64-
/>
65-
</Box>
66-
</Box>
67-
<Box display="flex" justifyContent="flex-end" alignItems="center">
68-
{actions}
21+
}: ListFiltersProps) => (
22+
<>
23+
<LegacyFiltersPresetsAlert />
24+
<Box display="flex" flexDirection="column" gap={3} paddingBottom={2} paddingX={6}>
25+
<Box display="grid" __gridTemplateColumns="auto 1fr" gap={4}>
26+
<Box display="flex" alignItems="center" gap={4}>
27+
<ExpressionFilters />
28+
<Box __width="360px">
29+
<SearchInput
30+
initialSearch={initialSearch}
31+
placeholder={searchPlaceholder}
32+
onSearchChange={onSearchChange}
33+
showSearchTooltip={showSearchTooltip}
34+
/>
6935
</Box>
7036
</Box>
71-
{isExpressionFilter ? <ExpressionFilterPanel /> : null}
37+
<Box display="flex" justifyContent="flex-end" alignItems="center">
38+
{actions}
39+
</Box>
7240
</Box>
73-
</>
74-
);
75-
};
41+
<ExpressionFilterPanel />
42+
</Box>
43+
</>
44+
);
7645

7746
ListFilters.displayName = "FilterBar";

src/components/AppLayout/ListFilters/components/FiltersSelect.tsx

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

0 commit comments

Comments
 (0)