3
0

Mark additional Compose resource fields as sortable

This commit is contained in:
Tomaž Jerman
2022-05-30 10:57:27 +02:00
parent 5c317cdbdf
commit a2606ea58d
5 changed files with 25 additions and 7 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ chart: schema.#Resource & {
struct: {
id: schema.IdField
handle: schema.HandleField
name: {}
name: {sortable: true}
config: { goType: "types.ChartConfig" }
namespace_id: { ident: "namespaceID", goType: "uint64", storeIdent: "rel_namespace" }
+2 -2
View File
@@ -16,8 +16,8 @@ moduleField: schema.#Resource & {
module_id: { ident: "moduleID", goType: "uint64", storeIdent: "rel_module" }
place: { goType: "int" }
kind: { goType: "string" }
name: {}
label: {}
name: {sortable: true}
label: {sortable: true}
options: { goType: "types.ModuleFieldOptions" }
encoding_strategy: { goType: "types.EncodingStrategy" }
privacy: { goType: "types.DataPrivacyConfig" }
+1 -1
View File
@@ -18,7 +18,7 @@ module: schema.#Resource & {
privacy: { goType: "types.DataPrivacyConfig" }
fields: { goType: "types.ModuleFieldSet", store: false }
namespace_id: { ident: "namespaceID", goType: "uint64", storeIdent: "rel_namespace" }
name: {}
name: {sortable: true}
created_at: schema.SortableTimestampField
updated_at: schema.SortableTimestampNilField
+2 -2
View File
@@ -19,8 +19,8 @@ page: schema.#Resource & {
blocks: { goType: "types.PageBlocks" }
children: { goType: "types.PageSet", store: false }
visible: { goType: "bool" }
weight: { goType: "int" }
title: { goType: "string" }
weight: { goType: "int", sortable: true }
title: { goType: "string", sortable: true }
description: { goType: "string" }
created_at: schema.SortableTimestampField
+19 -1
View File
@@ -6398,6 +6398,7 @@ func (Store) sortableComposeChartFields() map[string]string {
"deletedat": "deleted_at",
"handle": "handle",
"id": "id",
"name": "name",
"updated_at": "updated_at",
"updatedat": "updated_at",
}
@@ -6431,6 +6432,8 @@ func (s *Store) collectComposeChartCursorValues(res *composeType.Chart, cc ...*f
case "handle":
cur.Set(c.Column, res.Handle, c.Descending)
hasUnique = true
case "name":
cur.Set(c.Column, res.Name, c.Descending)
case "createdAt":
cur.Set(c.Column, res.CreatedAt, c.Descending)
case "updatedAt":
@@ -6970,6 +6973,7 @@ func (Store) sortableComposeModuleFields() map[string]string {
"deletedat": "deleted_at",
"handle": "handle",
"id": "id",
"name": "name",
"updated_at": "updated_at",
"updatedat": "updated_at",
}
@@ -7003,6 +7007,8 @@ func (s *Store) collectComposeModuleCursorValues(res *composeType.Module, cc ...
case "handle":
cur.Set(c.Column, res.Handle, c.Descending)
hasUnique = true
case "name":
cur.Set(c.Column, res.Name, c.Descending)
case "createdAt":
cur.Set(c.Column, res.CreatedAt, c.Descending)
case "updatedAt":
@@ -7290,7 +7296,9 @@ func (s *Store) LookupComposeModuleFieldByModuleIDName(ctx context.Context, modu
// This function is auto-generated
func (Store) sortableComposeModuleFieldFields() map[string]string {
return map[string]string{
"id": "id",
"id": "id",
"label": "label",
"name": "name",
}
}
@@ -7319,6 +7327,10 @@ func (s *Store) collectComposeModuleFieldCursorValues(res *composeType.ModuleFie
case "id":
cur.Set(c.Column, res.ID, c.Descending)
pkID = true
case "name":
cur.Set(c.Column, res.Name, c.Descending)
case "label":
cur.Set(c.Column, res.Label, c.Descending)
}
}
}
@@ -8436,8 +8448,10 @@ func (Store) sortableComposePageFields() map[string]string {
"deletedat": "deleted_at",
"handle": "handle",
"id": "id",
"title": "title",
"updated_at": "updated_at",
"updatedat": "updated_at",
"weight": "weight",
}
}
@@ -8469,6 +8483,10 @@ func (s *Store) collectComposePageCursorValues(res *composeType.Page, cc ...*fil
case "handle":
cur.Set(c.Column, res.Handle, c.Descending)
hasUnique = true
case "weight":
cur.Set(c.Column, res.Weight, c.Descending)
case "title":
cur.Set(c.Column, res.Title, c.Descending)
case "createdAt":
cur.Set(c.Column, res.CreatedAt, c.Descending)
case "updatedAt":