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