Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
react-admin-cubicweb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
react-admin-cubicweb
Commits
4d31c27cdf30
Commit
4d31c27cdf30
authored
4 years ago
by
Frank Bessou
Browse files
Options
Downloads
Patches
Plain Diff
feat: Allow build objs to have default values
parent
5651596f0201
No related branches found
No related tags found
1 merge request
!15
Topic/default/default values
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/ra-cubicweb/src/Schema.ts
+29
-2
29 additions, 2 deletions
packages/ra-cubicweb/src/Schema.ts
with
29 additions
and
2 deletions
packages/ra-cubicweb/src/Schema.ts
+
29
−
2
View file @
4d31c27c
export
type
BuildObj
=
{
type
BuildObj
Base
<
T
extends
string
>
=
{
type
:
"
String
"
|
"
Date
"
|
"
Float
"
|
"
Int
"
|
"
Boolean
"
;
type
:
T
;
required
?:
boolean
;
required
?:
boolean
;
};
};
...
@@ -3,6 +3,33 @@
...
@@ -3,6 +3,33 @@
required
?:
boolean
;
required
?:
boolean
;
};
};
interface
StringBuildObj
extends
BuildObjBase
<
"
String
"
>
{
default
?:
string
;
}
interface
DateBuidObj
extends
BuildObjBase
<
"
Date
"
>
{
default
?:
Date
|
"
NOW
"
|
"
TODAY
"
;
}
interface
FloatBuildObj
extends
BuildObjBase
<
"
Float
"
>
{
default
?:
number
;
}
interface
IntBuildObj
extends
BuildObjBase
<
"
Int
"
>
{
default
?:
number
;
}
interface
BooleanBuildObj
extends
BuildObjBase
<
"
Boolean
"
>
{
default
?:
boolean
;
}
export
type
BuildObj
=
|
StringBuildObj
|
DateBuidObj
|
FloatBuildObj
|
IntBuildObj
|
BooleanBuildObj
;
export
type
Cardinality
=
"
*
"
|
"
1
"
|
"
?
"
|
"
+
"
;
export
type
Cardinality
=
"
*
"
|
"
1
"
|
"
?
"
|
"
+
"
;
export
type
CardinalityPair
=
`
${
Cardinality
}${
Cardinality
}
`
;
export
type
CardinalityPair
=
`
${
Cardinality
}${
Cardinality
}
`
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment