diff --git a/docs/Upgrade.md b/docs/Upgrade.md index 76cbb63b99d..ea3484350ba 100644 --- a/docs/Upgrade.md +++ b/docs/Upgrade.md @@ -924,6 +924,10 @@ The `` component no longer accepts a `touched` prop. This prop If you were using this prop, you can safely remove it. +## `data-generator-retail` `commands` Have Been Renamed to `orders` + +The `data-generator-retail` package has been updated to provide types for all its records. In the process, we renamed the `commands` resource to `orders`. Accordingly, the `nb_commands` property of the `customers` resource has been renamed to `nb_orders` and the `command_id` property of the `invoices` and `reviews` resources has been renamed to `order_id`. + ## Upgrading to v4 If you are on react-admin v3, follow the [Upgrading to v4](https://marmelab.com/react-admin/doc/4.16/Upgrade.html) guide before upgrading to v5. diff --git a/examples/data-generator/README.md b/examples/data-generator/README.md index e9bf444a601..2adaf4a00d8 100644 --- a/examples/data-generator/README.md +++ b/examples/data-generator/README.md @@ -18,7 +18,7 @@ console.log(data); customers: [ /* ...900 customers */], categories: [ /* ...12 categories */], products: [ /* ...120 products */], - commands: [ /* ...600 orders */], + orders: [ /* ...600 orders */], invoices: [ /* ...about 500 invoices */], reviews: [ /* ... */], } @@ -42,7 +42,7 @@ console.log(data); - latest_purchase - has_newsletter: boolean - groups: array - - nb_commands: integer + - nb_orders: integer - total_spent: integer - categories - id: number @@ -58,7 +58,7 @@ console.log(data); - image: string - description: string - stock: integer -- commands +- orders - id: integer - reference: string - date: date @@ -74,7 +74,7 @@ console.log(data); - invoices - id: integer - date: date - - command_id: integer + - order_id: integer - customer_id: integer - total_ex_taxes: float - delivery_fees: float @@ -85,7 +85,7 @@ console.log(data); - id: integer - date: date - status: 'pending' | 'accepted' | 'rejected' - - command_id: integer + - order_id: integer - product_id: integer - customer_id: integer - rating: integer diff --git a/examples/data-generator/src/customers.ts b/examples/data-generator/src/customers.ts index 70c4179f047..4aba849031f 100644 --- a/examples/data-generator/src/customers.ts +++ b/examples/data-generator/src/customers.ts @@ -43,7 +43,7 @@ export const generateCustomers = (): Customer[] => { latest_purchase: null, // finalize has_newsletter: has_ordered ? weightedBoolean(30) : true, groups: [], // finalize - nb_commands: 0, + nb_orders: 0, total_spent: 0, }; }); @@ -66,6 +66,6 @@ export type Customer = { latest_purchase: string; has_newsletter: boolean; groups: string[]; - nb_commands: number; + nb_orders: number; total_spent: number; }; diff --git a/examples/data-generator/src/finalize.ts b/examples/data-generator/src/finalize.ts index b6c724448c0..1f6d4577500 100644 --- a/examples/data-generator/src/finalize.ts +++ b/examples/data-generator/src/finalize.ts @@ -3,31 +3,31 @@ import { weightedBoolean } from './utils'; export default function (db: Db) { // set latest purchase date - db.commands.forEach(command => { - let customer = db.customers[command.customer_id]; + db.orders.forEach(order => { + let customer = db.customers[order.customer_id]; if ( !customer.latest_purchase || - customer.latest_purchase < command.date + customer.latest_purchase < order.date ) { - customer.latest_purchase = command.date; + customer.latest_purchase = order.date; } - customer.total_spent += command.total; - customer.nb_commands++; + customer.total_spent += order.total; + customer.nb_orders++; }); // set product sales - db.commands.forEach(command => { - command.basket.forEach(item => { + db.orders.forEach(order => { + order.basket.forEach(item => { db.products[item.product_id].sales += item.quantity; }); }); // add 'collector' group - const customersBySpending = db.commands.reduce((customers, command) => { - if (!customers[command.customer_id]) { - customers[command.customer_id] = { nbProducts: 0 }; + const customersBySpending = db.orders.reduce((customers, order) => { + if (!customers[order.customer_id]) { + customers[order.customer_id] = { nbProducts: 0 }; } - customers[command.customer_id].nbProducts += command.basket.length; + customers[order.customer_id].nbProducts += order.basket.length; return customers; }, {}); Object.keys(customersBySpending).forEach(customer_id => { @@ -38,7 +38,7 @@ export default function (db: Db) { // add 'ordered_once' group db.customers - .filter(customer => customer.nb_commands === 1) + .filter(customer => customer.nb_orders === 1) .forEach(customer => customer.groups.push('ordered_once')); // add 'compulsive' group @@ -52,14 +52,13 @@ export default function (db: Db) { .forEach(customer => customer.groups.push('regular')); // add 'returns' group - db.commands - .filter(command => command.returned) - .forEach(command => { + db.orders + .filter(order => order.returned) + .forEach(order => { if ( - db.customers[command.customer_id].groups.indexOf('returns') === - -1 + db.customers[order.customer_id].groups.indexOf('returns') === -1 ) { - db.customers[command.customer_id].groups.push('returns'); + db.customers[order.customer_id].groups.push('returns'); } }); diff --git a/examples/data-generator/src/index.ts b/examples/data-generator/src/index.ts index c47ed1e235f..963043983d3 100644 --- a/examples/data-generator/src/index.ts +++ b/examples/data-generator/src/index.ts @@ -1,7 +1,7 @@ import { generateCustomers, Customer } from './customers'; import { generateCategories, Category } from './categories'; import { generateProducts, Product } from './products'; -import { generateCommands, Command, BasketItem } from './commands'; +import { generateOrders, Order, BasketItem } from './orders'; import { generateInvoices, Invoice } from './invoices'; import { generateReviews, Review } from './reviews'; import finalize from './finalize'; @@ -12,7 +12,7 @@ const generateData = (): Db => { db.customers = generateCustomers(); db.categories = generateCategories(); db.products = generateProducts(db); - db.commands = generateCommands(db); + db.orders = generateOrders(db); db.invoices = generateInvoices(db); db.reviews = generateReviews(db); finalize(db); @@ -25,7 +25,7 @@ export default generateData; export type { BasketItem, Category, - Command, + Order, Customer, Db, Invoice, diff --git a/examples/data-generator/src/invoices.ts b/examples/data-generator/src/invoices.ts index 6d524dc539c..b294021f099 100644 --- a/examples/data-generator/src/invoices.ts +++ b/examples/data-generator/src/invoices.ts @@ -4,20 +4,20 @@ export const generateInvoices = (db: Db): Invoice[] => { let id = 0; return ( - db.commands - .filter(command => command.status !== 'delivered') + db.orders + .filter(order => order.status !== 'delivered') // @ts-ignore .sort((a, b) => new Date(a.date) - new Date(b.date)) - .map(command => ({ + .map(order => ({ id: id++, - date: command.date, - command_id: command.id, - customer_id: command.customer_id, - total_ex_taxes: command.total_ex_taxes, - delivery_fees: command.delivery_fees, - tax_rate: command.tax_rate, - taxes: command.taxes, - total: command.total, + date: order.date, + order_id: order.id, + customer_id: order.customer_id, + total_ex_taxes: order.total_ex_taxes, + delivery_fees: order.delivery_fees, + tax_rate: order.tax_rate, + taxes: order.taxes, + total: order.total, })) ); }; @@ -25,7 +25,7 @@ export const generateInvoices = (db: Db): Invoice[] => { export type Invoice = { id: number; date: string; - command_id: number; + order_id: number; customer_id: number; total_ex_taxes: number; delivery_fees: number; diff --git a/examples/data-generator/src/commands.ts b/examples/data-generator/src/orders.ts similarity index 92% rename from examples/data-generator/src/commands.ts rename to examples/data-generator/src/orders.ts index d84d463dcfa..4ba9b4d3089 100644 --- a/examples/data-generator/src/commands.ts +++ b/examples/data-generator/src/orders.ts @@ -9,7 +9,7 @@ import { } from './utils'; import type { Db } from './types'; -export const generateCommands = (db: Db): Command[] => { +export const generateOrders = (db: Db): Order[] => { const today = new Date(); const aMonthAgo = subDays(today, 30); const realCustomers = db.customers.filter(customer => customer.has_ordered); @@ -42,7 +42,7 @@ export const generateCommands = (db: Db): Command[] => { const customer = random.arrayElement(realCustomers); const date = randomDate(customer.first_seen, customer.last_seen); - const status: CommandStatus = + const status: OrderStatus = isAfter(date, aMonthAgo) && random.boolean() ? 'ordered' : weightedArrayElement(['delivered', 'cancelled'], [10, 1]); @@ -65,7 +65,7 @@ export const generateCommands = (db: Db): Command[] => { }); }; -export type Command = { +export type Order = { id: number; reference: string; date: string; @@ -76,11 +76,11 @@ export type Command = { tax_rate: number; taxes: number; total: number; - status: CommandStatus; + status: OrderStatus; returned: boolean; }; -export type CommandStatus = 'ordered' | 'delivered' | 'cancelled'; +export type OrderStatus = 'ordered' | 'delivered' | 'cancelled'; export type BasketItem = { product_id: number; quantity: number; diff --git a/examples/data-generator/src/reviews.ts b/examples/data-generator/src/reviews.ts index 319249f017d..8935898b792 100644 --- a/examples/data-generator/src/reviews.ts +++ b/examples/data-generator/src/reviews.ts @@ -14,15 +14,15 @@ export const generateReviews = (db: Db): Review[] => { .filter(() => weightedBoolean(60)) // only 60% of buyers write reviews .map(customer => customer.id); - return db.commands - .filter(command => reviewers.indexOf(command.customer_id) !== -1) + return db.orders + .filter(order => reviewers.indexOf(order.customer_id) !== -1) .reduce( - (acc, command) => [ + (acc, order) => [ ...acc, - ...command.basket + ...order.basket .filter(() => weightedBoolean(40)) // reviewers review 40% of their products .map(product => { - const date = randomDate(command.date); + const date = randomDate(order.date); const status = isAfter(aMonthAgo, date) ? weightedArrayElement( ['accepted', 'rejected'], @@ -37,9 +37,9 @@ export const generateReviews = (db: Db): Review[] => { id: id++, date: date.toISOString(), status: status, - command_id: command.id, + order_id: order.id, product_id: product.product_id, - customer_id: command.customer_id, + customer_id: order.customer_id, rating: random.number({ min: 1, max: 5 }), comment: Array.apply( null, @@ -58,7 +58,7 @@ export type Review = { id: number; date: string; status: 'accepted' | 'rejected' | 'pending'; - command_id: number; + order_id: number; product_id: number; customer_id: number; rating: number; diff --git a/examples/data-generator/src/types.ts b/examples/data-generator/src/types.ts index b877422839b..89d52d68c8f 100644 --- a/examples/data-generator/src/types.ts +++ b/examples/data-generator/src/types.ts @@ -1,7 +1,7 @@ import type { Customer } from './customers'; import type { Category } from './categories'; import type { Product } from './products'; -import type { Command } from './commands'; +import type { Order } from './orders'; import type { Invoice } from './invoices'; import type { Review } from './reviews'; import { Settings } from './finalize'; @@ -10,7 +10,7 @@ export interface Db { customers: Customer[]; categories: Category[]; products: Product[]; - commands: Command[]; + orders: Order[]; invoices: Invoice[]; reviews: Review[]; settings: Settings; diff --git a/examples/demo/src/App.tsx b/examples/demo/src/App.tsx index 6a9fa80a319..c28639a00bd 100644 --- a/examples/demo/src/App.tsx +++ b/examples/demo/src/App.tsx @@ -66,11 +66,7 @@ const App = () => { } /> - + diff --git a/examples/demo/src/dashboard/Dashboard.tsx b/examples/demo/src/dashboard/Dashboard.tsx index ecfaa256fed..c258ac78c66 100644 --- a/examples/demo/src/dashboard/Dashboard.tsx +++ b/examples/demo/src/dashboard/Dashboard.tsx @@ -46,7 +46,7 @@ const Dashboard = () => { ); const aMonthAgo = useMemo(() => subDays(startOfDay(new Date()), 30), []); - const { data: orders } = useGetList('commands', { + const { data: orders } = useGetList('orders', { filter: { date_gte: aMonthAgo.toISOString() }, sort: { field: 'date', order: 'DESC' }, pagination: { page: 1, perPage: 50 }, diff --git a/examples/demo/src/dashboard/MonthlyRevenue.tsx b/examples/demo/src/dashboard/MonthlyRevenue.tsx index 2300aa46ebe..b7663f5a2b7 100644 --- a/examples/demo/src/dashboard/MonthlyRevenue.tsx +++ b/examples/demo/src/dashboard/MonthlyRevenue.tsx @@ -13,7 +13,7 @@ const MonthlyRevenue = (props: Props) => { const translate = useTranslate(); return ( { const translate = useTranslate(); return ( { }); return ( - + {isPending ? ( diff --git a/examples/demo/src/dataProvider/graphql.ts b/examples/demo/src/dataProvider/graphql.ts index f2740890b5a..458e73edc39 100644 --- a/examples/demo/src/dataProvider/graphql.ts +++ b/examples/demo/src/dataProvider/graphql.ts @@ -15,8 +15,8 @@ const getGqlResource = (resource: string) => { case 'categories': return 'Category'; - case 'commands': - return 'Command'; + case 'orders': + return 'Order'; case 'products': return 'Product'; @@ -72,7 +72,7 @@ const customBuildQuery: BuildQueryFactory = introspectionResults => { $latest_purchase: Date $has_newsletter: Boolean! $groups: [String]! - $nb_commands: Int! + $nb_orders: Int! $total_spent: Float! ) { createCustomer( @@ -90,7 +90,7 @@ const customBuildQuery: BuildQueryFactory = introspectionResults => { latest_purchase: $latest_purchase has_newsletter: $has_newsletter groups: $groups - nb_commands: $nb_commands + nb_orders: $nb_orders total_spent: $total_spent ) { id diff --git a/examples/demo/src/i18n/en.ts b/examples/demo/src/i18n/en.ts index b2ffc73ac82..fbccf194ed5 100644 --- a/examples/demo/src/i18n/en.ts +++ b/examples/demo/src/i18n/en.ts @@ -51,7 +51,7 @@ const customEnglishMessages: TranslationMessages = { customers: { name: 'Customer |||| Customers', fields: { - commands: 'Orders', + orders: 'Orders', first_seen: 'First seen', full_name: 'Name', groups: 'Segments', @@ -91,7 +91,7 @@ const customEnglishMessages: TranslationMessages = { 'The password confirmation is not the same as the password.', }, }, - commands: { + orders: { name: 'Order |||| Orders', amount: '1 order |||| %{smart_count} orders', title: 'Order %{reference}', @@ -128,7 +128,7 @@ const customEnglishMessages: TranslationMessages = { fields: { date: 'Invoice date', customer_id: 'Customer', - command_id: 'Order', + order_id: 'Order', date_gte: 'Passed Since', date_lte: 'Passed Before', total_gte: 'Min amount', @@ -186,7 +186,7 @@ const customEnglishMessages: TranslationMessages = { detail: 'Review detail', fields: { customer_id: 'Customer', - command_id: 'Order', + order_id: 'Order', product_id: 'Product', date_gte: 'Posted since', date_lte: 'Posted before', diff --git a/examples/demo/src/i18n/fr.ts b/examples/demo/src/i18n/fr.ts index 7154a150262..9243121f397 100644 --- a/examples/demo/src/i18n/fr.ts +++ b/examples/demo/src/i18n/fr.ts @@ -55,7 +55,7 @@ const customFrenchMessages: TranslationMessages = { birthday: 'Anniversaire', city: 'Ville', stateAbbr: 'Etat', - commands: 'Commandes', + orders: 'Commandes', first_name: 'Prénom', first_seen: 'Première visite', full_name: 'Nom', @@ -100,7 +100,7 @@ const customFrenchMessages: TranslationMessages = { 'La confirmation du mot de passe est différent du mot de passe.', }, }, - commands: { + orders: { name: 'Commande |||| Commandes', amount: '1 commande |||| %{smart_count} commandes', title: 'Commande n°%{reference}', @@ -139,7 +139,7 @@ const customFrenchMessages: TranslationMessages = { id: 'Numéro', date: 'Date de facture', customer_id: 'Client', - command_id: 'Commande', + order_id: 'Commande', date_gte: 'Emises depuis', date_lte: 'Emises avant', address: 'Adresse', @@ -200,7 +200,7 @@ const customFrenchMessages: TranslationMessages = { detail: 'Détail du commentaire', fields: { customer_id: 'Client', - command_id: 'Commande', + order_id: 'Commande', product_id: 'Produit', date_gte: 'Publié depuis', date_lte: 'Publié avant', diff --git a/examples/demo/src/invoices/InvoiceList.tsx b/examples/demo/src/invoices/InvoiceList.tsx index cebc98f09ec..c4a4131cf93 100644 --- a/examples/demo/src/invoices/InvoiceList.tsx +++ b/examples/demo/src/invoices/InvoiceList.tsx @@ -22,7 +22,7 @@ const listFilters = [ , , , - , + , ]; const ListActions = () => ( @@ -71,7 +71,7 @@ const InvoiceList = () => ( > - + diff --git a/examples/demo/src/invoices/InvoiceShow.tsx b/examples/demo/src/invoices/InvoiceShow.tsx index af9a9c8a744..ca6034230eb 100644 --- a/examples/demo/src/invoices/InvoiceShow.tsx +++ b/examples/demo/src/invoices/InvoiceShow.tsx @@ -50,8 +50,8 @@ const InvoiceShow = () => { Order { diff --git a/examples/demo/src/layout/Menu.tsx b/examples/demo/src/layout/Menu.tsx index 547334520af..a582b78e124 100644 --- a/examples/demo/src/layout/Menu.tsx +++ b/examples/demo/src/layout/Menu.tsx @@ -56,9 +56,9 @@ const Menu = ({ dense = false }: MenuProps) => { dense={dense} > } diff --git a/examples/demo/src/orders/Basket.tsx b/examples/demo/src/orders/Basket.tsx index c336bbbd608..bf067775bc1 100644 --- a/examples/demo/src/orders/Basket.tsx +++ b/examples/demo/src/orders/Basket.tsx @@ -36,20 +36,16 @@ const Basket = () => { - {translate( - 'resources.commands.fields.basket.reference' - )} + {translate('resources.orders.fields.basket.reference')} - {translate( - 'resources.commands.fields.basket.unit_price' - )} + {translate('resources.orders.fields.basket.unit_price')} - {translate('resources.commands.fields.basket.quantity')} + {translate('resources.orders.fields.basket.quantity')} - {translate('resources.commands.fields.basket.total')} + {translate('resources.orders.fields.basket.total')} diff --git a/examples/demo/src/orders/MobileGrid.tsx b/examples/demo/src/orders/MobileGrid.tsx index dae5c0c82fe..2dc7e16e2d9 100644 --- a/examples/demo/src/orders/MobileGrid.tsx +++ b/examples/demo/src/orders/MobileGrid.tsx @@ -29,7 +29,7 @@ const MobileGrid = () => { - {translate('resources.commands.name', 1)} # + {translate('resources.orders.name', 1)} # { {translate( - 'resources.commands.fields.basket.total' + 'resources.orders.fields.basket.total' )} :  { /> - {translate('resources.commands.fields.status')} + {translate('resources.orders.fields.status')} :  - {translate( - 'resources.commands.fields.returned' - )} + {translate('resources.orders.fields.returned')} :  diff --git a/examples/demo/src/orders/OrderEdit.tsx b/examples/demo/src/orders/OrderEdit.tsx index 9585004cc4c..c52ce0f68c7 100644 --- a/examples/demo/src/orders/OrderEdit.tsx +++ b/examples/demo/src/orders/OrderEdit.tsx @@ -31,7 +31,7 @@ const OrderTitle = () => { const record = useRecordContext(); return record ? ( - {translate('resources.commands.title', { + {translate('resources.orders.title', { reference: record.reference, })} @@ -83,7 +83,7 @@ const OrderForm = () => { {translate( - 'resources.commands.section.order' + 'resources.orders.section.order' )} @@ -137,7 +137,7 @@ const OrderForm = () => { {translate( - 'resources.commands.section.customer' + 'resources.orders.section.customer' )} { {translate( - 'resources.commands.section.shipping_address' + 'resources.orders.section.shipping_address' )} { - {translate('resources.commands.section.items')} + {translate('resources.orders.section.items')}
@@ -174,7 +174,7 @@ const OrderForm = () => { - {translate('resources.commands.section.total')} + {translate('resources.orders.section.total')}
diff --git a/examples/demo/src/orders/OrderList.tsx b/examples/demo/src/orders/OrderList.tsx index 47d770d7e04..f053362d0bc 100644 --- a/examples/demo/src/orders/OrderList.tsx +++ b/examples/demo/src/orders/OrderList.tsx @@ -136,13 +136,13 @@ const TabbedDatagrid = () => { source="customer_id" reference="customers" link={false} - label="resources.commands.fields.address" + label="resources.orders.fields.address" > { source="customer_id" reference="customers" link={false} - label="resources.commands.fields.address" + label="resources.orders.fields.address" > { source="customer_id" reference="customers" link={false} - label="resources.commands.fields.address" + label="resources.orders.fields.address" > { - {translate('resources.commands.fields.basket.sum')} + {translate('resources.orders.fields.basket.sum')} {record?.total_ex_taxes.toLocaleString(undefined, { @@ -25,7 +25,7 @@ const Totals = () => { - {translate('resources.commands.fields.basket.delivery')} + {translate('resources.orders.fields.basket.delivery')} {record?.delivery_fees.toLocaleString(undefined, { @@ -36,7 +36,7 @@ const Totals = () => { - {translate('resources.commands.fields.basket.taxes')} ( + {translate('resources.orders.fields.basket.taxes')} ( {record?.tax_rate.toLocaleString(undefined, { style: 'percent', })} @@ -51,7 +51,7 @@ const Totals = () => { - {translate('resources.commands.fields.basket.total')} + {translate('resources.orders.fields.basket.total')} {record?.total.toLocaleString(undefined, { diff --git a/examples/demo/src/types.ts b/examples/demo/src/types.ts index 3383cf25a97..da1118ffdb2 100644 --- a/examples/demo/src/types.ts +++ b/examples/demo/src/types.ts @@ -5,7 +5,7 @@ export type ThemeName = 'light' | 'dark'; export type Category = DataGenerator.Category; export type Product = DataGenerator.Product; export type Customer = DataGenerator.Customer; -export type Order = DataGenerator.Command; +export type Order = DataGenerator.Order; export type Invoice = DataGenerator.Invoice; export type Review = DataGenerator.Review; export type BasketItem = DataGenerator.BasketItem; diff --git a/examples/demo/src/visitors/Aside.tsx b/examples/demo/src/visitors/Aside.tsx index c5ca3c41e44..a53553ee372 100644 --- a/examples/demo/src/visitors/Aside.tsx +++ b/examples/demo/src/visitors/Aside.tsx @@ -47,7 +47,7 @@ const EventList = () => { const translate = useTranslate(); const { data: orders, total: totalOrders } = useGetList( - 'commands', + 'orders', { pagination: { page: 1, perPage: 100 }, sort: { field: 'date', order: 'DESC' }, @@ -99,7 +99,7 @@ const EventList = () => { variant="body2" flexGrow={1} to={{ - pathname: '/commands', + pathname: '/orders', search: `displayedFilters=${JSON.stringify( { customer_id: true } )}&filter=${JSON.stringify({ @@ -108,10 +108,9 @@ const EventList = () => { })}`, }} > - {translate( - 'resources.commands.amount', - { smart_count: totalOrders } - )} + {translate('resources.orders.amount', { + smart_count: totalOrders, + })} )} @@ -203,7 +202,7 @@ const Timeline = ({ events }: { events: AsideEvent[] }) => ( completed > { {translate( - 'resources.commands.name', - record.nb_commands || 1 + 'resources.orders.name', + record.nb_orders || 1 )} :  - + {translate( diff --git a/examples/demo/src/visitors/VisitorCreate.tsx b/examples/demo/src/visitors/VisitorCreate.tsx index fd66d2ba60a..8d6a0406e73 100644 --- a/examples/demo/src/visitors/VisitorCreate.tsx +++ b/examples/demo/src/visitors/VisitorCreate.tsx @@ -48,7 +48,7 @@ const VisitorCreate = () => ( latest_purchase: new Date(), has_newsletter: false, groups: [], - nb_commands: 0, + nb_orders: 0, total_spent: 0, }} validate={validateForm} diff --git a/examples/demo/src/visitors/VisitorList.tsx b/examples/demo/src/visitors/VisitorList.tsx index 74a575cee24..d234bd4c987 100644 --- a/examples/demo/src/visitors/VisitorList.tsx +++ b/examples/demo/src/visitors/VisitorList.tsx @@ -70,8 +70,8 @@ const VisitorList = () => { /> ( diff --git a/examples/demo/vite.config.ts b/examples/demo/vite.config.ts index 9fee47e662b..e16e62b06f5 100644 --- a/examples/demo/vite.config.ts +++ b/examples/demo/vite.config.ts @@ -7,7 +7,9 @@ import { visualizer } from 'rollup-plugin-visualizer'; // https://vitejs.dev/config/ export default defineConfig(async () => { const packages = fs.readdirSync(path.resolve(__dirname, '../../packages')); - const aliases: Record = {}; + const aliases: Record = { + 'data-generator-retail': path.resolve(__dirname, '../data-generator/src'), + }; for (const dirName of packages) { if (dirName === 'create-react-admin') continue; // eslint-disable-next-line prettier/prettier