MM-62548: CPA Reordering - drag and drop (#30097)

Этот коммит содержится в:
Caleb Roseland
2025-02-13 17:09:35 -06:00
коммит произвёл GitHub
родитель b2147476cc
Коммит 2182b1eaf9
11 изменённых файлов: 292 добавлений и 110 удалений

Просмотреть файл

@@ -6,6 +6,7 @@ package app
import (
"encoding/json"
"net/http"
"sort"
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/v8/channels/store"
@@ -68,6 +69,10 @@ func (a *App) ListCPAFields() ([]*model.PropertyField, *model.AppError) {
return nil, model.NewAppError("GetCPAFields", "app.custom_profile_attributes.search_property_fields.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
sort.Slice(fields, func(i, j int) bool {
return model.CustomProfileAttributesPropertySortOrder(fields[i]) < model.CustomProfileAttributesPropertySortOrder(fields[j])
})
return fields, nil
}