Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): fixes an issue with pasting in conditional readonly field #7564

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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
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
Loading