edit group editing title to match Android

pull/1306/head
Audric Ackermann 5 years ago
parent 1f228fe6ee
commit 5739d78ada
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1645,25 +1645,22 @@
"message": "Select message", "message": "Select message",
"description": "Button action that the user can click to select the message" "description": "Button action that the user can click to select the message"
}, },
"copiedMessage": { "editGroup": {
"message": "Message text copied", "message": "Edit group",
"description": "A toast message telling the user that the message text was copied" "description": "Button action that the user can click to edit a group name (open)",
}, "androidKey": "conversation__menu_edit_group"
"editGroupNameOrPicture": {
"message": "Edit group name or picture",
"description": "Button action that the user can click to edit a group name (open)"
}, },
"editGroupName": { "editGroupName": {
"message": "Edit group name", "message": "Edit group name",
"description": "Button action that the user can click to edit a group name (closed)" "description": "Button action that the user can click to edit a group name (closed)"
}, },
"updateGroupDialogTitle": { "updateGroupDialogTitle": {
"message": "Updating a Closed Group", "message": "Updating $name$...",
"description": "Title for the dialog box used to update an existing private group" "description": "Title for the dialog box used to update an existing private group",
}, "androidKey": "GroupCreateActivity_updating_group",
"updatePublicGroupDialogTitle": { "androidReplace": {
"message": "Updating a open group Channel", "%1$s": "$name$"
"description": "Title for the dialog box used to update an existing open group channel" }
}, },
"showRecoveryPhrase": { "showRecoveryPhrase": {
"message": "Show Recovery Phrase", "message": "Show Recovery Phrase",

@ -12,7 +12,8 @@
this.groupName = groupConvo.get('name'); this.groupName = groupConvo.get('name');
this.conversation = groupConvo; this.conversation = groupConvo;
this.titleText = i18n('updateGroupDialogTitle'); this.titleText = i18n('updateGroupDialogTitle', this.groupName);
this.close = this.close.bind(this); this.close = this.close.bind(this);
this.onSubmit = this.onSubmit.bind(this); this.onSubmit = this.onSubmit.bind(this);
this.isPublic = groupConvo.isPublic(); this.isPublic = groupConvo.isPublic();
@ -27,9 +28,7 @@
// public chat settings overrides // public chat settings overrides
if (this.isPublic) { if (this.isPublic) {
// fix the title // fix the title
this.titleText = `${i18n('updatePublicGroupDialogTitle')}: ${ this.titleText = i18n('updateGroupDialogTitle', this.groupName);
this.groupName
}`;
// I'd much prefer to integrate mods with groupAdmins // I'd much prefer to integrate mods with groupAdmins
// but lets discuss first... // but lets discuss first...
this.isAdmin = groupConvo.isModerator( this.isAdmin = groupConvo.isModerator(
@ -88,9 +87,7 @@
this.avatarPath = groupConvo.getAvatarPath(); this.avatarPath = groupConvo.getAvatarPath();
if (this.isPublic) { if (this.isPublic) {
this.titleText = `${i18n('updatePublicGroupDialogTitle')}: ${ this.titleText = i18n('updateGroupDialogTitle', this.groupName);
this.groupName
}`;
// I'd much prefer to integrate mods with groupAdmins // I'd much prefer to integrate mods with groupAdmins
// but lets discuss first... // but lets discuss first...
this.isAdmin = groupConvo.isModerator( this.isAdmin = groupConvo.isModerator(
@ -100,7 +97,7 @@
this.contactsAndMembers = []; this.contactsAndMembers = [];
this.existingMembers = []; this.existingMembers = [];
} else { } else {
this.titleText = i18n('updateGroupDialogTitle'); this.titleText = i18n('updateGroupDialogTitle', this.groupName);
this.isAdmin = groupConvo.get('groupAdmins').includes(ourPK); this.isAdmin = groupConvo.get('groupAdmins').includes(ourPK);
const convos = window.getConversations().models.filter(d => !!d); const convos = window.getConversations().models.filter(d => !!d);

@ -50,8 +50,6 @@
let message = ''; let message = '';
let instructions = ''; let instructions = '';
let hasInterruption = false; let hasInterruption = false;
let action = null;
let buttonClass = null;
const socketStatus = this.getSocketStatus(); const socketStatus = this.getSocketStatus();
switch (socketStatus) { switch (socketStatus) {
@ -106,20 +104,14 @@
hasInterruption = true; hasInterruption = true;
message = i18n('offline'); message = i18n('offline');
instructions = i18n('checkNetworkConnection'); instructions = i18n('checkNetworkConnection');
} else if (!Whisper.Registration.isDone()) {
hasInterruption = true;
message = i18n('unlinked');
instructions = i18n('unlinkedWarning');
action = i18n('relink');
buttonClass = 'openInstaller';
} }
return { return {
message, message,
instructions, instructions,
hasInterruption, hasInterruption,
action, action: null,
buttonClass, buttonClass: null,
}; };
}, },
update() { update() {

@ -267,9 +267,7 @@ export class SessionGroupSettings extends React.Component<Props, any> {
role="button" role="button"
onClick={this.props.onUpdateGroupName} onClick={this.props.onUpdateGroupName}
> >
{isPublic {isPublic ? window.i18n('editGroup') : window.i18n('editGroupName')}
? window.i18n('editGroupNameOrPicture')
: window.i18n('editGroupName')}
</div> </div>
)} )}
{showUpdateGroupMembersButton && ( {showUpdateGroupMembersButton && (

@ -174,9 +174,7 @@ export function getUpdateGroupNameMenuItem(
i18n: LocalizerType i18n: LocalizerType
): JSX.Element | null { ): JSX.Element | null {
if (showUpdateGroupName(Boolean(amMod), Boolean(isKickedFromGroup))) { if (showUpdateGroupName(Boolean(amMod), Boolean(isKickedFromGroup))) {
return ( return <MenuItem onClick={action}>{i18n('editGroup')}</MenuItem>;
<MenuItem onClick={action}>{i18n('editGroupNameOrPicture')}</MenuItem>
);
} }
return null; return null;
} }

Loading…
Cancel
Save