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
8 changes: 4 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"dependencies": {
"@azure/msal-browser": "^4.26.0",
"@emotion/cache": "^11.9.3",
"@emotion/react": "^11.9.3",
"@emotion/react": "^11.14.0",
"@fluentui/react-icons": "^2.0.315",
"@fluentui/react-icons-mdl2": "^1.4.2",
"@honkhonk/vite-plugin-svgr": "^1.1.0",
"@mantine/core": "^5.0.0",
"@mantine/core": "^5.10.5",
"@mantine/form": "^5.0.0",
"@mantine/hooks": "^5.0.0",
"@mantine/hooks": "^5.10.5",
"@mantine/modals": "^5.10.5",
"@mantine/notifications": "^5.0.0",
"@mantine/notifications": "^5.10.5",
"@microsoft/microsoft-graph-client": "^3.0.7",
"@reduxjs/toolkit": "^1.8.3",
"@visx/glyph": "^2.10.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/panels/xdc/CollectionPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function CollectionPanel({ id }) {
</Tabs.List>

<Tabs.Panel value={TabValues.UPLOAD}>
<CollectionWizard />
<CollectionWizard onUploadSuccess={() => setActiveTab(TabValues.RESULTS)}/>
<ScrollArea style={{ height: 'calc(100vh - 93px)' }}>
<Space h={20} />
</ScrollArea>
Expand Down
27 changes: 26 additions & 1 deletion frontend/src/components/panels/xdc/CollectionWizard.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button, Container, Group, Loader, Space, Stack } from '@mantine/core'
// import { Notifications } from '@mantine/notifications'
import { useContext, useState } from 'react'
import { usePanelProperty, useOpenPanel } from '../../../redux/hooks/panelsHooks'
import { useFile } from '../../../redux/hooks/workingDirectoryHooks'
Expand All @@ -9,7 +10,7 @@ import { uploadExperiment } from '../../../API'
import { showErrorNotification } from '../../../modules/util'
import Dropzone from '../../Dropzone'

export default function CollectionWizard() {
export default function CollectionWizard({ onUploadSuccess }) {
const panelId = useContext(PanelContext)
const openPanel = useOpenPanel()
const [dataSBH] = useLocalStorage({ key: 'SynbioHub', defaultValue: [] })
Expand All @@ -27,6 +28,7 @@ export default function CollectionWizard() {
const [uploads, setUploads] = usePanelProperty(panelId, 'uploads', false, [])

const [isSubmitting, setIsSubmitting] = useState(false)
const [uploadSuccess, setUploadSuccess] = useState(false)

const selectedRepo = collection?.selectedRepo || collection?.modalResult?.selectedRepo || ''
const authToken = collection?.authToken || collection?.modalResult?.authToken || dataSBH.find((repo) => repo.registryURL === selectedRepo)?.authtoken || ''
Expand Down Expand Up @@ -72,6 +74,18 @@ export default function CollectionWizard() {
}

setUploads((currentUploads) => [...(currentUploads || []), uploadEntry])
setUploadSuccess(true)

// notifications.show({
// title: 'Upload successful',
// message: 'Your collection has been uploaded.',
// color: 'green',
// action: {
// label: 'See Results',
// onClick: onUploadSuccess
// }
// })

} catch (error) {
showErrorNotification('Upload failed', error?.response?.data?.error || error.message || 'Unable to upload the collection metadata.')
} finally {
Expand Down Expand Up @@ -117,6 +131,17 @@ export default function CollectionWizard() {
{isSubmitting ? <Loader size="xs" /> : uploadLabel}
</Button>
</Group>

{uploadSuccess && (
<Button
onClick={onUploadSuccess}
color="green"
style={{ marginTop: 20 }}
>
See Results
</Button>
)}

</Container>
)
}
Expand Down
Binary file added tutorial/~$A_Parts_with_sequences.docx
Binary file not shown.
Loading