fix: address regression tests UI issues

pull/2515/head
Audric Ackermann 3 years ago
parent ffc7ed0b32
commit dcf2f96c9f

@ -251,7 +251,7 @@
"userBanned": "Banned successfully", "userBanned": "Banned successfully",
"userBanFailed": "Ban failed!", "userBanFailed": "Ban failed!",
"leaveGroup": "Leave Group", "leaveGroup": "Leave Group",
"leaveAndRemoveForEveryone": "Leave Group and remove for everyone", "leaveAndRemoveForEveryone": "Leave Group and Remove for Everyone",
"leaveGroupConfirmation": "Are you sure you want to leave this group?", "leaveGroupConfirmation": "Are you sure you want to leave this group?",
"leaveGroupConfirmationAdmin": "As you are the admin of this group, if you leave it it will be removed for every current members. Are you sure you want to leave this group?", "leaveGroupConfirmationAdmin": "As you are the admin of this group, if you leave it it will be removed for every current members. Are you sure you want to leave this group?",
"cannotRemoveCreatorFromGroup": "Cannot remove this user", "cannotRemoveCreatorFromGroup": "Cannot remove this user",
@ -274,6 +274,8 @@
"removeAccountPasswordDescription": "Remove the password required to unlock Session.", "removeAccountPasswordDescription": "Remove the password required to unlock Session.",
"enterPassword": "Please enter your password", "enterPassword": "Please enter your password",
"confirmPassword": "Confirm password", "confirmPassword": "Confirm password",
"enterNewPassword": "Please enter your new password",
"confirmNewPassword": "Confirm new password",
"showRecoveryPhrasePasswordRequest": "Please enter your password", "showRecoveryPhrasePasswordRequest": "Please enter your password",
"recoveryPhraseSavePromptMain": "Your recovery phrase is the master key to your Session ID — you can use it to restore your Session ID if you lose access to your device. Store your recovery phrase in a safe place, and don't give it to anyone.", "recoveryPhraseSavePromptMain": "Your recovery phrase is the master key to your Session ID — you can use it to restore your Session ID if you lose access to your device. Store your recovery phrase in a safe place, and don't give it to anyone.",
"invalidOpenGroupUrl": "Invalid URL", "invalidOpenGroupUrl": "Invalid URL",

@ -89,6 +89,7 @@
margin-bottom: 5px; margin-bottom: 5px;
margin-top: 10px; margin-top: 10px;
padding-left: 10px; padding-left: 10px;
padding-right: 5px;
} }
.module-quote--no-click { .module-quote--no-click {

@ -319,7 +319,7 @@ pre {
overflow: hidden; overflow: hidden;
min-width: 30px; min-width: 30px;
// To limit messages with things forcing them wider, like long attachment names // To limit messages with things forcing them wider, like long attachment names
max-width: calc(100vw - 380px - 100px); max-width: 100%;
align-items: center; align-items: center;
} }
label { label {
@ -793,7 +793,7 @@ label {
align-items: center; align-items: center;
max-width: 90%; max-width: 90%;
width: 600px; min-width: 400px;
background: var(--color-cell-background); background: var(--color-cell-background);
color: var(--color-text); color: var(--color-text);

@ -26,10 +26,10 @@ const StyledSessionToggle = styled.div<{ active: boolean }>`
border: 1px solid #e5e5ea; // TODO Theming update border: 1px solid #e5e5ea; // TODO Theming update
border-radius: 16px; border-radius: 16px;
position: relative; position: relative;
cursor: pointer; cursor: pointer;
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
transition: var(--default-duration); transition: var(--default-duration);
flex-shrink: 0;
background-color: ${props => background-color: ${props =>
props.active ? 'var(--color-accent)' : 'var(--color-clickable-hovered)'}; props.active ? 'var(--color-accent)' : 'var(--color-clickable-hovered)'};

@ -23,6 +23,7 @@ const ExpireTimerCount = styled.div<{
text-transform: uppercase; text-transform: uppercase;
user-select: none; user-select: none;
color: ${props => props.color}; color: ${props => props.color};
flex-shrink: 0;
`; `;
const ExpireTimerBucket = styled.div` const ExpireTimerBucket = styled.div`

@ -44,6 +44,10 @@ const StyledMessageContentContainer = styled.div<{ direction: 'left' | 'right' }
} }
`; `;
const StyledMessageWithAuthor = styled.div<{ isOutgoing: boolean }>`
max-width: ${props => (props.isOutgoing ? 'calc(100% - 17px)' : '100%')};
`;
export const MessageContentWithStatuses = (props: Props) => { export const MessageContentWithStatuses = (props: Props) => {
const contentProps = useSelector(state => const contentProps = useSelector(state =>
getMessageContentWithStatusesSelectorProps(state as any, props.messageId) getMessageContentWithStatusesSelectorProps(state as any, props.messageId)
@ -122,11 +126,11 @@ export const MessageContentWithStatuses = (props: Props) => {
messageId={messageId} messageId={messageId}
isCorrectSide={isIncoming} isCorrectSide={isIncoming}
/> />
<div> <StyledMessageWithAuthor isOutgoing={!isIncoming}>
<MessageAuthorText messageId={messageId} /> <MessageAuthorText messageId={messageId} />
<MessageContent messageId={messageId} isDetailView={isDetailView} /> <MessageContent messageId={messageId} isDetailView={isDetailView} />
</div> </StyledMessageWithAuthor>
<MessageStatus <MessageStatus
dataTestId="msg-status-outgoing" dataTestId="msg-status-outgoing"
messageId={messageId} messageId={messageId}

@ -50,14 +50,21 @@ export class SessionPasswordDialog extends React.Component<Props, State> {
public render() { public render() {
const { passwordAction } = this.props; const { passwordAction } = this.props;
const placeholders = let placeholders: Array<string> = [];
passwordAction === 'change' switch (passwordAction) {
? [ case 'change':
placeholders = [
window.i18n('typeInOldPassword'), window.i18n('typeInOldPassword'),
window.i18n('enterPassword'), window.i18n('enterPassword'),
window.i18n('confirmPassword'), window.i18n('confirmPassword'),
] ];
: [window.i18n('enterPassword'), window.i18n('confirmPassword')]; break;
case 'remove':
placeholders = [window.i18n('enterPassword'), window.i18n('confirmPassword')];
break;
default:
placeholders = [window.i18n('enterNewPassword'), window.i18n('confirmNewPassword')];
}
const confirmButtonColor = const confirmButtonColor =
passwordAction === 'remove' ? SessionButtonColor.Danger : SessionButtonColor.Green; passwordAction === 'remove' ? SessionButtonColor.Danger : SessionButtonColor.Green;

@ -2069,11 +2069,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
attachments attachments
.filter( .filter(
(attachment: any) => (attachment: any) =>
attachment && attachment && attachment.contentType && !attachment.pending && !attachment.error
attachment.contentType &&
!attachment.pending &&
!attachment.error &&
attachment?.thumbnail?.path // loadAttachmentData throws if the thumbnail.path is not set
) )
.slice(0, 1) .slice(0, 1)
.map(async (attachment: any) => { .map(async (attachment: any) => {
@ -2084,7 +2080,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
// Our protos library complains about this field being undefined, so we // Our protos library complains about this field being undefined, so we
// force it to null // force it to null
fileName: fileName || null, fileName: fileName || null,
thumbnail: thumbnail thumbnail: attachment?.thumbnail?.path // loadAttachmentData throws if the thumbnail.path is not set
? { ? {
...(await loadAttachmentData(thumbnail)), ...(await loadAttachmentData(thumbnail)),
objectUrl: getAbsoluteAttachmentPath(thumbnail.path), objectUrl: getAbsoluteAttachmentPath(thumbnail.path),

@ -141,9 +141,9 @@ export function pushedMissedCall(conversationName: string) {
); );
} }
const openPrivacySettings = () => { const openPermissionsSettings = () => {
window.inboxStore?.dispatch(showLeftPaneSection(SectionType.Settings)); window.inboxStore?.dispatch(showLeftPaneSection(SectionType.Settings));
window.inboxStore?.dispatch(showSettingsSection(SessionSettingCategory.Privacy)); window.inboxStore?.dispatch(showSettingsSection(SessionSettingCategory.Permissions));
}; };
export function pushedMissedCallCauseOfPermission(conversationName: string) { export function pushedMissedCallCauseOfPermission(conversationName: string) {
@ -153,7 +153,7 @@ export function pushedMissedCallCauseOfPermission(conversationName: string) {
title={window.i18n('callMissedTitle')} title={window.i18n('callMissedTitle')}
description={window.i18n('callMissedCausePermission', [conversationName])} description={window.i18n('callMissedCausePermission', [conversationName])}
type={SessionToastType.Info} type={SessionToastType.Info}
onToastClick={openPrivacySettings} onToastClick={openPermissionsSettings}
/>, />,
{ toastId: id, updateId: id, autoClose: 10000 } { toastId: id, updateId: id, autoClose: 10000 }
); );
@ -172,7 +172,7 @@ export function pushVideoCallPermissionNeeded() {
'videoCallPermissionNeeded', 'videoCallPermissionNeeded',
window.i18n('cameraPermissionNeededTitle'), window.i18n('cameraPermissionNeededTitle'),
window.i18n('cameraPermissionNeeded'), window.i18n('cameraPermissionNeeded'),
openPrivacySettings openPermissionsSettings
); );
} }
@ -181,10 +181,7 @@ export function pushAudioPermissionNeeded() {
'audioPermissionNeeded', 'audioPermissionNeeded',
window.i18n('audioPermissionNeededTitle'), window.i18n('audioPermissionNeededTitle'),
window.i18n('audioPermissionNeeded'), window.i18n('audioPermissionNeeded'),
() => { openPermissionsSettings
window.inboxStore?.dispatch(showLeftPaneSection(SectionType.Settings));
window.inboxStore?.dispatch(showSettingsSection(SessionSettingCategory.Privacy));
}
); );
} }

@ -84,6 +84,7 @@ export type LocalizerKeys =
| 'mustBeApproved' | 'mustBeApproved'
| 'appMenuHideOthers' | 'appMenuHideOthers'
| 'sendFailed' | 'sendFailed'
| 'enterNewPassword'
| 'expandedReactionsText' | 'expandedReactionsText'
| 'openMessageRequestInbox' | 'openMessageRequestInbox'
| 'enterPassword' | 'enterPassword'
@ -261,6 +262,7 @@ export type LocalizerKeys =
| 'audioMessageAutoplayDescription' | 'audioMessageAutoplayDescription'
| 'leaveAndRemoveForEveryone' | 'leaveAndRemoveForEveryone'
| 'previewThumbnail' | 'previewThumbnail'
| 'primaryColorPurple'
| 'photo' | 'photo'
| 'setPassword' | 'setPassword'
| 'editMenuDeleteContact' | 'editMenuDeleteContact'
@ -291,7 +293,7 @@ export type LocalizerKeys =
| 'newMessage' | 'newMessage'
| 'windowMenuClose' | 'windowMenuClose'
| 'mainMenuFile' | 'mainMenuFile'
| 'primaryColorPurple' | 'confirmNewPassword'
| 'callMissed' | 'callMissed'
| 'getStarted' | 'getStarted'
| 'reactionListCountSingular' | 'reactionListCountSingular'

Loading…
Cancel
Save