-
Notifications
You must be signed in to change notification settings - Fork 5
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 #22 from aleksbobic/3-dataset-overview
3 dataset overview
- Loading branch information
Showing
16 changed files
with
2,242 additions
and
964 deletions.
There are no files selected for viewing
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
413 changes: 413 additions & 0 deletions
413
app/src/components/feature/datasetconfig/DatasetConfig.component.jsx
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
74 changes: 74 additions & 0 deletions
74
app/src/components/interface/datasetconfigmodal/DatasetConfigModal.component.jsx
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,74 @@ | ||
import { | ||
Button, | ||
Modal, | ||
ModalBody, | ||
ModalContent, | ||
ModalFooter, | ||
ModalHeader, | ||
ModalOverlay, | ||
useDisclosure | ||
} from '@chakra-ui/react'; | ||
import DatasetConfigComponent from 'components/feature/datasetconfig/DatasetConfig.component'; | ||
import { observer } from 'mobx-react'; | ||
import { useContext, useEffect } from 'react'; | ||
import { RootStoreContext } from 'stores/RootStore'; | ||
|
||
function DatasetConfigModal() { | ||
const store = useContext(RootStoreContext); | ||
const { isOpen, onOpen, onClose } = useDisclosure(); | ||
|
||
useEffect(() => { | ||
if (store.fileUpload.showConfigChangeModal) { | ||
onOpen(); | ||
} else if (!store.fileUpload.showConfigChangeModal && isOpen) { | ||
onClose(); | ||
} | ||
}, [isOpen, onClose, onOpen, store.fileUpload.showConfigChangeModal]); | ||
|
||
const updateConfig = () => { | ||
store.fileUpload.updateConfig(); | ||
}; | ||
|
||
const cancelSettingsEdit = () => { | ||
store.fileUpload.changeConfigChangeModalVisiblity(false); | ||
store.fileUpload.resetFileUploadData(); | ||
}; | ||
|
||
return ( | ||
<Modal | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
size="xl" | ||
isCentered | ||
closeOnEsc={false} | ||
closeOnOverlayClick={false} | ||
> | ||
<ModalOverlay bg="none" backdropFilter="auto" backdropBlur="2px" /> | ||
<ModalContent width="748px" minWidth="748px" maxWidth="748px"> | ||
<ModalHeader>Dataset config change</ModalHeader> | ||
{isOpen && ( | ||
<ModalBody overflowY="scroll" width="748px"> | ||
<DatasetConfigComponent formType="modify" /> | ||
</ModalBody> | ||
)} | ||
|
||
{store.fileUpload.fileUploadData.name !== '' && ( | ||
<ModalFooter> | ||
<Button | ||
variant="outline" | ||
mr={3} | ||
onClick={cancelSettingsEdit} | ||
> | ||
Cancel | ||
</Button> | ||
<Button variant="solid" onClick={() => updateConfig()}> | ||
Update config | ||
</Button> | ||
</ModalFooter> | ||
)} | ||
</ModalContent> | ||
</Modal> | ||
); | ||
} | ||
|
||
export default observer(DatasetConfigModal); |
Oops, something went wrong.