Skip to content

Commit

Permalink
fix(core): fixes an issue with pasting in conditional readonly field (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 committed Oct 1, 2024
1 parent df0e18a commit 2e47715
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
set,
setIfMissing,
useClient,
useCurrentUser,
useSchema,
useTranslation,
} from '../..'
Expand All @@ -41,6 +42,7 @@ export const CopyPasteProvider: React.FC<{
const toast = useToast()
const telemetry = useTelemetry()
const schema = useSchema()
const currentUser = useCurrentUser()

const {t} = useTranslation('copy-paste')
const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)
Expand Down Expand Up @@ -245,6 +247,7 @@ export const CopyPasteProvider: React.FC<{
// needs the document and absolute path to the field
targetRootPath: targetPath,
targetRootValue: value,
currentUser,
options: {
validateAssets: true,
validateReferences: true,
Expand Down Expand Up @@ -356,7 +359,7 @@ export const CopyPasteProvider: React.FC<{
// TODO: missing case with multiple updated items?
}
},
[documentMeta, schema, telemetry, toast, client, t],
[documentMeta, schema, currentUser, client, telemetry, toast, t],
)

const contextValue = useMemo(
Expand Down
Loading

0 comments on commit 2e47715

Please sign in to comment.