Configurable ending time and alert values

This commit is contained in:
Lucas Zawacki 2020-06-17 21:08:36 +00:00
parent a586c7db55
commit 3f16d894c3
4 changed files with 28 additions and 15 deletions

View File

@ -83,7 +83,8 @@ export default injectNotify(injectIntl(withTracker(({
notify,
messageDuration,
timeEndedMessage,
alertMessageUnderOneMinute,
alertMessage,
alertUnderMinutes,
}) => {
const data = {};
if (breakoutRoom) {
@ -104,7 +105,9 @@ export default injectNotify(injectIntl(withTracker(({
if (timeRemaining >= 0 && timeRemainingInterval) {
if (timeRemaining > 0) {
const time = getTimeRemaining();
if (time === (1 * 60) && alertMessageUnderOneMinute) notify(alertMessageUnderOneMinute, 'info', 'rooms');
if (time === (alertUnderMinutes * 60) && alertMessage) {
notify(alertMessage, 'info', 'rooms');
}
data.message = intl.formatMessage(messageDuration, { 0: humanizeSeconds(time) });
} else {
clearInterval(timeRemainingInterval);

View File

@ -30,6 +30,7 @@ const ENABLE_NETWORK_MONITORING = Meteor.settings.public.networkMonitoring.enabl
const HELP_LINK = METEOR_SETTINGS_APP.helpLink;
const REMAINING_TIME_THRESHOLD = METEOR_SETTINGS_APP.remainingTimeThreshold;
const REMAINING_TIME_ALERT_THRESHOLD = METEOR_SETTINGS_APP.remainingTimeAlertThreshold;
const intlMessages = defineMessages({
failedMessage: {
@ -68,13 +69,13 @@ const intlMessages = defineMessages({
id: 'app.meeting.meetingTimeHasEnded',
description: 'Message that tells time has ended and meeting will close',
},
alertMeetingEndsUnderOneMinute: {
id: 'app.meeting.alertMeetingEndsUnderOneMinute',
description: 'Alert that tells that the meeting end under a minute',
alertMeetingEndsUnderMinutes: {
id: 'app.meeting.alertMeetingEndsUnderMinutes',
description: 'Alert that tells that the meeting ends under x minutes',
},
alertBreakoutEndsUnderOneMinute: {
id: 'app.meeting.alertBreakoutEndsUnderOneMinute',
description: 'Alert that tells that the breakout end under a minute',
alertBreakoutEndsUnderMinutes: {
id: 'app.meeting.alertBreakoutEndsUnderMinutes',
description: 'Alert that tells that the breakout ends under x minutes',
},
slowEffectiveConnectionDetected: {
id: 'app.network.connection.effective.slow',
@ -183,6 +184,8 @@ export default injectIntl(withTracker(({ intl }) => {
const meetingId = Auth.meetingID;
const breakouts = breakoutService.getBreakouts();
const msg = { id: `${intlMessages.alertBreakoutEndsUnderMinutes.id}${REMAINING_TIME_ALERT_THRESHOLD == 1 ? 'Singular' : 'Plural'}` };
if (breakouts.length > 0) {
const currentBreakout = breakouts.find(b => b.breakoutId === meetingId);
@ -192,9 +195,10 @@ export default injectIntl(withTracker(({ intl }) => {
breakoutRoom={currentBreakout}
messageDuration={intlMessages.breakoutTimeRemaining}
timeEndedMessage={intlMessages.breakoutWillClose}
alertMessageUnderOneMinute={
intl.formatMessage(intlMessages.alertBreakoutEndsUnderOneMinute)
alertMessage={
intl.formatMessage(msg, {0: REMAINING_TIME_ALERT_THRESHOLD})
}
alertUnderMinutes={REMAINING_TIME_ALERT_THRESHOLD}
/>
);
}
@ -209,15 +213,18 @@ export default injectIntl(withTracker(({ intl }) => {
const { isBreakout } = Meeting.meetingProp;
const underThirtyMin = timeRemaining && timeRemaining <= (REMAINING_TIME_THRESHOLD * 60);
const msg = { id: `${intlMessages.alertMeetingEndsUnderMinutes.id}${REMAINING_TIME_ALERT_THRESHOLD == 1 ? 'Singular' : 'Plural'}` };
if (underThirtyMin && !isBreakout) {
data.message = (
<BreakoutRemainingTime
breakoutRoom={meetingTimeRemaining}
messageDuration={intlMessages.meetingTimeRemaining}
timeEndedMessage={intlMessages.meetingWillClose}
alertMessageUnderOneMinute={
intl.formatMessage(intlMessages.alertMeetingEndsUnderOneMinute)
alertMessage={
intl.formatMessage(msg, {0: REMAINING_TIME_ALERT_THRESHOLD})
}
alertUnderMinutes={REMAINING_TIME_ALERT_THRESHOLD}
/>
);
}

View File

@ -25,7 +25,8 @@ public:
ipv4FallbackDomain: ""
allowLogout: true
allowFullscreen: true
remainingTimeThreshold: 5
remainingTimeThreshold: 30
remainingTimeAlertThreshold: 1
defaultSettings:
application:
animations: true

View File

@ -126,8 +126,10 @@
"app.meeting.meetingTimeRemaining": "Meeting time remaining: {0}",
"app.meeting.meetingTimeHasEnded": "Time ended. Meeting will close soon",
"app.meeting.endedMessage": "You will be forwarded back to the home screen",
"app.meeting.alertMeetingEndsUnderOneMinute": "Meeting is closing in a minute.",
"app.meeting.alertBreakoutEndsUnderOneMinute": "Breakout is closing in a minute.",
"app.meeting.alertMeetingEndsUnderMinutesSingular": "Meeting is closing in one minute.",
"app.meeting.alertMeetingEndsUnderMinutesPlural": "Meeting is closing in {0} minutes.",
"app.meeting.alertBreakoutEndsUnderMinutesSingular": "Breakout is closing in {0} minutes.",
"app.meeting.alertBreakoutEndsUnderMinutesPlural": "Breakout is closing in one minute.",
"app.presentation.hide": "Hide presentation",
"app.presentation.notificationLabel": "Current presentation",
"app.presentation.slideContent": "Slide Content",