@stoker-platform/web-app 0.5.95 → 0.5.97

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,24 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.97
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: add Computed field asRichText option
8
+ - @stoker-platform/node-client@0.5.54
9
+ - @stoker-platform/utils@0.5.46
10
+ - @stoker-platform/web-client@0.5.55
11
+
12
+ ## 0.5.96
13
+
14
+ ### Patch Changes
15
+
16
+ - fix: improve Form null handling
17
+ - Updated dependencies
18
+ - @stoker-platform/utils@0.5.45
19
+ - @stoker-platform/node-client@0.5.53
20
+ - @stoker-platform/web-client@0.5.54
21
+
3
22
  ## 0.5.95
4
23
 
5
24
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.95",
3
+ "version": "0.5.97",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
@@ -51,9 +51,9 @@
51
51
  "@radix-ui/react-tooltip": "^1.2.8",
52
52
  "@react-google-maps/api": "^2.20.8",
53
53
  "@sentry/react": "^10.50.0",
54
- "@stoker-platform/node-client": "0.5.52",
55
- "@stoker-platform/utils": "0.5.44",
56
- "@stoker-platform/web-client": "0.5.53",
54
+ "@stoker-platform/node-client": "0.5.54",
55
+ "@stoker-platform/utils": "0.5.46",
56
+ "@stoker-platform/web-client": "0.5.55",
57
57
  "@tanstack/react-table": "^8.21.3",
58
58
  "@types/react": "18.3.13",
59
59
  "@types/react-dom": "18.3.1",
package/src/Form.tsx CHANGED
@@ -416,6 +416,18 @@ const RecordFormField = (props: FieldProps) => {
416
416
  isUpdateDisabled))
417
417
 
418
418
  if (isReadOnly && !isRichText) {
419
+ if (field.type === "Computed" && tryFunction(customization.admin?.asRichText)) {
420
+ return (
421
+ <MapField
422
+ {...props}
423
+ label={label}
424
+ description={description}
425
+ isRichText={true}
426
+ readOnly={true}
427
+ icon={icon}
428
+ />
429
+ )
430
+ }
419
431
  return <ComputedField {...props} label={label} description={description} icon={icon} />
420
432
  }
421
433
 
@@ -506,6 +518,18 @@ const RecordFormField = (props: FieldProps) => {
506
518
  />
507
519
  )
508
520
  case "Computed":
521
+ if (field.type === "Computed" && tryFunction(customization.admin?.asRichText)) {
522
+ return (
523
+ <MapField
524
+ {...props}
525
+ label={label}
526
+ description={description}
527
+ isRichText={true}
528
+ readOnly={true}
529
+ icon={icon}
530
+ />
531
+ )
532
+ }
509
533
  return <ComputedField {...props} label={label} description={description} icon={icon} />
510
534
  default:
511
535
  if (isRelationField(field) && schema.collections[field.collection]) {
@@ -3836,6 +3860,14 @@ function RecordForm({
3836
3860
  ) {
3837
3861
  delete values[field.name]
3838
3862
  }
3863
+
3864
+ if (values[field.name] === null) {
3865
+ if (originalRecord?.[field.name]) {
3866
+ values[field.name] = deleteField()
3867
+ } else {
3868
+ delete values[field.name]
3869
+ }
3870
+ }
3839
3871
  }
3840
3872
 
3841
3873
  let userData: UserData | undefined
@@ -5113,12 +5145,6 @@ function RecordForm({
5113
5145
  ) {
5114
5146
  form.setValue(field.name, 0)
5115
5147
  }
5116
- if (
5117
- field.nullable &&
5118
- form.getValues(field.name) === null
5119
- ) {
5120
- form.setValue(field.name, undefined)
5121
- }
5122
5148
  }
5123
5149
  form.handleSubmit(handleSubmit, (errors) => {
5124
5150
  console.error(errors)
@@ -5634,9 +5660,6 @@ function RecordForm({
5634
5660
  ) {
5635
5661
  form.setValue(field.name, 0)
5636
5662
  }
5637
- if (field.nullable && form.getValues(field.name) === null) {
5638
- form.setValue(field.name, undefined)
5639
- }
5640
5663
  }
5641
5664
  form.handleSubmit(handleSubmit, (errors) => {
5642
5665
  console.error(errors)
@@ -75,7 +75,7 @@ export const RecordSidebar = ({
75
75
 
76
76
  const editItem = [
77
77
  {
78
- title: "Edit",
78
+ title: "Details",
79
79
  page: "edit",
80
80
  icon: EditIcon,
81
81
  },