Merge branch 'devel' into features

This commit is contained in:
aforge
2021-08-15 09:47:38 +03:00
27 changed files with 1143 additions and 1570 deletions
+2 -2
View File
@@ -462,7 +462,7 @@ div.alert .content {
position: relative; position: relative;
display: flex; display: flex;
height: 100%; height: 100%;
max-width: 80rem; max-width: 84rem;
overflow: hidden; overflow: hidden;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
@@ -1416,7 +1416,7 @@ i.search {
.chat-box .bubble { .chat-box .bubble {
position: relative; position: relative;
display: flex; display: flex;
max-width: 40rem; max-width: 36rem;
min-width: 9rem; min-width: 9rem;
height: auto; height: auto;
padding: 0.75rem 0.5rem 0.75rem 0.5rem; padding: 0.75rem 0.5rem 0.75rem 0.5rem;
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -5
View File
@@ -22,11 +22,11 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500,700,700i" /> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500,700,700i" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" /> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="css/base.min.css" /> <link rel="stylesheet" href="css/base.min.css" />
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react@17.0.1/umd/react.production.min.js"></script> <script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react@17.0.2/umd/react.production.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react-dom@17.0.1/umd/react-dom.production.min.js"></script> <script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react-dom@17.0.2/umd/react-dom.production.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react-intl@5.18.3/react-intl.iife.min.js"></script> <script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/react-intl@5.20.7/react-intl.iife.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/firebase@8.7.1/firebase-app.js"></script> <script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/firebase@8.9.1/firebase-app.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/firebase@8.7.1/firebase-messaging.js"></script> <script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/firebase@8.9.1/firebase-messaging.js"></script>
</head> </head>
<body> <body>
<noscript><div id="noscript-message"><div id="noscript-title">Javascript support is required.</div> <noscript><div id="noscript-message"><div id="noscript-title">Javascript support is required.</div>
+972 -1513
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -1,7 +1,7 @@
{ {
"name": "tinode-webapp", "name": "tinode-webapp",
"description": "Tinode messenger for the web", "description": "Tinode messenger for the web",
"version": "0.17.8", "version": "0.17.8-rc1",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/tinode/example-react-js.git" "url": "https://github.com/tinode/example-react-js.git"
@@ -64,11 +64,11 @@
"author": "Tinode Authors <info@tinode.co>", "author": "Tinode Authors <info@tinode.co>",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"firebase": "^8.7.1", "firebase": "^8.9.1",
"react": "^17.0.1", "react": "^17.0.2",
"react-dom": "^17.0.1", "react-dom": "^17.0.2",
"react-intl": "^5.20.2", "react-intl": "^5.20.2",
"tinode-sdk": "^0.17.8" "tinode-sdk": "^0.17.8-rc1"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.14.5", "@babel/core": "^7.14.5",
+2 -2
View File
@@ -1,6 +1,6 @@
// Must be located at the root. // Must be located at the root.
importScripts('https://cdn.jsdelivr.net/npm/firebase@8.7.1/firebase-app.js'); importScripts('https://cdn.jsdelivr.net/npm/firebase@8.9.1/firebase-app.js');
importScripts('https://cdn.jsdelivr.net/npm/firebase@8.7.1/firebase-messaging.js'); importScripts('https://cdn.jsdelivr.net/npm/firebase@8.9.1/firebase-messaging.js');
importScripts('firebase-init.js'); importScripts('firebase-init.js');
importScripts('version.js'); importScripts('version.js');
+2 -1
View File
@@ -175,5 +175,6 @@
"channel": "Sender", "channel": "Sender",
"drafty_attachment": "Dateianhang", "drafty_attachment": "Dateianhang",
"drafty_form": "Formular:", "drafty_form": "Formular:",
"drafty_image": "Bild" "drafty_image": "Bild",
"topic_delete": "Chat löschen"
} }
+2 -1
View File
@@ -169,7 +169,8 @@
"title_permissions": "Permissions", "title_permissions": "Permissions",
"title_tag_manager": "Tags (user discovery)", "title_tag_manager": "Tags (user discovery)",
"topic_block_warning": "Are you sure you want to block this conversation?", "topic_block_warning": "Are you sure you want to block this conversation?",
"topic_delete_warning": "Are you sure you want to delete this conversation?", "topic_delete": "Delete Conversation",
"topic_delete_warning": "Are you sure you want to delete this conversation? It cannot be undone.",
"topic_name_editing_placeholder": "Freeform name of the group", "topic_name_editing_placeholder": "Freeform name of the group",
"unnamed_topic": "Unnamed", "unnamed_topic": "Unnamed",
"update_available": "Update available.", "update_available": "Update available.",
+2 -1
View File
@@ -175,5 +175,6 @@
"channel": "canal", "channel": "canal",
"drafty_attachment": "Archivo", "drafty_attachment": "Archivo",
"drafty_form": "Formulario:", "drafty_form": "Formulario:",
"drafty_image": "Imagen" "drafty_image": "Imagen",
"topic_delete": "Eliminar chat"
} }
+5 -1
View File
@@ -677,8 +677,12 @@
"defaultMessage": "Are you sure you want to block this conversation?", "defaultMessage": "Are you sure you want to block this conversation?",
"description": "Alert warning when blocking a topic." "description": "Alert warning when blocking a topic."
}, },
"topic_delete": {
"defaultMessage": "Delete Conversation",
"description": "Alert title when deleting the topic."
},
"topic_delete_warning": { "topic_delete_warning": {
"defaultMessage": "Are you sure you want to delete this conversation?", "defaultMessage": "Are you sure you want to delete this conversation? It cannot be undone.",
"description": "Alert warning when deleting entire topic" "description": "Alert warning when deleting entire topic"
}, },
"topic_name_editing_placeholder": { "topic_name_editing_placeholder": {
+2 -1
View File
@@ -178,5 +178,6 @@
"channel": "채널", "channel": "채널",
"drafty_attachment": "부착", "drafty_attachment": "부착",
"drafty_form": "형태:", "drafty_form": "형태:",
"drafty_image": "이미지" "drafty_image": "이미지",
"topic_delete": "채팅 삭제"
} }
+2 -1
View File
@@ -175,5 +175,6 @@
"title_manage_tags": "Administrează", "title_manage_tags": "Administrează",
"drafty_attachment": "Atasament", "drafty_attachment": "Atasament",
"drafty_form": "Formă:", "drafty_form": "Formă:",
"drafty_image": "Imagine" "drafty_image": "Imagine",
"topic_delete": "Ștergeți Chat"
} }
+2 -1
View File
@@ -175,5 +175,6 @@
"channel": "канал", "channel": "канал",
"drafty_attachment": "Аттачмент", "drafty_attachment": "Аттачмент",
"drafty_form": "Форма:", "drafty_form": "Форма:",
"drafty_image": "Картинка" "drafty_image": "Картинка",
"topic_delete": "Удалить чат"
} }
+2 -1
View File
@@ -175,5 +175,6 @@
"update_available": "有可用的更新。", "update_available": "有可用的更新。",
"upload_finishing": "正在完成...", "upload_finishing": "正在完成...",
"user_not_found": "找不到", "user_not_found": "找不到",
"validate_credential_action": "確認" "validate_credential_action": "確認",
"topic_delete": "刪除聊天"
} }
+2 -1
View File
@@ -175,5 +175,6 @@
"channel": "频道", "channel": "频道",
"drafty_attachment": "附件", "drafty_attachment": "附件",
"drafty_form": "形式:", "drafty_form": "形式:",
"drafty_image": "图像" "drafty_image": "图像",
"topic_delete": "删除聊天"
} }
+16 -8
View File
@@ -176,7 +176,8 @@
"channel": "Sender", "channel": "Sender",
"drafty_attachment": "Dateianhang", "drafty_attachment": "Dateianhang",
"drafty_form": "Formular:", "drafty_form": "Formular:",
"drafty_image": "Bild" "drafty_image": "Bild",
"topic_delete": "Chat löschen"
}, },
"en": { "en": {
"action_block_contact": "Block Contact", "action_block_contact": "Block Contact",
@@ -350,7 +351,8 @@
"title_permissions": "Permissions", "title_permissions": "Permissions",
"title_tag_manager": "Tags (user discovery)", "title_tag_manager": "Tags (user discovery)",
"topic_block_warning": "Are you sure you want to block this conversation?", "topic_block_warning": "Are you sure you want to block this conversation?",
"topic_delete_warning": "Are you sure you want to delete this conversation?", "topic_delete": "Delete Conversation",
"topic_delete_warning": "Are you sure you want to delete this conversation? It cannot be undone.",
"topic_name_editing_placeholder": "Freeform name of the group", "topic_name_editing_placeholder": "Freeform name of the group",
"unnamed_topic": "Unnamed", "unnamed_topic": "Unnamed",
"update_available": "Update available.", "update_available": "Update available.",
@@ -535,7 +537,8 @@
"channel": "canal", "channel": "canal",
"drafty_attachment": "Archivo", "drafty_attachment": "Archivo",
"drafty_form": "Formulario:", "drafty_form": "Formulario:",
"drafty_image": "Imagen" "drafty_image": "Imagen",
"topic_delete": "Eliminar chat"
}, },
"ko": { "ko": {
"validate_credential_action": "확인", "validate_credential_action": "확인",
@@ -714,7 +717,8 @@
"channel": "채널", "channel": "채널",
"drafty_attachment": "부착", "drafty_attachment": "부착",
"drafty_form": "형태:", "drafty_form": "형태:",
"drafty_image": "이미지" "drafty_image": "이미지",
"topic_delete": "채팅 삭제"
}, },
"ro": { "ro": {
"validate_credential_action": "confirmă", "validate_credential_action": "confirmă",
@@ -893,7 +897,8 @@
"title_manage_tags": "Administrează", "title_manage_tags": "Administrează",
"drafty_attachment": "Atasament", "drafty_attachment": "Atasament",
"drafty_form": "Formă:", "drafty_form": "Formă:",
"drafty_image": "Imagine" "drafty_image": "Imagine",
"topic_delete": "Ștergeți Chat"
}, },
"ru": { "ru": {
"contacts_not_found": "Чатов нет<br />¯∖_(ツ)_/¯", "contacts_not_found": "Чатов нет<br />¯∖_(ツ)_/¯",
@@ -1072,7 +1077,8 @@
"channel": "канал", "channel": "канал",
"drafty_attachment": "Аттачмент", "drafty_attachment": "Аттачмент",
"drafty_form": "Форма:", "drafty_form": "Форма:",
"drafty_image": "Картинка" "drafty_image": "Картинка",
"topic_delete": "Удалить чат"
}, },
"zh-TW": { "zh-TW": {
"action_block_contact": "封鎖聯絡人", "action_block_contact": "封鎖聯絡人",
@@ -1251,7 +1257,8 @@
"update_available": "有可用的更新。", "update_available": "有可用的更新。",
"upload_finishing": "正在完成...", "upload_finishing": "正在完成...",
"user_not_found": "找不到", "user_not_found": "找不到",
"validate_credential_action": "確認" "validate_credential_action": "確認",
"topic_delete": "刪除聊天"
}, },
"zh": { "zh": {
"archived_contacts": "已归档联系人 ({count})", "archived_contacts": "已归档联系人 ({count})",
@@ -1430,6 +1437,7 @@
"channel": "频道", "channel": "频道",
"drafty_attachment": "附件", "drafty_attachment": "附件",
"drafty_form": "形式:", "drafty_form": "形式:",
"drafty_image": "图像" "drafty_image": "图像",
"topic_delete": "删除聊天"
} }
} }
+1 -1
View File
@@ -1,3 +1,3 @@
// This is a generated file. Don't edit. // This is a generated file. Don't edit.
export const PACKAGE_VERSION = "0.17.8"; export const PACKAGE_VERSION = "0.17.8-rc1";
+33 -3
View File
@@ -61,6 +61,16 @@ const messages = defineMessages({
defaultMessage: 'Are you sure you want to delete all messages for everyone? It cannot be undone.', defaultMessage: 'Are you sure you want to delete all messages for everyone? It cannot be undone.',
description: 'Alert dialog warning when hard-deleting all messages.' description: 'Alert dialog warning when hard-deleting all messages.'
}, },
topic_delete: {
id: 'topic_delete',
defaultMessage: 'Delete Conversation',
description: 'Alert title when deleting the topic.'
},
topic_delete_warning: {
id: 'topic_delete_warning',
defaultMessage: 'Are you sure you want to delete this conversation? It cannot be undone.',
description: 'Alert warning when deleting entire topic'
},
leave_chat: { leave_chat: {
id: 'action_leave_chat', id: 'action_leave_chat',
defaultMessage: 'Leave Conversation', defaultMessage: 'Leave Conversation',
@@ -143,6 +153,7 @@ class InfoView extends React.Component {
this.handleShowAddMembers = this.handleShowAddMembers.bind(this); this.handleShowAddMembers = this.handleShowAddMembers.bind(this);
this.handleHideAddMembers = this.handleHideAddMembers.bind(this); this.handleHideAddMembers = this.handleHideAddMembers.bind(this);
this.handleMemberUpdateRequest = this.handleMemberUpdateRequest.bind(this); this.handleMemberUpdateRequest = this.handleMemberUpdateRequest.bind(this);
this.handleDeleteTopic = this.handleDeleteTopic.bind(this);
this.handleDeleteMessages = this.handleDeleteMessages.bind(this); this.handleDeleteMessages = this.handleDeleteMessages.bind(this);
this.handleLeave = this.handleLeave.bind(this); this.handleLeave = this.handleLeave.bind(this);
this.handleBlock = this.handleBlock.bind(this); this.handleBlock = this.handleBlock.bind(this);
@@ -422,6 +433,19 @@ class InfoView extends React.Component {
this.setState({showMemberPanel: false}); this.setState({showMemberPanel: false});
} }
handleDeleteTopic(e) {
e.preventDefault();
const {formatMessage} = this.props.intl;
this.props.onShowAlert(
formatMessage(messages.topic_delete), // title
formatMessage(messages.topic_delete_warning), // content
(() => { this.props.onDeleteTopic(this.props.topic); }), // onConfirm
null, // "OK"
true, // Show Reject button
null // "Cancel"
);
}
handleDeleteMessages(e) { handleDeleteMessages(e) {
e.preventDefault(); e.preventDefault();
const {formatMessage} = this.props.intl; const {formatMessage} = this.props.intl;
@@ -717,9 +741,15 @@ class InfoView extends React.Component {
: :
null null
} }
<a href="#" className="danger flat-button" onClick={this.handleLeave}> {this.state.owner ?
<i className="material-icons">exit_to_app</i> &nbsp;{formatMessage(messages.leave_chat)} <a href="#" className="danger flat-button" onClick={this.handleDeleteTopic}>
</a> <i className="material-icons">delete</i> &nbsp;{formatMessage(messages.topic_delete)}
</a>
:
<a href="#" className="danger flat-button" onClick={this.handleLeave}>
<i className="material-icons">exit_to_app</i> &nbsp;{formatMessage(messages.leave_chat)}
</a>
}
{!this.state.groupTopic ? {!this.state.groupTopic ?
<a href="#" className="danger flat-button" onClick={this.handleBlock}> <a href="#" className="danger flat-button" onClick={this.handleBlock}>
<i className="material-icons">block</i> &nbsp;{formatMessage(messages.block_contact)} <i className="material-icons">block</i> &nbsp;{formatMessage(messages.block_contact)}
+17
View File
@@ -123,6 +123,7 @@ class TinodeWeb extends React.Component {
this.handleTagsUpdated = this.handleTagsUpdated.bind(this); this.handleTagsUpdated = this.handleTagsUpdated.bind(this);
this.handleLogout = this.handleLogout.bind(this); this.handleLogout = this.handleLogout.bind(this);
this.handleDeleteAccount = this.handleDeleteAccount.bind(this); this.handleDeleteAccount = this.handleDeleteAccount.bind(this);
this.handleDeleteTopicRequest = this.handleDeleteTopicRequest.bind(this);
this.handleDeleteMessagesRequest = this.handleDeleteMessagesRequest.bind(this); this.handleDeleteMessagesRequest = this.handleDeleteMessagesRequest.bind(this);
this.handleLeaveUnsubRequest = this.handleLeaveUnsubRequest.bind(this); this.handleLeaveUnsubRequest = this.handleLeaveUnsubRequest.bind(this);
this.handleBlockTopicRequest = this.handleBlockTopicRequest.bind(this); this.handleBlockTopicRequest = this.handleBlockTopicRequest.bind(this);
@@ -1290,6 +1291,21 @@ class TinodeWeb extends React.Component {
}); });
} }
handleDeleteTopicRequest(topicName) {
const topic = this.tinode.getTopic(topicName);
if (!topic) {
return;
}
// Request to hard-delete topic.
topic.delTopic(true).then((ctrl) => {
// Hide MessagesView and InfoView panels.
HashNavigation.navigateTo(HashNavigation.setUrlTopic(window.location.hash, ''));
}).catch((err) => {
this.handleError(err.message, 'err');
});
}
handleDeleteMessagesRequest(topicName) { handleDeleteMessagesRequest(topicName) {
const topic = this.tinode.getTopic(topicName); const topic = this.tinode.getTopic(topicName);
if (!topic) { if (!topic) {
@@ -1655,6 +1671,7 @@ class TinodeWeb extends React.Component {
onShowAlert={this.handleShowAlert} onShowAlert={this.handleShowAlert}
onChangePermissions={this.handleChangePermissions} onChangePermissions={this.handleChangePermissions}
onMemberUpdateRequest={this.handleMemberUpdateRequest} onMemberUpdateRequest={this.handleMemberUpdateRequest}
onDeleteTopic={this.handleDeleteTopicRequest}
onDeleteMessages={this.handleDeleteMessagesRequest} onDeleteMessages={this.handleDeleteMessagesRequest}
onLeaveTopic={this.handleLeaveUnsubRequest} onLeaveTopic={this.handleLeaveUnsubRequest}
onBlockTopic={this.handleBlockTopicRequest} onBlockTopic={this.handleBlockTopicRequest}
+1 -1
View File
@@ -59,7 +59,7 @@ const messages = defineMessages({
}, },
topic_delete_warning: { topic_delete_warning: {
id: 'topic_delete_warning', id: 'topic_delete_warning',
defaultMessage: 'Are you sure you want to delete this conversation?', defaultMessage: 'Are you sure you want to delete this conversation? It cannot be undone.',
description: 'Alert warning when deleting entire topic' description: 'Alert warning when deleting entire topic'
}, },
delete_messages_warning: { delete_messages_warning: {
+60 -13
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,3 +1,3 @@
// This is a generated file. Don't edit. // This is a generated file. Don't edit.
const PACKAGE_VERSION = "0.17.8"; const PACKAGE_VERSION = "0.17.8-rc1";