@stoker-platform/web-app 0.5.191 → 0.5.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.192
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: remove image field images from image carousel
8
+
3
9
  ## 0.5.191
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.191",
3
+ "version": "0.5.192",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
package/src/Form.tsx CHANGED
@@ -3713,6 +3713,15 @@ function RecordForm({
3713
3713
  useEffect(() => {
3714
3714
  const loadImages = async () => {
3715
3715
  if (!formImagesEnabled || operation !== "update" || !record || isOffline) return
3716
+ const imageFieldUrls = fields
3717
+ .filter((field) => {
3718
+ if (field.type !== "String") return false
3719
+ const fieldCustomization = getFieldCustomization(field, customization)
3720
+ return tryFunction(fieldCustomization.admin?.image)
3721
+ })
3722
+ .map((field) => {
3723
+ return record?.[field.name]
3724
+ })
3716
3725
  try {
3717
3726
  const items = await getFiles("", record)
3718
3727
  const imageItems = items.filter((item) => {
@@ -3724,7 +3733,7 @@ function RecordForm({
3724
3733
  return url
3725
3734
  }),
3726
3735
  )
3727
- setCarouselImages(urls)
3736
+ setCarouselImages(urls.filter((url) => !imageFieldUrls.includes(url)))
3728
3737
  } finally {
3729
3738
  setCarouselLoading(false)
3730
3739
  }