forked from pavol-brunclik-m2ms/fragalysis-frontend
-
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.
- Loading branch information
Showing
58 changed files
with
5,197 additions
and
539 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { memo } from 'react'; | ||
import { DialogTitle, DialogContent, DialogContentText, DialogActions, Button } from '@material-ui/core'; | ||
import Modal from '../index'; | ||
|
||
export const AlertModal = memo(({ open, title, description, handleOnOk, handleOnCancel }) => { | ||
return ( | ||
<Modal open={open}> | ||
<DialogTitle>{title}</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText>{description}</DialogContentText> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={handleOnCancel} color="secondary" variant="contained"> | ||
Cancel | ||
</Button> | ||
<Button onClick={handleOnOk} color="primary" autoFocus variant="contained"> | ||
OK | ||
</Button> | ||
</DialogActions> | ||
</Modal> | ||
); | ||
}); |
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,102 @@ | ||
import { CircularProgress, makeStyles, Modal as MaterialModal } from '@material-ui/core'; | ||
import React, { memo } from 'react'; | ||
import classNames from 'classnames'; | ||
import useResizeObserver from '../../../utils/useResizeObserver'; | ||
import { useSelector } from 'react-redux'; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
paper: { | ||
position: 'absolute', | ||
top: '204px', | ||
transform: 'translate(-50%, -50%)', | ||
backgroundColor: theme.palette.background.paper, | ||
borderRadius: theme.spacing(1) / 2, | ||
boxShadow: theme.direction[0], | ||
outline: 'none', | ||
border: '#3f51b5', | ||
borderWidth: '2px', | ||
borderStyle: 'solid', | ||
zIndex: '1300' | ||
}, | ||
withPadding: { | ||
//padding: theme.spacing(2, 4, 3) | ||
}, | ||
resizable: { | ||
resize: 'both', | ||
overflow: 'hidden' | ||
} | ||
})); | ||
|
||
let absoluteTitleLength = 0; | ||
|
||
export const ModalNewProject = memo( | ||
({ | ||
children, | ||
open, | ||
loading, | ||
onClose, | ||
noPadding, | ||
resizable, | ||
onResize, | ||
otherClasses, | ||
otherContentClasses, | ||
modalBackground, | ||
...rest | ||
}) => { | ||
|
||
const addButton = useSelector(state => state.projectReducers.addButton); | ||
|
||
// counting title width for fixed position modal window for create new project | ||
const defaultTitleLength = 445; | ||
const titleLength = document.getElementById("headerNavbarTitle"); | ||
const totalScreenWidth = window.innerWidth; | ||
let newTitleLength = 0; | ||
|
||
if (addButton === true) { | ||
absoluteTitleLength = totalScreenWidth - defaultTitleLength +170; | ||
} | ||
else { | ||
if (titleLength !== null) { | ||
newTitleLength = titleLength.offsetWidth; | ||
} | ||
absoluteTitleLength = defaultTitleLength + newTitleLength; | ||
} | ||
const classes = useStyles(); | ||
const content = loading ? <CircularProgress /> : children; | ||
|
||
const [containerDiv] = useResizeObserver(onResize); | ||
|
||
return ( | ||
<MaterialModal | ||
open={open} | ||
onClose={onClose} | ||
{...rest} | ||
style={{position: 'none'}} | ||
> | ||
<div> | ||
<div | ||
style={addButton === true ? {left: absoluteTitleLength + 'px', top: '249px'} :{left: absoluteTitleLength + 'px'} } | ||
ref={containerDiv} | ||
className={classNames( | ||
classes.paper, | ||
{ | ||
[classes.resizable]: resizable | ||
}, | ||
{ [otherClasses]: !!otherClasses } | ||
)} | ||
> | ||
<div | ||
/* className={classNames(noPadding ? undefined : classes.withPadding, { | ||
[otherContentClasses]: !!otherContentClasses | ||
})}*/ | ||
> | ||
{content} | ||
</div> | ||
</div> | ||
</div> | ||
</MaterialModal> | ||
); | ||
} | ||
); | ||
|
||
export default ModalNewProject; |
22 changes: 22 additions & 0 deletions
22
js/components/common/ModalSaveSnapshot/AlertModal/index.js
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,22 @@ | ||
import React, { memo } from 'react'; | ||
import { DialogTitle, DialogContent, DialogContentText, DialogActions, Button } from '@material-ui/core'; | ||
import Modal from '../index'; | ||
|
||
export const AlertModal = memo(({ open, title, description, handleOnOk, handleOnCancel }) => { | ||
return ( | ||
<Modal open={open}> | ||
<DialogTitle>{title}</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText>{description}</DialogContentText> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={handleOnCancel} color="secondary" variant="contained"> | ||
Cancel | ||
</Button> | ||
<Button onClick={handleOnOk} color="primary" autoFocus variant="contained"> | ||
OK | ||
</Button> | ||
</DialogActions> | ||
</Modal> | ||
); | ||
}); |
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,105 @@ | ||
import { CircularProgress, makeStyles, Modal as MaterialModal } from '@material-ui/core'; | ||
import React, { memo } from 'react'; | ||
import classNames from 'classnames'; | ||
import useResizeObserver from '../../../utils/useResizeObserver'; | ||
import { useSelector } from 'react-redux'; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
paper: { | ||
position: 'absolute', | ||
top: '175px', | ||
transform: 'translate(-50%, -50%)', | ||
backgroundColor: theme.palette.background.paper, | ||
borderRadius: theme.spacing(1) / 2, | ||
boxShadow: theme.shadows[0], | ||
outline: 'none', | ||
border: '#3f51b5', | ||
borderWidth: '2px', | ||
borderStyle: 'solid', | ||
zIndex: '1300' | ||
}, | ||
paper2: { | ||
position: 'absolute', | ||
top: '203px', | ||
transform: 'translate(-50%, -50%)', | ||
backgroundColor: theme.palette.background.paper, | ||
borderRadius: theme.spacing(1) / 2, | ||
boxShadow: theme.shadows[0], | ||
outline: 'none', | ||
border: '#3f51b5', | ||
borderWidth: '2px', | ||
borderStyle: 'solid', | ||
zIndex: '1300' | ||
}, | ||
withPadding: { | ||
//padding: theme.spacing(2, 4, 3) | ||
}, | ||
resizable: { | ||
resize: 'both', | ||
overflow: 'hidden' | ||
} | ||
})); | ||
|
||
export const ModalSaveSnapshot = memo( | ||
({ | ||
children, | ||
open, | ||
loading, | ||
onClose, | ||
noPadding, | ||
resizable, | ||
onResize, | ||
otherClasses, | ||
otherContentClasses, | ||
...rest | ||
}) => { | ||
|
||
// counting title width for fix position modal window for save new snapshot | ||
const defaultTitleLength = 600; | ||
const titleLength = document.getElementById("headerNavbarTitle"); | ||
let newTitleLength = 0; | ||
if (titleLength !== null) { | ||
newTitleLength = titleLength.offsetWidth; | ||
} | ||
const absoluteTitleLength = defaultTitleLength + newTitleLength; // for fix popover/modal dialog under button | ||
const currentSnapshotID = useSelector(state => state.projectReducers.currentSnapshot.id); | ||
|
||
const classes = useStyles(); | ||
const content = loading ? <CircularProgress /> : children; | ||
|
||
const [containerDiv] = useResizeObserver(onResize); | ||
|
||
return ( | ||
<MaterialModal | ||
aria-labelledby="simple-modal-title" | ||
aria-describedby="simple-modal-description" | ||
open={open} | ||
onClose={onClose} | ||
{...rest} | ||
style={{position: 'none'}} | ||
> | ||
<div | ||
style={{left: absoluteTitleLength + 'px'}} | ||
ref={containerDiv} | ||
className={classNames( | ||
currentSnapshotID === null? classes.paper : classes.paper2, | ||
{ | ||
[classes.resizable]: resizable | ||
}, | ||
{ [otherClasses]: !!otherClasses } | ||
)} | ||
> | ||
<div | ||
className={classNames(noPadding ? undefined : classes.withPadding, { | ||
[otherContentClasses]: !!otherContentClasses | ||
})} | ||
> | ||
{content} | ||
</div> | ||
</div> | ||
</MaterialModal> | ||
); | ||
} | ||
); | ||
|
||
export default ModalSaveSnapshot; |
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.