Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1262821
file.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
749 B
Referenced Files
None
Subscribers
None
file.ts
View Options
import
{
toCamelCase
}
from
"js-convert-case"
;
import
{
FieldHandler
,
FieldHandlerResult
,
}
from
"../shared-crud-form-fields.js"
;
export
const
file_handler
:
FieldHandler
<
FieldHandlerResult
,
Partial
<
FieldHandlerResult
>
>
=
async
(
_
,
{
name
,
is_required
},
__
,
{
is_required_expr
})
=>
{
const
tempname
=
toCamelCase
(
"prepared-"
+
name
);
return
{
field
:
`
${
name
}
: new Fields.File(
${
is_required_expr
}
, TheFileManager)`
,
initial_value_edit
:
`
${
name
}
: {old: item.get("
${
name
}
")}`
,
pre_edit
:
`const
${
tempname
}
= data.
${
name
}
.new || data.
${
name
}
.old;
if(!
${
tempname
}
){
throw new Error("Missing field:
${
name
}
")
}`
,
fallback_value_sealious
:
"null"
,
...(
is_required
?
{
main_value_sealious
:
tempname
}
:
{}),
};
};
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Fri, Jan 24, 15:16 (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
600407
Default Alt Text
file.ts (749 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment