Skip to content

Commit

Permalink
more pr ammendments
Browse files Browse the repository at this point in the history
  • Loading branch information
ARADDCC002 authored and ARADDCC002 committed Sep 21, 2022
1 parent abf7d0d commit 5f672d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
4 changes: 2 additions & 2 deletions pages/model/[uuid]/new-version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useGetSchema } from '../../../data/schema'
import LoadingBar from '../../../src/common/LoadingBar'
import MultipleErrorWrapper from '../../../src/errors/MultipleErrorWrapper'
import Form from '../../../src/Form/Form'
import RenderFileTab, { RenderBasicFileTab, FileTabComplete } from '../../../src/Form/RenderFileTab'
import RenderFileTab, { RenderBasicFileTab, fileTabComplete } from '../../../src/Form/RenderFileTab'
import ModelExportAndSubmission from '../../../src/Form/ModelExportAndSubmission'
import { RenderButtonsInterface } from '../../../src/Form/RenderButtons'
import SubmissionError from '../../../src/Form/SubmissionError'
Expand Down Expand Up @@ -76,7 +76,7 @@ function Upload() {

render: RenderFileTab,
renderBasic: RenderBasicFileTab,
isComplete: FileTabComplete,
isComplete: fileTabComplete,
})
)

Expand Down
4 changes: 2 additions & 2 deletions pages/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import MultipleErrorWrapper from '@/src/errors/MultipleErrorWrapper'
import Form from '@/src/Form/Form'
import ModelExportAndSubmission from '@/src/Form/ModelExportAndSubmission'
import { RenderButtonsInterface } from '@/src/Form/RenderButtons'
import RenderFileTab, { FileTabComplete, RenderBasicFileTab } from '@/src/Form/RenderFileTab'
import RenderFileTab, { fileTabComplete, RenderBasicFileTab } from '@/src/Form/RenderFileTab'
import SchemaSelector from '@/src/Form/SchemaSelector'
import SubmissionError from '@/src/Form/SubmissionError'
import Wrapper from '@/src/Wrapper'
Expand Down Expand Up @@ -94,7 +94,7 @@ function Upload() {

render: RenderFileTab,
renderBasic: RenderBasicFileTab,
isComplete: FileTabComplete,
isComplete: fileTabComplete,
})
)

Expand Down
18 changes: 2 additions & 16 deletions src/Form/RenderFileTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ export default function RenderFileTab({ step, splitSchema, setSplitSchema }: Ren
)
}

export function FileTabComplete(step: Step) {
export function fileTabComplete(step: Step) {
const buildOptionsStep = step.state.steps.find(
(buildOptionSchemaStep) => buildOptionSchemaStep.section === 'buildOptions'
)
const hasUploadType = useMemo(() => !!buildOptionsStep.state.uploadType, [buildOptionsStep])
const hasUploadType = !!buildOptionsStep.state.uploadType
if (!hasUploadType) {
return true
}
Expand Down Expand Up @@ -128,17 +128,3 @@ export function RenderBasicFileTab({ step, splitSchema, setSplitSchema }: Render
</Box>
)
}

export function BasicFileTabComplete(step: Step) {
const buildOptionsStep = useMemo(
() => step.state.steps.find((buildOptionSchemaStep) => buildOptionSchemaStep.section === 'buildOptions'),
[step]
)
return (
(buildOptionsStep !== undefined &&
buildOptionsStep.state.uploadType === ModelUploadType.Zip &&
step.state.binary &&
step.state.code) ||
buildOptionsStep.state.uploadType === ModelUploadType.ModelCard
)
}

0 comments on commit 5f672d7

Please sign in to comment.