2018-09-04 09:29:48 +02:00
|
|
|
import React, { Component } from 'react';
|
2023-04-24 14:09:50 +03:00
|
|
|
import { WithTranslation } from 'react-i18next';
|
2023-03-21 09:47:52 +02:00
|
|
|
import { connect } from 'react-redux';
|
2018-09-04 09:29:48 +02:00
|
|
|
|
2023-04-24 14:09:50 +03:00
|
|
|
import { IStore } from '../../app/types';
|
2023-03-31 14:04:33 +03:00
|
|
|
import ConfirmDialog from '../../base/dialog/components/native/ConfirmDialog';
|
2023-04-03 13:49:19 +03:00
|
|
|
import { translate } from '../../base/i18n/functions';
|
2018-09-04 09:29:48 +02:00
|
|
|
import { updateCalendarEvent } from '../actions';
|
|
|
|
|
|
2023-04-24 14:09:50 +03:00
|
|
|
interface IProps extends WithTranslation {
|
2018-09-04 09:29:48 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The Redux dispatch function.
|
|
|
|
|
*/
|
2023-04-24 14:09:50 +03:00
|
|
|
dispatch: IStore['dispatch'];
|
2018-09-04 09:29:48 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The ID of the event to be updated.
|
|
|
|
|
*/
|
2023-04-24 14:09:50 +03:00
|
|
|
eventId: string;
|
|
|
|
|
}
|
2018-09-04 09:29:48 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Component for the add Jitsi link confirm dialog.
|
|
|
|
|
*/
|
2023-04-24 14:09:50 +03:00
|
|
|
class UpdateCalendarEventDialog extends Component<IProps> {
|
2018-09-04 09:29:48 +02:00
|
|
|
/**
|
|
|
|
|
* Initializes a new {@code UpdateCalendarEventDialog} instance.
|
|
|
|
|
*
|
|
|
|
|
* @inheritdoc
|
|
|
|
|
*/
|
2023-04-24 14:09:50 +03:00
|
|
|
constructor(props: IProps) {
|
2018-09-04 09:29:48 +02:00
|
|
|
super(props);
|
|
|
|
|
|
|
|
|
|
this._onSubmit = this._onSubmit.bind(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
|
*
|
|
|
|
|
* @inheritdoc
|
|
|
|
|
* @returns {ReactElement}
|
|
|
|
|
*/
|
2025-03-12 10:19:11 -05:00
|
|
|
override render() {
|
2018-09-04 09:29:48 +02:00
|
|
|
return (
|
2018-10-18 10:31:38 +02:00
|
|
|
<ConfirmDialog
|
2022-02-03 17:45:02 +02:00
|
|
|
descriptionKey = 'calendarSync.confirmAddLink'
|
2018-10-18 10:31:38 +02:00
|
|
|
onSubmit = { this._onSubmit } />
|
2018-09-04 09:29:48 +02:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Callback for the confirm button.
|
|
|
|
|
*
|
|
|
|
|
* @private
|
|
|
|
|
* @returns {boolean} - True (to note that the modal should be closed).
|
|
|
|
|
*/
|
|
|
|
|
_onSubmit() {
|
2023-04-24 14:09:50 +03:00
|
|
|
this.props.dispatch(updateCalendarEvent(this.props.eventId));
|
2018-09-04 09:29:48 +02:00
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default translate(connect()(UpdateCalendarEventDialog));
|