Skip to content

Commit 7cf9d18

Browse files
committed
Use iframe for inner components use for tab content. Apply themes inline for each sample. Add Sales Grid into main app.
1 parent c3d3fb6 commit 7cf9d18

21 files changed

+88
-145
lines changed

src/app/app-routes.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import { redirect, RouteObject } from 'react-router-dom';
2-
import ERPInventory from './erpinventory/erpinventory';
3-
import OrgChartHRPortal from './org-chart-hr-portal/org-chart-hr-portal';
4-
import FinancialPortfolio from './financial-portfolio/financial-portfolio';
5-
import SalesDashboard from './sales-dashboard/sales-dashboard';
6-
import FleetManagement from './fleet-management/fleet-management';
7-
import HomeView from './home-view/home-view';
2+
import ErpHGridView from './views/erp-hgrid/erp-hgrid-view';
3+
import HRPortalView from './views/hr-portal/hr-portal-view';
4+
import FinanceView from './views/finance/finance-view';
5+
import SalesView from './views/sales/sales-view';
6+
import FleetManagementView from './views/fleet-management/fleet-management-view';
7+
import HomeView from './views/home/home-view';
88

99
export const routes: RouteObject[] = [
1010
{ index: true, loader: () => redirect('home') },
1111
{ path: 'home', element: <HomeView />,
1212
children: [
1313
{ index: true, loader: () => redirect('inventory') },
14-
{ path: 'inventory', element: <ERPInventory /> },
15-
{ path: 'hr-portal', element: <OrgChartHRPortal /> },
16-
{ path: 'finance', element: <FinancialPortfolio />},
17-
{ path: 'sales', element: <SalesDashboard /> },
18-
{ path: 'fleet', element: <FleetManagement /> },
14+
{ path: 'inventory', element: <ErpHGridView /> },
15+
{ path: 'hr-portal', element: <HRPortalView /> },
16+
{ path: 'finance', element: <FinanceView />},
17+
{ path: 'sales', element: <SalesView /> },
18+
{ path: 'fleet', element: <FleetManagementView /> },
1919
]
2020
},
21-
{ path: 'inventory', element: <ERPInventory /> },
22-
{ path: 'hr-portal', element: <OrgChartHRPortal /> },
23-
{ path: 'finance', element: <FinancialPortfolio />},
24-
{ path: 'sales', element: <SalesDashboard /> },
25-
{ path: 'fleet', element: <FleetManagement /> },
21+
{ path: 'inventory', element: <ErpHGridView /> },
22+
{ path: 'hr-portal', element: <HRPortalView /> },
23+
{ path: 'finance', element: <FinanceView />},
24+
{ path: 'sales', element: <SalesView /> },
25+
{ path: 'fleet', element: <FleetManagementView /> },
2626
];

src/app/sales-dashboard/sales-dashboard.module.css

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

src/app/sales-dashboard/sales-dashboard.tsx

Lines changed: 0 additions & 72 deletions
This file was deleted.
File renamed without changes.

src/app/erpinventory/erpinventory.test.tsx renamed to src/app/views/erp-hgrid/erp-hgrid-view.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect, test, vi } from 'vitest';
22
import { render } from '@testing-library/react';
3-
import ERPInventory from './erpinventory';
3+
import ERPInventory from './erp-hgrid-view';
44
import 'element-internals-polyfill';
55

66
// Mock API response
@@ -12,4 +12,4 @@ global.fetch = vi.fn().mockResolvedValue(mockResponse);
1212
test('renders ERPInventory component', () => {
1313
const wrapper = render(<ERPInventory />);
1414
expect(wrapper).toBeTruthy();
15-
});
15+
});

src/app/erpinventory/erpinventory.tsx renamed to src/app/views/erp-hgrid/erp-hgrid-view.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { IgrCellTemplateContext, IgrColumn, IgrGridToolbar, IgrGridToolbarActions, IgrGridToolbarExporter, IgrGridToolbarHiding, IgrGridToolbarPinning, IgrGridToolbarTitle, IgrHierarchicalGrid, IgrRowIsland } from 'igniteui-react-grids';
22
import { IgrRating } from 'igniteui-react';
3-
import { useGetTable1List as eRPProductsUseGetTable1List } from '../hooks/erpproducts-hooks';
3+
import { useGetTable1List as eRPProductsUseGetTable1List } from '../../hooks/erpproducts-hooks';
44

5-
import styles from './erpinventory.module.css';
6-
import createClassTransformer from '../style-utils';
5+
import styles from './erp-hgrid-view.module.css';
6+
import createClassTransformer from '../../style-utils';
77

8-
export default function ERPInventory() {
8+
export default function ERPHGridView() {
99
const classes = createClassTransformer(styles);
1010
const uuid = () => crypto.randomUUID();
1111
const { eRPProductsTable1 } = eRPProductsUseGetTable1List();
File renamed without changes.

src/app/financial-portfolio/financial-portfolio.test.tsx renamed to src/app/views/finance/finance-view.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect, test, vi } from 'vitest';
22
import { render } from '@testing-library/react';
3-
import FinancialPortfolio from './financial-portfolio';
3+
import FinancialPortfolio from './finance-view';
44
import 'element-internals-polyfill';
55

66
// Mock API response
@@ -12,4 +12,4 @@ global.fetch = vi.fn().mockResolvedValue(mockResponse);
1212
test('renders FinancialPortfolio component', () => {
1313
const wrapper = render(<FinancialPortfolio />);
1414
expect(wrapper).toBeTruthy();
15-
});
15+
});

src/app/financial-portfolio/financial-portfolio.tsx renamed to src/app/views/finance/finance-view.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { IgrAvatar } from 'igniteui-react';
22
import { IgrCellTemplateContext, IgrColumn, IgrGrid, IgrGridToolbar, IgrGridToolbarActions, IgrGridToolbarExporter, IgrGridToolbarHiding, IgrGridToolbarPinning, IgrGridToolbarTitle } from 'igniteui-react-grids';
3-
import { useGetTable1List as financeUseGetTable1List } from '../hooks/finance-hooks';
4-
import createClassTransformer from '../style-utils';
3+
import { useGetTable1List as financeUseGetTable1List } from '../../hooks/finance-hooks';
4+
import createClassTransformer from '../../style-utils';
55

6-
IgrAvatarModule.register();
7-
IgrGridModule.register();
6+
import styles from './finance-view.module.css';
7+
import lightBootstrap from 'igniteui-react-grids/grids/themes/light/bootstrap.css?inline';
88

9-
export default function FinancialPortfolio() {
9+
export default function FinanceView() {
1010
const classes = createClassTransformer(styles);
1111
const uuid = () => crypto.randomUUID();
1212
const { financeTable1 } = financeUseGetTable1List();
@@ -37,6 +37,9 @@ export default function FinancialPortfolio() {
3737

3838
return (
3939
<>
40+
<style>
41+
{lightBootstrap}
42+
</style>
4043
<div className={classes("row-layout financial-portfolio-container")}>
4144
<IgrGrid data={financeTable1} primaryKey="id" rowSelection="multiple" className={classes("ig-typography ig-scrollbar grid")} key={uuid()}>
4245
<IgrGridToolbar>

src/app/fleet-management/fleet-management.module.css renamed to src/app/views/fleet-management/fleet-management-view.module.css

File renamed without changes.

0 commit comments

Comments
 (0)