Remove insights (#23952)
* 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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e37459cd00
Коммит
26617fcbdc
@@ -138,7 +138,6 @@ import {
|
||||
} from '@mattermost/types/data_retention';
|
||||
import {CompleteOnboardingRequest} from '@mattermost/types/setup';
|
||||
import {UserThreadList, UserThread, UserThreadWithPost} from '@mattermost/types/threads';
|
||||
import {LeastActiveChannelsResponse, TopChannelResponse, TopReactionResponse, TopThreadResponse, TopDMsResponse} from '@mattermost/types/insights';
|
||||
|
||||
import {cleanUrlForLogging} from './errors';
|
||||
import {buildQueryString} from './helpers';
|
||||
@@ -2177,74 +2176,6 @@ export default class Client4 {
|
||||
);
|
||||
};
|
||||
|
||||
getTopReactionsForTeam = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<TopReactionResponse>(
|
||||
`${this.getTeamRoute(teamId)}/top/reactions${buildQueryString({page, per_page: perPage, time_range: timeRange})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
|
||||
getMyTopReactions = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<TopReactionResponse>(
|
||||
`${this.getUsersRoute()}/me/top/reactions${buildQueryString({page, per_page: perPage, time_range: timeRange, team_id: teamId})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
|
||||
getTopChannelsForTeam = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<TopChannelResponse>(
|
||||
`${this.getTeamRoute(teamId)}/top/channels${buildQueryString({page, per_page: perPage, time_range: timeRange})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
|
||||
getMyTopChannels = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<TopChannelResponse>(
|
||||
`${this.getUsersRoute()}/me/top/channels${buildQueryString({page, per_page: perPage, time_range: timeRange, team_id: teamId})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
|
||||
getTopThreadsForTeam = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<TopThreadResponse>(
|
||||
`${this.getTeamRoute(teamId)}/top/threads${buildQueryString({page, per_page: perPage, time_range: timeRange})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
|
||||
getMyTopThreads = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<TopThreadResponse>(
|
||||
`${this.getUsersRoute()}/me/top/threads${buildQueryString({page, per_page: perPage, time_range: timeRange, team_id: teamId})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
|
||||
getLeastActiveChannelsForTeam = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<LeastActiveChannelsResponse>(
|
||||
`${this.getTeamRoute(teamId)}/top/inactive_channels${buildQueryString({page, per_page: perPage, time_range: timeRange})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
getMyTopDMs = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<TopDMsResponse>(
|
||||
`${this.getUsersRoute()}/me/top/dms${buildQueryString({page, per_page: perPage, time_range: timeRange, team_id: teamId})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
|
||||
getMyLeastActiveChannels = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<LeastActiveChannelsResponse>(
|
||||
`${this.getUsersRoute()}/me/top/inactive_channels${buildQueryString({page, per_page: perPage, time_range: timeRange, team_id: teamId})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
getNewTeamMembers = (teamId: string, page: number, perPage: number, timeRange: string) => {
|
||||
return this.doFetch<TopDMsResponse>(
|
||||
`${this.getTeamRoute(teamId)}/top/team_members${buildQueryString({page, per_page: perPage, time_range: timeRange})}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
|
||||
searchPostsWithParams = (teamId: string, params: any) => {
|
||||
this.trackEvent('api', 'api_posts_search', {team_id: teamId});
|
||||
|
||||
|
||||
@@ -131,7 +131,6 @@ export type ClientConfig = {
|
||||
IosAppDownloadLink: string;
|
||||
IosLatestVersion: string;
|
||||
IosMinVersion: string;
|
||||
InsightsEnabled: string;
|
||||
InstallationDate: string;
|
||||
IsDefaultMarketplace: string;
|
||||
LdapFirstNameAttributeSet: string;
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {ChannelType} from './channels';
|
||||
import {Post} from './posts';
|
||||
import {UserProfile} from './users';
|
||||
|
||||
export enum InsightsWidgetTypes {
|
||||
TOP_CHANNELS = 'TOP_CHANNELS',
|
||||
TOP_REACTIONS = 'TOP_REACTIONS',
|
||||
TOP_THREADS = 'TOP_THREADS',
|
||||
TOP_BOARDS = 'TOP_BOARDS',
|
||||
LEAST_ACTIVE_CHANNELS = 'LEAST_ACTIVE_CHANNELS',
|
||||
TOP_PLAYBOOKS = 'TOP_PLAYBOOKS',
|
||||
TOP_DMS = 'TOP_DMS',
|
||||
NEW_TEAM_MEMBERS = 'NEW_TEAM_MEMBERS',
|
||||
}
|
||||
|
||||
export enum CardSizes {
|
||||
large = 'lg',
|
||||
medium = 'md',
|
||||
small = 'sm',
|
||||
}
|
||||
export type CardSize = CardSizes;
|
||||
|
||||
export enum TimeFrames {
|
||||
INSIGHTS_1_DAY = 'today',
|
||||
INSIGHTS_7_DAYS = '7_day',
|
||||
INSIGHTS_28_DAYS = '28_day',
|
||||
}
|
||||
|
||||
export type TimeFrame = TimeFrames;
|
||||
|
||||
export type TopReaction = {
|
||||
emoji_name: string;
|
||||
count: number;
|
||||
}
|
||||
|
||||
export type TopReactionResponse = {
|
||||
has_next: boolean;
|
||||
items: TopReaction[];
|
||||
timeFrame?: TimeFrame;
|
||||
}
|
||||
|
||||
export type TopChannel = {
|
||||
id: string;
|
||||
type: ChannelType;
|
||||
display_name: string;
|
||||
name: string;
|
||||
team_id: string;
|
||||
message_count: number;
|
||||
}
|
||||
|
||||
export type TopChannelGraphData = Record<string, Record<string, number>>;
|
||||
|
||||
export type TopChannelResponse = {
|
||||
has_next: boolean;
|
||||
items: TopChannel[];
|
||||
daily_channel_post_counts: TopChannelGraphData;
|
||||
};
|
||||
|
||||
export type InsightsState = {
|
||||
topReactions: Record<string, Record<TimeFrame, Record<string, TopReaction>>>;
|
||||
myTopReactions: Record<string, Record<TimeFrame, Record<string, TopReaction>>>;
|
||||
}
|
||||
|
||||
export type TopChannelActionResult = {
|
||||
data?: TopChannelResponse;
|
||||
error?: any;
|
||||
};
|
||||
|
||||
export type TopThread = {
|
||||
channel_id: string;
|
||||
channel_display_name: string;
|
||||
channel_name: string;
|
||||
participants: string[];
|
||||
user_information: {
|
||||
id: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
last_picture_update: number;
|
||||
};
|
||||
post: Post;
|
||||
};
|
||||
|
||||
export type TopThreadResponse = {
|
||||
has_next: boolean;
|
||||
items: TopThread[];
|
||||
};
|
||||
|
||||
export type TopThreadActionResult = {
|
||||
data?: TopThreadResponse;
|
||||
error?: any;
|
||||
};
|
||||
|
||||
export type TopBoard = {
|
||||
boardID: string;
|
||||
icon: string;
|
||||
title: string;
|
||||
activityCount: number;
|
||||
|
||||
// MM-49023: community bugfix to maintain backwards compatibility
|
||||
activeUsers: Array<UserProfile['id']> | string;
|
||||
createdBy: string;
|
||||
};
|
||||
|
||||
export type TopBoardResponse = {
|
||||
has_next: boolean;
|
||||
items: TopBoard[];
|
||||
};
|
||||
|
||||
export type LeastActiveChannel = {
|
||||
id: string;
|
||||
display_name: string;
|
||||
name: string;
|
||||
participants: string[];
|
||||
last_activity_at: number;
|
||||
type: ChannelType;
|
||||
team_id: string;
|
||||
message_count: number;
|
||||
};
|
||||
|
||||
export type LeastActiveChannelsResponse = {
|
||||
has_next: boolean;
|
||||
items: LeastActiveChannel[];
|
||||
};
|
||||
|
||||
export type LeastActiveChannelsActionResult = {
|
||||
data?: LeastActiveChannelsResponse;
|
||||
error?: any;
|
||||
};
|
||||
export type TopPlaybook = {
|
||||
playbook_id: string;
|
||||
num_runs: number;
|
||||
title: string;
|
||||
last_run_at: number;
|
||||
};
|
||||
|
||||
export type TopPlaybookResponse = {
|
||||
has_next: boolean;
|
||||
items: TopPlaybook[];
|
||||
};
|
||||
|
||||
type MinUserProfile = {
|
||||
id: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
last_picture_update: number;
|
||||
nickname: string;
|
||||
position: string;
|
||||
username: string;
|
||||
};
|
||||
|
||||
export type TopDM = {
|
||||
outgoing_message_count: number;
|
||||
post_count: number;
|
||||
second_participant: MinUserProfile;
|
||||
};
|
||||
|
||||
export type TopDMsResponse = {
|
||||
has_next: boolean;
|
||||
items: TopDM[];
|
||||
};
|
||||
|
||||
export type TopDMsActionResult = {
|
||||
data?: TopDMsResponse;
|
||||
error?: any;
|
||||
};
|
||||
|
||||
export type NewMember = MinUserProfile & {
|
||||
create_at: number;
|
||||
};
|
||||
|
||||
export type NewMembersResponse = {
|
||||
has_next: boolean;
|
||||
items: NewMember[];
|
||||
total_count: number;
|
||||
};
|
||||
|
||||
export type NewMembersActionResult = {
|
||||
data?: NewMembersResponse;
|
||||
error?: any;
|
||||
};
|
||||
@@ -29,7 +29,6 @@ import {ThreadsState} from './threads';
|
||||
import {Typing} from './typing';
|
||||
import {UsersState} from './users';
|
||||
import {AppsState} from './apps';
|
||||
import {InsightsState} from './insights';
|
||||
import {GifsState} from './gifs';
|
||||
|
||||
export type GlobalState = {
|
||||
@@ -69,7 +68,6 @@ export type GlobalState = {
|
||||
cloud: CloudState;
|
||||
hostedCustomer: HostedCustomerState;
|
||||
usage: CloudUsage;
|
||||
insights: InsightsState;
|
||||
};
|
||||
errors: any[];
|
||||
requests: {
|
||||
|
||||
Ссылка в новой задаче
Block a user