-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert change name field, return to
url
because the transformers ho…
…oks into that.
- Loading branch information
Showing
10 changed files
with
3,064 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { flattenToAppURL } from '@plone/volto/helpers'; | ||
|
||
export const HighlightBlockDataAdapter = ({ | ||
block, | ||
data, | ||
id, | ||
onChangeBlock, | ||
value, | ||
content, | ||
}) => { | ||
let dataSaved = { | ||
...data, | ||
[id]: value, | ||
}; | ||
if (id === 'url' && typeof value === 'object') { | ||
dataSaved = { | ||
...dataSaved, | ||
[id]: flattenToAppURL(value['@id']), | ||
image_field: 'image', | ||
image_scales: value.image_scales, | ||
}; | ||
} | ||
// I uploaded the image right now, no image info | ||
if (id === 'url' && typeof value === 'string') { | ||
dataSaved = { | ||
...dataSaved, | ||
image_field: 'image', | ||
image_scales: { image: [content?.image] }, | ||
}; | ||
} | ||
onChangeBlock(block, dataSaved); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.