MM-60640: [Shared Channels] Display remotes' names in Shared With tooltip (#30886)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bd16f4f9bf
Коммит
bd5ca1c07e
@@ -120,7 +120,7 @@ import type {ScheduledPost} from '@mattermost/types/schedule_post';
|
||||
import type {Scheme} from '@mattermost/types/schemes';
|
||||
import type {Session} from '@mattermost/types/sessions';
|
||||
import type {CompleteOnboardingRequest} from '@mattermost/types/setup';
|
||||
import type {SharedChannelRemote} from '@mattermost/types/shared_channels';
|
||||
import type {RemoteClusterInfo, SharedChannelRemote} from '@mattermost/types/shared_channels';
|
||||
import type {
|
||||
GetTeamMembersOpts,
|
||||
Team,
|
||||
@@ -2093,6 +2093,20 @@ export default class Client4 {
|
||||
);
|
||||
};
|
||||
|
||||
getSharedChannelRemoteInfos = (channelId: string) => {
|
||||
return this.doFetch<RemoteClusterInfo[]>(
|
||||
`${this.getBaseRoute()}/sharedchannels/${channelId}/remotes`,
|
||||
{method: 'GET'},
|
||||
);
|
||||
};
|
||||
|
||||
getRemoteClusterInfo = (remoteId: string) => {
|
||||
return this.doFetch<RemoteClusterInfo>(
|
||||
`${this.getBaseRoute()}/sharedchannels/remote_info/${remoteId}`,
|
||||
{method: 'GET'},
|
||||
);
|
||||
};
|
||||
|
||||
sharedChannelRemoteInvite = (remoteId: string, channelId: string) => {
|
||||
return this.doFetch<StatusOK>(
|
||||
`${this.getRemoteClusterRoute(remoteId)}/channels/${channelId}/invite`,
|
||||
|
||||
@@ -16,3 +16,17 @@ export type SharedChannelRemote = {
|
||||
last_post_create_at: number;
|
||||
last_post_create_id: string;
|
||||
}
|
||||
|
||||
// RemoteClusterInfo matches the server-side struct with subset of RemoteCluster fields
|
||||
export type RemoteClusterInfo = {
|
||||
name: string;
|
||||
display_name: string;
|
||||
create_at: number;
|
||||
delete_at: number;
|
||||
last_ping_at: number;
|
||||
};
|
||||
|
||||
export type SharedChannelsState = {
|
||||
remotes: Record<string, RemoteClusterInfo[]>;
|
||||
remotesByRemoteId: Record<string, RemoteClusterInfo>;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import type {Role} from './roles';
|
||||
import type {ScheduledPostsState} from './schedule_post';
|
||||
import type {SchemesState} from './schemes';
|
||||
import type {SearchState} from './search';
|
||||
import type {RemoteClusterInfo} from './shared_channels';
|
||||
import type {TeamsState} from './teams';
|
||||
import type {ThreadsState} from './threads';
|
||||
import type {Typing} from './typing';
|
||||
@@ -77,6 +78,10 @@ export type GlobalState = {
|
||||
hostedCustomer: HostedCustomerState;
|
||||
usage: CloudUsage;
|
||||
scheduledPosts: ScheduledPostsState;
|
||||
sharedChannels?: {
|
||||
remotes?: Record<string, RemoteClusterInfo[]>;
|
||||
remotesByRemoteId?: Record<string, RemoteClusterInfo>;
|
||||
};
|
||||
};
|
||||
errors: any[];
|
||||
requests: {
|
||||
|
||||
Ссылка в новой задаче
Block a user