Skip to content

Commit

Permalink
Merge branch 'dev' into avs
Browse files Browse the repository at this point in the history
  • Loading branch information
bennycode committed Jun 29, 2020
2 parents fd73a46 + d50bc04 commit 8ac43c7
Show file tree
Hide file tree
Showing 34 changed files with 489 additions and 439 deletions.
6 changes: 3 additions & 3 deletions app-config/package.json
@@ -1,7 +1,7 @@
{
"dependencies": {
"wire-web-config-default-ey": "https://github.com/wireapp/wire-web-config-ey.git#v0.24.82-0",
"wire-web-config-default-master": "https://github.com/wireapp/wire-web-config-wire#v0.24.82-0",
"wire-web-config-default-staging": "https://github.com/wireapp/wire-web-config-default#v0.24.81"
"wire-web-config-default-ey": "https://github.com/wireapp/wire-web-config-ey.git#v0.24.83-0",
"wire-web-config-default-master": "https://github.com/wireapp/wire-web-config-wire#v0.24.83-0",
"wire-web-config-default-staging": "https://github.com/wireapp/wire-web-config-default#v0.24.82"
}
}
28 changes: 14 additions & 14 deletions package.json
Expand Up @@ -27,7 +27,7 @@
"raygun4js": "2.20.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-intl": "4.6.9",
"react-intl": "4.7.5",
"react-intl-po": "2.2.2",
"react-redux": "7.2.0",
"react-router": "5.2.0",
Expand All @@ -36,7 +36,7 @@
"redux-logdown": "1.0.4",
"redux-thunk": "2.3.0",
"sdp-transform": "2.14.0",
"simplebar": "5.2.0",
"simplebar": "5.2.1",
"speakingurl": "14.0.1",
"switch-path": "1.2.0",
"tsyringe": "4.3.0",
Expand Down Expand Up @@ -65,7 +65,7 @@
"@types/faker": "4.1.12",
"@types/generate-changelog": "1.8.0",
"@types/highlight.js": "9.12.4",
"@types/jasmine": "3.5.10",
"@types/jasmine": "3.5.11",
"@types/js-cookie": "2.2.6",
"@types/keyboardjs": "2.5.0",
"@types/libsodium-wrappers-sumo": "0.7.3",
Expand All @@ -74,10 +74,10 @@
"@types/open-graph": "0.2.0",
"@types/platform": "1.3.2",
"@types/raygun4js": "2.13.3",
"@types/react": "16.9.38",
"@types/react": "16.9.41",
"@types/react-dom": "16.9.8",
"@types/react-redux": "7.1.9",
"@types/react-router": "5.1.7",
"@types/react-router": "5.1.8",
"@types/react-router-dom": "5.1.5",
"@types/redux-mock-store": "1.0.2",
"@types/sdp-transform": "2.4.3",
Expand All @@ -86,16 +86,16 @@
"@types/uint32": "0.2.0",
"@types/underscore": "1.10.1",
"@types/webpack-env": "1.15.2",
"@typescript-eslint/eslint-plugin": "3.3.0",
"@typescript-eslint/parser": "3.3.0",
"@typescript-eslint/eslint-plugin": "3.4.0",
"@typescript-eslint/parser": "3.4.0",
"@wireapp/copy-config": "1.0.12",
"@wireapp/eslint-config": "1.7.1",
"@wireapp/prettier-config": "0.3.0",
"adm-zip": "0.4.14",
"autoprefixer": "9.8.1",
"adm-zip": "0.4.16",
"autoprefixer": "9.8.4",
"babel-eslint": "10.1.0",
"babel-loader": "8.1.0",
"babel-plugin-react-intl": "7.5.21",
"babel-plugin-react-intl": "7.5.24",
"concurrently": "5.2.0",
"cross-env": "7.0.2",
"cspell": "4.0.63",
Expand All @@ -104,11 +104,11 @@
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.2",
"enzyme-to-json": "3.5.0",
"eslint": "7.3.0",
"eslint": "7.3.1",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-babel": "5.3.0",
"eslint-plugin-import": "2.21.2",
"eslint-plugin-jsdoc": "28.0.0",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jsdoc": "28.5.1",
"eslint-plugin-no-unsanitized": "3.1.2",
"eslint-plugin-prettier": "3.1.4",
"eslint-plugin-react": "7.20.0",
Expand Down Expand Up @@ -155,7 +155,7 @@
"redux-devtools-extension": "2.13.8",
"redux-logger": "3.0.6",
"redux-mock-store": "1.5.4",
"simple-git": "2.9.0",
"simple-git": "2.11.0",
"sinon": "9.0.2",
"snabbdom": "0.7.4",
"sort-json": "2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions server/package.json
Expand Up @@ -13,7 +13,7 @@
"fs-extra": "9.0.1",
"geolite2": "1.3.0",
"hbs": "4.1.1",
"helmet": "3.23.1",
"helmet": "3.23.3",
"logdown": "3.3.1",
"maxmind": "4.1.3",
"opn": "6.0.0",
Expand All @@ -26,7 +26,7 @@
"@types/fs-extra": "8.1.1",
"@types/hbs": "4.0.1",
"@types/helmet": "0.0.47",
"@types/jasmine": "3.5.10",
"@types/jasmine": "3.5.11",
"@types/node": "~10",
"jasmine": "3.5.0",
"nyc": "15.1.0",
Expand Down
34 changes: 8 additions & 26 deletions server/yarn.lock
Expand Up @@ -313,10 +313,10 @@
dependencies:
"@types/express" "*"

"@types/jasmine@3.5.10":
version "3.5.10"
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.5.10.tgz#a1a41012012b5da9d4b205ba9eba58f6cce2ab7b"
integrity sha512-3F8qpwBAiVc5+HPJeXJpbrl+XjawGmciN5LgiO7Gv1pl1RHtjoMNqZpqEksaPJW05ViKe8snYInRs6xB25Xdew==
"@types/jasmine@3.5.11":
version "3.5.11"
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.5.11.tgz#ba8e80639dffbe277f49c708b45373a320d158e2"
integrity sha512-fg1rOd/DehQTIJTifGqGVY6q92lDgnLfs7C6t1ccSwQrMyoTGSoH6wWzhJDZb6ezhsdwAX4EIBLe8w5fXWmEng==

"@types/mime@*":
version "2.0.1"
Expand Down Expand Up @@ -941,11 +941,6 @@ diff@^4.0.1:
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff"
integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==

dns-prefetch-control@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/dns-prefetch-control/-/dns-prefetch-control-0.2.0.tgz#73988161841f3dcc81f47686d539a2c702c88624"
integrity sha512-hvSnros73+qyZXhHFjx2CMLwoj3Fe7eR9EJsFsqmcI1bB2OBWL/+0YzaEaKssCHnj/6crawNnUyw74Gm2EKe+Q==

dont-sniff-mimetype@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz#c7d0427f8bcb095762751252af59d148b0a623b2"
Expand Down Expand Up @@ -1110,11 +1105,6 @@ eventemitter2@~0.4.14:
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab"
integrity sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=

expect-ct@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/expect-ct/-/expect-ct-0.2.0.tgz#3a54741b6ed34cc7a93305c605f63cd268a54a62"
integrity sha512-6SK3MG/Bbhm8MsgyJAylg+ucIOU71/FzyFalcfu5nY19dH8y/z0tBJU0wrNBXD4B27EoQtqPF/9wqH0iYAd04g==

express-sitemap-xml@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/express-sitemap-xml/-/express-sitemap-xml-1.1.0.tgz#f440f16f39ca2bc7a09fd526774801fc78d48753"
Expand Down Expand Up @@ -1265,11 +1255,6 @@ forwarded@~0.1.2:
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84"
integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=

frameguard@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/frameguard/-/frameguard-3.1.0.tgz#bd1442cca1d67dc346a6751559b6d04502103a22"
integrity sha512-TxgSKM+7LTA6sidjOiSZK9wxY0ffMPY3Wta//MqwmX0nZuEHc8QrkV8Fh3ZhMJeiH+Uyh/tcaarImRy8u77O7g==

fresh@0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
Expand Down Expand Up @@ -1478,17 +1463,14 @@ helmet-csp@2.10.0:
content-security-policy-builder "2.1.0"
dasherize "2.0.0"

helmet@3.23.1:
version "3.23.1"
resolved "https://registry.yarnpkg.com/helmet/-/helmet-3.23.1.tgz#97067661c678d6c8d730dda001406f1946a6c6d1"
integrity sha512-e034HHfRK4065BFjYbffn5jXaTWWrhTNgmLIppsGEOjpdDB1MBQkWlAFW/auULXAu6uKk2X76n7a7gvz5sSjkg==
helmet@3.23.3:
version "3.23.3"
resolved "https://registry.yarnpkg.com/helmet/-/helmet-3.23.3.tgz#5ba30209c5f73ded4ab65746a3a11bedd4579ab7"
integrity sha512-U3MeYdzPJQhtvqAVBPntVgAvNSOJyagwZwyKsFdyRa8TV3pOKVFljalPOCxbw5Wwf2kncGhmP0qHjyazIdNdSA==
dependencies:
depd "2.0.0"
dns-prefetch-control "0.2.0"
dont-sniff-mimetype "1.1.0"
expect-ct "0.2.0"
feature-policy "0.3.0"
frameguard "3.1.0"
helmet-crossdomain "0.4.0"
helmet-csp "2.10.0"
hide-powered-by "1.1.0"
Expand Down
8 changes: 4 additions & 4 deletions src/page/template/content/preferences-account.htm
Expand Up @@ -54,11 +54,11 @@
<div class="preferences-account-username-hint text-foreground font-size-xs"
data-bind="text: t('preferencesAccountUsernameHint')"></div>
<!-- /ko -->
<!-- ko if: usernameState() === z.viewModel.content.PreferencesAccountViewModel.USERNAME_STATE.AVAILABLE -->
<!-- ko if: usernameState() === UserNameState.AVAILABLE -->
<div class="preferences-account-username-error font-size-xs"
data-bind="text: t('preferencesAccountUsernameAvailable')"></div>
<!-- /ko -->
<!-- ko if: usernameState() === z.viewModel.content.PreferencesAccountViewModel.USERNAME_STATE.TAKEN -->
<!-- ko if: usernameState() === UserNameState.TAKEN -->
<div class="preferences-account-username-error font-size-xs"
data-bind="text: t('preferencesAccountUsernameErrorTaken'), css: {'text-red': submittedUsername() === enteredUsername()}"></div>
<!-- /ko -->
Expand Down Expand Up @@ -91,7 +91,7 @@
<participant-avatar params="participant: selfUser, size: ParticipantAvatar.SIZE.X_LARGE"></participant-avatar>
<input id="self-upload-file-input"
type="file"
data-bind="attr: {accept: z.viewModel.content.PreferencesAccountViewModel.CONFIG.PROFILE_IMAGE.FILE_TYPES.join(',')}, file_select: clickOnChangePicture"
data-bind="attr: {accept: Config.PROFILE_IMAGE.FILE_TYPES.join(',')}, file_select: clickOnChangePicture"
data-uie-name="do-select-picture"/>
<span class="icon-camera"></span>
</label>
Expand Down Expand Up @@ -186,7 +186,7 @@
</section>
<!-- /ko -->

<!-- ko if: isActivatedAccount() && !Environment.desktop -->
<!-- ko if: isActivatedAccount() && !isDesktop -->
<section class="preferences-section">
<div class="preferences-link accent-text" data-bind="click: clickOnLogout, text: t('preferencesAccountLogOut')" data-uie-name="do-logout"></div>
</section>
Expand Down
4 changes: 1 addition & 3 deletions src/page/template/list/temporary-guest.htm
Expand Up @@ -9,14 +9,12 @@
conversation: getConversationById(activeCall.conversationId),
multitasking: multitasking,
callingRepository: callingRepository,
temporaryUserStyle: true,
callActions: callActions,
hasAccessToCamera: hasAccessToCamera()"
data-uie-name="item-call">
</conversation-list-calling-cell>
<!-- /ko -->
<!-- ko if: $parent.hasJoinableCall() && !activeCalls -->
<div class="call-ui__button call-ui__button--green call-ui__button--join" style="margin: 0 16px;" data-bind="click: onClickJoinCall, text: t('callJoin')" data-uie-name="do-call-controls-call-join"></div>
<!-- /ko -->
<!-- /ko -->
<div class="temporary-guest__content">
<logo-full-icon></logo-full-icon>
Expand Down
12 changes: 12 additions & 0 deletions src/script/components/list/conversationListCallingCell.ts
Expand Up @@ -66,6 +66,7 @@ class ConversationListCallingCell {
readonly dispose: () => void;
readonly isConnecting: ko.PureComputed<boolean>;
readonly isDeclined: ko.PureComputed<boolean>;
readonly isStillOngoing: ko.PureComputed<boolean>;
readonly isIdle: ko.PureComputed<boolean>;
readonly isIncoming: ko.PureComputed<boolean>;
readonly isMuted: ko.Observable<boolean>;
Expand All @@ -79,6 +80,7 @@ class ConversationListCallingCell {
readonly showParticipants: ko.Observable<boolean>;
readonly showParticipantsButton: ko.PureComputed<boolean>;
readonly showVideoButton: ko.PureComputed<boolean>;
readonly showJoinButton: ko.PureComputed<boolean>;
readonly showVideoGrid: ko.PureComputed<boolean>;
readonly temporaryUserStyle: boolean;
readonly videoGrid: ko.PureComputed<Grid>;
Expand Down Expand Up @@ -126,6 +128,8 @@ class ConversationListCallingCell {
[CALL_REASON.STILL_ONGOING, CALL_REASON.ANSWERED_ELSEWHERE].includes(call.reason()),
);

this.isStillOngoing = ko.pureComputed(() => [CALL_REASON.STILL_ONGOING].includes(call.reason()));

this.isMuted = callingRepository.isMuted;

this.callDuration = ko.observable();
Expand Down Expand Up @@ -157,6 +161,7 @@ class ConversationListCallingCell {
});

this.showVideoButton = ko.pureComputed(() => call.initialType === CALL_TYPE.VIDEO || this.isOngoing());
this.showJoinButton = ko.pureComputed(() => conversation() && this.isStillOngoing() && temporaryUserStyle);
this.disableScreenButton = !this.callingRepository.supportsScreenSharing;
this.disableVideoButton = ko.pureComputed(() => {
const selfParticipant = call.getSelfParticipant();
Expand Down Expand Up @@ -189,6 +194,10 @@ class ConversationListCallingCell {
return this.isIncoming() ? this.callActions.reject(call) : this.callActions.leave(call);
}

joinCall(call: Call) {
this.callActions.answer(call);
}

showFullscreenVideoGrid(): void {
this.multitasking.autoMinimize(false);
this.multitasking.isMinimized(false);
Expand All @@ -213,6 +222,9 @@ class ConversationListCallingCell {

ko.components.register('conversation-list-calling-cell', {
template: `
<!-- ko if: showJoinButton() -->
<div class="call-ui__button call-ui__button--green call-ui__button--join" style="margin: 16px 16px 0 16px;" data-bind="click: () => joinCall(call), text: t('callJoin')" data-uie-name="do-call-controls-call-join"></div>
<!-- /ko -->
<!-- ko if: conversation() && !isDeclined() -->
<div class="conversation-list-calling-cell conversation-list-cell">
<!-- ko ifnot: temporaryUserStyle -->
Expand Down
29 changes: 14 additions & 15 deletions src/script/conversation/ConversationRepository.js
Expand Up @@ -1590,19 +1590,19 @@ export class ConversationRepository {
* @param {Date} isoDate Date of member removal
* @returns {Promise<void>} No return value
*/
teamMemberLeave(teamId, userId, isoDate = this.serverTimeHandler.toServerTimestamp()) {
return this.userRepository.getUserById(userId).then(userEntity => {
this.conversations()
.filter(conversationEntity => {
const conversationInTeam = conversationEntity.team_id === teamId;
const userIsParticipant = conversationEntity.participating_user_ids().includes(userId);
return conversationInTeam && userIsParticipant && !conversationEntity.removed_from_conversation();
})
.forEach(conversationEntity => {
const leaveEvent = EventBuilder.buildTeamMemberLeave(conversationEntity, userEntity, isoDate);
this.eventRepository.injectEvent(leaveEvent);
});
});
async teamMemberLeave(teamId, userId, isoDate = this.serverTimeHandler.toServerTimestamp()) {
const userEntity = await this.userRepository.getUserById(userId);
this.conversations()
.filter(conversationEntity => {
const conversationInTeam = conversationEntity.team_id === teamId;
const userIsParticipant = conversationEntity.participating_user_ids().includes(userId);
return conversationInTeam && userIsParticipant && !conversationEntity.removed_from_conversation();
})
.forEach(conversationEntity => {
const leaveEvent = EventBuilder.buildTeamMemberLeave(conversationEntity, userEntity, isoDate);
this.eventRepository.injectEvent(leaveEvent);
});
userEntity.isDeleted = true;
}

/**
Expand Down Expand Up @@ -4167,8 +4167,7 @@ export class ConversationRepository {

const asset_et = message_et.get_first_asset();
if (asset_et) {
const is_proper_asset = asset_et.is_audio() || asset_et.is_file() || asset_et.is_video();
if (!is_proper_asset) {
if (!asset_et.is_downloadable()) {
throw new Error(`Tried to update message with wrong asset type as upload failed '${asset_et.type}'`);
}

Expand Down
4 changes: 4 additions & 0 deletions src/script/entity/message/Asset.ts
Expand Up @@ -43,6 +43,10 @@ export class Asset {
this.type = '';
}

is_downloadable(): boolean {
return this.is_audio() || this.is_file() || this.is_video() || this.is_image();
}

is_image(): this is MediumImageAsset {
return this.type === AssetType.IMAGE;
}
Expand Down
1 change: 0 additions & 1 deletion src/script/main/globals.ts
Expand Up @@ -67,7 +67,6 @@ import '../view_model/bindings/MessageListBindings';
import '../view_model/bindings/VideoCallingBindings';
import '../view_model/content/InputBarViewModel';
import '../view_model/content/PreferencesAboutViewModel';
import '../view_model/content/PreferencesAccountViewModel';
import '../view_model/content/PreferencesDeviceDetailsViewModel';
import '../view_model/content/PreferencesDevicesViewModel';
import '../view_model/content/TitleBarViewModel';
Expand Down
Expand Up @@ -29,7 +29,7 @@ import type {User} from '../entity/User';
import {BackendEvent} from '../event/Backend';
import {PropertiesRepository} from '../properties/PropertiesRepository';

interface Notification {
export interface Notification {
data: ClientEntity | boolean;
type: string;
}
Expand Down
2 changes: 1 addition & 1 deletion src/script/properties/PropertiesRepository.ts
Expand Up @@ -53,7 +53,7 @@ export class PropertiesRepository {

private readonly logger: Logger;
private readonly propertiesService: PropertiesService;
private readonly receiptMode: ko.Observable<any>;
public readonly receiptMode: ko.Observable<Confirmation.Type>;
private readonly selfService: SelfService;
private readonly selfUser: ko.Observable<User>;
public properties: WebappProperties;
Expand Down
4 changes: 2 additions & 2 deletions src/script/team/TeamRepository.ts
Expand Up @@ -73,7 +73,7 @@ export class TeamRepository {
private readonly supportsLegalHold: ko.Observable<boolean>;
private readonly teamMapper: TeamMapper;
readonly teamMembers: ko.PureComputed<User[]>;
private readonly teamName: ko.PureComputed<string>;
public readonly teamName: ko.PureComputed<string>;
readonly teamUsers: ko.PureComputed<User[]>;
private readonly userRepository: UserRepository;
private readonly assetRepository: AssetRepository;
Expand Down Expand Up @@ -298,7 +298,7 @@ export class TeamRepository {
return;
}

const members = await this.teamService.getTeamMembersByIds(teamEntity.id, memberIds);
const members = await this.teamService.getTeamMembersByIds(teamId, memberIds);
const mappedMembers = this.teamMapper.mapMemberFromArray(members);
memberIds = mappedMembers.map(member => member.userId);

Expand Down

0 comments on commit 8ac43c7

Please sign in to comment.