Commit f1f300b13c74dac6cfd34d073a29d8ba9222e637

Authored by Marko Tikvić
1 parent da1d1d418f
Exists in master and in 1 other branch v2

Added nav node field

Showing 1 changed file with 14 additions and 11 deletions   Show diff stats
... ... @@ -49,11 +49,12 @@ type ListActions struct {
49 49 }
50 50  
51 51 type ListNavNode struct {
52   - ObjectType string `json:"objectType"`
53   - LabelField string `json:"label"`
54   - Icon string `json:"icon"`
55   - ParentObjectType string `json:"parentObjectType"`
56   - ParentIDField string `json:"parentIdField"`
  52 + ObjectType string `json:"objectType"`
  53 + LabelField string `json:"label"`
  54 + Icon string `json:"icon"`
  55 + ParentObjectType string `json:"parentObjectType"`
  56 + ParentIDField string `json:"parentIdField"`
  57 + ParentFilterField string `json:"parentFilterField"`
57 58 }
58 59  
59 60 type ListParentNode struct {
... ... @@ -178,7 +179,7 @@ func newDefaultList(objType string) ListConfig {
178 179 func setListParams(db *ora.Ses, list *ListConfig, objType string) error {
179 180 var err error
180 181 var stmt *ora.Stmt
181   - query := `SELECT
  182 + query := `SELECT
182 183 OBJECT_TYPE, TITLE, LAZY_LOAD, INLINE_EDIT
183 184 FROM LIST_CONFIG
184 185 WHERE OBJECT_TYPE = '` + objType + `'`
... ... @@ -217,9 +218,9 @@ func getListNavigation(db *ora.Ses, listObjType string) ([]ListNavNode, error) {
217 218 resp := make([]ListNavNode, 0)
218 219 var err error
219 220 var stmt *ora.Stmt
220   - query := `SELECT
221   - a.OBJECT_TYPE, a.PARENT_OBJECT_TYPE, a.LABEL, a.ICON, b.PARENT_ID_FIELD, b.RB
222   - FROM LIST_CONFIG_NAVIGATION b
  221 + query := `SELECT
  222 + a.OBJECT_TYPE, a.PARENT_OBJECT_TYPE, a.LABEL, a.ICON, a.PARENT_FILTER_FIELD, b.PARENT_ID_FIELD, b.RB
  223 + FROM LIST_CONFIG_NAVIGATION b
223 224 JOIN LIST_CONFIG_CHILD a ON b.PARENT_CHILD_ID = a.PARENT_CHILD_ID
224 225 WHERE b.LIST_OBJECT_TYPE = '`+listObjType+`'
225 226 ORDER BY b.RB ASC`
... ... @@ -240,7 +241,9 @@ func getListNavigation(db *ora.Ses, listObjType string) ([]ListNavNode, error) {
240 241 ParentObjectType: rset.Row[1].(string),
241 242 LabelField: rset.Row[2].(string),
242 243 Icon: rset.Row[3].(string),
243   - ParentIDField: rset.Row[4].(string),
  244 + ParentFilterField: rset.Row[4].(string),
  245 + ParentIDField: rset.Row[5].(string),
  246 + // RB is ignored
244 247 })
245 248 }
246 249 if rset.Err != nil {
... ... @@ -255,7 +258,7 @@ func getListActions(db *ora.Ses, objType string) (ListActions, error) {
255 258 var resp ListActions
256 259 var err error
257 260 var stmt *ora.Stmt
258   - query := `SELECT
  261 + query := `SELECT
259 262 ACTION_CREATE, ACTION_UPDATE, ACTION_DELETE, ACTION_EXPORT,
260 263 ACTION_PRINT, ACTION_GRAPH
261 264 FROM LIST_CONFIG
... ...