Add module, record labels for mapping
This commit is contained in:
@@ -222,6 +222,7 @@ func (d composeResources) Modules(ctx context.Context, namespaceID uint64, limit
|
||||
}
|
||||
return out
|
||||
}(),
|
||||
Labels: mod.Labels,
|
||||
Created: makePartialChange(&mod.CreatedAt),
|
||||
Updated: makePartialChange(mod.UpdatedAt),
|
||||
Deleted: makePartialChange(mod.DeletedAt),
|
||||
@@ -302,6 +303,7 @@ func (d composeResources) Records(ctx context.Context, namespaceID, moduleID uin
|
||||
Namespace: nsPartial,
|
||||
Module: modPartial,
|
||||
Url: d.getUrlToResource(pageDetail{moduleID: moduleID, recordID: recordID}),
|
||||
Labels: rec.Labels,
|
||||
Values: d.recordValues(ctx, rec),
|
||||
Created: makePartialChange(&rec.CreatedAt),
|
||||
Updated: makePartialChange(rec.UpdatedAt),
|
||||
|
||||
@@ -79,6 +79,7 @@ type (
|
||||
Name string `json:"name,omitempty"`
|
||||
Handle string `json:"handle,omitempty"`
|
||||
Url string `json:"url,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Fields []*docPartialComposeModuleField `json:"fields"`
|
||||
Namespace docPartialComposeNamespace `json:"namespace"`
|
||||
Updated *docPartialChange `json:"updated,omitempty"`
|
||||
@@ -104,6 +105,7 @@ type (
|
||||
Url string `json:"url,omitempty"`
|
||||
Namespace docPartialComposeNamespace `json:"namespace"`
|
||||
Module docPartialComposeModule `json:"module"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Values map[string][]interface{} `json:"values"`
|
||||
Updated *docPartialChange `json:"updated,omitempty"`
|
||||
Created *docPartialChange `json:"created,omitempty"`
|
||||
|
||||
@@ -82,6 +82,9 @@ func (m composeMapping) Modules(ctx context.Context) ([]*Mapping, error) {
|
||||
"name": {Type: "text", Boost: 2},
|
||||
"handle": {Type: "keyword", Boost: 2},
|
||||
"url": {Type: "text"},
|
||||
"labels": {
|
||||
Type: "object",
|
||||
},
|
||||
"fields": {
|
||||
Type: "object",
|
||||
Properties: map[string]*property{
|
||||
@@ -152,6 +155,9 @@ func (m composeMapping) records(ctx context.Context, mod *types.Module, mm types
|
||||
mapping.Mapping["deleted"] = change()
|
||||
mapping.Mapping["security"] = security()
|
||||
|
||||
mapping.Mapping["labels"] = &property{
|
||||
Type: "object",
|
||||
}
|
||||
mapping.Mapping["values"] = &property{
|
||||
Type: "nested",
|
||||
Properties: props,
|
||||
|
||||
Reference in New Issue
Block a user