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

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

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

@@ -4,3 +4,19 @@
package model
const CustomProfileAttributesPropertyGroupName = "custom_profile_attributes"
const CustomProfileAttributesPropertyAttrsSortOrder = "sort_order"
func CustomProfileAttributesPropertySortOrder(p *PropertyField) int {
value, ok := p.Attrs[CustomProfileAttributesPropertyAttrsSortOrder]
if !ok {
return 0
}
order, ok := value.(float64)
if !ok {
return 0
}
return int(order)
}

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

@@ -99,7 +99,7 @@ func (pf *PropertyField) SanitizeInput() {
type PropertyFieldPatch struct {
Name *string `json:"name"`
Type *PropertyFieldType `json:"type"`
Attrs *map[string]any `json:"attrs"`
Attrs *StringInterface `json:"attrs"`
TargetID *string `json:"target_id"`
TargetType *string `json:"target_type"`
}
@@ -174,3 +174,7 @@ type PropertyFieldSearchOpts struct {
Cursor PropertyFieldSearchCursor
PerPage int
}
func (pf *PropertyField) GetAttr(key string) any {
return pf.Attrs[key]
}