* removed server side

* Updated store layer

* unused import

* Updated autogenerated code template

* Updated tests

* lint fix

* unused translations

* webapp side

* Updated i18n

* lint fix:

* type fix

* Updated snapshots

* Removed insights from API specs

* updated e2e

* Updated e2e tests

* Updated e2e tests

* Removed insights tests

* Removed Insights as possible channel to load in sidebar from test

* Removed more insights tests

* More e2e fixed

* More cleanup

* Lint

* More cleanup in client4 and boards api

* More cleanup

* Fixes

* lint fix

---------

Co-authored-by: maria.nunez <maria.nunez@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Harshil Sharma
2023-07-25 12:34:38 +05:30
коммит произвёл GitHub
родитель e37459cd00
Коммит 26617fcbdc
192 изменённых файлов: 47 добавлений и 19885 удалений

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

@@ -3670,76 +3670,6 @@ func (c *Client4) AutocompleteChannelsForTeamForSearch(ctx context.Context, team
return ch, BuildResponse(r), nil
}
// GetTopChannelsForTeamSince will return an ordered list of the top channels in a given team.
func (c *Client4) GetTopChannelsForTeamSince(ctx context.Context, teamId string, timeRange string, page int, perPage int) (*TopChannelList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
r, err := c.DoAPIGet(ctx, c.teamRoute(teamId)+"/top/channels"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var topChannels *TopChannelList
if err := json.NewDecoder(r.Body).Decode(&topChannels); err != nil {
return nil, nil, NewAppError("GetTopChannelsForTeamSince", "api.unmarshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
return topChannels, BuildResponse(r), nil
}
// GetTopChannelsForUserSince will return an ordered list of your top channels in a given team.
func (c *Client4) GetTopChannelsForUserSince(ctx context.Context, teamId string, timeRange string, page int, perPage int) (*TopChannelList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
if teamId != "" {
query += fmt.Sprintf("&team_id=%v", teamId)
}
r, err := c.DoAPIGet(ctx, c.usersRoute()+"/me/top/channels"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var topChannels *TopChannelList
if err := json.NewDecoder(r.Body).Decode(&topChannels); err != nil {
return nil, nil, NewAppError("GetTopChannelsForUserSince", "api.unmarshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
return topChannels, BuildResponse(r), nil
}
// GetTopInactiveChannelsForTeamSince will return an ordered list of the top channels in a given team.
func (c *Client4) GetTopInactiveChannelsForTeamSince(ctx context.Context, teamId string, timeRange string, page int, perPage int) (*TopInactiveChannelList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
r, err := c.DoAPIGet(ctx, c.teamRoute(teamId)+"/top/inactive_channels"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var topInactiveChannels *TopInactiveChannelList
if jsonErr := json.NewDecoder(r.Body).Decode(&topInactiveChannels); jsonErr != nil {
return nil, nil, NewAppError("GetTopInactiveChannelsForTeamSince", "api.unmarshal_error", nil, jsonErr.Error(), http.StatusInternalServerError)
}
return topInactiveChannels, BuildResponse(r), nil
}
// GetTopInactiveChannelsForUserSince will return an ordered list of your top channels in a given team.
func (c *Client4) GetTopInactiveChannelsForUserSince(ctx context.Context, teamId string, timeRange string, page int, perPage int) (*TopInactiveChannelList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
if teamId != "" {
query += fmt.Sprintf("&team_id=%v", teamId)
}
r, err := c.DoAPIGet(ctx, c.usersRoute()+"/me/top/inactive_channels"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var topInactiveChannels *TopInactiveChannelList
if jsonErr := json.NewDecoder(r.Body).Decode(&topInactiveChannels); jsonErr != nil {
return nil, nil, NewAppError("GetTopInactiveChannelsForUserSince", "api.unmarshal_error", nil, jsonErr.Error(), http.StatusInternalServerError)
}
return topInactiveChannels, BuildResponse(r), nil
}
// Post Section
// CreatePost creates a post based on the provided post struct.
@@ -4322,41 +4252,6 @@ func (c *Client4) DoPostActionWithCookie(ctx context.Context, postId, actionId,
return BuildResponse(r), nil
}
// GetTopThreadsForTeamSince will return an ordered list of the top channels in a given team.
func (c *Client4) GetTopThreadsForTeamSince(ctx context.Context, teamId string, timeRange string, page int, perPage int) (*TopThreadList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
r, err := c.DoAPIGet(ctx, c.teamRoute(teamId)+"/top/threads"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var topThreads *TopThreadList
if err := json.NewDecoder(r.Body).Decode(&topThreads); err != nil {
return nil, nil, NewAppError("GetTopThreadsForTeamSince", "api.unmarshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
return topThreads, BuildResponse(r), nil
}
// GetTopThreadsForUserSince will return an ordered list of your top channels in a given team.
func (c *Client4) GetTopThreadsForUserSince(ctx context.Context, teamId string, timeRange string, page int, perPage int) (*TopThreadList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
if teamId != "" {
query += fmt.Sprintf("&team_id=%v", teamId)
}
r, err := c.DoAPIGet(ctx, c.usersRoute()+"/me/top/threads"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var topThreads *TopThreadList
if err := json.NewDecoder(r.Body).Decode(&topThreads); err != nil {
return nil, nil, NewAppError("GetTopThreadsForUserSince", "api.unmarshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
return topThreads, BuildResponse(r), nil
}
// OpenInteractiveDialog sends a WebSocket event to a user's clients to
// open interactive dialogs, based on the provided trigger ID and other
// provided data. Used with interactive message buttons, menus and
@@ -6849,54 +6744,6 @@ func (c *Client4) GetBulkReactions(ctx context.Context, postIds []string) (map[s
return reactions, BuildResponse(r), nil
}
func (c *Client4) GetTopReactionsForTeamSince(ctx context.Context, teamId string, timeRange string, page int, perPage int) (*TopReactionList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
r, err := c.DoAPIGet(ctx, c.teamRoute(teamId)+"/top/reactions"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var topReactions *TopReactionList
if err := json.NewDecoder(r.Body).Decode(&topReactions); err != nil {
return nil, nil, NewAppError("GetTopReactionsForTeamSince", "api.unmarshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
return topReactions, BuildResponse(r), nil
}
func (c *Client4) GetTopReactionsForUserSince(ctx context.Context, teamId string, timeRange string, page int, perPage int) (*TopReactionList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
if teamId != "" {
query += fmt.Sprintf("&team_id=%v", teamId)
}
r, err := c.DoAPIGet(ctx, c.usersRoute()+"/me/top/reactions"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var topReactions *TopReactionList
if err := json.NewDecoder(r.Body).Decode(&topReactions); err != nil {
return nil, nil, NewAppError("GetTopReactionsForUserSince", "api.unmarshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
return topReactions, BuildResponse(r), nil
}
func (c *Client4) GetTopDMsForUserSince(ctx context.Context, timeRange string, page int, perPage int) (*TopDMList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
r, err := c.DoAPIGet(ctx, c.usersRoute()+"/me/top/dms"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var topDMs *TopDMList
if jsonErr := json.NewDecoder(r.Body).Decode(&topDMs); jsonErr != nil {
return nil, nil, NewAppError("GetTopReactionsForUserSince", "api.unmarshal_error", nil, jsonErr.Error(), http.StatusInternalServerError)
}
return topDMs, BuildResponse(r), nil
}
// Timezone Section
// GetSupportedTimezone returns a page of supported timezones on the system.
@@ -8645,20 +8492,6 @@ func (c *Client4) GetTeamsUsage(ctx context.Context) (*TeamsUsage, *Response, er
return usage, BuildResponse(r), err
}
func (c *Client4) GetNewTeamMembersSince(ctx context.Context, teamID string, timeRange string, page int, perPage int) (*NewTeamMembersList, *Response, error) {
query := fmt.Sprintf("?time_range=%v&page=%v&per_page=%v", timeRange, page, perPage)
r, err := c.DoAPIGet(ctx, c.teamRoute(teamID)+"/top/team_members"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var newTeamMembersList *NewTeamMembersList
if jsonErr := json.NewDecoder(r.Body).Decode(&newTeamMembersList); jsonErr != nil {
return nil, nil, NewAppError("GetNewTeamMembersSince", "api.unmarshal_error", nil, jsonErr.Error(), http.StatusInternalServerError)
}
return newTeamMembersList, BuildResponse(r), nil
}
func (c *Client4) SelfHostedSignupAvailable(ctx context.Context) (*Response, error) {
r, err := c.DoAPIGet(ctx, c.hostedCustomerRoute()+"/signup_available", "")