提交 2ae3823a 编写于 作者: L LiHui

Fix: show app name in review list

Signed-off-by: NLiHui <andrewli@yunify.com>
上级 9e235ce0
......@@ -230,7 +230,11 @@ func (c *applicationOperator) ListAppVersionReviews(conditions *params.Condition
items := make([]interface{}, 0, len(filtered))
for i, j := offset, 0; i < len(filtered) && j < limit; i, j = i+1, j+1 {
review := convertAppVersionReview(filtered[i])
app, err := c.appLister.Get(filtered[i].GetHelmApplicationId())
if err != nil {
return nil, err
}
review := convertAppVersionReview(app, filtered[i])
items = append(items, review)
}
......
......@@ -17,6 +17,7 @@ limitations under the License.
package openpitrix
import (
"encoding/json"
"fmt"
"path"
"regexp"
......@@ -754,7 +755,7 @@ func attachmentKeyInStorage(ws, id string) string {
return path.Join(ws, id)
}
func convertAppVersionReview(appVersion *v1alpha1.HelmApplicationVersion) *AppVersionReview {
func convertAppVersionReview(app *v1alpha1.HelmApplication, appVersion *v1alpha1.HelmApplicationVersion) *AppVersionReview {
review := &AppVersionReview{}
status := appVersion.Status
review.Reviewer = status.Audit[0].Operator
......@@ -766,7 +767,7 @@ func convertAppVersionReview(appVersion *v1alpha1.HelmApplicationVersion) *AppVe
review.VersionName = appVersion.GetVersionName()
review.StatusTime = strfmt.DateTime(status.Audit[0].Time.Time)
review.AppName = appVersion.GetTrueName()
review.AppName = app.GetTrueName()
return review
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册