Files
upstream-corteza/server/compose/module_field.cue
upstream-mirror 7e385fc126
Some checks failed
SonarQube / SonarQube (push) Failing after 5m28s
E2e test on main branch push / server and client test (map[name:admin port:8080]) (push) Failing after 3m33s
Server and lib tests / Library test (js) (push) Failing after 1m36s
Server and lib tests / Library test (vue) (push) Successful in 2m24s
Server and lib tests / Web client test (admin) (push) Successful in 2m52s
Server and lib tests / Web client test (compose) (push) Successful in 3m23s
Server and lib tests / Web client test (discovery) (push) Successful in 2m49s
Server and lib tests / Web client test (one) (push) Successful in 2m52s
Server and lib tests / Web client test (privacy) (push) Successful in 2m44s
Server and lib tests / Web client test (reporter) (push) Successful in 2m56s
Server and lib tests / Web client test (workflow) (push) Successful in 3m0s
Server and lib tests / Server tests (push) Failing after 4m55s
E2e test on main branch push / notify-failure (push) Failing after 9s
Server and lib tests / Send matrix testing notification (push) Successful in 2s
Mark stale issues and pull requests / stale (push) Successful in 40s
snapshot of https://github.com/cortezaproject/corteza.git (2024.9.x, 2026-09-18; blobs > 131072B omitted)
2026-09-18 01:22:23 +05:00

213 lines
4.1 KiB
CUE

package compose
import (
"github.com/cortezaproject/corteza/server/codegen/schema"
)
moduleField: {
parents: [
{handle: "namespace"},
{handle: "module"},
]
model: {
defaultSetter: true
ident: "compose_module_field"
attributes: {
id: schema.IdField & {
envoy: {
identifier: true
}
}
module_id: {
ident: "moduleID",
goType: "uint64",
storeIdent: "rel_module"
dal: { type: "Ref", refModelResType: "corteza::compose:module" }
}
place: {
sortable: true,
goType: "int"
dal: { type: "Number", meta: { "rdbms:type": "integer" } }
}
kind: {
sortable: true,
goType: "string"
dal: {}
}
options: {
goType: "types.ModuleFieldOptions"
dal: { type: "JSON", defaultEmptyObject: true }
omitSetter: true
omitGetter: true
envoy: {
yaml: {
customDecoder: true
customEncoder: true
}
}
}
name: {
sortable: true
dal: {}
} & {
envoy: {
identifier: true
}
}
label: {
sortable: true
dal: {}
}
config: {
goType: "types.ModuleFieldConfig"
dal: { type: "JSON", defaultEmptyObject: true }
omitSetter: true
omitGetter: true
}
required: {
goType: "bool",
storeIdent: "is_required"
dal: { type: "Boolean" }
}
multi: {
goType: "bool",
storeIdent: "is_multi"
dal: { type: "Boolean" }
}
default_value: {
goType: "types.RecordValueSet"
dal: { type: "JSON", defaultEmptyObject: true }
omitSetter: true
omitGetter: true
envoy: {
yaml: {
customDecoder: true
}
}
}
expressions: {
goType: "types.ModuleFieldExpr"
dal: { type: "JSON", defaultEmptyObject: true }
omitSetter: true
omitGetter: true
envoy: {
yaml: {
customDecoder: true
}
}
}
created_at: schema.SortableTimestampNowField
updated_at: schema.SortableTimestampNilField
deleted_at: schema.SortableTimestampNilField
}
indexes: {
"primary": { attribute: "id" }
"module": { attribute: "module_id" },
"unique_name": {
fields: [{ attribute: "name", modifiers: ["LOWERCASE"] }, { attribute: "module_id" }]
predicate: "name != '' AND deleted_at IS NULL"
}
}
}
filter: {
struct: {
module_id: { goType: "[]uint64", ident: "moduleID", storeIdent: "rel_module" }
deleted: { goType: "filter.State", storeIdent: "deleted_at" }
}
byNilState: ["deleted"]
byValue: ["module_id"]
}
features: {
labels: false
paging: false
sorting: false
checkFn: false
}
envoy: {
scoped: true
yaml: {
supportMappedInput: true
mappedField: "Name"
identKeyAlias: ["module_fields", "modulefields", "fields"]
}
store: {
handleField: ""
customFilterBuilder: true
extendedRefDecoder: true
sanitizeBeforeSave: true
}
}
rbac: {
operations: {
"record.value.read": description: "Read field value on records"
"record.value.update": description: "Update field value on records"
}
}
locale: {
skipSvc: true
keys: {
label: {}
descriptionView: {
path: ["meta", "description", "view"]
customHandler: true
}
descriptionEdit: {
path: ["meta", "description", "edit"]
customHandler: true
}
hintView: {
path: ["meta", "hint", "view"]
customHandler: true
}
hintEdit: {
path: ["meta", "hint", "edit"]
customHandler: true
}
validatorError: {
path: ["expression", "validator", {part: "validatorID", var: true}, "error"]
customHandler: true
}
optionsOptionTexts: {
path: ["meta", "options", {part: "value", var: true}, "text"]
customHandler: true
}
optionsBoolLabels: {
path: ["meta", "bool", {part: "value", var: true}, "label"]
customHandler: true
}
}
}
store: {
ident: "composeModuleField"
api: {
lookups: [
{
fields: ["module_id", "name"]
constraintCheck: true
nullConstraint: ["deleted_at"]
description: """
searches for compose module field by name (case-insensitive)
"""
}, {
fields: ["id"]
description: """
searches for compose module field by ID
"""
}
]
}
}
}