-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Strexas/MDE/back-end-optimization
Mde/back-end-optimization
- Loading branch information
Showing
13 changed files
with
453 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
app/front-end/src/features/editor/components/editorView/editorColumnMenu.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { styled } from '@mui/material/styles'; | ||
import { GridColumnMenuContainer, GridColumnMenuHideItem, GridColumnMenuProps } from '@mui/x-data-grid'; | ||
|
||
const StyledGridColumnMenuContainer = styled(GridColumnMenuContainer)(({ theme }) => ({ | ||
backgroundColor: theme.palette.secondary.main, | ||
})); | ||
|
||
interface GridColumnMenuContainerProps extends GridColumnMenuProps {} | ||
|
||
/** | ||
* `EditorColumnMenu` component customizes the column menu in a DataGrid with a styled container. | ||
* | ||
* @description This component extends the default column menu functionality of the DataGrid by applying custom styles | ||
* to the menu container. The `StyledGridColumnMenuContainer` applies a background color from the theme's secondary palette | ||
* to the menu. The menu includes a `GridColumnMenuHideItem` for hiding the column, which invokes the `hideMenu` function | ||
* when clicked. | ||
* | ||
* @component | ||
* | ||
* @param {GridColumnMenuContainerProps} props - The props for the component. | ||
* @param {() => void} props.hideMenu - A callback function to hide the column menu. | ||
* @param {object} props.colDef - Column definition object passed to the menu. | ||
* @param {GridColumnMenuProps} [other] - Other props that are passed to the `GridColumnMenuContainer`. | ||
* | ||
* @example | ||
* // Example usage of the EditorColumnMenu component | ||
* <EditorColumnMenu | ||
* hideMenu={() => console.log('Hide menu')} | ||
* colDef={columnDefinition} | ||
* /> | ||
* | ||
* @returns {JSX.Element} A styled `GridColumnMenuContainer` containing a `GridColumnMenuHideItem`. | ||
*/ | ||
export const EditorColumnMenu: React.FC<GridColumnMenuContainerProps> = ({ hideMenu, colDef, ...other }) => { | ||
return ( | ||
<StyledGridColumnMenuContainer hideMenu={hideMenu} colDef={colDef} {...other}> | ||
<GridColumnMenuHideItem onClick={hideMenu} colDef={colDef!} /> | ||
</StyledGridColumnMenuContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
app/front-end/src/features/editor/components/editorView/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { EditorColumnMenu } from './editorColumnMenu'; | ||
export { EditorToolbar } from './editorToolbar'; | ||
export { EditorView } from './editorView'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type FileData = { | ||
page: number; | ||
header: string[]; | ||
rows: string[][]; | ||
}; | ||
|
||
export type FileDataRequestDTO = FileData & { | ||
rowsPerPage: number; | ||
}; | ||
|
||
export type FileDataResponseDTO = FileData & { | ||
totalRows: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { ConsoleFeedbackTypes } from './consoleFeedback'; | ||
export type { ConsoleFeedback } from './consoleFeedback'; | ||
export type { FileDataRequestDTO, FileDataResponseDTO } from './fileData'; | ||
export type { FileTreeViewItemProps } from './fileTreeViewItemProps'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const Events = { | ||
CONSOLE_FEEDBACK_EVENT: 'console_feedback', | ||
WORKSPACE_FILE_SAVE_FEEDBACK_EVENT: 'workspace_file_save_feedback', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters