Skip to content

Commit

Permalink
Unify package creation / update dialogs (add s3 file picker to packag…
Browse files Browse the repository at this point in the history
…e creation dialog) (#2302)

* package create / update dialogs: refactor, adjust, tsify, extract upload logic

* JsonEditor: fix types

* Bucket/requests/package: fix types

* move dissocBy out

* TSify utils/defer
  • Loading branch information
nl0 authored Aug 18, 2021
1 parent 581e11d commit fea1f5f
Show file tree
Hide file tree
Showing 25 changed files with 1,294 additions and 1,858 deletions.
2 changes: 1 addition & 1 deletion catalog/app/components/JsonEditor/JsonEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ interface JsonEditorWrapperProps {
className?: string
disabled?: boolean
onChange: (value: JsonValue) => void
schema: JsonSchema
schema?: JsonSchema
value: JsonValue
}

Expand Down
2 changes: 1 addition & 1 deletion catalog/app/containers/Auth/urqlExchange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function useAuthExchange() {
const dispatch = redux.useDispatch()

const getTokens = React.useCallback(() => {
const { resolver, promise } = defer()
const { resolver, promise } = defer<AuthTokens>()
dispatch(actions.getTokens(resolver))
return promise
}, [dispatch])
Expand Down
57 changes: 25 additions & 32 deletions catalog/app/containers/Bucket/PackageCopyDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as RF from 'react-final-form'
import * as M from '@material-ui/core'

import * as Intercom from 'components/Intercom'
import AsyncResult from 'utils/AsyncResult'
import * as AWS from 'utils/AWS'
import * as Data from 'utils/Data'
import * as NamedRoutes from 'utils/NamedRoutes'
Expand Down Expand Up @@ -165,23 +164,20 @@ function DialogForm({
<RF.Form
onSubmit={onSubmitWrapped}
subscription={{
handleSubmit: true,
submitting: true,
submitFailed: true,
error: true,
submitError: true,
hasValidationErrors: true,
form: true,
submitError: true,
submitFailed: true,
submitting: true,
}}
>
{({
handleSubmit,
submitting,
submitFailed,
error,
submitError,
hasValidationErrors,
form,
submitError,
submitFailed,
submitting,
handleSubmit,
}) => (
<>
<DialogTitle bucket={successor.slug} />
Expand Down Expand Up @@ -422,27 +418,24 @@ export default function PackageCopyDialog({
workflowsConfig={workflowsConfig}
workflow={workflow}
>
{AsyncResult.case({
Ok: (schemaProps) => (
<DialogForm
{...schemaProps}
{...{
bucket,
close,
setSubmitting,
setSuccess,
setWorkflow,
workflowsConfig,

hash,
manifest,
name,
successor,
}}
/>
),
_: R.identity,
})}
{(schemaProps) => (
<DialogForm
{...schemaProps}
{...{
bucket,
close,
setSubmitting,
setSuccess,
setWorkflow,
workflowsConfig,

hash,
manifest,
name,
successor,
}}
/>
)}
</PD.SchemaFetcher>
),
Success: (props) =>
Expand Down
Loading

0 comments on commit fea1f5f

Please sign in to comment.