From 5e3acc480940c88482c5ccd58cb1668e85d0a20d Mon Sep 17 00:00:00 2001 From: Valentin Kuznetsov Date: Sat, 11 Dec 2021 17:48:22 -0500 Subject: [PATCH] fix config ids links --- services/reqmgr.go | 2 +- web/utils.go | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/services/reqmgr.go b/services/reqmgr.go index 35a1116..2d1b13b 100644 --- a/services/reqmgr.go +++ b/services/reqmgr.go @@ -327,7 +327,7 @@ func reqmgrConfigs(dasquery dasql.DASQuery) []mongo.DASRecord { var configIds []string for _, k := range req.ConfigIDs { if v, ok := req.ConfigIDMap[k]; ok { - configIds = append(configIds, fmt.Sprintf("%s (%s)", k, v)) + configIds = append(configIds, fmt.Sprintf("%s::%s", k, v)) } else { configIds = append(configIds, k) } diff --git a/web/utils.go b/web/utils.go index 7fa4884..2801fba 100644 --- a/web/utils.go +++ b/web/utils.go @@ -497,7 +497,14 @@ func PresentData(path string, dasquery dasql.DASQuery, data []mongo.DASRecord, p var vals []string for _, vvv := range strings.Split(value, ",") { v := strings.Trim(vvv, " ") - v = fmt.Sprintf("%s", v, v) + name := v + cid := v + if strings.Contains(v, "::") { + arr := strings.Split(v, "::") + cid = arr[0] + name = arr[1] + } + v = fmt.Sprintf("%s", cid, name) vals = append(vals, v) } value = strings.Join(vals, ", ")