Add missing field "sortOrder" to graphQL schema (#20956)
* Add missing field "sortOrder" to graphQL schema * Add test Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1fc5fcd900
Коммит
56bf9cec50
@@ -27,6 +27,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
|
|||||||
Sorting model.SidebarCategorySorting `json:"sorting"`
|
Sorting model.SidebarCategorySorting `json:"sorting"`
|
||||||
ChannelIDs []string `json:"channelIds"`
|
ChannelIDs []string `json:"channelIds"`
|
||||||
TeamID string `json:"teamId"`
|
TeamID string `json:"teamId"`
|
||||||
|
SortOrder int64 `json:"sortOrder"`
|
||||||
} `json:"sidebarCategories"`
|
} `json:"sidebarCategories"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
|
|||||||
displayName
|
displayName
|
||||||
sorting
|
sorting
|
||||||
channelIds
|
channelIds
|
||||||
|
sortOrder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
@@ -69,6 +71,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
|
|||||||
assert.Equal(t, categories.Categories[i].DisplayName, q.SidebarCategories[i].DisplayName)
|
assert.Equal(t, categories.Categories[i].DisplayName, q.SidebarCategories[i].DisplayName)
|
||||||
assert.Equal(t, categories.Categories[i].Sorting, q.SidebarCategories[i].Sorting)
|
assert.Equal(t, categories.Categories[i].Sorting, q.SidebarCategories[i].Sorting)
|
||||||
assert.Equal(t, categories.Categories[i].ChannelIds(), q.SidebarCategories[i].ChannelIDs)
|
assert.Equal(t, categories.Categories[i].ChannelIds(), q.SidebarCategories[i].ChannelIDs)
|
||||||
|
assert.Equal(t, categories.Categories[i].SortOrder, q.SidebarCategories[i].SortOrder)
|
||||||
}
|
}
|
||||||
|
|
||||||
input = graphQLInput{
|
input = graphQLInput{
|
||||||
@@ -80,6 +83,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
|
|||||||
displayName
|
displayName
|
||||||
sorting
|
sorting
|
||||||
channelIds
|
channelIds
|
||||||
|
sortOrder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
@@ -114,6 +118,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
|
|||||||
sorting
|
sorting
|
||||||
channelIds
|
channelIds
|
||||||
teamId
|
teamId
|
||||||
|
sortOrder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ type SidebarCategory {
|
|||||||
collapsed: Boolean!
|
collapsed: Boolean!
|
||||||
teamId: String!
|
teamId: String!
|
||||||
channelIds: [String!]!
|
channelIds: [String!]!
|
||||||
|
sortOrder: Float!
|
||||||
}
|
}
|
||||||
|
|
||||||
# Deliberately leaving out teamMembers.
|
# Deliberately leaving out teamMembers.
|
||||||
|
|||||||
@@ -124,3 +124,7 @@ func (t *SidebarCategorySorting) UnmarshalGraphQL(input any) error {
|
|||||||
*t = SidebarCategorySorting(chType)
|
*t = SidebarCategorySorting(chType)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *SidebarCategory) SortOrder_() float64 {
|
||||||
|
return float64(t.SortOrder)
|
||||||
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user