feat(recording) Add config to hide storage warning (#11761)

This commit is contained in:
Robert Pintilii 2022-06-29 13:28:20 +01:00 committed by GitHub
parent ee266160f9
commit c4f39e9c34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 34 deletions

View File

@ -271,8 +271,9 @@ var config = {
// Recording // Recording
// Whether to enable file recording or not. // DEPRECATED. Use recordingService.enabled instead.
// fileRecordingsEnabled: false, // fileRecordingsEnabled: false,
// Enable the dropbox integration. // Enable the dropbox integration.
// dropbox: { // dropbox: {
// appKey: '<APP_KEY>' // Specify your app key here. // appKey: '<APP_KEY>' // Specify your app key here.
@ -282,14 +283,27 @@ var config = {
// redirectURI: // redirectURI:
// 'https://jitsi-meet.example.com/subfolder/static/oauth.html' // 'https://jitsi-meet.example.com/subfolder/static/oauth.html'
// }, // },
// When integrations like dropbox are enabled only that will be shown,
// by enabling fileRecordingsServiceEnabled, we show both the integrations // recordingService: {
// and the generic recording service (its configuration and storage type // // When integrations like dropbox are enabled only that will be shown,
// depends on jibri configuration) // // by enabling fileRecordingsServiceEnabled, we show both the integrations
// // and the generic recording service (its configuration and storage type
// // depends on jibri configuration)
// enabled: false,
// // Whether to show the possibility to share file recording with other people
// // (e.g. meeting participants), based on the actual implementation
// // on the backend.
// sharingEnabled: false,
// // Hide the warning that says we only store the recording for 24 hours.
// hideStorageWarning: false
// },
// DEPRECATED. Use recordingService.enabled instead.
// fileRecordingsServiceEnabled: false, // fileRecordingsServiceEnabled: false,
// Whether to show the possibility to share file recording with other people
// (e.g. meeting participants), based on the actual implementation // DEPRECATED. Use recordingService.sharingEnabled instead.
// on the backend.
// fileRecordingsServiceSharingEnabled: false, // fileRecordingsServiceSharingEnabled: false,
// Whether to enable live streaming or not. // Whether to enable live streaming or not.

View File

@ -397,6 +397,20 @@ function _translateLegacyConfig(oldValue: Object) {
}; };
} }
newValue.recordingService = newValue.recordingService || {};
if (oldValue.fileRecordingsServiceEnabled !== undefined) {
newValue.recordingService = {
...newValue.recordingService,
enabled: oldValue.fileRecordingsServiceEnabled
};
}
if (oldValue.fileRecordingsServiceSharingEnabled !== undefined) {
newValue.recordingService = {
...newValue.recordingService,
sharingEnabled: oldValue.fileRecordingsServiceSharingEnabled
};
}
return newValue; return newValue;
} }

View File

@ -405,9 +405,7 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
export function mapStateToProps(state: Object) { export function mapStateToProps(state: Object) {
const { const {
transcription, transcription,
fileRecordingsEnabled = false, recordingService,
fileRecordingsServiceEnabled = false,
fileRecordingsServiceSharingEnabled = false,
dropbox = {} dropbox = {}
} = state['features/base/config']; } = state['features/base/config'];
@ -415,9 +413,8 @@ export function mapStateToProps(state: Object) {
_appKey: dropbox.appKey, _appKey: dropbox.appKey,
_autoCaptionOnRecord: transcription?.autoCaptionOnRecord ?? false, _autoCaptionOnRecord: transcription?.autoCaptionOnRecord ?? false,
_conference: state['features/base/conference'].conference, _conference: state['features/base/conference'].conference,
_fileRecordingsEnabled: fileRecordingsEnabled, _fileRecordingsServiceEnabled: recordingService?.enabled ?? false,
_fileRecordingsServiceEnabled: fileRecordingsServiceEnabled, _fileRecordingsServiceSharingEnabled: recordingService?.sharingEnabled ?? false,
_fileRecordingsServiceSharingEnabled: fileRecordingsServiceSharingEnabled,
_isDropboxEnabled: isDropboxEnabled(state), _isDropboxEnabled: isDropboxEnabled(state),
_rToken: state['features/dropbox'].rToken, _rToken: state['features/dropbox'].rToken,
_tokenExpireDate: state['features/dropbox'].expireDate, _tokenExpireDate: state['features/dropbox'].expireDate,

View File

@ -44,6 +44,11 @@ type Props = {
*/ */
_dialogStyles: StyleType, _dialogStyles: StyleType,
/**
* Whether to hide the storage warning or not.
*/
_hideStorageWarning: boolean,
/** /**
* Whether local recording is enabled or not. * Whether local recording is enabled or not.
*/ */
@ -64,11 +69,6 @@ type Props = {
*/ */
dispatch: Function, dispatch: Function,
/**
* Whether the file recording is enabled.
*/
fileRecordingsEnabled: boolean,
/** /**
* Whether to show file recordings service, even if integrations * Whether to show file recordings service, even if integrations
* are enabled. * are enabled.
@ -217,13 +217,14 @@ class StartRecordingDialogContent extends Component<Props> {
*/ */
_shouldRenderFileSharingContent() { _shouldRenderFileSharingContent() {
const { const {
fileRecordingsServiceEnabled,
fileRecordingsServiceSharingEnabled, fileRecordingsServiceSharingEnabled,
isVpaas, isVpaas,
selectedRecordingService, selectedRecordingService
fileRecordingsEnabled
} = this.props; } = this.props;
if (!(fileRecordingsServiceSharingEnabled && fileRecordingsEnabled) if (!fileRecordingsServiceEnabled
|| !fileRecordingsServiceSharingEnabled
|| isVpaas || isVpaas
|| selectedRecordingService !== RECORDING_TYPES.JITSI_REC_SERVICE) { || selectedRecordingService !== RECORDING_TYPES.JITSI_REC_SERVICE) {
return false; return false;
@ -290,13 +291,14 @@ class StartRecordingDialogContent extends Component<Props> {
_renderUploadToTheCloudInfo() { _renderUploadToTheCloudInfo() {
const { const {
_dialogStyles, _dialogStyles,
_hideStorageWarning,
_styles: styles, _styles: styles,
isVpaas, isVpaas,
selectedRecordingService, selectedRecordingService,
t t
} = this.props; } = this.props;
if (!(isVpaas && selectedRecordingService === RECORDING_TYPES.JITSI_REC_SERVICE)) { if (!(isVpaas && selectedRecordingService === RECORDING_TYPES.JITSI_REC_SERVICE) || _hideStorageWarning) {
return null; return null;
} }
@ -328,12 +330,8 @@ class StartRecordingDialogContent extends Component<Props> {
*/ */
_shouldRenderNoIntegrationsContent() { _shouldRenderNoIntegrationsContent() {
// show the non integrations part only if fileRecordingsServiceEnabled // show the non integrations part only if fileRecordingsServiceEnabled
// is enabled or when there are no integrations enabled // is enabled
if (!this.props.fileRecordingsEnabled) { if (!this.props.fileRecordingsServiceEnabled) {
return false;
}
if (!(this.props.fileRecordingsServiceEnabled
|| !this.props.integrationsEnabled)) {
return false; return false;
} }
@ -454,7 +452,7 @@ class StartRecordingDialogContent extends Component<Props> {
); );
} }
if (this.props.fileRecordingsServiceEnabled && this.props.fileRecordingsEnabled) { if (this.props.fileRecordingsServiceEnabled) {
switchContent = ( switchContent = (
<Switch <Switch
className = 'recording-switch' className = 'recording-switch'
@ -761,6 +759,7 @@ function _mapStateToProps(state) {
return { return {
..._abstractMapStateToProps(state), ..._abstractMapStateToProps(state),
isVpaas: isVpaasMeeting(state), isVpaas: isVpaasMeeting(state),
_hideStorageWarning: state['features/base/config'].recording?.hideStorageWarning,
_localRecordingEnabled: !state['features/base/config'].localRecording?.disable, _localRecordingEnabled: !state['features/base/config'].localRecording?.disable,
_localRecordingNoNotification: !state['features/base/config'].localRecording?.notifyAllParticipants, _localRecordingNoNotification: !state['features/base/config'].localRecording?.notifyAllParticipants,
_styles: ColorSchemeRegistry.get(state, 'StartRecordingDialogContent') _styles: ColorSchemeRegistry.get(state, 'StartRecordingDialogContent')

View File

@ -62,7 +62,6 @@ class StartRecordingDialog extends AbstractStartRecordingDialog {
userName userName
} = this.state; } = this.state;
const { const {
_fileRecordingsEnabled,
_fileRecordingsServiceEnabled, _fileRecordingsServiceEnabled,
_fileRecordingsServiceSharingEnabled _fileRecordingsServiceSharingEnabled
} = this.props; } = this.props;
@ -75,7 +74,6 @@ class StartRecordingDialog extends AbstractStartRecordingDialog {
titleKey = 'dialog.startRecording' titleKey = 'dialog.startRecording'
width = 'small'> width = 'small'>
<StartRecordingDialogContent <StartRecordingDialogContent
fileRecordingsEnabled = { _fileRecordingsEnabled }
fileRecordingsServiceEnabled = { _fileRecordingsServiceEnabled } fileRecordingsServiceEnabled = { _fileRecordingsServiceEnabled }
fileRecordingsServiceSharingEnabled = { _fileRecordingsServiceSharingEnabled } fileRecordingsServiceSharingEnabled = { _fileRecordingsServiceSharingEnabled }
integrationsEnabled = { this._areIntegrationsEnabled() } integrationsEnabled = { this._areIntegrationsEnabled() }

View File

@ -151,7 +151,7 @@ export function getRecordButtonProps(state: Object): ?string {
const isModerator = isLocalParticipantModerator(state); const isModerator = isLocalParticipantModerator(state);
const { const {
enableFeaturesBasedOnToken, enableFeaturesBasedOnToken,
fileRecordingsEnabled, recordingService,
localRecording localRecording
} = state['features/base/config']; } = state['features/base/config'];
const { features = {} } = getLocalParticipant(state); const { features = {} } = getLocalParticipant(state);
@ -161,7 +161,9 @@ export function getRecordButtonProps(state: Object): ?string {
localRecordingEnabled = false; localRecordingEnabled = false;
} }
visible = isModerator && (fileRecordingsEnabled || localRecordingEnabled); const dropboxEnabled = isDropboxEnabled(state);
visible = isModerator && (recordingService?.enabled || localRecordingEnabled || dropboxEnabled);
if (enableFeaturesBasedOnToken) { if (enableFeaturesBasedOnToken) {
visible = visible && String(features.recording) === 'true'; visible = visible && String(features.recording) === 'true';