2022-05-02 23:13:39 +00:00
|
|
|
/* eslint-disable complexity */
|
2022-03-02 14:49:43 +00:00
|
|
|
import { Q } from '@nozbe/watermelondb';
|
2022-06-27 19:03:24 +00:00
|
|
|
import { StackNavigationOptions, StackNavigationProp } from '@react-navigation/stack';
|
2022-03-02 14:49:43 +00:00
|
|
|
import isEmpty from 'lodash/isEmpty';
|
2018-02-19 21:19:39 +00:00
|
|
|
import React from 'react';
|
2021-09-13 20:41:05 +00:00
|
|
|
import { Share, Switch, Text, View } from 'react-native';
|
2019-01-31 16:08:38 +00:00
|
|
|
import { connect } from 'react-redux';
|
2022-03-02 14:49:43 +00:00
|
|
|
import { Observable, Subscription } from 'rxjs';
|
2022-06-27 19:03:24 +00:00
|
|
|
import { CompositeNavigationProp } from '@react-navigation/native';
|
2018-02-19 21:19:39 +00:00
|
|
|
|
2022-06-27 19:03:24 +00:00
|
|
|
import { leaveRoom } from '../../actions/room';
|
2022-03-02 14:49:43 +00:00
|
|
|
import { setLoading } from '../../actions/selectedUsers';
|
|
|
|
import Avatar from '../../containers/Avatar';
|
2020-10-30 16:15:58 +00:00
|
|
|
import * as HeaderButton from '../../containers/HeaderButton';
|
2022-03-02 14:49:43 +00:00
|
|
|
import * as List from '../../containers/List';
|
2022-02-17 15:27:01 +00:00
|
|
|
import { MarkdownPreview } from '../../containers/markdown';
|
2022-03-02 14:49:43 +00:00
|
|
|
import RoomTypeIcon from '../../containers/RoomTypeIcon';
|
2020-06-15 14:00:46 +00:00
|
|
|
import SafeAreaView from '../../containers/SafeAreaView';
|
2022-03-02 14:49:43 +00:00
|
|
|
import Status from '../../containers/Status';
|
|
|
|
import StatusBar from '../../containers/StatusBar';
|
2022-05-02 12:40:19 +00:00
|
|
|
import { IApplicationState, IBaseScreen, ISubscription, IUser, SubscriptionType, TSubscriptionModel } from '../../definitions';
|
2022-03-02 14:49:43 +00:00
|
|
|
import { withDimensions } from '../../dimensions';
|
|
|
|
import I18n from '../../i18n';
|
|
|
|
import database from '../../lib/database';
|
2020-09-11 14:31:38 +00:00
|
|
|
import protectedFunction from '../../lib/methods/helpers/protectedFunction';
|
2022-03-02 14:49:43 +00:00
|
|
|
import { getUserSelector } from '../../selectors/login';
|
|
|
|
import { ChatsStackParamList } from '../../stacks/types';
|
|
|
|
import { withTheme } from '../../theme';
|
2022-06-06 14:17:51 +00:00
|
|
|
import { showConfirmationAlert, showErrorAlert } from '../../lib/methods/helpers/info';
|
|
|
|
import log, { events, logEvent } from '../../lib/methods/helpers/log';
|
|
|
|
import Touch from '../../lib/methods/helpers/touch';
|
2022-03-02 14:49:43 +00:00
|
|
|
import sharedStyles from '../Styles';
|
2021-09-13 20:41:05 +00:00
|
|
|
import styles from './styles';
|
2022-03-02 14:49:43 +00:00
|
|
|
import { ERoomType } from '../../definitions/ERoomType';
|
2022-04-07 14:10:03 +00:00
|
|
|
import { E2E_ROOM_TYPES, SWITCH_TRACK_COLOR, themes } from '../../lib/constants';
|
2022-06-06 14:17:51 +00:00
|
|
|
import { callJitsi, getPermalinkChannel } from '../../lib/methods';
|
2022-04-28 20:37:25 +00:00
|
|
|
import {
|
|
|
|
canAutoTranslate as canAutoTranslateMethod,
|
|
|
|
getRoomAvatar,
|
|
|
|
getRoomTitle,
|
|
|
|
getUidDirectMessage,
|
|
|
|
hasPermission,
|
2022-06-06 14:17:51 +00:00
|
|
|
isGroupChat,
|
|
|
|
compareServerVersion
|
|
|
|
} from '../../lib/methods/helpers';
|
2022-04-28 20:37:25 +00:00
|
|
|
import { Services } from '../../lib/services';
|
2022-04-18 19:35:50 +00:00
|
|
|
import { getSubscriptionByRoomId } from '../../lib/database/services/Subscription';
|
2022-06-27 19:03:24 +00:00
|
|
|
import { IActionSheetProvider, withActionSheet } from '../../containers/ActionSheet';
|
|
|
|
import CloseLivechatSheet from '../../ee/omnichannel/containers/CloseLivechatSheet';
|
|
|
|
import { MasterDetailInsideStackParamList } from '../../stacks/MasterDetailStack/types';
|
|
|
|
import { closeLivechat } from '../../lib/methods/helpers/closeLivechat';
|
2022-06-27 18:04:20 +00:00
|
|
|
import { videoConfStartAndJoin } from '../../lib/methods/videoConf';
|
2022-03-02 14:49:43 +00:00
|
|
|
|
2022-05-02 23:13:39 +00:00
|
|
|
interface IOnPressTouch {
|
|
|
|
<T extends keyof ChatsStackParamList>(item: { route?: T; params?: ChatsStackParamList[T]; event?: Function }): void;
|
|
|
|
}
|
|
|
|
|
2022-06-27 19:03:24 +00:00
|
|
|
interface IRoomActionsViewProps extends IActionSheetProvider, IBaseScreen<ChatsStackParamList, 'RoomActionsView'> {
|
2022-03-02 14:49:43 +00:00
|
|
|
userId: string;
|
|
|
|
jitsiEnabled: boolean;
|
|
|
|
jitsiEnableTeams: boolean;
|
|
|
|
jitsiEnableChannels: boolean;
|
|
|
|
encryptionEnabled: boolean;
|
|
|
|
fontScale: number;
|
|
|
|
serverVersion: string | null;
|
|
|
|
addUserToJoinedRoomPermission?: string[];
|
|
|
|
addUserToAnyCRoomPermission?: string[];
|
|
|
|
addUserToAnyPRoomPermission?: string[];
|
|
|
|
createInviteLinksPermission?: string[];
|
|
|
|
editRoomPermission?: string[];
|
|
|
|
toggleRoomE2EEncryptionPermission?: string[];
|
|
|
|
viewBroadcastMemberListPermission?: string[];
|
|
|
|
createTeamPermission?: string[];
|
|
|
|
addTeamChannelPermission?: string[];
|
|
|
|
convertTeamPermission?: string[];
|
|
|
|
viewCannedResponsesPermission?: string[];
|
2022-06-27 19:03:24 +00:00
|
|
|
livechatAllowManualOnHold?: boolean;
|
|
|
|
livechatRequestComment?: boolean;
|
|
|
|
navigation: CompositeNavigationProp<
|
|
|
|
StackNavigationProp<ChatsStackParamList, 'RoomActionsView'>,
|
|
|
|
StackNavigationProp<MasterDetailInsideStackParamList>
|
|
|
|
>;
|
2022-06-27 18:04:20 +00:00
|
|
|
videoConf_Enable_DMs: boolean;
|
|
|
|
videoConf_Enable_Channels: boolean;
|
|
|
|
videoConf_Enable_Groups: boolean;
|
|
|
|
videoConf_Enable_Teams: boolean;
|
2022-03-02 14:49:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface IRoomActionsViewState {
|
|
|
|
room: TSubscriptionModel;
|
|
|
|
membersCount: number;
|
|
|
|
member: Partial<IUser>;
|
|
|
|
joined: boolean;
|
|
|
|
canViewMembers: boolean;
|
|
|
|
canAutoTranslate: boolean;
|
|
|
|
canAddUser: boolean;
|
|
|
|
canInviteUser: boolean;
|
|
|
|
canEdit: boolean;
|
|
|
|
canToggleEncryption: boolean;
|
|
|
|
canCreateTeam: boolean;
|
|
|
|
canAddChannelToTeam: boolean;
|
|
|
|
canConvertTeam: boolean;
|
|
|
|
}
|
2018-04-24 19:34:03 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
class RoomActionsView extends React.Component<IRoomActionsViewProps, IRoomActionsViewState> {
|
|
|
|
private mounted: boolean;
|
|
|
|
private rid: string;
|
|
|
|
private t: string;
|
|
|
|
private joined: boolean;
|
2022-06-09 14:42:12 +00:00
|
|
|
private omnichannelPermissions?: {
|
|
|
|
canForwardGuest: boolean;
|
|
|
|
canReturnQueue: boolean;
|
|
|
|
canViewCannedResponse: boolean;
|
|
|
|
canPlaceLivechatOnHold: boolean;
|
|
|
|
};
|
2022-03-02 14:49:43 +00:00
|
|
|
private roomObservable?: Observable<TSubscriptionModel>;
|
|
|
|
private subscription?: Subscription;
|
|
|
|
|
|
|
|
static navigationOptions = ({
|
|
|
|
navigation,
|
|
|
|
isMasterDetail
|
|
|
|
}: Pick<IRoomActionsViewProps, 'navigation' | 'isMasterDetail'>): StackNavigationOptions => {
|
|
|
|
const options: StackNavigationOptions = {
|
2019-11-25 20:01:17 +00:00
|
|
|
title: I18n.t('Actions')
|
|
|
|
};
|
2020-06-15 14:00:46 +00:00
|
|
|
if (isMasterDetail) {
|
2020-10-30 16:15:58 +00:00
|
|
|
options.headerLeft = () => <HeaderButton.CloseModal navigation={navigation} testID='room-actions-view-close' />;
|
2019-11-25 20:01:17 +00:00
|
|
|
}
|
|
|
|
return options;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-10-23 21:39:48 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
constructor(props: IRoomActionsViewProps) {
|
2019-05-28 13:03:08 +00:00
|
|
|
super(props);
|
2019-09-16 20:26:32 +00:00
|
|
|
this.mounted = false;
|
2020-06-15 14:00:46 +00:00
|
|
|
const room = props.route.params?.room;
|
|
|
|
const member = props.route.params?.member;
|
|
|
|
this.rid = props.route.params?.rid;
|
|
|
|
this.t = props.route.params?.t;
|
2021-09-28 19:33:25 +00:00
|
|
|
this.joined = props.route.params?.joined;
|
2022-06-09 14:42:12 +00:00
|
|
|
this.omnichannelPermissions = props.route.params?.omnichannelPermissions;
|
2018-02-19 21:19:39 +00:00
|
|
|
this.state = {
|
2022-03-08 13:46:33 +00:00
|
|
|
room: room || { rid: this.rid, t: this.t },
|
2018-12-05 20:52:08 +00:00
|
|
|
membersCount: 0,
|
2020-03-30 20:19:01 +00:00
|
|
|
member: member || {},
|
2019-09-16 20:26:32 +00:00
|
|
|
joined: !!room,
|
2019-06-28 17:02:30 +00:00
|
|
|
canViewMembers: false,
|
2019-09-16 20:26:32 +00:00
|
|
|
canAutoTranslate: false,
|
2020-01-28 13:22:35 +00:00
|
|
|
canAddUser: false,
|
2020-05-08 17:36:10 +00:00
|
|
|
canInviteUser: false,
|
2021-01-20 17:34:01 +00:00
|
|
|
canEdit: false,
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
canToggleEncryption: false,
|
|
|
|
canCreateTeam: false,
|
2021-07-09 18:46:24 +00:00
|
|
|
canAddChannelToTeam: false,
|
2022-06-09 14:42:12 +00:00
|
|
|
canConvertTeam: false
|
2018-02-19 21:19:39 +00:00
|
|
|
};
|
2019-12-18 21:13:11 +00:00
|
|
|
if (room && room.observe && room.rid) {
|
2019-09-17 14:43:49 +00:00
|
|
|
this.roomObservable = room.observe();
|
2021-09-13 20:41:05 +00:00
|
|
|
this.subscription = this.roomObservable.subscribe(changes => {
|
|
|
|
if (this.mounted) {
|
2022-06-09 14:42:12 +00:00
|
|
|
this.setState({ room: changes });
|
2021-09-13 20:41:05 +00:00
|
|
|
} else {
|
2022-03-02 14:49:43 +00:00
|
|
|
// @ts-ignore
|
2021-09-13 20:41:05 +00:00
|
|
|
this.state.room = changes;
|
|
|
|
}
|
|
|
|
});
|
2019-09-17 14:43:49 +00:00
|
|
|
}
|
2018-02-19 21:19:39 +00:00
|
|
|
}
|
|
|
|
|
2018-03-23 16:49:51 +00:00
|
|
|
async componentDidMount() {
|
2019-09-16 20:26:32 +00:00
|
|
|
this.mounted = true;
|
2020-03-30 20:19:01 +00:00
|
|
|
const { room, member } = this.state;
|
2020-04-30 18:11:34 +00:00
|
|
|
if (room.rid) {
|
2022-04-18 19:35:50 +00:00
|
|
|
if (!room.id) {
|
|
|
|
if (room.t === SubscriptionType.OMNICHANNEL) {
|
|
|
|
if (!this.isOmnichannelPreview) {
|
|
|
|
const result = await getSubscriptionByRoomId(room.rid);
|
|
|
|
if (result) {
|
|
|
|
this.setState({ room: result });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
try {
|
2022-04-28 20:37:25 +00:00
|
|
|
const result = await Services.getChannelInfo(room.rid);
|
2022-04-18 19:35:50 +00:00
|
|
|
if (result.success) {
|
|
|
|
// @ts-ignore
|
|
|
|
this.setState({ room: { ...result.channel, rid: result.channel._id } });
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
2020-04-30 18:11:34 +00:00
|
|
|
}
|
2019-04-08 12:35:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-02 23:13:39 +00:00
|
|
|
if (room && room.t !== 'd' && (await this.canViewMembers())) {
|
2020-04-30 18:11:34 +00:00
|
|
|
try {
|
2022-04-28 20:37:25 +00:00
|
|
|
const counters = await Services.getRoomCounters(room.rid, room.t as any);
|
2020-04-30 18:11:34 +00:00
|
|
|
if (counters.success) {
|
|
|
|
this.setState({ membersCount: counters.members, joined: counters.joined });
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
2018-12-05 20:52:08 +00:00
|
|
|
}
|
2021-02-01 17:18:55 +00:00
|
|
|
} else if (room.t === 'd' && isEmpty(member)) {
|
2020-04-30 18:11:34 +00:00
|
|
|
this.updateRoomMember();
|
2018-12-05 20:52:08 +00:00
|
|
|
}
|
2019-06-28 17:02:30 +00:00
|
|
|
|
2022-04-28 20:37:25 +00:00
|
|
|
const canAutoTranslate = canAutoTranslateMethod();
|
2021-03-18 17:33:20 +00:00
|
|
|
const canAddUser = await this.canAddUser();
|
|
|
|
const canInviteUser = await this.canInviteUser();
|
|
|
|
const canEdit = await this.canEdit();
|
|
|
|
const canToggleEncryption = await this.canToggleEncryption();
|
|
|
|
const canViewMembers = await this.canViewMembers();
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
const canCreateTeam = await this.canCreateTeam();
|
|
|
|
const canAddChannelToTeam = await this.canAddChannelToTeam();
|
2021-07-09 18:46:24 +00:00
|
|
|
const canConvertTeam = await this.canConvertTeam();
|
2021-03-18 17:33:20 +00:00
|
|
|
|
|
|
|
this.setState({
|
2021-09-13 20:41:05 +00:00
|
|
|
canAutoTranslate,
|
|
|
|
canAddUser,
|
|
|
|
canInviteUser,
|
|
|
|
canEdit,
|
|
|
|
canToggleEncryption,
|
|
|
|
canViewMembers,
|
|
|
|
canCreateTeam,
|
|
|
|
canAddChannelToTeam,
|
|
|
|
canConvertTeam
|
2021-03-18 17:33:20 +00:00
|
|
|
});
|
2022-04-20 20:53:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-23 16:49:51 +00:00
|
|
|
componentWillUnmount() {
|
2019-09-16 20:26:32 +00:00
|
|
|
if (this.subscription && this.subscription.unsubscribe) {
|
|
|
|
this.subscription.unsubscribe();
|
|
|
|
}
|
2018-03-23 16:49:51 +00:00
|
|
|
}
|
|
|
|
|
2020-07-31 18:22:30 +00:00
|
|
|
get isOmnichannelPreview() {
|
|
|
|
const { room } = this.state;
|
2021-09-28 19:33:25 +00:00
|
|
|
return room.t === 'l' && room.status === 'queued' && !this.joined;
|
2020-07-31 18:22:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-02 23:13:39 +00:00
|
|
|
onPressTouchable: IOnPressTouch = (item: {
|
|
|
|
route?: keyof ChatsStackParamList;
|
|
|
|
params?: ChatsStackParamList[keyof ChatsStackParamList];
|
|
|
|
event?: Function;
|
|
|
|
}) => {
|
2020-08-05 13:15:56 +00:00
|
|
|
const { route, event, params } = item;
|
|
|
|
if (route) {
|
2022-03-02 14:49:43 +00:00
|
|
|
/**
|
|
|
|
* TODO: params can vary too much and ts is going to be happy
|
|
|
|
* Instead of playing with this, we should think on a better `logEvent` function
|
|
|
|
*/
|
|
|
|
// @ts-ignore
|
2021-09-13 20:41:05 +00:00
|
|
|
logEvent(events[`RA_GO_${route.replace('View', '').toUpperCase()}${params.name ? params.name.toUpperCase() : ''}`]);
|
2019-03-12 16:23:06 +00:00
|
|
|
const { navigation } = this.props;
|
2020-08-05 13:15:56 +00:00
|
|
|
navigation.navigate(route, params);
|
2018-03-23 16:49:51 +00:00
|
|
|
}
|
2020-08-05 13:15:56 +00:00
|
|
|
if (event) {
|
|
|
|
return event();
|
2018-03-23 16:49:51 +00:00
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-03-23 16:49:51 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
canAddUser = async () => {
|
2018-12-05 20:52:08 +00:00
|
|
|
const { room, joined } = this.state;
|
2021-02-25 16:41:44 +00:00
|
|
|
const { addUserToJoinedRoomPermission, addUserToAnyCRoomPermission, addUserToAnyPRoomPermission } = this.props;
|
2018-10-16 20:30:04 +00:00
|
|
|
const { rid, t } = room;
|
2021-02-25 16:41:44 +00:00
|
|
|
let canAddUser = false;
|
2018-09-25 19:28:42 +00:00
|
|
|
|
2018-12-05 20:52:08 +00:00
|
|
|
const userInRoom = joined;
|
2022-04-28 20:37:25 +00:00
|
|
|
const permissions = await hasPermission(
|
2021-09-13 20:41:05 +00:00
|
|
|
[addUserToJoinedRoomPermission, addUserToAnyCRoomPermission, addUserToAnyPRoomPermission],
|
|
|
|
rid
|
|
|
|
);
|
2018-04-24 19:34:03 +00:00
|
|
|
|
2021-02-25 16:41:44 +00:00
|
|
|
if (userInRoom && permissions[0]) {
|
|
|
|
canAddUser = true;
|
|
|
|
}
|
|
|
|
if (t === 'c' && permissions[1]) {
|
|
|
|
canAddUser = true;
|
2018-04-24 19:34:03 +00:00
|
|
|
}
|
2021-02-25 16:41:44 +00:00
|
|
|
if (t === 'p' && permissions[2]) {
|
|
|
|
canAddUser = true;
|
|
|
|
}
|
2021-03-18 17:33:20 +00:00
|
|
|
return canAddUser;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-09-25 19:28:42 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
canInviteUser = async () => {
|
2020-01-28 13:22:35 +00:00
|
|
|
const { room } = this.state;
|
2021-02-25 16:41:44 +00:00
|
|
|
const { createInviteLinksPermission } = this.props;
|
2020-01-28 13:22:35 +00:00
|
|
|
const { rid } = room;
|
2022-04-28 20:37:25 +00:00
|
|
|
const permissions = await hasPermission([createInviteLinksPermission], rid);
|
2020-01-28 13:22:35 +00:00
|
|
|
|
2021-02-25 16:41:44 +00:00
|
|
|
const canInviteUser = permissions[0];
|
2021-03-18 17:33:20 +00:00
|
|
|
return canInviteUser;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-01-28 13:22:35 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
canEdit = async () => {
|
2020-09-11 14:31:38 +00:00
|
|
|
const { room } = this.state;
|
2021-02-25 16:41:44 +00:00
|
|
|
const { editRoomPermission } = this.props;
|
2020-09-11 14:31:38 +00:00
|
|
|
const { rid } = room;
|
2022-04-28 20:37:25 +00:00
|
|
|
const permissions = await hasPermission([editRoomPermission], rid);
|
2020-09-11 14:31:38 +00:00
|
|
|
|
2021-02-25 16:41:44 +00:00
|
|
|
const canEdit = permissions[0];
|
2021-03-18 17:33:20 +00:00
|
|
|
return canEdit;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-09-11 14:31:38 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
canCreateTeam = async () => {
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
const { room } = this.state;
|
|
|
|
const { createTeamPermission } = this.props;
|
|
|
|
const { rid } = room;
|
2022-04-28 20:37:25 +00:00
|
|
|
const permissions = await hasPermission([createTeamPermission], rid);
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
|
|
|
const canCreateTeam = permissions[0];
|
|
|
|
return canCreateTeam;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
canAddChannelToTeam = async () => {
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
const { room } = this.state;
|
|
|
|
const { addTeamChannelPermission } = this.props;
|
|
|
|
const { rid } = room;
|
2022-04-28 20:37:25 +00:00
|
|
|
const permissions = await hasPermission([addTeamChannelPermission], rid);
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
|
|
|
const canAddChannelToTeam = permissions[0];
|
|
|
|
return canAddChannelToTeam;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
canConvertTeam = async () => {
|
2021-07-09 18:46:24 +00:00
|
|
|
const { room } = this.state;
|
|
|
|
const { convertTeamPermission } = this.props;
|
|
|
|
const { rid } = room;
|
2022-04-28 20:37:25 +00:00
|
|
|
const permissions = await hasPermission([convertTeamPermission], rid);
|
2021-07-09 18:46:24 +00:00
|
|
|
|
|
|
|
const canConvertTeam = permissions[0];
|
|
|
|
return canConvertTeam;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-07-09 18:46:24 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
canToggleEncryption = async () => {
|
2021-01-20 17:34:01 +00:00
|
|
|
const { room } = this.state;
|
2021-02-25 16:41:44 +00:00
|
|
|
const { toggleRoomE2EEncryptionPermission } = this.props;
|
2021-01-20 17:34:01 +00:00
|
|
|
const { rid } = room;
|
2022-04-28 20:37:25 +00:00
|
|
|
const permissions = await hasPermission([toggleRoomE2EEncryptionPermission], rid);
|
2021-01-20 17:34:01 +00:00
|
|
|
|
2021-02-25 16:41:44 +00:00
|
|
|
const canToggleEncryption = permissions[0];
|
2021-03-18 17:33:20 +00:00
|
|
|
return canToggleEncryption;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-01-20 17:34:01 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
canViewMembers = async () => {
|
2018-09-25 19:28:42 +00:00
|
|
|
const { room } = this.state;
|
2021-02-25 16:41:44 +00:00
|
|
|
const { viewBroadcastMemberListPermission } = this.props;
|
2018-09-25 19:28:42 +00:00
|
|
|
const { rid, t, broadcast } = room;
|
2018-05-24 20:17:45 +00:00
|
|
|
if (broadcast) {
|
2022-04-28 20:37:25 +00:00
|
|
|
const permissions = await hasPermission([viewBroadcastMemberListPermission], rid);
|
2021-02-25 16:41:44 +00:00
|
|
|
if (!permissions[0]) {
|
2018-05-24 20:17:45 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2018-12-05 20:52:08 +00:00
|
|
|
|
|
|
|
// This method is executed only in componentDidMount and returns a value
|
|
|
|
// We save the state to read in render
|
2021-09-13 20:41:05 +00:00
|
|
|
const result = t === 'c' || t === 'p';
|
2018-12-05 20:52:08 +00:00
|
|
|
return result;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-09-25 19:28:42 +00:00
|
|
|
|
2020-09-11 14:31:38 +00:00
|
|
|
renderEncryptedSwitch = () => {
|
2021-01-20 17:34:01 +00:00
|
|
|
const { room, canToggleEncryption, canEdit } = this.state;
|
2020-09-11 14:31:38 +00:00
|
|
|
const { encrypted } = room;
|
2021-01-20 17:34:01 +00:00
|
|
|
const { serverVersion } = this.props;
|
|
|
|
let hasPermission = false;
|
2022-02-07 18:44:04 +00:00
|
|
|
if (compareServerVersion(serverVersion, 'lowerThan', '3.11.0')) {
|
2021-01-20 17:34:01 +00:00
|
|
|
hasPermission = canEdit;
|
|
|
|
} else {
|
|
|
|
hasPermission = canToggleEncryption;
|
|
|
|
}
|
2020-09-11 14:31:38 +00:00
|
|
|
return (
|
2021-09-13 20:41:05 +00:00
|
|
|
<Switch value={encrypted} trackColor={SWITCH_TRACK_COLOR} onValueChange={this.toggleEncrypted} disabled={!hasPermission} />
|
2020-09-11 14:31:38 +00:00
|
|
|
);
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-09-11 14:31:38 +00:00
|
|
|
|
2020-05-08 17:36:10 +00:00
|
|
|
closeLivechat = () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
const {
|
|
|
|
room: { rid }
|
|
|
|
} = this.state;
|
2022-06-27 19:03:24 +00:00
|
|
|
const { livechatRequestComment, showActionSheet, hideActionSheet, isMasterDetail } = this.props;
|
|
|
|
|
|
|
|
if (!livechatRequestComment) {
|
|
|
|
const comment = I18n.t('Chat_closed_by_agent');
|
|
|
|
return closeLivechat({ rid, isMasterDetail, comment });
|
|
|
|
}
|
2020-05-08 17:36:10 +00:00
|
|
|
|
2022-06-27 19:03:24 +00:00
|
|
|
showActionSheet({
|
|
|
|
children: (
|
|
|
|
<CloseLivechatSheet
|
|
|
|
onSubmit={(comment: string) => {
|
|
|
|
hideActionSheet();
|
|
|
|
closeLivechat({ rid, isMasterDetail, comment });
|
|
|
|
}}
|
|
|
|
onCancel={() => hideActionSheet()}
|
|
|
|
/>
|
|
|
|
),
|
|
|
|
headerHeight: 225
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-05-08 17:36:10 +00:00
|
|
|
|
2022-04-20 20:53:11 +00:00
|
|
|
placeOnHoldLivechat = () => {
|
|
|
|
const { navigation } = this.props;
|
|
|
|
const { room } = this.state;
|
|
|
|
showConfirmationAlert({
|
|
|
|
title: I18n.t('Are_you_sure_question_mark'),
|
|
|
|
message: I18n.t('Would_like_to_place_on_hold'),
|
|
|
|
confirmationText: I18n.t('Yes'),
|
|
|
|
onPress: async () => {
|
|
|
|
try {
|
2022-04-28 20:37:25 +00:00
|
|
|
await Services.onHoldLivechat(room.rid);
|
2022-04-20 20:53:11 +00:00
|
|
|
navigation.navigate('RoomsListView');
|
|
|
|
} catch (e: any) {
|
|
|
|
showErrorAlert(e.data?.error, I18n.t('Oops'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2020-05-08 17:36:10 +00:00
|
|
|
returnLivechat = () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
const {
|
|
|
|
room: { rid }
|
|
|
|
} = this.state;
|
2020-05-08 17:36:10 +00:00
|
|
|
showConfirmationAlert({
|
|
|
|
message: I18n.t('Would_you_like_to_return_the_inquiry'),
|
2020-08-25 20:04:18 +00:00
|
|
|
confirmationText: I18n.t('Yes'),
|
2021-09-13 20:41:05 +00:00
|
|
|
onPress: async () => {
|
2020-05-08 17:36:10 +00:00
|
|
|
try {
|
2022-04-28 20:37:25 +00:00
|
|
|
await Services.returnLivechat(rid);
|
2022-03-02 14:49:43 +00:00
|
|
|
} catch (e: any) {
|
2020-05-08 17:36:10 +00:00
|
|
|
showErrorAlert(e.reason, I18n.t('Oops'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-05-08 17:36:10 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
updateRoomMember = async () => {
|
2018-12-12 15:15:10 +00:00
|
|
|
const { room } = this.state;
|
|
|
|
|
|
|
|
try {
|
2022-04-28 20:37:25 +00:00
|
|
|
if (!isGroupChat(room)) {
|
|
|
|
const roomUserId = getUidDirectMessage(room);
|
|
|
|
const result = await Services.getUserInfo(roomUserId);
|
2020-04-01 12:28:54 +00:00
|
|
|
if (result.success) {
|
2022-03-02 14:49:43 +00:00
|
|
|
this.setState({ member: result.user as any });
|
2020-04-01 12:28:54 +00:00
|
|
|
}
|
2019-04-29 16:03:52 +00:00
|
|
|
}
|
2018-12-12 15:15:10 +00:00
|
|
|
} catch (e) {
|
2019-08-23 13:18:47 +00:00
|
|
|
log(e);
|
2018-12-21 10:55:35 +00:00
|
|
|
this.setState({ member: {} });
|
2018-12-12 15:15:10 +00:00
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-12-12 15:15:10 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
addUser = async () => {
|
2020-04-01 12:28:54 +00:00
|
|
|
const { room } = this.state;
|
2022-02-18 13:46:19 +00:00
|
|
|
const { dispatch, navigation } = this.props;
|
2020-04-01 12:28:54 +00:00
|
|
|
const { rid } = room;
|
|
|
|
try {
|
2022-02-18 13:46:19 +00:00
|
|
|
dispatch(setLoading(true));
|
2022-04-28 20:37:25 +00:00
|
|
|
await Services.addUsersToRoom(rid);
|
2020-04-01 12:28:54 +00:00
|
|
|
navigation.pop();
|
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
|
|
|
} finally {
|
2022-02-18 13:46:19 +00:00
|
|
|
dispatch(setLoading(false));
|
2020-04-01 12:28:54 +00:00
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-04-01 12:28:54 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
toggleBlockUser = async () => {
|
2020-08-05 13:15:56 +00:00
|
|
|
logEvent(events.RA_TOGGLE_BLOCK_USER);
|
2018-09-25 19:28:42 +00:00
|
|
|
const { room } = this.state;
|
|
|
|
const { rid, blocker } = room;
|
2018-03-29 17:55:37 +00:00
|
|
|
const { member } = this.state;
|
2018-05-18 17:55:08 +00:00
|
|
|
try {
|
2022-04-28 20:37:25 +00:00
|
|
|
await Services.toggleBlockUser(rid, member._id as string, !blocker);
|
2018-05-18 17:55:08 +00:00
|
|
|
} catch (e) {
|
2020-08-05 13:15:56 +00:00
|
|
|
logEvent(events.RA_TOGGLE_BLOCK_USER_F);
|
2019-08-23 13:18:47 +00:00
|
|
|
log(e);
|
2018-05-18 17:55:08 +00:00
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-03-23 16:49:51 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
toggleEncrypted = async () => {
|
2020-09-11 14:31:38 +00:00
|
|
|
logEvent(events.RA_TOGGLE_ENCRYPTED);
|
|
|
|
const { room } = this.state;
|
|
|
|
const { rid } = room;
|
|
|
|
const db = database.active;
|
|
|
|
|
|
|
|
// Toggle encrypted value
|
|
|
|
const encrypted = !room.encrypted;
|
|
|
|
try {
|
|
|
|
// Instantly feedback to the user
|
2022-03-02 14:49:43 +00:00
|
|
|
await db.write(async () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
await room.update(
|
2022-03-02 14:49:43 +00:00
|
|
|
protectedFunction((r: TSubscriptionModel) => {
|
2021-09-13 20:41:05 +00:00
|
|
|
r.encrypted = encrypted;
|
|
|
|
})
|
|
|
|
);
|
2020-09-11 14:31:38 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
try {
|
|
|
|
// Send new room setting value to server
|
2022-04-28 20:37:25 +00:00
|
|
|
const { result } = await Services.saveRoomSettings(rid, { encrypted });
|
2020-09-11 14:31:38 +00:00
|
|
|
// If it was saved successfully
|
|
|
|
if (result) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} catch {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
// If something goes wrong we go back to the previous value
|
2022-03-02 14:49:43 +00:00
|
|
|
await db.write(async () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
await room.update(
|
2022-03-02 14:49:43 +00:00
|
|
|
protectedFunction((r: TSubscriptionModel) => {
|
2021-09-13 20:41:05 +00:00
|
|
|
r.encrypted = room.encrypted;
|
|
|
|
})
|
|
|
|
);
|
2020-09-11 14:31:38 +00:00
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
logEvent(events.RA_TOGGLE_ENCRYPTED_F);
|
|
|
|
log(e);
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-09-11 14:31:38 +00:00
|
|
|
|
2019-05-29 21:19:12 +00:00
|
|
|
handleShare = () => {
|
2020-08-05 13:15:56 +00:00
|
|
|
logEvent(events.RA_SHARE);
|
2019-05-29 21:19:12 +00:00
|
|
|
const { room } = this.state;
|
2022-04-28 20:37:25 +00:00
|
|
|
const permalink = getPermalinkChannel(room);
|
2020-02-05 16:40:44 +00:00
|
|
|
if (!permalink) {
|
|
|
|
return;
|
|
|
|
}
|
2019-05-29 21:19:12 +00:00
|
|
|
Share.share({
|
|
|
|
message: permalink
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2018-03-23 16:49:51 +00:00
|
|
|
leaveChannel = () => {
|
|
|
|
const { room } = this.state;
|
2022-02-18 13:46:19 +00:00
|
|
|
const { dispatch } = this.props;
|
2018-09-25 19:28:42 +00:00
|
|
|
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
showConfirmationAlert({
|
2022-04-28 20:37:25 +00:00
|
|
|
message: I18n.t('Are_you_sure_you_want_to_leave_the_room', { room: getRoomTitle(room) }),
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
confirmationText: I18n.t('Yes_action_it', { action: I18n.t('leave') }),
|
2022-03-02 14:49:43 +00:00
|
|
|
onPress: () => dispatch(leaveRoom(ERoomType.c, room))
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
convertTeamToChannel = async () => {
|
2021-07-09 18:46:24 +00:00
|
|
|
const { room } = this.state;
|
2022-03-02 14:49:43 +00:00
|
|
|
const { navigation, userId } = this.props;
|
2021-07-09 18:46:24 +00:00
|
|
|
|
|
|
|
try {
|
2022-03-02 14:49:43 +00:00
|
|
|
if (!room.teamId) {
|
|
|
|
return;
|
|
|
|
}
|
2022-04-28 20:37:25 +00:00
|
|
|
const result = await Services.teamListRoomsOfUser({ teamId: room.teamId, userId });
|
2021-07-09 18:46:24 +00:00
|
|
|
|
2022-03-03 04:58:14 +00:00
|
|
|
if (result.success) {
|
|
|
|
if (result.rooms?.length) {
|
2022-05-02 12:40:19 +00:00
|
|
|
const teamChannels = result.rooms.map(r => ({
|
2022-03-03 04:58:14 +00:00
|
|
|
rid: r._id,
|
|
|
|
name: r.name,
|
|
|
|
teamId: r.teamId
|
|
|
|
}));
|
|
|
|
navigation.navigate('SelectListView', {
|
|
|
|
title: 'Converting_Team_To_Channel',
|
2022-05-02 12:40:19 +00:00
|
|
|
data: teamChannels,
|
2022-03-03 04:58:14 +00:00
|
|
|
infoText: 'Select_Team_Channels_To_Delete',
|
|
|
|
nextAction: (data: string[]) => this.convertTeamToChannelConfirmation(data)
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
this.convertTeamToChannelConfirmation();
|
|
|
|
}
|
2021-07-09 18:46:24 +00:00
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
this.convertTeamToChannelConfirmation();
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-07-09 18:46:24 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
handleConvertTeamToChannel = async (selected: string[]) => {
|
2021-07-09 18:46:24 +00:00
|
|
|
logEvent(events.RA_CONVERT_TEAM_TO_CHANNEL);
|
|
|
|
try {
|
|
|
|
const { room } = this.state;
|
|
|
|
const { navigation } = this.props;
|
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
if (!room.teamId) {
|
|
|
|
return;
|
|
|
|
}
|
2022-04-28 20:37:25 +00:00
|
|
|
const result = await Services.convertTeamToChannel({ teamId: room.teamId, selected });
|
2021-07-09 18:46:24 +00:00
|
|
|
|
|
|
|
if (result.success) {
|
|
|
|
navigation.navigate('RoomView');
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
logEvent(events.RA_CONVERT_TEAM_TO_CHANNEL_F);
|
|
|
|
log(e);
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-07-09 18:46:24 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
convertTeamToChannelConfirmation = (selected: string[] = []) => {
|
2021-07-09 18:46:24 +00:00
|
|
|
showConfirmationAlert({
|
|
|
|
title: I18n.t('Confirmation'),
|
|
|
|
message: I18n.t('You_are_converting_the_team'),
|
|
|
|
confirmationText: I18n.t('Convert'),
|
|
|
|
onPress: () => this.handleConvertTeamToChannel(selected)
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-07-09 18:46:24 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
leaveTeam = async () => {
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
const { room } = this.state;
|
2022-03-02 14:49:43 +00:00
|
|
|
const { navigation, dispatch, userId } = this.props;
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
|
|
|
|
try {
|
2022-03-02 14:49:43 +00:00
|
|
|
if (!room.teamId) {
|
|
|
|
return;
|
|
|
|
}
|
2022-04-28 20:37:25 +00:00
|
|
|
const result = await Services.teamListRoomsOfUser({ teamId: room.teamId, userId });
|
2021-06-07 19:08:20 +00:00
|
|
|
|
2022-03-03 04:58:14 +00:00
|
|
|
if (result.success) {
|
|
|
|
if (result.rooms?.length) {
|
2022-05-02 23:13:39 +00:00
|
|
|
const teamChannels = result.rooms.map(r => ({
|
2022-03-03 04:58:14 +00:00
|
|
|
rid: r._id,
|
|
|
|
name: r.name,
|
|
|
|
teamId: r.teamId,
|
|
|
|
alert: r.isLastOwner
|
|
|
|
}));
|
|
|
|
navigation.navigate('SelectListView', {
|
|
|
|
title: 'Leave_Team',
|
|
|
|
data: teamChannels as any,
|
|
|
|
infoText: 'Select_Team_Channels',
|
|
|
|
nextAction: data => dispatch(leaveRoom(ERoomType.t, room, data)),
|
|
|
|
showAlert: () => showErrorAlert(I18n.t('Last_owner_team_room'), I18n.t('Cannot_leave'))
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
showConfirmationAlert({
|
2022-04-28 20:37:25 +00:00
|
|
|
message: I18n.t('You_are_leaving_the_team', { team: getRoomTitle(room) }),
|
2022-03-03 04:58:14 +00:00
|
|
|
confirmationText: I18n.t('Yes_action_it', { action: I18n.t('leave') }),
|
|
|
|
onPress: () => dispatch(leaveRoom(ERoomType.t, room))
|
|
|
|
});
|
|
|
|
}
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
}
|
|
|
|
} catch (e) {
|
[NEW] Remove member from team (#3117)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Added confirmationAlert for missing permissions case
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-26 21:01:06 +00:00
|
|
|
showConfirmationAlert({
|
2022-04-28 20:37:25 +00:00
|
|
|
message: I18n.t('You_are_leaving_the_team', { team: getRoomTitle(room) }),
|
[NEW] Remove member from team (#3117)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Added confirmationAlert for missing permissions case
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-26 21:01:06 +00:00
|
|
|
confirmationText: I18n.t('Yes_action_it', { action: I18n.t('leave') }),
|
2022-03-02 14:49:43 +00:00
|
|
|
onPress: () => dispatch(leaveRoom(ERoomType.t, room))
|
[NEW] Remove member from team (#3117)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Added confirmationAlert for missing permissions case
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-26 21:01:06 +00:00
|
|
|
});
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-03-23 16:49:51 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
handleConvertToTeam = async () => {
|
2021-06-04 18:08:37 +00:00
|
|
|
logEvent(events.RA_CONVERT_TO_TEAM);
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
try {
|
|
|
|
const { room } = this.state;
|
|
|
|
const { navigation } = this.props;
|
2022-04-28 20:37:25 +00:00
|
|
|
const result = await Services.convertChannelToTeam({ rid: room.rid, name: room.name, type: room.t as any });
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
|
|
|
if (result.success) {
|
|
|
|
navigation.navigate('RoomView');
|
|
|
|
}
|
|
|
|
} catch (e) {
|
2021-06-04 18:08:37 +00:00
|
|
|
logEvent(events.RA_CONVERT_TO_TEAM_F);
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
log(e);
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
|
|
|
convertToTeam = () => {
|
|
|
|
showConfirmationAlert({
|
|
|
|
title: I18n.t('Confirmation'),
|
|
|
|
message: I18n.t('Convert_to_Team_Warning'),
|
|
|
|
confirmationText: I18n.t('Convert'),
|
|
|
|
onPress: () => this.handleConvertToTeam()
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
handleMoveToTeam = async (selected: string[]) => {
|
2021-06-04 18:08:37 +00:00
|
|
|
logEvent(events.RA_MOVE_TO_TEAM);
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
try {
|
|
|
|
const { room } = this.state;
|
|
|
|
const { navigation } = this.props;
|
2022-04-28 20:37:25 +00:00
|
|
|
const result = await Services.addRoomsToTeam({ teamId: selected?.[0], rooms: [room.rid] });
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
if (result.success) {
|
|
|
|
navigation.navigate('RoomView');
|
|
|
|
}
|
|
|
|
} catch (e) {
|
2021-06-04 18:08:37 +00:00
|
|
|
logEvent(events.RA_MOVE_TO_TEAM_F);
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
log(e);
|
|
|
|
showErrorAlert(I18n.t('There_was_an_error_while_action', { action: I18n.t('moving_channel_to_team') }));
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
moveToTeam = async () => {
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
try {
|
|
|
|
const { navigation } = this.props;
|
|
|
|
const db = database.active;
|
|
|
|
const subCollection = db.get('subscriptions');
|
2022-03-02 14:49:43 +00:00
|
|
|
const teamRooms = await subCollection.query(Q.where('team_main', true)).fetch();
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
|
|
|
if (teamRooms.length) {
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
const data = teamRooms.map(team => ({
|
2022-05-02 12:40:19 +00:00
|
|
|
rid: team.teamId as string,
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
t: team.t,
|
|
|
|
name: team.name
|
2022-05-02 12:40:19 +00:00
|
|
|
}));
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
navigation.navigate('SelectListView', {
|
|
|
|
title: 'Move_to_Team',
|
|
|
|
infoText: 'Move_Channel_Paragraph',
|
|
|
|
nextAction: () => {
|
|
|
|
navigation.push('SelectListView', {
|
|
|
|
title: 'Select_Team',
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
data,
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
isRadio: true,
|
|
|
|
isSearch: true,
|
|
|
|
onSearch: onChangeText => this.searchTeam(onChangeText),
|
2021-09-13 20:41:05 +00:00
|
|
|
nextAction: selected =>
|
|
|
|
showConfirmationAlert({
|
|
|
|
title: I18n.t('Confirmation'),
|
|
|
|
message: I18n.t('Move_to_Team_Warning'),
|
|
|
|
confirmationText: I18n.t('Yes_action_it', { action: I18n.t('move') }),
|
|
|
|
onPress: () => this.handleMoveToTeam(selected)
|
|
|
|
})
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
searchTeam = async (onChangeText: string) => {
|
2021-06-04 18:08:37 +00:00
|
|
|
logEvent(events.RA_SEARCH_TEAM);
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
try {
|
|
|
|
const { addTeamChannelPermission, createTeamPermission } = this.props;
|
|
|
|
const QUERY_SIZE = 50;
|
|
|
|
const db = database.active;
|
2022-02-01 13:39:09 +00:00
|
|
|
const teams = await db
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
.get('subscriptions')
|
|
|
|
.query(
|
2021-06-07 20:20:07 +00:00
|
|
|
Q.where('team_main', true),
|
2021-09-13 20:41:05 +00:00
|
|
|
Q.where('name', Q.like(`%${onChangeText}%`)),
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
Q.experimentalTake(QUERY_SIZE),
|
|
|
|
Q.experimentalSortBy('room_updated_at', Q.desc)
|
2022-03-02 14:49:43 +00:00
|
|
|
)
|
|
|
|
.fetch();
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
const asyncFilter = async (teamArray: TSubscriptionModel[]) => {
|
2021-09-13 20:41:05 +00:00
|
|
|
const results = await Promise.all(
|
|
|
|
teamArray.map(async team => {
|
2022-04-28 20:37:25 +00:00
|
|
|
const permissions = await hasPermission([addTeamChannelPermission, createTeamPermission], team.rid);
|
2021-09-13 20:41:05 +00:00
|
|
|
if (!permissions[0]) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
})
|
|
|
|
);
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
|
|
|
return teamArray.filter((_v, index) => results[index]);
|
|
|
|
};
|
|
|
|
const teamsFiltered = await asyncFilter(teams);
|
|
|
|
return teamsFiltered;
|
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
2022-06-27 18:04:20 +00:00
|
|
|
startVideoConf = ({ video }: { video: boolean }): void => {
|
|
|
|
const { room } = this.state;
|
|
|
|
const { serverVersion } = this.props;
|
|
|
|
if (compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '5.0.0')) {
|
|
|
|
videoConfStartAndJoin(room.rid, video);
|
|
|
|
} else {
|
|
|
|
callJitsi(room, !video);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
renderRoomInfo = () => {
|
2018-03-29 17:55:37 +00:00
|
|
|
const { room, member } = this.state;
|
2022-04-15 02:27:36 +00:00
|
|
|
const { rid, name, t, topic, source } = room;
|
2020-10-30 13:59:44 +00:00
|
|
|
const { theme, fontScale } = this.props;
|
2018-09-25 19:28:42 +00:00
|
|
|
|
2022-04-28 20:37:25 +00:00
|
|
|
const avatar = getRoomAvatar(room);
|
|
|
|
const isGroupChatHandler = isGroupChat(room);
|
2020-04-01 12:28:54 +00:00
|
|
|
|
2018-03-02 15:11:34 +00:00
|
|
|
return (
|
2020-10-30 13:59:44 +00:00
|
|
|
<List.Section>
|
|
|
|
<List.Separator />
|
|
|
|
<Touch
|
2021-09-13 20:41:05 +00:00
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
|
|
|
route: 'RoomInfoView',
|
|
|
|
// forward room only if room isn't joined
|
|
|
|
params: {
|
|
|
|
rid,
|
|
|
|
t,
|
|
|
|
room,
|
|
|
|
member
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2020-10-30 13:59:44 +00:00
|
|
|
style={{ backgroundColor: themes[theme].backgroundColor }}
|
|
|
|
accessibilityLabel={I18n.t('Room_Info')}
|
2022-04-28 20:37:25 +00:00
|
|
|
enabled={!isGroupChatHandler}
|
2020-10-30 13:59:44 +00:00
|
|
|
testID='room-actions-info'
|
2021-09-13 20:41:05 +00:00
|
|
|
theme={theme}>
|
2020-10-30 13:59:44 +00:00
|
|
|
<View style={[styles.roomInfoContainer, { height: 72 * fontScale }]}>
|
2021-09-13 20:41:05 +00:00
|
|
|
<Avatar text={avatar} style={styles.avatar} size={50 * fontScale} type={t} rid={rid}>
|
|
|
|
{t === 'd' && member._id ? (
|
|
|
|
<View style={[sharedStyles.status, { backgroundColor: themes[theme].backgroundColor }]}>
|
|
|
|
<Status size={16} id={member._id} />
|
|
|
|
</View>
|
2022-03-02 14:49:43 +00:00
|
|
|
) : undefined}
|
2020-10-30 13:59:44 +00:00
|
|
|
</Avatar>
|
|
|
|
<View style={styles.roomTitleContainer}>
|
2021-09-13 20:41:05 +00:00
|
|
|
{room.t === 'd' ? (
|
|
|
|
<Text style={[styles.roomTitle, { color: themes[theme].titleText }]} numberOfLines={1}>
|
|
|
|
{room.fname}
|
|
|
|
</Text>
|
|
|
|
) : (
|
|
|
|
<View style={styles.roomTitleRow}>
|
2022-04-15 02:27:36 +00:00
|
|
|
<RoomTypeIcon
|
|
|
|
type={room.prid ? 'discussion' : room.t}
|
|
|
|
teamMain={room.teamMain}
|
|
|
|
status={room.visitor?.status}
|
|
|
|
sourceType={source}
|
|
|
|
/>
|
2021-09-13 20:41:05 +00:00
|
|
|
<Text style={[styles.roomTitle, { color: themes[theme].titleText }]} numberOfLines={1}>
|
2022-04-28 20:37:25 +00:00
|
|
|
{getRoomTitle(room)}
|
2021-09-13 20:41:05 +00:00
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
)}
|
2022-02-17 15:27:01 +00:00
|
|
|
<MarkdownPreview
|
2021-09-13 20:41:05 +00:00
|
|
|
msg={t === 'd' ? `@${name}` : topic}
|
2020-10-30 13:59:44 +00:00
|
|
|
style={[styles.roomDescription, { color: themes[theme].auxiliaryText }]}
|
|
|
|
/>
|
2021-09-13 20:41:05 +00:00
|
|
|
{room.t === 'd' && (
|
2022-02-17 15:27:01 +00:00
|
|
|
<MarkdownPreview
|
2021-09-13 20:41:05 +00:00
|
|
|
msg={member.statusText}
|
|
|
|
style={[styles.roomDescription, { color: themes[theme].auxiliaryText }]}
|
|
|
|
/>
|
|
|
|
)}
|
2020-10-30 13:59:44 +00:00
|
|
|
</View>
|
2022-04-28 20:37:25 +00:00
|
|
|
{isGroupChatHandler ? null : <List.Icon name='chevron-right' style={styles.actionIndicator} />}
|
2020-04-01 12:28:54 +00:00
|
|
|
</View>
|
2020-10-30 13:59:44 +00:00
|
|
|
</Touch>
|
|
|
|
<List.Separator />
|
|
|
|
</List.Section>
|
2018-03-02 15:11:34 +00:00
|
|
|
);
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-02-19 21:19:39 +00:00
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
renderJitsi = () => {
|
|
|
|
const { room } = this.state;
|
2022-06-27 18:04:20 +00:00
|
|
|
const {
|
|
|
|
jitsiEnabled,
|
|
|
|
jitsiEnableTeams,
|
|
|
|
jitsiEnableChannels,
|
|
|
|
serverVersion,
|
|
|
|
videoConf_Enable_DMs,
|
|
|
|
videoConf_Enable_Channels,
|
|
|
|
videoConf_Enable_Groups,
|
|
|
|
videoConf_Enable_Teams
|
|
|
|
} = this.props;
|
2021-07-02 19:15:21 +00:00
|
|
|
|
|
|
|
const isJitsiDisabledForTeams = room.teamMain && !jitsiEnableTeams;
|
|
|
|
const isJitsiDisabledForChannels = !room.teamMain && (room.t === 'p' || room.t === 'c') && !jitsiEnableChannels;
|
|
|
|
|
2022-06-27 18:04:20 +00:00
|
|
|
const isVideoConfDisabledForTeams = !!room.teamMain && !videoConf_Enable_Teams;
|
|
|
|
const isVideoConfDisabledForChannels = !room.teamMain && room.t === 'c' && !videoConf_Enable_Channels;
|
|
|
|
const isVideoConfDisabledForGroups = !room.teamMain && room.t === 'p' && !videoConf_Enable_Groups;
|
|
|
|
const isVideoConfDisabledForDirect = !room.teamMain && room.t === 'd' && !videoConf_Enable_DMs;
|
|
|
|
|
|
|
|
if (compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '5.0.0')) {
|
|
|
|
if (
|
|
|
|
isVideoConfDisabledForTeams ||
|
|
|
|
isVideoConfDisabledForChannels ||
|
|
|
|
isVideoConfDisabledForGroups ||
|
|
|
|
isVideoConfDisabledForDirect
|
|
|
|
) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
} else if (!jitsiEnabled || isJitsiDisabledForTeams || isJitsiDisabledForChannels) {
|
2020-10-30 13:59:44 +00:00
|
|
|
return null;
|
|
|
|
}
|
2021-07-02 19:15:21 +00:00
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
return (
|
2020-10-30 13:59:44 +00:00
|
|
|
<List.Section>
|
|
|
|
<List.Separator />
|
|
|
|
<List.Item
|
|
|
|
title='Voice_call'
|
2022-06-27 18:04:20 +00:00
|
|
|
onPress={() => this.startVideoConf({ video: false })}
|
2020-10-30 13:59:44 +00:00
|
|
|
testID='room-actions-voice'
|
|
|
|
left={() => <List.Icon name='phone' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
<List.Item
|
|
|
|
title='Video_call'
|
2022-06-27 18:04:20 +00:00
|
|
|
onPress={() => this.startVideoConf({ video: true })}
|
2020-10-30 13:59:44 +00:00
|
|
|
testID='room-actions-video'
|
|
|
|
left={() => <List.Icon name='camera' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</List.Section>
|
2019-12-04 16:39:53 +00:00
|
|
|
);
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-02-19 21:19:39 +00:00
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
renderE2EEncryption = () => {
|
2021-01-20 17:34:01 +00:00
|
|
|
const { room } = this.state;
|
|
|
|
const { encryptionEnabled } = this.props;
|
2020-10-30 13:59:44 +00:00
|
|
|
|
2021-01-20 17:34:01 +00:00
|
|
|
// If this room type can be encrypted
|
|
|
|
// If e2e is enabled
|
2022-03-02 14:49:43 +00:00
|
|
|
if (E2E_ROOM_TYPES[room.t] && encryptionEnabled) {
|
2020-10-30 13:59:44 +00:00
|
|
|
return (
|
|
|
|
<List.Section>
|
|
|
|
<List.Separator />
|
|
|
|
<List.Item
|
|
|
|
title='Encrypted'
|
|
|
|
testID='room-actions-encrypt'
|
|
|
|
left={() => <List.Icon name='encrypted' />}
|
|
|
|
right={this.renderEncryptedSwitch}
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</List.Section>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return null;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-02-19 21:19:39 +00:00
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
renderLastSection = () => {
|
|
|
|
const { room, joined } = this.state;
|
2019-12-04 16:39:53 +00:00
|
|
|
const { theme } = this.props;
|
2020-10-30 13:59:44 +00:00
|
|
|
const { t, blocker } = room;
|
|
|
|
|
|
|
|
if (!joined || t === 'l') {
|
|
|
|
return null;
|
2018-02-19 21:19:39 +00:00
|
|
|
}
|
2020-10-30 13:59:44 +00:00
|
|
|
|
2022-04-28 20:37:25 +00:00
|
|
|
if (t === 'd' && !isGroupChat(room)) {
|
2020-10-30 13:59:44 +00:00
|
|
|
return (
|
|
|
|
<List.Section>
|
|
|
|
<List.Separator />
|
|
|
|
<List.Item
|
2021-09-13 20:41:05 +00:00
|
|
|
title={`${blocker ? 'Unblock' : 'Block'}_user`}
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
|
|
|
event: this.toggleBlockUser
|
|
|
|
})
|
|
|
|
}
|
2020-10-30 13:59:44 +00:00
|
|
|
testID='room-actions-block-user'
|
2020-11-30 20:00:31 +00:00
|
|
|
left={() => <List.Icon name='ignore' color={themes[theme].dangerColor} />}
|
2020-10-30 13:59:44 +00:00
|
|
|
showActionIndicator
|
|
|
|
color={themes[theme].dangerColor}
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</List.Section>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (t === 'p' || t === 'c') {
|
|
|
|
return (
|
|
|
|
<List.Section>
|
|
|
|
<List.Separator />
|
|
|
|
<List.Item
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
title='Leave'
|
2021-09-13 20:41:05 +00:00
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
|
|
|
event: room.teamMain ? this.leaveTeam : this.leaveChannel
|
|
|
|
})
|
|
|
|
}
|
2020-10-30 13:59:44 +00:00
|
|
|
testID='room-actions-leave-channel'
|
|
|
|
left={() => <List.Icon name='logout' color={themes[theme].dangerColor} />}
|
|
|
|
showActionIndicator
|
|
|
|
color={themes[theme].dangerColor}
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</List.Section>
|
|
|
|
);
|
2018-04-24 19:34:03 +00:00
|
|
|
}
|
2021-06-10 17:52:00 +00:00
|
|
|
|
|
|
|
return null;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2018-02-19 21:19:39 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
teamChannelActions = (t: string, room: ISubscription) => {
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
const { canEdit, canCreateTeam, canAddChannelToTeam } = this.state;
|
|
|
|
const canConvertToTeam = canEdit && canCreateTeam && !room.teamMain;
|
|
|
|
const canMoveToTeam = canEdit && canAddChannelToTeam && !room.teamId;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2021-09-13 20:41:05 +00:00
|
|
|
{['c', 'p'].includes(t) && canConvertToTeam ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Convert_to_Team'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
event: this.convertToTeam
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-convert-to-team'
|
|
|
|
left={() => <List.Icon name='teams' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p'].includes(t) && canMoveToTeam ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Move_to_Team'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
event: this.moveToTeam
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-move-to-team'
|
|
|
|
left={() => <List.Icon name='channel-move-to-team' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
</>
|
|
|
|
);
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
teamToChannelActions = (t: string, room: ISubscription) => {
|
2021-07-09 18:46:24 +00:00
|
|
|
const { canEdit, canConvertTeam } = this.state;
|
|
|
|
const canConvertTeamToChannel = canEdit && canConvertTeam && !!room?.teamMain;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2021-09-13 20:41:05 +00:00
|
|
|
{['c', 'p'].includes(t) && canConvertTeamToChannel ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Convert_to_Channel'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2021-07-09 18:46:24 +00:00
|
|
|
event: this.convertTeamToChannel
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
left={() => <List.Icon name='channel-public' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
2021-07-09 18:46:24 +00:00
|
|
|
</>
|
|
|
|
);
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-07-09 18:46:24 +00:00
|
|
|
|
2022-06-09 14:42:12 +00:00
|
|
|
renderOmnichannelSection = () => {
|
|
|
|
const { room } = this.state;
|
|
|
|
const { rid, t } = room;
|
|
|
|
const { theme } = this.props;
|
|
|
|
|
|
|
|
if (t !== 'l' || this.isOmnichannelPreview) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<List.Section>
|
|
|
|
{this.omnichannelPermissions?.canForwardGuest ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Forward'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
|
|
|
route: 'ForwardLivechatView',
|
|
|
|
params: { rid }
|
|
|
|
})
|
|
|
|
}
|
|
|
|
left={() => <List.Icon name='chat-forward' color={themes[theme].titleText} />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{this.omnichannelPermissions?.canPlaceLivechatOnHold ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Place_chat_on_hold'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
|
|
|
event: this.placeOnHoldLivechat
|
|
|
|
})
|
|
|
|
}
|
|
|
|
left={() => <List.Icon name='pause' color={themes[theme].titleText} />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{this.omnichannelPermissions?.canReturnQueue ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Return_to_waiting_line'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
|
|
|
event: this.returnLivechat
|
|
|
|
})
|
|
|
|
}
|
|
|
|
left={() => <List.Icon name='move-to-the-queue' color={themes[theme].titleText} />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Close'
|
|
|
|
color={themes[theme].dangerColor}
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
|
|
|
event: this.closeLivechat
|
|
|
|
})
|
|
|
|
}
|
|
|
|
left={() => <List.Icon name='chat-close' color={themes[theme].dangerColor} />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
</List.Section>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2018-02-19 21:19:39 +00:00
|
|
|
render() {
|
2022-06-09 14:42:12 +00:00
|
|
|
const { room, membersCount, canViewMembers, canAddUser, canInviteUser, joined, canAutoTranslate } = this.state;
|
2021-09-15 13:28:55 +00:00
|
|
|
const { rid, t, prid } = room;
|
2022-04-28 20:37:25 +00:00
|
|
|
const isGroupChatHandler = isGroupChat(room);
|
2021-03-18 17:33:20 +00:00
|
|
|
|
2018-02-19 21:19:39 +00:00
|
|
|
return (
|
2020-10-30 13:59:44 +00:00
|
|
|
<SafeAreaView testID='room-actions-view'>
|
|
|
|
<StatusBar />
|
2021-04-19 14:31:43 +00:00
|
|
|
<List.Container testID='room-actions-scrollview'>
|
2020-10-30 13:59:44 +00:00
|
|
|
{this.renderRoomInfo()}
|
|
|
|
{this.renderJitsi()}
|
|
|
|
{this.renderE2EEncryption()}
|
|
|
|
<List.Section>
|
|
|
|
<List.Separator />
|
|
|
|
|
2022-04-28 20:37:25 +00:00
|
|
|
{(['c', 'p'].includes(t) && canViewMembers) || isGroupChatHandler ? (
|
2021-09-13 20:41:05 +00:00
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Members'
|
2022-03-02 14:49:43 +00:00
|
|
|
subtitle={membersCount > 0 ? `${membersCount} ${I18n.t('members')}` : undefined}
|
2021-09-13 20:41:05 +00:00
|
|
|
onPress={() => this.onPressTouchable({ route: 'RoomMembersView', params: { rid, room } })}
|
|
|
|
testID='room-actions-members'
|
|
|
|
left={() => <List.Icon name='team' />}
|
|
|
|
showActionIndicator
|
|
|
|
translateSubtitle={false}
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p'].includes(t) && canAddUser ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Add_users'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2020-10-30 13:59:44 +00:00
|
|
|
route: 'SelectedUsersView',
|
|
|
|
params: {
|
|
|
|
title: I18n.t('Add_users'),
|
|
|
|
nextAction: this.addUser
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-add-user'
|
|
|
|
left={() => <List.Icon name='add' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p'].includes(t) && canInviteUser ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Invite_users'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2020-10-30 13:59:44 +00:00
|
|
|
route: 'InviteUsersView',
|
|
|
|
params: { rid }
|
2021-09-15 13:28:55 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-invite-user'
|
|
|
|
left={() => <List.Icon name='user-add' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p', 'd'].includes(t) && !prid ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Discussions'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2021-09-16 18:16:02 +00:00
|
|
|
route: 'DiscussionsView',
|
2021-07-19 15:33:09 +00:00
|
|
|
params: {
|
2022-01-24 18:35:06 +00:00
|
|
|
rid,
|
|
|
|
t
|
2021-07-19 15:33:09 +00:00
|
|
|
}
|
2021-09-15 13:28:55 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-discussions'
|
|
|
|
left={() => <List.Icon name='discussions' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
2022-06-09 14:42:12 +00:00
|
|
|
{['l'].includes(t) && !this.isOmnichannelPreview && this.omnichannelPermissions?.canViewCannedResponse ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Canned_Responses'
|
|
|
|
onPress={() => this.onPressTouchable({ route: 'CannedResponsesListView', params: { rid } })}
|
|
|
|
left={() => <List.Icon name='canned-response' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
2021-09-15 13:28:55 +00:00
|
|
|
{['c', 'p', 'd'].includes(t) ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Files'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2020-10-30 13:59:44 +00:00
|
|
|
route: 'MessagesView',
|
|
|
|
params: { rid, t, name: 'Files' }
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-files'
|
|
|
|
left={() => <List.Icon name='attach' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p', 'd'].includes(t) ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Mentions'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2020-10-30 13:59:44 +00:00
|
|
|
route: 'MessagesView',
|
|
|
|
params: { rid, t, name: 'Mentions' }
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-mentioned'
|
|
|
|
left={() => <List.Icon name='mention' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p', 'd'].includes(t) ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Starred'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2020-10-30 13:59:44 +00:00
|
|
|
route: 'MessagesView',
|
|
|
|
params: { rid, t, name: 'Starred' }
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-starred'
|
|
|
|
left={() => <List.Icon name='star' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p', 'd'].includes(t) ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Share'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2020-10-30 13:59:44 +00:00
|
|
|
event: this.handleShare
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-share'
|
|
|
|
left={() => <List.Icon name='share' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p', 'd'].includes(t) ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Pinned'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2020-10-30 13:59:44 +00:00
|
|
|
route: 'MessagesView',
|
|
|
|
params: { rid, t, name: 'Pinned' }
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-pinned'
|
|
|
|
left={() => <List.Icon name='pin' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p', 'd'].includes(t) && canAutoTranslate ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Auto_Translate'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2020-10-30 13:59:44 +00:00
|
|
|
route: 'AutoTranslateView',
|
|
|
|
params: { rid, room }
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-auto-translate'
|
|
|
|
left={() => <List.Icon name='language' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{['c', 'p', 'd'].includes(t) && joined ? (
|
|
|
|
<>
|
|
|
|
<List.Item
|
|
|
|
title='Notifications'
|
|
|
|
onPress={() =>
|
|
|
|
this.onPressTouchable({
|
2020-10-30 13:59:44 +00:00
|
|
|
route: 'NotificationPrefView',
|
|
|
|
params: { rid, room }
|
2021-09-13 20:41:05 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
testID='room-actions-notifications'
|
|
|
|
left={() => <List.Icon name='notification' />}
|
|
|
|
showActionIndicator
|
|
|
|
/>
|
|
|
|
<List.Separator />
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
{this.teamChannelActions(t, room)}
|
2021-07-09 18:46:24 +00:00
|
|
|
{this.teamToChannelActions(t, room)}
|
2020-10-30 13:59:44 +00:00
|
|
|
</List.Section>
|
2022-06-09 14:42:12 +00:00
|
|
|
{this.renderOmnichannelSection()}
|
2020-10-30 13:59:44 +00:00
|
|
|
{this.renderLastSection()}
|
|
|
|
</List.Container>
|
2018-08-01 19:35:06 +00:00
|
|
|
</SafeAreaView>
|
2018-02-19 21:19:39 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2019-08-07 13:51:34 +00:00
|
|
|
|
2022-03-02 14:49:43 +00:00
|
|
|
const mapStateToProps = (state: IApplicationState) => ({
|
|
|
|
userId: getUserSelector(state).id,
|
|
|
|
jitsiEnabled: (state.settings.Jitsi_Enabled || false) as boolean,
|
|
|
|
jitsiEnableTeams: (state.settings.Jitsi_Enable_Teams || false) as boolean,
|
|
|
|
jitsiEnableChannels: (state.settings.Jitsi_Enable_Channels || false) as boolean,
|
2022-06-27 18:04:20 +00:00
|
|
|
videoConf_Enable_DMs: (state.settings.VideoConf_Enable_DMs ?? true) as boolean,
|
|
|
|
videoConf_Enable_Channels: (state.settings.VideoConf_Enable_Channels ?? true) as boolean,
|
|
|
|
videoConf_Enable_Groups: (state.settings.VideoConf_Enable_Groups ?? true) as boolean,
|
|
|
|
videoConf_Enable_Teams: (state.settings.VideoConf_Enable_Teams ?? true) as boolean,
|
2021-01-20 17:34:01 +00:00
|
|
|
encryptionEnabled: state.encryption.enabled,
|
2021-02-25 16:41:44 +00:00
|
|
|
serverVersion: state.server.version,
|
[NEW] Leave Teams (#3116)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Minor tweak
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-25 18:04:05 +00:00
|
|
|
isMasterDetail: state.app.isMasterDetail,
|
2021-02-25 16:41:44 +00:00
|
|
|
addUserToJoinedRoomPermission: state.permissions['add-user-to-joined-room'],
|
|
|
|
addUserToAnyCRoomPermission: state.permissions['add-user-to-any-c-room'],
|
|
|
|
addUserToAnyPRoomPermission: state.permissions['add-user-to-any-p-room'],
|
|
|
|
createInviteLinksPermission: state.permissions['create-invite-links'],
|
|
|
|
editRoomPermission: state.permissions['edit-room'],
|
|
|
|
toggleRoomE2EEncryptionPermission: state.permissions['toggle-room-e2e-encryption'],
|
|
|
|
viewBroadcastMemberListPermission: state.permissions['view-broadcast-member-list'],
|
[NEW] Convert/Move Channel to Team (#3164)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-02 13:44:19 +00:00
|
|
|
createTeamPermission: state.permissions['create-team'],
|
2021-07-09 18:46:24 +00:00
|
|
|
addTeamChannelPermission: state.permissions['add-team-channel'],
|
2022-06-27 19:03:24 +00:00
|
|
|
convertTeamPermission: state.permissions['convert-team'],
|
|
|
|
viewCannedResponsesPermission: state.permissions['view-canned-responses'],
|
|
|
|
livechatAllowManualOnHold: state.settings.Livechat_allow_manual_on_hold as boolean,
|
|
|
|
livechatRequestComment: state.settings.Livechat_request_comment_when_closing_conversation as boolean
|
2019-08-07 13:51:34 +00:00
|
|
|
});
|
|
|
|
|
2022-06-27 19:03:24 +00:00
|
|
|
export default connect(mapStateToProps)(withTheme(withActionSheet(withDimensions(RoomActionsView))));
|