diff --git a/app/i18n/locales/en.json b/app/i18n/locales/en.json
index 84862128c..7aad5b43c 100644
--- a/app/i18n/locales/en.json
+++ b/app/i18n/locales/en.json
@@ -768,7 +768,7 @@
"Convert_to_Team_Warning": "You are converting this Channel to a Team. All Members will be kept.",
"Move_to_Team": "Move to Team",
"Move_Channel_Paragraph": "Moving a channel inside a team means that this channel will be added in the team’s context, however, all channel’s members, which are not members of the respective team, will still have access to this channel, but will not be added as team’s members. \n\nAll channel’s management will still be made by the owners of this channel.\n\nTeam’s members and even team’s owners, if not a member of this channel, can not have access to the channel’s content. \n\nPlease notice that the Team’s owner will be able remove members from the Channel.",
- "Move_to_Team_Warning": "After reading the previous intructions about this behavior, do you still want to move this channel to the selected team?",
+ "Move_to_Team_Warning": "After reading the previous instructions about this behavior, do you still want to move this channel to the selected team?",
"Load_More": "Load More",
"Load_Newer": "Load Newer",
"Load_Older": "Load Older",
diff --git a/app/lib/hooks/useVideoConf.tsx b/app/lib/hooks/useVideoConf.tsx
index 6b79f59eb..c435d837f 100644
--- a/app/lib/hooks/useVideoConf.tsx
+++ b/app/lib/hooks/useVideoConf.tsx
@@ -1,12 +1,10 @@
import React, { useEffect, useState } from 'react';
-import { Q } from '@nozbe/watermelondb';
import { useActionSheet } from '../../containers/ActionSheet';
import StartACallActionSheet from '../../containers/UIKit/VideoConferenceBlock/components/StartACallActionSheet';
-import { ISubscription, SubscriptionType, TSubscriptionModel } from '../../definitions';
+import { ISubscription, SubscriptionType } from '../../definitions';
import i18n from '../../i18n';
import { getUserSelector } from '../../selectors/login';
-import database from '../database';
import { getSubscriptionByRoomId } from '../database/services/Subscription';
import { callJitsi } from '../methods';
import { compareServerVersion, showErrorAlert } from '../methods/helpers';
@@ -40,14 +38,18 @@ export const useVideoConf = (rid: string): { showInitCallActionSheet: () => Prom
const { showActionSheet } = useActionSheet();
const snaps = useSnaps([1250]);
- const handleShowCallOption = (room: TSubscriptionModel) => {
+ const handleShowCallOption = async () => {
if (isServer5OrNewer) return setShowCallOption(true);
- const isJitsiDisabledForTeams = room.teamMain && !jitsiEnableTeams;
- const isJitsiDisabledForChannels = !room.teamMain && (room.t === 'p' || room.t === 'c') && !jitsiEnableChannels;
+ const room = await getSubscriptionByRoomId(rid);
- if (room.t === SubscriptionType.DIRECT) return setShowCallOption(!!jitsiEnabled);
- if (room.t === SubscriptionType.CHANNEL) return setShowCallOption(!isJitsiDisabledForChannels);
- if (room.t === SubscriptionType.GROUP) return setShowCallOption(!isJitsiDisabledForTeams);
+ if (room) {
+ const isJitsiDisabledForTeams = room.teamMain && !jitsiEnableTeams;
+ const isJitsiDisabledForChannels = !room.teamMain && (room.t === 'p' || room.t === 'c') && !jitsiEnableChannels;
+
+ if (room.t === SubscriptionType.DIRECT) return setShowCallOption(!!jitsiEnabled);
+ if (room.t === SubscriptionType.CHANNEL) return setShowCallOption(!isJitsiDisabledForChannels);
+ if (room.t === SubscriptionType.GROUP) return setShowCallOption(!isJitsiDisabledForTeams);
+ }
return setShowCallOption(false);
};
@@ -90,23 +92,8 @@ export const useVideoConf = (rid: string): { showInitCallActionSheet: () => Prom
}
};
- const initSubscription = () => {
- try {
- const db = database.active;
- const observeSubCollection = db.get('subscriptions').query(Q.where('rid', rid)).observe();
- const subObserveQuery = observeSubCollection.subscribe(data => {
- if (data[0]) {
- handleShowCallOption(data[0]);
- subObserveQuery.unsubscribe();
- }
- });
- } catch (e) {
- console.log("observeSubscriptions: Can't find subscription to observe");
- }
- };
-
useEffect(() => {
- initSubscription();
+ handleShowCallOption();
}, []);
return { showInitCallActionSheet, showCallOption };
diff --git a/app/views/RoomActionsView/index.tsx b/app/views/RoomActionsView/index.tsx
index 8e0a409b6..79128f462 100644
--- a/app/views/RoomActionsView/index.tsx
+++ b/app/views/RoomActionsView/index.tsx
@@ -41,7 +41,8 @@ import {
getUidDirectMessage,
hasPermission,
isGroupChat,
- compareServerVersion
+ compareServerVersion,
+ isTeamRoom
} from '../../lib/methods/helpers';
import { Services } from '../../lib/services';
import { getSubscriptionByRoomId } from '../../lib/database/services/Subscription';
@@ -1033,7 +1034,8 @@ class RoomActionsView extends React.Component
>
) : null}
-
+ {teamId && isTeamRoom({ teamId, joined }) ? (
+ <>
+ {
+ logEvent(events.ROOM_GO_TEAM_CHANNELS);
+ if (isMasterDetail) {
+ // @ts-ignore TODO: find a way to make this work - OLD Diego :)
+ navigation.navigate('ModalStackNavigator', {
+ screen: 'TeamChannelsView',
+ params: { teamId, joined }
+ });
+ } else {
+ navigation.navigate('TeamChannelsView', {
+ teamId,
+ joined
+ });
+ }
+ }}
+ testID='room-actions-teams'
+ left={() => }
+ showActionIndicator
+ />
+
+ >
+ ) : null}
{['l'].includes(t) && !this.isOmnichannelPreview && this.omnichannelPermissions?.canViewCannedResponse ? (
<>
{
- logEvent(events.ROOM_GO_TEAM_CHANNELS);
- const { navigation, isMasterDetail, teamId, joined } = this.props;
- if (!teamId) {
- return;
- }
- if (isMasterDetail) {
- // @ts-ignore TODO: find a way to make this work
- navigation.navigate('ModalStackNavigator', {
- screen: 'TeamChannelsView',
- params: { teamId, joined }
- });
- } else {
- navigation.navigate('TeamChannelsView', { teamId, joined });
- }
- };
-
goThreadsView = () => {
logEvent(events.ROOM_GO_THREADS);
const { rid, t, navigation, isMasterDetail } = this.props;
diff --git a/e2e/tests/assorted/02-broadcast.spec.ts b/e2e/tests/assorted/02-broadcast.spec.ts
index a996714cf..3469486da 100644
--- a/e2e/tests/assorted/02-broadcast.spec.ts
+++ b/e2e/tests/assorted/02-broadcast.spec.ts
@@ -16,7 +16,7 @@ import {
import { createRandomUser, ITestUser } from '../../helpers/data_setup';
import random from '../../helpers/random';
-describe.skip('Broadcast room', () => {
+describe('Broadcast room', () => {
let textMatcher: TTextMatcher;
let user: ITestUser;
let otherUser: ITestUser;
diff --git a/e2e/tests/room/02-room.spec.ts b/e2e/tests/room/02-room.spec.ts
index d8b547ee0..8b19a4916 100644
--- a/e2e/tests/room/02-room.spec.ts
+++ b/e2e/tests/room/02-room.spec.ts
@@ -485,7 +485,7 @@ describe('Room screen', () => {
await tapBack();
});
- it.skip('should reply in DM to another user', async () => {
+ it('should reply in DM to another user', async () => {
const replyUser = await createRandomUser();
const { name: replyRoom } = await createRandomRoom(replyUser, 'c');
const originalMessage = 'Message to reply in DM';
diff --git a/e2e/tests/team/02-team.spec.ts b/e2e/tests/team/02-team.spec.ts
index e31fe2e7e..10d202e65 100644
--- a/e2e/tests/team/02-team.spec.ts
+++ b/e2e/tests/team/02-team.spec.ts
@@ -26,7 +26,7 @@ async function openActionSheet(username: string) {
async function navigateToRoomActions() {
await waitFor(element(by.id('room-view')))
.toExist()
- .withTimeout(2000);
+ .withTimeout(5000);
await element(by.id('room-header')).atIndex(0).tap();
await waitFor(element(by.id('room-actions-view')))
.toExist()
@@ -92,14 +92,14 @@ describe('Team', () => {
await navigateToRoom(team);
});
- describe.skip('Team Room', () => {
+ describe('Team Room', () => {
describe('Team Header', () => {
it('should have actions button ', async () => {
await expect(element(by.id('room-header'))).toExist();
});
- it('should have team channels button ', async () => {
- await expect(element(by.id('room-view-header-team-channels'))).toExist();
+ it('should have call button ', async () => {
+ await expect(element(by.id('room-view-header-call'))).toExist();
});
it('should have threads button ', async () => {
@@ -111,9 +111,10 @@ describe('Team', () => {
});
});
- describe('Team Header Usage', () => {
+ describe('Team Action Usage', () => {
it('should navigate to team channels view', async () => {
- await element(by.id('room-view-header-team-channels')).tap();
+ await element(by.id('room-header')).tap();
+ await element(by.id('room-actions-teams')).tap();
await waitFor(element(by.id('team-channels-view')))
.toExist()
.withTimeout(5000);
@@ -183,8 +184,9 @@ describe('Team', () => {
.toExist()
.withTimeout(20000);
await expect(element(by.id('room-view'))).toExist();
- await expect(element(by.id('room-view-header-team-channels'))).toExist();
- await element(by.id('room-view-header-team-channels')).tap();
+ await element(by.id('room-header')).tap();
+ await expect(element(by.id('room-actions-teams'))).toExist();
+ await element(by.id('room-actions-teams')).tap();
await waitFor(element(by.id('team-channels-view')))
.toExist()
@@ -198,7 +200,7 @@ describe('Team', () => {
.toExist()
.withTimeout(60000);
await expect(element(by.id(`room-view-title-${room}`))).toExist();
- await expect(element(by.id('room-view-header-team-channels')).atIndex(0)).toExist();
+ await expect(element(by.id('room-view-header-call')).atIndex(0)).toExist();
await expect(element(by.id('room-view-header-threads')).atIndex(0)).toExist();
await expect(element(by.id('room-view-search')).atIndex(0)).toExist();
await tapBack();
@@ -206,10 +208,9 @@ describe('Team', () => {
it('should add existing channel to team', async () => {
await navigateToRoom(team);
- await waitFor(element(by.id('room-view-header-team-channels')))
- .toExist()
- .withTimeout(5000);
- await element(by.id('room-view-header-team-channels')).tap();
+ await element(by.id('room-header')).tap();
+ await expect(element(by.id('room-actions-teams'))).toExist();
+ await element(by.id('room-actions-teams')).tap();
await waitFor(element(by.id('team-channels-view')))
.toExist()
.withTimeout(5000);
@@ -229,11 +230,9 @@ describe('Team', () => {
.withTimeout(6000);
await element(by.id('add-existing-channel-view-submit')).tap();
await checkRoomTitle(team);
- await waitFor(element(by.id('room-view-header-team-channels')))
- .toBeVisible()
- .withTimeout(2000);
- await element(by.id('room-view-header-team-channels')).tap();
-
+ await element(by.id('room-header')).tap();
+ await expect(element(by.id('room-actions-teams'))).toExist();
+ await element(by.id('room-actions-teams')).tap();
await waitFor(element(by.id(`rooms-list-view-item-${existingRoom}`)).atIndex(0))
.toExist()
.withTimeout(10000);
@@ -276,6 +275,7 @@ describe('Team', () => {
await waitFor(element(by.id(`rooms-list-view-item-${existingRoom}`)).atIndex(0))
.toExist()
.withTimeout(6000);
+ await tapBack();
});
});
@@ -383,10 +383,6 @@ describe('Team', () => {
describe('Room Members', () => {
beforeAll(async () => {
await tapAndWaitFor(element(by.id('room-actions-members')), element(by.id('room-members-view')), 2000);
- // await element(by.id('room-actions-members')).tap();
- // await waitFor(element(by.id('room-members-view')))
- // .toBeVisible()
- // .withTimeout(2000);
});
it('should show all users', async () => {
diff --git a/e2e/tests/team/03-moveconvert.spec.ts b/e2e/tests/team/03-moveconvert.spec.ts
index b7e398754..b2721e6a1 100644
--- a/e2e/tests/team/03-moveconvert.spec.ts
+++ b/e2e/tests/team/03-moveconvert.spec.ts
@@ -55,7 +55,7 @@ async function navigateToRoomActions(room: string) {
.withTimeout(5000);
}
-describe.skip('Move/Convert Team', () => {
+describe('Move/Convert Team', () => {
let alertButtonType: string;
let textMatcher: TTextMatcher;
let user: ITestUser;
@@ -124,16 +124,19 @@ describe.skip('Move/Convert Team', () => {
await waitFor(
element(
by[textMatcher](
- 'After reading the previous intructions about this behavior, do you still want to move this channel to the selected team?'
+ 'After reading the previous instructions about this behavior, do you still want to move this channel to the selected team?'
)
)
)
.toBeVisible()
.withTimeout(2000);
await element(by[textMatcher]('Yes, move it!').and(by.type(alertButtonType))).tap();
- await waitFor(element(by.id('room-view-header-team-channels')))
- .toBeVisible()
- .withTimeout(10000);
+ await sleep(300); // wait for animation
+ await element(by.id('room-header')).tap();
+ await waitFor(element(by.id(`room-actions-teams`)))
+ .toExist()
+ .withTimeout(6000);
+ await tapBack();
});
afterAll(async () => {