Skip to content

Commit

Permalink
revert: "feat(dashboard): adding new property panel layout"
Browse files Browse the repository at this point in the history
This reverts commit 07ece7b.
  • Loading branch information
chejimmy committed Feb 28, 2024
1 parent f9b3183 commit 9f6b707
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 515 deletions.
54 changes: 23 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 0 additions & 75 deletions packages/dashboard/e2e/tests/propertyPanel/propertyPanel.spec.ts

This file was deleted.

22 changes: 0 additions & 22 deletions packages/dashboard/e2e/tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface Fixtures {
dashboardWithKPIWidget: DashboardPage;
dashboardWithStatusWidget: DashboardPage;
dashboardWithTableWidget: DashboardPage;
dashboardWithPropertyPanel: DashboardPage;
resourceExplorer: ResourceExplorer;
configPanel: ConfigPanel;
}
Expand Down Expand Up @@ -71,12 +70,6 @@ export const test = base.extend<Fixtures>({

return use(dashboardWithKPIWidget);
},
dashboardWithPropertyPanel: async ({ page, browser }, use) => {
const dashboardWithLineWidgetPropertyPanel =
await createNewDashboardWithPropertyPanel(page, browser);

return use(dashboardWithLineWidgetPropertyPanel);
},
configPanel: async ({ page }, use) => {
const configPanel = new ConfigPanel({ page });
await use(configPanel);
Expand All @@ -100,18 +93,3 @@ const createNewDashboardWithWidget = async (
}
return dashboard;
};

const createNewDashboardWithPropertyPanel = async (
page: Page,
browser: Browser
) => {
const dashboard = new DashboardPage({ page, browser });
await dashboard.goto();
await page.evaluate(() =>
localStorage.setItem('SHOW_DASHBOARD_LAYOUT', 'true')
);
await page.reload();
await dashboard.makeViewportToAbsolute();

return dashboard;
};
2 changes: 0 additions & 2 deletions packages/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@types/papaparse": "^5.3.10",
"@types/react": "^18.2.12",
"@types/react-dom": "^18.2.5",
"@types/react-resizable": "^3.0.7",
"css-loader": "6.8.1",
"dotenv": "^16.3.1",
"eslint-config-iot-app-kit": "9.15.0",
Expand Down Expand Up @@ -121,7 +120,6 @@
"react-hook-form": "^7.46.1",
"react-hotkeys": "^2.0.0",
"react-popper": "^2.3.0",
"react-resizable": "^3.0.5",
"react-use": "17.4.0",
"tiny-invariant": "^1.3.1",
"turbowatch": "^2.29.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import React from 'react';
import { render, fireEvent, cleanup } from '@testing-library/react';
import { render, fireEvent } from '@testing-library/react';
import CustomOrangeButton from './index';

describe('CustomOrangeButton', () => {
const title = 'Test Button';
const handleClick = jest.fn();
beforeEach(() => {
cleanup();
handleClick.mockReset();
});

test('renders button with correct title', () => {
const { getByText } = render(
<CustomOrangeButton title={title} handleClick={handleClick} />
Expand All @@ -23,16 +20,4 @@ describe('CustomOrangeButton', () => {
fireEvent.click(button);
expect(handleClick).toHaveBeenCalledTimes(1);
});
test('does not calls handleClick when clicked but disabled', () => {
const { getByRole } = render(
<CustomOrangeButton
title={title}
handleClick={handleClick}
disabled={true}
/>
);
const button = getByRole('button');
button.click();
expect(handleClick).toHaveBeenCalledTimes(0);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@ import './index.css';
const CustomOrangeButton = ({
title,
handleClick,
disabled,
...rest
}: { title: string; handleClick?: () => void } & ButtonProps) => {
if (disabled) {
return (
<Button variant='primary' disabled={true}>
{title}
</Button>
);
}
return (
<Button
className='btn-custom-primary'
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 9f6b707

Please sign in to comment.