Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"Cesar Vela",
"Emre Temel",
"Enok Maj",
"Marcus Neble Jensen",
"Mathias Brændgaard",
"Omar Suleiman",
"Vanessa Scherma"
Expand Down Expand Up @@ -66,6 +67,7 @@
"@types/react-syntax-highlighter": "^15.5.13",
"@types/remarkable": "^2.0.8",
"@types/styled-components": "^5.1.32",
"@types/uuid": "10.0.0",
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"cross-env": "^7.0.3",
Expand Down Expand Up @@ -102,6 +104,7 @@
"serve": "^14.2.1",
"styled-components": "^6.1.1",
"typescript": "5.1.6",
"uuid": "11.1.0",
"zod": "3.24.1"
},
"devDependencies": {
Expand All @@ -121,6 +124,7 @@
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"eslint-config-react-app": "^7.0.1",
"fake-indexeddb": "6.0.1",
"globals": "15.11.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "29.7.0",
Expand Down
1 change: 1 addition & 0 deletions client/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default defineConfig({
// Use prepared auth state.
storageState: 'playwright/.auth/user.json',
},
timeout: 2 * 60 * 1000,
dependencies: ['setup'],
},
],
Expand Down
49 changes: 49 additions & 0 deletions client/src/components/asset/HistoryButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import * as React from 'react';
import { Dispatch, SetStateAction } from 'react';
import { Button, Badge } from '@mui/material';
import { useSelector } from 'react-redux';
import { selectExecutionHistoryByDTName } from 'store/selectors/executionHistory.selectors';

interface HistoryButtonProps {
setShowLog: Dispatch<React.SetStateAction<boolean>>;
historyButtonDisabled: boolean;
assetName: string;
}

export const handleToggleHistory = (
setShowLog: Dispatch<SetStateAction<boolean>>,
) => {
setShowLog((prev) => !prev);
};

function HistoryButton({
setShowLog,
historyButtonDisabled,
assetName,
}: HistoryButtonProps) {
const executions =
useSelector(selectExecutionHistoryByDTName(assetName)) || [];

const executionCount = executions.length;

return (
<Badge
badgeContent={executionCount > 0 ? executionCount : 0}
color="secondary"
overlap="circular"
invisible={executionCount === 0}
>
<Button
variant="contained"
size="small"
color="primary"
onClick={() => handleToggleHistory(setShowLog)}
disabled={historyButtonDisabled && executionCount === 0}
>
History
</Button>
</Badge>
);
}

export default HistoryButton;
Loading
Loading