Merge pull request #12352 from jfsiebel/content-loss-warning

feat: Add warning on meeting end modal about content in meeting.
This commit is contained in:
Anton Georgiev 2021-05-11 16:30:32 -04:00 committed by GitHub
commit cfab8518e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 5 deletions

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import Button from '/imports/ui/components/button/component';
@ -18,6 +18,10 @@ const intlMessages = defineMessages({
id: 'app.endMeeting.noUserDescription',
description: 'end meeting description',
},
contentWarning: {
id: 'app.endMeeting.contentWarning',
description: 'end meeting content warning',
},
yesLabel: {
id: 'app.endMeeting.yesLabel',
description: 'label for yes button for end meeting',
@ -28,6 +32,8 @@ const intlMessages = defineMessages({
},
});
const { warnAboutUnsavedContentOnMeetingEnd } = Meteor.settings.public.app;
const propTypes = {
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
@ -38,7 +44,7 @@ const propTypes = {
users: PropTypes.number.isRequired,
};
class EndMeetingComponent extends React.PureComponent {
class EndMeetingComponent extends PureComponent {
render() {
const {
users, intl, closeModal, endMeeting, meetingTitle,
@ -54,9 +60,18 @@ class EndMeetingComponent extends React.PureComponent {
>
<div className={styles.container}>
<div className={styles.description}>
{users > 0
? intl.formatMessage(intlMessages.endMeetingDescription, { 0: users })
: intl.formatMessage(intlMessages.endMeetingNoUserDescription)
{
users > 0
? intl.formatMessage(intlMessages.endMeetingDescription, { 0: users })
: intl.formatMessage(intlMessages.endMeetingNoUserDescription)
}
{
warnAboutUnsavedContentOnMeetingEnd
? (
<p>
{intl.formatMessage(intlMessages.contentWarning)}
</p>
) : null
}
</div>
<div className={styles.footer}>

View File

@ -51,6 +51,7 @@ public:
allowLogout: true
allowFullscreen: true
preloadNextSlides: 2
warnAboutUnsavedContentOnMeetingEnd: false
mutedAlert:
enabled: true
interval: 200

View File

@ -316,6 +316,7 @@
"app.endMeeting.title": "End {0}",
"app.endMeeting.description": "This action will end the session for {0} active user(s). Are you sure you want to end this session?",
"app.endMeeting.noUserDescription": "Are you sure you want to end this session?",
"app.endMeeting.contentWarning": "Chat messages, shared notes, whiteboard content and shared documents for this session will no longer be directly accessible",
"app.endMeeting.yesLabel": "Yes",
"app.endMeeting.noLabel": "No",
"app.about.title": "About",