Merge pull request #7250 from KDSBrowne/2.2-suggest-ios-update

Add toast indicating to upgrade iOS version (12.2+)
This commit is contained in:
Anton Georgiev 2019-04-18 16:50:26 -04:00 committed by GitHub
commit c368254587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 85 additions and 25 deletions

View File

@ -42,6 +42,10 @@ const intlMessages = defineMessages({
id: 'app.actionsBar.label',
description: 'Aria-label for ActionsBar Section',
},
iOSWarning: {
id: 'app.iOSWarning.label',
description: 'message indicating to upgrade ios version',
},
});
const propTypes = {
@ -77,7 +81,9 @@ class App extends Component {
}
componentDidMount() {
const { locale } = this.props;
const {
locale, notify, intl, validIOSVersion,
} = this.props;
const BROWSER_RESULTS = browser();
const isMobileBrowser = BROWSER_RESULTS.mobile || BROWSER_RESULTS.os.includes('Android');
@ -93,6 +99,14 @@ class App extends Component {
body.classList.add(`os-${BROWSER_RESULTS.os.split(' ').shift().toLowerCase()}`);
}
if (!validIOSVersion()) {
notify(
intl.formatMessage(intlMessages.iOSWarning),
'error',
'warning',
);
}
this.handleWindowResize();
window.addEventListener('resize', this.handleWindowResize, false);

View File

@ -4,7 +4,7 @@ import { defineMessages, injectIntl } from 'react-intl';
import PropTypes from 'prop-types';
import Auth from '/imports/ui/services/auth';
import Users from '/imports/api/users';
import { notify } from '/imports/ui/services/notification';
import ClosedCaptionsContainer from '/imports/ui/components/closed-captions/container';
import getFromUserSettings from '/imports/ui/services/users-settings';
@ -14,6 +14,7 @@ import {
getFontSize,
getCaptionsStatus,
getBreakoutRooms,
validIOSVersion,
} from './service';
import { withModalMounter } from '../modal/service';
@ -99,6 +100,8 @@ export default injectIntl(withModalMounter(withTracker(({ intl, baseControls })
openPanel: Session.get('openPanel'),
userListIsOpen: !Session.equals('openPanel', ''),
UserInfo,
notify,
validIOSVersion,
};
})(AppContainer)));

View File

@ -25,10 +25,22 @@ function meetingIsBreakout() {
return (meeting && meeting.meetingProp.isBreakout);
}
const validIOSVersion = () => {
const SUPPORTED_OS_VERSION = 12.2;
const iosMatch = navigator.userAgent.match(/OS (\d+)_(\d+) /);
if (iosMatch) {
const versionNumber = iosMatch[0].split(' ')[1].replace('_', '.');
const isInvalid = parseFloat(versionNumber) < SUPPORTED_OS_VERSION;
if (isInvalid) return false;
}
return true;
};
export {
getCaptionsStatus,
getFontSize,
meetingIsBreakout,
getBreakoutRooms,
getMeeting,
validIOSVersion,
};

View File

@ -22,9 +22,12 @@ const intlMessages = defineMessages({
id: 'app.video.videoLocked',
description: 'video disabled label',
},
iOSWarning: {
id: 'app.iOSWarning.label',
description: 'message indicating to upgrade ios version',
},
});
const propTypes = {
intl: intlShape.isRequired,
isSharingVideo: PropTypes.bool.isRequired,
@ -39,7 +42,21 @@ const JoinVideoButton = ({
isDisabled,
handleJoinVideo,
handleCloseVideo,
}) => (
notify,
validIOSVersion,
}) => {
const verifyIOS = () => {
if (!validIOSVersion()) {
return notify(
intl.formatMessage(intlMessages.iOSWarning),
'error',
'warning',
);
}
handleJoinVideo();
};
return (
<Button
label={isDisabled
? intl.formatMessage(intlMessages.videoLocked)
@ -49,7 +66,7 @@ const JoinVideoButton = ({
)
}
className={cx(styles.button, isSharingVideo || styles.btn)}
onClick={isSharingVideo ? handleCloseVideo : handleJoinVideo}
onClick={isSharingVideo ? handleCloseVideo : verifyIOS}
hideLabel
aria-label={intl.formatMessage(intlMessages.videoButtonDesc)}
color={isSharingVideo ? 'primary' : 'default'}
@ -59,7 +76,8 @@ const JoinVideoButton = ({
circle
disabled={isDisabled}
/>
);
);
};
JoinVideoButton.propTypes = propTypes;
export default injectIntl(JoinVideoButton);

View File

@ -3,9 +3,14 @@ import { withTracker } from 'meteor/react-meteor-data';
import { injectIntl } from 'react-intl';
import { withModalMounter } from '/imports/ui/components/modal/service';
import VideoPreviewContainer from '/imports/ui/components/video-preview/container';
import { notify } from '/imports/ui/services/notification';
import JoinVideoButton from './component';
import VideoButtonService from './service';
import {
validIOSVersion,
} from '/imports/ui/components/app/service';
const JoinVideoOptionsContainer = (props) => {
const {
isSharingVideo,
@ -21,7 +26,12 @@ const JoinVideoOptionsContainer = (props) => {
const mountPreview = () => { mountModal(<VideoPreviewContainer />); };
return !isMobileNative && <JoinVideoButton {...{ handleJoinVideo: mountPreview, handleCloseVideo, isSharingVideo, isDisabled, ...restProps }} />;
return !isMobileNative && (
<JoinVideoButton {...{
handleJoinVideo: mountPreview, handleCloseVideo, isSharingVideo, isDisabled, ...restProps,
}}
/>
);
};
export default withModalMounter(injectIntl(withTracker(() => ({
@ -30,4 +40,6 @@ export default withModalMounter(injectIntl(withTracker(() => ({
isDisabled: VideoButtonService.isDisabled(),
videoShareAllowed: VideoButtonService.videoShareAllowed(),
isMobileNative: navigator.userAgent.toLowerCase().includes('bbbnative'),
notify,
validIOSVersion,
}))(JoinVideoOptionsContainer)));

View File

@ -580,5 +580,6 @@
"app.externalVideo.close": "Close",
"app.externalVideo.noteLabel": "Note: Shared YouTube videos will not appear in the recording",
"app.actionsBar.actionsDropdown.shareExternalVideo": "Share YouTube video",
"app.actionsBar.actionsDropdown.stopShareExternalVideo": "Stop sharing YouTube video"
"app.actionsBar.actionsDropdown.stopShareExternalVideo": "Stop sharing YouTube video",
"app.iOSWarning.label": "Please upgrade to iOS 12.2 or higher"
}