forked from buildlyio/buildly-react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Production Release - 9th Feb 2022 (#72)
* change requirements & issues ui in new project setup (#51) * change requirements & issues ui in new project setup * use icons as buttons in requirements & issues * add color to checked radio label * add theme & alert.js files code * remove css for image radio buttons * add dropdown filter for global admin (#55) * add dropdown filter for global admin * change isAdmin values * show filter for super admin * Fix the redux (#59) * Initial placeholder changes * Data table for release * Add Edit Release placeholder * View release UI changes * Intial redux setup for using datamesh * GET devpartner and project service * GET queries using Datamesh * code cleanup part 1 * code cleanup part 2 * code cleanup part 3 * Fix the redux (service queries) * Add overflow menu (Kanban view) * add overflow menu to cards * add edit & delete options for cards in overflow menu * Fix lint problems Co-authored-by: RadhikaPPatel <70138493+RadhikaPPatel@users.noreply.github.com> * Modify feature and issues form * update feature & issue form * remove options for tag field * Integration with BE (Product, Features, Issues, Convert to Issue) (#65) * Integrate create product with BE * Integrate features for BE * Integrate issues with BE * Integrate convert to issues to BE * User redirect to forms based on user type * show different forms for developer and product team * change user type to select text field * resolve linting errors * update user survey_status after filling product/developer forms * based on survey_status show form or dashboard * update user in context after user patch request * Changes for user form redirect Co-authored-by: RadhikaPPatel <70138493+RadhikaPPatel@users.noreply.github.com> * Hide pages and dashboard for Production * Hide navbar Co-authored-by: MounikaReddy15 <60848892+MounikaReddy15@users.noreply.github.com>
- Loading branch information
1 parent
433dbe9
commit 6f70314
Showing
98 changed files
with
11,828 additions
and
10,714 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
import React from 'react'; | ||
import MUIDataTable from 'mui-datatables'; | ||
import makeStyles from '@mui/styles/makeStyles'; | ||
import { | ||
Grid, | ||
Button, | ||
IconButton, | ||
Box, | ||
Typography, | ||
} from '@mui/material'; | ||
import { | ||
Add as AddIcon, | ||
Edit as EditIcon, | ||
Delete as DeleteIcon, | ||
} from '@mui/icons-material'; | ||
import Loader from '@components/Loader/Loader'; | ||
import ConfirmModal from '@components/Modal/ConfirmModal'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
dashboardHeading: { | ||
fontWeight: 'bold', | ||
marginBottom: '0.5em', | ||
}, | ||
iconButton: { | ||
padding: theme.spacing(1.5, 0.5), | ||
}, | ||
dataTableBody: { | ||
'&:nth-of-type(odd)': { | ||
backgroundColor: '#4F4D4D', | ||
}, | ||
'&:nth-of-type(even)': { | ||
backgroundColor: '#383636', | ||
}, | ||
'&:hover': { | ||
backgroundColor: '#000 !important', | ||
}, | ||
}, | ||
dataTable: { | ||
'& .MuiPaper-root': { | ||
backgroundColor: '#383636', | ||
}, | ||
'& tr > th': { | ||
backgroundColor: '#383636', | ||
}, | ||
}, | ||
})); | ||
|
||
const DataTableWrapper = ({ | ||
loading, | ||
rows, | ||
columns, | ||
filename, | ||
addButtonHeading, | ||
onAddButtonClick, | ||
children, | ||
editAction, | ||
deleteAction, | ||
openDeleteModal, | ||
setDeleteModal, | ||
handleDeleteModal, | ||
deleteModalTitle, | ||
tableHeight, | ||
tableHeader, | ||
hideAddButton, | ||
selectable, | ||
selected, | ||
customSort, | ||
noCustomTheme, | ||
noSpace, | ||
noOptionsIcon, | ||
}) => { | ||
const classes = useStyles(); | ||
|
||
let finalColumns = []; | ||
if (editAction) { | ||
finalColumns = [ | ||
...finalColumns, | ||
{ | ||
name: 'Edit', | ||
options: { | ||
filter: false, | ||
sort: false, | ||
empty: true, | ||
customBodyRenderLite: (dataIndex) => ( | ||
<IconButton | ||
className={classes.iconButton} | ||
onClick={() => editAction(rows[dataIndex])} | ||
> | ||
<EditIcon /> | ||
</IconButton> | ||
), | ||
}, | ||
}, | ||
]; | ||
} | ||
if (deleteAction) { | ||
finalColumns = [ | ||
...finalColumns, | ||
{ | ||
name: 'Delete', | ||
options: { | ||
filter: false, | ||
sort: false, | ||
empty: true, | ||
customBodyRenderLite: (dataIndex) => ( | ||
<IconButton | ||
onClick={() => deleteAction(rows[dataIndex])} | ||
> | ||
<DeleteIcon /> | ||
</IconButton> | ||
), | ||
}, | ||
}, | ||
]; | ||
} | ||
finalColumns = [ | ||
...finalColumns, | ||
...columns, | ||
]; | ||
|
||
const options = { | ||
download: !noOptionsIcon, | ||
print: !noOptionsIcon, | ||
search: !noOptionsIcon, | ||
viewColumns: !noOptionsIcon, | ||
filter: !noOptionsIcon, | ||
filterType: 'multiselect', | ||
responsive: 'standard', | ||
tableBodyHeight: tableHeight || '', | ||
selectableRows: selectable && selectable.rows | ||
? selectable.rows | ||
: 'none', | ||
selectToolbarPlacement: 'none', | ||
selectableRowsHeader: selectable && selectable.rowsHeader | ||
? selectable.rowsHeader | ||
: true, | ||
selectableRowsHideCheckboxes: selectable && selectable.rowsHideCheckboxes | ||
? selectable.rowsHideCheckboxes | ||
: false, | ||
rowsSelected: selected || [], | ||
rowsPerPageOptions: [5, 10, 15], | ||
downloadOptions: noOptionsIcon | ||
? { | ||
filename: 'nothing.csv', | ||
separator: ',', | ||
} | ||
: { | ||
filename: `${filename}.csv`, | ||
separator: ',', | ||
}, | ||
textLabels: { | ||
body: { | ||
noMatch: 'No data to display', | ||
}, | ||
}, | ||
setRowProps: (row, dataIndex, rowIndex) => !noCustomTheme && ({ | ||
className: classes.dataTableBody, | ||
}), | ||
customSort, | ||
}; | ||
|
||
return ( | ||
<Box mt={noSpace ? 0 : 5} mb={noSpace ? 0 : 5}> | ||
{loading && <Loader open={loading} />} | ||
<div> | ||
{!hideAddButton && ( | ||
<Box mb={3} mt={2}> | ||
<Button | ||
type="button" | ||
variant="contained" | ||
color="primary" | ||
onClick={onAddButtonClick} | ||
> | ||
<AddIcon /> | ||
{` ${addButtonHeading}`} | ||
</Button> | ||
</Box> | ||
)} | ||
{tableHeader && ( | ||
<Typography | ||
className={classes.dashboardHeading} | ||
variant="h4" | ||
> | ||
{tableHeader} | ||
</Typography> | ||
)} | ||
<Grid | ||
className={`${!noCustomTheme && classes.dataTable}`} | ||
container | ||
spacing={2} | ||
> | ||
<Grid item xs={12}> | ||
<MUIDataTable | ||
data={rows} | ||
columns={finalColumns} | ||
options={options} | ||
/> | ||
</Grid> | ||
</Grid> | ||
{children} | ||
</div> | ||
|
||
{deleteAction && ( | ||
<ConfirmModal | ||
open={openDeleteModal} | ||
setOpen={setDeleteModal} | ||
submitAction={handleDeleteModal} | ||
title={deleteModalTitle} | ||
submitText="Delete" | ||
/> | ||
)} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default DataTableWrapper; |
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
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
Oops, something went wrong.