Automatic channel category sorting (#30866)

* Automatic channel category sorting

* Fix types

* AIed

* Fix issue where categories are updated for all users

* Move all logic to server, clean up

* PR feedback

* Fix lint

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Devin Binnie
2025-06-11 14:29:36 -04:00
коммит произвёл GitHub
родитель c6a11763a8
Коммит 25a4839a9e
17 изменённых файлов: 289 добавлений и 30 удалений

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

@@ -137,6 +137,7 @@ func channelSliceColumns(isSelect bool, prefix ...string) []string {
p + "TotalMsgCountRoot",
p + "LastRootPostAt",
p + "BannerInfo",
p + "DefaultCategoryName",
}
if isSelect {
@@ -172,6 +173,7 @@ func channelToSlice(channel *model.Channel) []any {
channel.TotalMsgCountRoot,
channel.LastRootPostAt,
channel.BannerInfo,
channel.DefaultCategoryName,
}
}
@@ -834,7 +836,8 @@ func (s SqlChannelStore) updateChannelT(transaction *sqlxTxWrapper, channel *mod
Shared=:Shared,
TotalMsgCountRoot=:TotalMsgCountRoot,
LastRootPostAt=:LastRootPostAt,
BannerInfo=:BannerInfo
BannerInfo=:BannerInfo,
DefaultCategoryName=:DefaultCategoryName
WHERE Id=:Id`, channel)
if err != nil {
if IsUniqueConstraintError(err, []string{"Name", "channels_name_teamid_key"}) {