@selfcommunity/react-ui 0.8.0-alpha.2 → 0.8.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/EventForm/EventAddress.d.ts +3 -8
- package/lib/cjs/components/EventForm/EventAddress.js +20 -20
- package/lib/cjs/components/EventForm/EventForm.d.ts +1 -1
- package/lib/cjs/components/EventForm/EventForm.js +26 -30
- package/lib/cjs/components/EventForm/types.d.ts +28 -0
- package/lib/cjs/components/EventForm/types.js +2 -0
- package/lib/cjs/components/EventHeader/EventHeader.js +1 -1
- package/lib/cjs/shared/EventActionsMenu/index.d.ts +4 -0
- package/lib/cjs/shared/EventActionsMenu/index.js +13 -3
- package/lib/esm/components/EventForm/EventAddress.d.ts +3 -8
- package/lib/esm/components/EventForm/EventAddress.js +20 -20
- package/lib/esm/components/EventForm/EventForm.d.ts +1 -1
- package/lib/esm/components/EventForm/EventForm.js +26 -30
- package/lib/esm/components/EventForm/types.d.ts +28 -0
- package/lib/esm/components/EventForm/types.js +1 -0
- package/lib/esm/components/EventHeader/EventHeader.js +1 -1
- package/lib/esm/shared/EventActionsMenu/index.d.ts +4 -0
- package/lib/esm/shared/EventActionsMenu/index.js +13 -3
- package/lib/umd/react-ui.js +1 -1
- package/package.json +4 -4
|
@@ -111,7 +111,7 @@ const Root = styled(BaseDialog, {
|
|
|
111
111
|
* @param inProps
|
|
112
112
|
*/
|
|
113
113
|
export default function EventForm(inProps) {
|
|
114
|
-
var _a, _b, _c, _d, _e
|
|
114
|
+
var _a, _b, _c, _d, _e;
|
|
115
115
|
//PROPS
|
|
116
116
|
const props = useThemeProps({
|
|
117
117
|
props: inProps,
|
|
@@ -123,23 +123,23 @@ export default function EventForm(inProps) {
|
|
|
123
123
|
// INTL
|
|
124
124
|
const intl = useIntl();
|
|
125
125
|
const initialFieldState = {
|
|
126
|
-
imageOriginal: event ? event.image_bigger
|
|
126
|
+
imageOriginal: (event === null || event === void 0 ? void 0 : event.image_bigger) || '',
|
|
127
127
|
imageOriginalFile: '',
|
|
128
128
|
startDate: event ? new Date(event.start_date) : null,
|
|
129
129
|
startTime: event ? new Date(event.start_date) : null,
|
|
130
|
-
endDate: event
|
|
131
|
-
endTime: event
|
|
132
|
-
location: event ? event.location
|
|
133
|
-
geolocation: event ? event.geolocation
|
|
134
|
-
lat: event ? event.geolocation_lat
|
|
135
|
-
lng: event ? event.geolocation_lng
|
|
136
|
-
link: event ? event.link
|
|
137
|
-
recurring: event ? event.recurring
|
|
138
|
-
name: event ? event.name
|
|
130
|
+
endDate: (event === null || event === void 0 ? void 0 : event.end_date) ? new Date(event.end_date) : null,
|
|
131
|
+
endTime: (event === null || event === void 0 ? void 0 : event.end_date) ? new Date(event.end_date) : null,
|
|
132
|
+
location: (event === null || event === void 0 ? void 0 : event.location) || SCEventLocationType.PERSON,
|
|
133
|
+
geolocation: (event === null || event === void 0 ? void 0 : event.geolocation) || '',
|
|
134
|
+
lat: (event === null || event === void 0 ? void 0 : event.geolocation_lat) || null,
|
|
135
|
+
lng: (event === null || event === void 0 ? void 0 : event.geolocation_lng) || null,
|
|
136
|
+
link: (event === null || event === void 0 ? void 0 : event.link) || '',
|
|
137
|
+
recurring: (event === null || event === void 0 ? void 0 : event.recurring) || SCEventRecurrenceType.NEVER,
|
|
138
|
+
name: (event === null || event === void 0 ? void 0 : event.name) || '',
|
|
139
139
|
description: event ? event.description : '',
|
|
140
|
-
isPublic: (_a = (event
|
|
140
|
+
isPublic: (_a = (event === null || event === void 0 ? void 0 : event.privacy) === SCEventPrivacyType.PUBLIC) !== null && _a !== void 0 ? _a : true,
|
|
141
141
|
isSubmitting: false,
|
|
142
|
-
showEndDateTime: (_b = (event
|
|
142
|
+
showEndDateTime: (_b = !!(event === null || event === void 0 ? void 0 : event.end_date)) !== null && _b !== void 0 ? _b : false
|
|
143
143
|
};
|
|
144
144
|
// STATE
|
|
145
145
|
const [field, setField] = useState(initialFieldState);
|
|
@@ -213,14 +213,14 @@ export default function EventForm(inProps) {
|
|
|
213
213
|
}
|
|
214
214
|
if (field.location === SCEventLocationType.PERSON) {
|
|
215
215
|
formData.append('geolocation', field.geolocation);
|
|
216
|
-
formData.append('geolocation_lat', field.lat);
|
|
217
|
-
formData.append('geolocation_lng', field.lng);
|
|
216
|
+
formData.append('geolocation_lat', field.lat.toString());
|
|
217
|
+
formData.append('geolocation_lng', field.lng.toString());
|
|
218
218
|
}
|
|
219
219
|
if (privateEnabled) {
|
|
220
220
|
formData.append('privacy', field.isPublic ? SCEventPrivacyType.PUBLIC : SCEventPrivacyType.PRIVATE);
|
|
221
221
|
}
|
|
222
222
|
if (visibilityEnabled) {
|
|
223
|
-
formData.append('visible', true);
|
|
223
|
+
formData.append('visible', 'true');
|
|
224
224
|
}
|
|
225
225
|
formData.append('description', field.description);
|
|
226
226
|
let eventService;
|
|
@@ -232,9 +232,9 @@ export default function EventForm(inProps) {
|
|
|
232
232
|
}
|
|
233
233
|
eventService
|
|
234
234
|
.then((data) => {
|
|
235
|
-
onSuccess
|
|
235
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data);
|
|
236
236
|
notifyChanges(data);
|
|
237
|
-
onClose
|
|
237
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
238
238
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
239
239
|
})
|
|
240
240
|
.catch((e) => {
|
|
@@ -279,7 +279,7 @@ export default function EventForm(inProps) {
|
|
|
279
279
|
field.name.length > EVENT_TITLE_MAX_LENGTH ||
|
|
280
280
|
field.description.length > EVENT_DESCRIPTION_MAX_LENGTH, variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: event ? (_jsx(FormattedMessage, { id: "ui.eventForm.button.edit", defaultMessage: "ui.eventForm.button.edit" })) : (_jsx(FormattedMessage, { id: "ui.eventForm.button.create", defaultMessage: "ui.eventForm.button.create" })) })) }, rest, { children: _jsxs(_Fragment, { children: [_jsx(Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: _jsx(UploadEventCover, { isCreationMode: true, onChange: handleChangeCover }) })), _jsxs(FormGroup, Object.assign({ className: classes.form }, { children: [_jsx(TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, InputProps: {
|
|
281
281
|
endAdornment: _jsx(Typography, Object.assign({ variant: "body2" }, { children: EVENT_TITLE_MAX_LENGTH - field.name.length }))
|
|
282
|
-
}, error: Boolean(
|
|
282
|
+
}, error: Boolean(field.name.length > EVENT_TITLE_MAX_LENGTH) || Boolean(error['nameError']), helperText: field.name.length > EVENT_TITLE_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.eventForm.name.error.maxLength", defaultMessage: "ui.eventForm.name.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), _jsx(Box, Object.assign({ className: classes.dateTime }, { children: _jsxs(LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? itLocale : enLocale }, { children: [_jsx(MobileDatePicker, { className: classes.picker, disablePast: true, label: field.startDate && _jsx(FormattedMessage, { id: "ui.eventForm.date.placeholder", defaultMessage: "ui.eventForm.date.placeholder" }), value: field.startDate, slots: {
|
|
283
283
|
textField: (params) => (_jsx(TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.startDate)}`, startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "CalendarIcon" }) }) }))) }) })))
|
|
284
284
|
}, slotProps: {
|
|
285
285
|
toolbar: {
|
|
@@ -308,15 +308,11 @@ export default function EventForm(inProps) {
|
|
|
308
308
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
309
309
|
// @ts-ignore
|
|
310
310
|
b: (chunks) => _jsx("strong", { children: chunks })
|
|
311
|
-
} })) : (_jsx(
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
b: (chunks) => _jsx("strong", { children: chunks })
|
|
319
|
-
} })) })) }))] }))), _jsx(TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
320
|
-
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) ? EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : EVENT_DESCRIPTION_MAX_LENGTH })))
|
|
321
|
-
}, error: Boolean(((_f = field.description) === null || _f === void 0 ? void 0 : _f.length) > EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_g = field.description) === null || _g === void 0 ? void 0 : _g.length) > EVENT_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null })] }))] }) })));
|
|
311
|
+
} })) : (_jsx(FormattedMessage, { id: "ui.eventForm.privacy.private.info", defaultMessage: "ui.eventForm.private.public.info", values: {
|
|
312
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
313
|
+
// @ts-ignore
|
|
314
|
+
b: (chunks) => _jsx("strong", { children: chunks })
|
|
315
|
+
} })) }))] }))), _jsx(TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
316
|
+
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) ? EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : EVENT_DESCRIPTION_MAX_LENGTH })))
|
|
317
|
+
}, error: Boolean(((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > EVENT_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null })] }))] }) })));
|
|
322
318
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SCEventLocationType, SCEventRecurrenceType } from '@selfcommunity/types';
|
|
2
|
+
export declare type Place = {
|
|
3
|
+
description: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type Geolocation = {
|
|
7
|
+
location: SCEventLocationType;
|
|
8
|
+
geolocation?: string;
|
|
9
|
+
lat?: number;
|
|
10
|
+
lng?: number;
|
|
11
|
+
link?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare type InitialFieldState = Geolocation & {
|
|
14
|
+
imageOriginal: string | ArrayBuffer;
|
|
15
|
+
imageOriginalFile: string | Blob;
|
|
16
|
+
startDate: Date | null;
|
|
17
|
+
startTime: Date | null;
|
|
18
|
+
endDate: Date | null;
|
|
19
|
+
endTime: Date | null;
|
|
20
|
+
recurring: SCEventRecurrenceType;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
isPublic: boolean;
|
|
24
|
+
isSubmitting: boolean;
|
|
25
|
+
showEndDateTime: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare type FieldStateKeys = keyof InitialFieldState;
|
|
28
|
+
export declare type FieldStateValues = InitialFieldState[FieldStateKeys];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -174,5 +174,5 @@ export default function EventHeader(inProps) {
|
|
|
174
174
|
month: 'long'
|
|
175
175
|
}),
|
|
176
176
|
hour: intl.formatDate(scEvent.start_date, { hour: 'numeric', minute: 'numeric' })
|
|
177
|
-
} })) })), _jsx(Typography, Object.assign({ variant: "h5", className: classes.name }, { children: scEvent.name })), _jsxs(Box, Object.assign({ className: classes.visibility }, { children: [_jsx(_Fragment, { children: scEvent.privacy === SCEventPrivacyType.PUBLIC ? (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "public" }), _jsx(FormattedMessage, { id: "ui.eventHeader.visibility.public", defaultMessage: "ui.eventHeader.visibility.public" })] }))) : (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "private" }), _jsx(FormattedMessage, { id: "ui.eventHeader.visibility.private", defaultMessage: "ui.eventHeader.visibility.private" })] }))) }), _jsx(Bullet, {}), _jsx(Typography, Object.assign({ className: classes.visibilityItem }, { children: scEvent.location === SCEventLocationType.PERSON ? (_jsx(FormattedMessage, { id: "ui.eventHeader.location.live", defaultMessage: "ui.eventHeader.location.live" })) : (_jsx(FormattedMessage, { id: "ui.eventHeader.location.online", defaultMessage: "ui.eventHeader.location.online" })) }))] })), _jsx(User, { className: classes.planner, userId: scEvent.managed_by.id, secondary: _jsx(FormattedMessage, { id: "ui.eventHeader.user.manager", defaultMessage: "ui.eventHeader.user.manager" }), elevation: 0, actions: _jsx(_Fragment, { children: isEventAdmin ? (_jsxs(Box, Object.assign({ className: classes.multiActions }, { children: [_jsx(EventInviteButton, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id, disabled: isEventFinished }), _jsxs(Box, { children: [_jsx(EditEventButton, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id, onEditSuccess: (data) => setSCEvent(data), disabled: isEventFinished }), _jsx(EventActionsMenu, Object.assign({ event: scEvent }, EventActionsProps))] })] }))) : (_jsxs(_Fragment, { children: [_jsx(EventSubscribeButton, Object.assign({ event: scEvent, onSubscribe: handleSubscribe }, EventSubscribeButtonProps, { disabled: isEventFinished })), _jsx(EventActionsMenu, Object.assign({ event: scEvent }, EventActionsProps))] })) }) })] }))] })));
|
|
177
|
+
} })) })), _jsx(Typography, Object.assign({ variant: "h5", className: classes.name }, { children: scEvent.name })), _jsxs(Box, Object.assign({ className: classes.visibility }, { children: [_jsx(_Fragment, { children: scEvent.privacy === SCEventPrivacyType.PUBLIC ? (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "public" }), _jsx(FormattedMessage, { id: "ui.eventHeader.visibility.public", defaultMessage: "ui.eventHeader.visibility.public" })] }))) : (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "private" }), _jsx(FormattedMessage, { id: "ui.eventHeader.visibility.private", defaultMessage: "ui.eventHeader.visibility.private" })] }))) }), _jsx(Bullet, {}), _jsx(Typography, Object.assign({ className: classes.visibilityItem }, { children: scEvent.location === SCEventLocationType.PERSON ? (_jsx(FormattedMessage, { id: "ui.eventHeader.location.live", defaultMessage: "ui.eventHeader.location.live" })) : (_jsx(FormattedMessage, { id: "ui.eventHeader.location.online", defaultMessage: "ui.eventHeader.location.online" })) }))] })), _jsx(User, { className: classes.planner, userId: scEvent.managed_by.id, secondary: _jsx(FormattedMessage, { id: "ui.eventHeader.user.manager", defaultMessage: "ui.eventHeader.user.manager" }), elevation: 0, actions: _jsx(_Fragment, { children: isEventAdmin ? (_jsxs(Box, Object.assign({ className: classes.multiActions }, { children: [_jsx(EventInviteButton, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id, disabled: isEventFinished }), _jsxs(Box, { children: [!isMobile && (_jsx(EditEventButton, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id, onEditSuccess: (data) => setSCEvent(data), disabled: isEventFinished })), _jsx(EventActionsMenu, Object.assign({ event: scEvent, onEditSuccess: (data) => setSCEvent(data) }, EventActionsProps))] })] }))) : (_jsxs(_Fragment, { children: [_jsx(EventSubscribeButton, Object.assign({ event: scEvent, onSubscribe: handleSubscribe }, EventSubscribeButtonProps, { disabled: isEventFinished })), _jsx(EventActionsMenu, Object.assign({ event: scEvent, onEditSuccess: (data) => setSCEvent(data) }, EventActionsProps))] })) }) })] }))] })));
|
|
178
178
|
}
|
|
@@ -18,6 +18,10 @@ export interface EventActionsMenuProps extends IconButtonProps {
|
|
|
18
18
|
* Handles callback on delete confirm
|
|
19
19
|
*/
|
|
20
20
|
onDeleteConfirm?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Handles on edit success
|
|
23
|
+
*/
|
|
24
|
+
onEditSuccess?: (data: SCEventType) => any;
|
|
21
25
|
/**
|
|
22
26
|
* Any other properties
|
|
23
27
|
*/
|
|
@@ -15,6 +15,7 @@ import { copyTextToClipboard } from '@selfcommunity/utils';
|
|
|
15
15
|
import { enqueueSnackbar } from 'notistack';
|
|
16
16
|
import PubSub from 'pubsub-js';
|
|
17
17
|
import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
|
|
18
|
+
import EventForm from '../../components/EventForm';
|
|
18
19
|
const PREFIX = 'SCEventActionsMenu';
|
|
19
20
|
const classes = {
|
|
20
21
|
root: `${PREFIX}-root`,
|
|
@@ -69,16 +70,17 @@ export default function EventActionsMenu(inProps) {
|
|
|
69
70
|
props: inProps,
|
|
70
71
|
name: PREFIX
|
|
71
72
|
});
|
|
72
|
-
const { className, event, eventId, onDeleteConfirm } = props, rest = __rest(props, ["className", "event", "eventId", "onDeleteConfirm"]);
|
|
73
|
+
const { className, event, eventId, onDeleteConfirm, onEditSuccess } = props, rest = __rest(props, ["className", "event", "eventId", "onDeleteConfirm", "onEditSuccess"]);
|
|
73
74
|
// STATE
|
|
74
75
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
75
76
|
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
|
|
77
|
+
const [openEdit, setOpenEdit] = useState(false);
|
|
76
78
|
// HOOKS
|
|
77
79
|
const theme = useTheme();
|
|
78
80
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
79
81
|
const scRoutingContext = useSCRouting();
|
|
80
82
|
const scUserContext = useSCUser();
|
|
81
|
-
const { scEvent } = useSCFetchEvent({ id: eventId, event });
|
|
83
|
+
const { scEvent, setSCEvent } = useSCFetchEvent({ id: eventId, event });
|
|
82
84
|
const isEventAdmin = useMemo(() => { var _a; return scUserContext.user && ((_a = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _a === void 0 ? void 0 : _a.id) === scUserContext.user.id; }, [scUserContext.user, (_a = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _a === void 0 ? void 0 : _a.id]);
|
|
83
85
|
const isEventFinished = useMemo(() => {
|
|
84
86
|
if (scEvent && !scEvent.running) {
|
|
@@ -93,10 +95,17 @@ export default function EventActionsMenu(inProps) {
|
|
|
93
95
|
const handleClose = () => {
|
|
94
96
|
setAnchorEl(null);
|
|
95
97
|
};
|
|
98
|
+
const handleEditClick = () => {
|
|
99
|
+
setOpenEdit((o) => !o);
|
|
100
|
+
};
|
|
96
101
|
const handleCloseDialog = () => {
|
|
97
102
|
setOpenConfirmDialog(false);
|
|
98
103
|
setAnchorEl(null);
|
|
99
104
|
};
|
|
105
|
+
const handleEditSuccess = (data) => {
|
|
106
|
+
setSCEvent(data);
|
|
107
|
+
onEditSuccess && onEditSuccess(data);
|
|
108
|
+
};
|
|
100
109
|
/**
|
|
101
110
|
* Handles thread deletion
|
|
102
111
|
*/
|
|
@@ -148,6 +157,7 @@ export default function EventActionsMenu(inProps) {
|
|
|
148
157
|
isEventAdmin &&
|
|
149
158
|
!isEventFinished && [
|
|
150
159
|
_jsx(Divider, {}, "divider"),
|
|
160
|
+
isMobile && (_jsxs(MenuItem, Object.assign({ className: classes.item, onClick: handleEditClick }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "edit" }) }), _jsx(FormattedMessage, { id: "ui.shared.eventActionsMenu.item.edit", defaultMessage: "ui.shared.eventActionsMenu.item.edit" })] }), "edit")),
|
|
151
161
|
_jsxs(MenuItem, Object.assign({ className: classes.item, onClick: () => handleAction(CANCEL_EVENT) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "close" }) }), _jsx(FormattedMessage, { id: "ui.shared.eventActionsMenu.item.cancel", defaultMessage: "ui.shared.eventActionsMenu.item.cancel" })] }), "cancel")
|
|
152
162
|
]
|
|
153
163
|
];
|
|
@@ -155,5 +165,5 @@ export default function EventActionsMenu(inProps) {
|
|
|
155
165
|
if (!scEvent) {
|
|
156
166
|
return null;
|
|
157
167
|
}
|
|
158
|
-
return (_jsxs(_Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { onClick: handleOpen }, { children: _jsx(Icon, { children: "more_vert" }) })), isMobile ? (_jsx(SwipeableDrawerRoot, Object.assign({ className: classes.drawerRoot, anchor: "bottom", open: Boolean(anchorEl), onClose: handleClose, onOpen: handleOpen, PaperProps: { className: classes.paper }, disableSwipeToOpen: true }, { children: _jsx(List, { children: renderList() }) }))) : (_jsx(MenuRoot, Object.assign({ className: classes.menuRoot, anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, PaperProps: { className: classes.paper } }, { children: renderList() }))), openConfirmDialog && (_jsx(ConfirmDialog, { open: openConfirmDialog, title: _jsx(FormattedMessage, { id: "ui.shared.eventActionsMenu.dialog.msg", defaultMessage: "ui.shared.eventActionsMenu.dialog.msg" }), btnConfirm: _jsx(FormattedMessage, { id: "ui.shared.eventActionsMenu.dialog.confirm", defaultMessage: "ui.shared.eventActionsMenu.dialog.confirm" }), onConfirm: handleDeleteThread, onClose: handleCloseDialog }))] }));
|
|
168
|
+
return (_jsxs(_Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { onClick: handleOpen }, { children: _jsx(Icon, { children: "more_vert" }) })), isMobile ? (_jsx(SwipeableDrawerRoot, Object.assign({ className: classes.drawerRoot, anchor: "bottom", open: Boolean(anchorEl), onClose: handleClose, onOpen: handleOpen, PaperProps: { className: classes.paper }, disableSwipeToOpen: true }, { children: _jsx(List, { children: renderList() }) }))) : (_jsx(MenuRoot, Object.assign({ className: classes.menuRoot, anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, PaperProps: { className: classes.paper } }, { children: renderList() }))), openConfirmDialog && (_jsx(ConfirmDialog, { open: openConfirmDialog, title: _jsx(FormattedMessage, { id: "ui.shared.eventActionsMenu.dialog.msg", defaultMessage: "ui.shared.eventActionsMenu.dialog.msg" }), btnConfirm: _jsx(FormattedMessage, { id: "ui.shared.eventActionsMenu.dialog.confirm", defaultMessage: "ui.shared.eventActionsMenu.dialog.confirm" }), onConfirm: handleDeleteThread, onClose: handleCloseDialog })), openEdit && _jsx(EventForm, { onClose: handleEditClick, event: scEvent, onSuccess: handleEditSuccess })] }));
|
|
159
169
|
}
|