@stoker-platform/web-app 0.5.94 → 0.5.96
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 +16 -0
- package/package.json +4 -4
- package/src/Form.tsx +8 -9
- package/src/RecordSidebar.tsx +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @stoker-platform/web-app
|
|
2
2
|
|
|
3
|
+
## 0.5.96
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix: improve Form null handling
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @stoker-platform/utils@0.5.45
|
|
10
|
+
- @stoker-platform/node-client@0.5.53
|
|
11
|
+
- @stoker-platform/web-client@0.5.54
|
|
12
|
+
|
|
13
|
+
## 0.5.95
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- fix: delay record sidebar display until initialised
|
|
18
|
+
|
|
3
19
|
## 0.5.94
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoker-platform/web-app",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.96",
|
|
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.
|
|
55
|
-
"@stoker-platform/utils": "0.5.
|
|
56
|
-
"@stoker-platform/web-client": "0.5.
|
|
54
|
+
"@stoker-platform/node-client": "0.5.53",
|
|
55
|
+
"@stoker-platform/utils": "0.5.45",
|
|
56
|
+
"@stoker-platform/web-client": "0.5.54",
|
|
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
|
@@ -3836,6 +3836,14 @@ function RecordForm({
|
|
|
3836
3836
|
) {
|
|
3837
3837
|
delete values[field.name]
|
|
3838
3838
|
}
|
|
3839
|
+
|
|
3840
|
+
if (values[field.name] === null) {
|
|
3841
|
+
if (originalRecord?.[field.name]) {
|
|
3842
|
+
values[field.name] = deleteField()
|
|
3843
|
+
} else {
|
|
3844
|
+
delete values[field.name]
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3839
3847
|
}
|
|
3840
3848
|
|
|
3841
3849
|
let userData: UserData | undefined
|
|
@@ -5113,12 +5121,6 @@ function RecordForm({
|
|
|
5113
5121
|
) {
|
|
5114
5122
|
form.setValue(field.name, 0)
|
|
5115
5123
|
}
|
|
5116
|
-
if (
|
|
5117
|
-
field.nullable &&
|
|
5118
|
-
form.getValues(field.name) === null
|
|
5119
|
-
) {
|
|
5120
|
-
form.setValue(field.name, undefined)
|
|
5121
|
-
}
|
|
5122
5124
|
}
|
|
5123
5125
|
form.handleSubmit(handleSubmit, (errors) => {
|
|
5124
5126
|
console.error(errors)
|
|
@@ -5634,9 +5636,6 @@ function RecordForm({
|
|
|
5634
5636
|
) {
|
|
5635
5637
|
form.setValue(field.name, 0)
|
|
5636
5638
|
}
|
|
5637
|
-
if (field.nullable && form.getValues(field.name) === null) {
|
|
5638
|
-
form.setValue(field.name, undefined)
|
|
5639
|
-
}
|
|
5640
5639
|
}
|
|
5641
5640
|
form.handleSubmit(handleSubmit, (errors) => {
|
|
5642
5641
|
console.error(errors)
|
package/src/RecordSidebar.tsx
CHANGED
|
@@ -45,6 +45,7 @@ export const RecordSidebar = ({
|
|
|
45
45
|
const [relationTitles, setRelationTitles] = useState<Record<string, string>>({})
|
|
46
46
|
const [relationIcons, setRelationIcons] = useState<Record<string, React.FC>>({})
|
|
47
47
|
const [assignable, setAssignable] = useState<Assignable[]>([])
|
|
48
|
+
const [isInitialized, setIsInitialized] = useState(false)
|
|
48
49
|
|
|
49
50
|
useEffect(() => {
|
|
50
51
|
;(async () => {
|
|
@@ -68,6 +69,7 @@ export const RecordSidebar = ({
|
|
|
68
69
|
const assignable = await tryPromise(customization.admin?.assignable)
|
|
69
70
|
setAssignable(assignable)
|
|
70
71
|
}
|
|
72
|
+
setIsInitialized(true)
|
|
71
73
|
})()
|
|
72
74
|
}, [])
|
|
73
75
|
|
|
@@ -126,6 +128,8 @@ export const RecordSidebar = ({
|
|
|
126
128
|
const anyCustomActive = customItems.some((item) => location.pathname.includes(item.page))
|
|
127
129
|
const anyRelationActive = relationItems.some((item) => location.pathname.includes(item.page))
|
|
128
130
|
|
|
131
|
+
if (!isInitialized) return null
|
|
132
|
+
|
|
129
133
|
return (
|
|
130
134
|
<Sidebar
|
|
131
135
|
collapsible="none"
|