Fix empty translations, add details to errors.
Этот коммит содержится в:
@@ -326,7 +326,7 @@ func requestTrueUpReview(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
// Customer Info & Usage Analytics
|
// Customer Info & Usage Analytics
|
||||||
activeUserCount, err := c.App.Srv().Store().Status().GetTotalActiveUsersCount()
|
activeUserCount, err := c.App.Srv().Store().Status().GetTotalActiveUsersCount()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.user_count_fail", nil, "", http.StatusInternalServerError)
|
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.user_count_fail", nil, "Could not get the total active users count", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,12 +334,12 @@ func requestTrueUpReview(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
incomingWebhookCount, err := c.App.Srv().Store().Webhook().AnalyticsIncomingCount("")
|
incomingWebhookCount, err := c.App.Srv().Store().Webhook().AnalyticsIncomingCount("")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.webhook_in_count_fail", nil, "", http.StatusInternalServerError)
|
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.webhook_in_count_fail", nil, "Could not get the total incoming webhook count", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
outgoingWebhookCount, err := c.App.Srv().Store().Webhook().AnalyticsOutgoingCount("")
|
outgoingWebhookCount, err := c.App.Srv().Store().Webhook().AnalyticsOutgoingCount("")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.webhook_out_count_fail", nil, "", http.StatusInternalServerError)
|
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.webhook_out_count_fail", nil, "Could not get the total outgoing webhook count", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,15 +413,15 @@ func requestTrueUpReview(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
var nfErr *store.ErrNotFound
|
var nfErr *store.ErrNotFound
|
||||||
switch {
|
switch {
|
||||||
case errors.As(err, &nfErr):
|
case errors.As(err, &nfErr):
|
||||||
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.status_not_found", nil, "", http.StatusNotFound).Wrap(err)
|
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.status_not_found", nil, "Could not find any true up status records", http.StatusNotFound).Wrap(err)
|
||||||
default:
|
default:
|
||||||
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.get_status_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.get_status_error", nil, "Could not get true up status records", http.StatusInternalServerError).Wrap(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
status, err = c.App.Srv().Store().TrueUpReview().CreateTrueUpReviewStatusRecord(status)
|
status, err = c.App.Srv().Store().TrueUpReview().CreateTrueUpReviewStatusRecord(status)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.create.fail.app_error", nil, "", http.StatusInternalServerError)
|
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.create_error", nil, "Could not create true up status record", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -458,12 +458,12 @@ func trueUpReviewStatus(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
license := c.App.Channels().License()
|
license := c.App.Channels().License()
|
||||||
if license == nil {
|
if license == nil {
|
||||||
c.Err = model.NewAppError("cloudTrueUpReviewNotAllowed", "api.license.true_up_review.license_required", nil, "", http.StatusNotImplemented)
|
c.Err = model.NewAppError("cloudTrueUpReviewNotAllowed", "api.license.true_up_review.license_required", nil, "True up review requires a license", http.StatusNotImplemented)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if license.IsCloud() {
|
if license.IsCloud() {
|
||||||
c.Err = model.NewAppError("cloudTrueUpReviewNotAllowed", "api.license.true_up_review.not_allowed_for_cloud", nil, "", http.StatusNotImplemented)
|
c.Err = model.NewAppError("cloudTrueUpReviewNotAllowed", "api.license.true_up_review.not_allowed_for_cloud", nil, "True up review is not allowed for cloud instances", http.StatusNotImplemented)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,16 +473,16 @@ func trueUpReviewStatus(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
var nfErr *store.ErrNotFound
|
var nfErr *store.ErrNotFound
|
||||||
switch {
|
switch {
|
||||||
case errors.As(err, &nfErr):
|
case errors.As(err, &nfErr):
|
||||||
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.status_not_found", nil, "", http.StatusNotFound).Wrap(err)
|
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.status_not_found", nil, "Could not find any true up status records", http.StatusNotFound).Wrap(err)
|
||||||
default:
|
default:
|
||||||
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.get_status_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.get_status_error", nil, "Could not get true up status records", http.StatusInternalServerError).Wrap(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
status, err = c.App.Srv().Store().TrueUpReview().CreateTrueUpReviewStatusRecord(status)
|
status, err = c.App.Srv().Store().TrueUpReview().CreateTrueUpReviewStatusRecord(status)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.create_error", nil, "", http.StatusInternalServerError)
|
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.create_error", nil, "Could not create true up status record", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
20
i18n/en.json
20
i18n/en.json
@@ -2077,17 +2077,13 @@
|
|||||||
"id": "api.license.request_trial_license.fail_get_user_count.app_error",
|
"id": "api.license.request_trial_license.fail_get_user_count.app_error",
|
||||||
"translation": "Unable to get a trial license, please try again or contact with support@mattermost.com. Cannot obtain the number of registered users."
|
"translation": "Unable to get a trial license, please try again or contact with support@mattermost.com. Cannot obtain the number of registered users."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "api.license.true_up_review.create.fail.app_error",
|
|
||||||
"translation": "Unable to create a true up review record."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "api.license.true_up_review.create_error",
|
"id": "api.license.true_up_review.create_error",
|
||||||
"translation": ""
|
"translation": "Could not create true up status record"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.license.true_up_review.get_status_error",
|
"id": "api.license.true_up_review.get_status_error",
|
||||||
"translation": ""
|
"translation": "Could not get true up status records"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.license.true_up_review.license.required",
|
"id": "api.license.true_up_review.license.required",
|
||||||
@@ -2095,27 +2091,27 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.license.true_up_review.license_required",
|
"id": "api.license.true_up_review.license_required",
|
||||||
"translation": ""
|
"translation": "True up review requires a license"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.license.true_up_review.not_allowed_for_cloud",
|
"id": "api.license.true_up_review.not_allowed_for_cloud",
|
||||||
"translation": ""
|
"translation": "True up review is not allowed for cloud instances"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.license.true_up_review.status_not_found",
|
"id": "api.license.true_up_review.status_not_found",
|
||||||
"translation": ""
|
"translation": "Could not find any true up status records"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.license.true_up_review.user_count_fail",
|
"id": "api.license.true_up_review.user_count_fail",
|
||||||
"translation": ""
|
"translation": "Could not get the total active users count"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.license.true_up_review.webhook_in_count_fail",
|
"id": "api.license.true_up_review.webhook_in_count_fail",
|
||||||
"translation": ""
|
"translation": "Could not get the total incoming webhook count"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.license.true_up_review.webhook_out_count_fail",
|
"id": "api.license.true_up_review.webhook_out_count_fail",
|
||||||
"translation": ""
|
"translation": "Could not get the total outgoing webhook count"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.license.upgrade_needed.app_error",
|
"id": "api.license.upgrade_needed.app_error",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user