@selfcommunity/react-ui 0.11.0-alpha.6 → 0.11.0-alpha.60

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.
Files changed (163) hide show
  1. package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
  2. package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
  3. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
  4. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
  5. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +9 -1
  6. package/lib/cjs/components/CreateEventButton/CreateEventButton.d.ts +1 -1
  7. package/lib/cjs/components/CreateEventButton/CreateEventButton.js +1 -1
  8. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
  9. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
  10. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
  11. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
  12. package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +10 -2
  13. package/lib/cjs/components/Editor/Editor.js +9 -9
  14. package/lib/cjs/components/Editor/nodes/HashtagNode.js +2 -0
  15. package/lib/cjs/components/Editor/nodes/MentionNode.js +2 -0
  16. package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
  17. package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.js +34 -0
  18. package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
  19. package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.js +2 -3
  20. package/lib/cjs/components/Event/Event.js +6 -3
  21. package/lib/cjs/components/EventForm/EventAddress.js +1 -1
  22. package/lib/cjs/components/EventForm/EventForm.js +40 -22
  23. package/lib/cjs/components/EventForm/utils.d.ts +1 -0
  24. package/lib/cjs/components/EventForm/utils.js +6 -1
  25. package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
  26. package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
  27. package/lib/cjs/components/EventHeader/EventHeader.js +3 -2
  28. package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +12 -12
  29. package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +8 -8
  30. package/lib/cjs/components/EventMembersWidget/types.d.ts +4 -5
  31. package/lib/cjs/components/EventMembersWidget/types.js +7 -7
  32. package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
  33. package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
  34. package/lib/cjs/components/Events/Events.d.ts +11 -0
  35. package/lib/cjs/components/Events/Events.js +21 -10
  36. package/lib/cjs/components/Events/OngoingEventsFilter.d.ts +8 -0
  37. package/lib/cjs/components/Events/OngoingEventsFilter.js +24 -0
  38. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +4 -1
  39. package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
  40. package/lib/cjs/components/Footer/Footer.js +9 -6
  41. package/lib/cjs/components/Footer/constants.d.ts +1 -0
  42. package/lib/cjs/components/Footer/constants.js +2 -1
  43. package/lib/cjs/components/GroupForm/GroupForm.js +2 -2
  44. package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
  45. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
  46. package/lib/cjs/components/Groups/Groups.js +18 -16
  47. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +65 -6
  48. package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
  49. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
  50. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
  51. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
  52. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
  53. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
  54. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +106 -0
  55. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
  56. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +37 -0
  57. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
  58. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
  59. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
  60. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
  61. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +62 -5
  62. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
  63. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
  64. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
  65. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +2 -2
  66. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
  67. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
  68. package/lib/cjs/components/Notification/Event/Event.js +20 -2
  69. package/lib/cjs/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
  70. package/lib/cjs/components/SearchDialog/SearchDialog.d.ts +4 -1
  71. package/lib/cjs/components/SearchDialog/SearchDialog.js +2 -2
  72. package/lib/cjs/constants/LiveStream.d.ts +1 -0
  73. package/lib/cjs/constants/LiveStream.js +2 -1
  74. package/lib/cjs/shared/EventActionsMenu/index.js +5 -1
  75. package/lib/cjs/shared/UpScalingTierBadge/index.js +9 -0
  76. package/lib/cjs/utils/buttonCounters.d.ts +1 -0
  77. package/lib/cjs/utils/buttonCounters.js +4 -3
  78. package/lib/cjs/utils/events.d.ts +1 -0
  79. package/lib/cjs/utils/events.js +6 -1
  80. package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
  81. package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
  82. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
  83. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
  84. package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +10 -2
  85. package/lib/esm/components/CreateEventButton/CreateEventButton.d.ts +1 -1
  86. package/lib/esm/components/CreateEventButton/CreateEventButton.js +1 -1
  87. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
  88. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
  89. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
  90. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
  91. package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +12 -4
  92. package/lib/esm/components/Editor/Editor.js +8 -8
  93. package/lib/esm/components/Editor/nodes/HashtagNode.js +2 -0
  94. package/lib/esm/components/Editor/nodes/MentionNode.js +2 -0
  95. package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
  96. package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.js +30 -0
  97. package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
  98. package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.js +1 -1
  99. package/lib/esm/components/Event/Event.js +6 -3
  100. package/lib/esm/components/EventForm/EventAddress.js +1 -1
  101. package/lib/esm/components/EventForm/EventForm.js +42 -24
  102. package/lib/esm/components/EventForm/utils.d.ts +1 -0
  103. package/lib/esm/components/EventForm/utils.js +4 -0
  104. package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
  105. package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
  106. package/lib/esm/components/EventHeader/EventHeader.js +3 -2
  107. package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +14 -14
  108. package/lib/esm/components/EventMembersWidget/TabContentComponent.js +9 -9
  109. package/lib/esm/components/EventMembersWidget/types.d.ts +4 -5
  110. package/lib/esm/components/EventMembersWidget/types.js +6 -6
  111. package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
  112. package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
  113. package/lib/esm/components/Events/Events.d.ts +11 -0
  114. package/lib/esm/components/Events/Events.js +22 -11
  115. package/lib/esm/components/Events/OngoingEventsFilter.d.ts +8 -0
  116. package/lib/esm/components/Events/OngoingEventsFilter.js +21 -0
  117. package/lib/esm/components/FeedObject/Actions/Share/Share.js +4 -1
  118. package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
  119. package/lib/esm/components/Footer/Footer.js +10 -7
  120. package/lib/esm/components/Footer/constants.d.ts +1 -0
  121. package/lib/esm/components/Footer/constants.js +1 -0
  122. package/lib/esm/components/GroupForm/GroupForm.js +2 -2
  123. package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
  124. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
  125. package/lib/esm/components/Groups/Groups.js +21 -19
  126. package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +67 -8
  127. package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
  128. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
  129. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
  130. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
  131. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
  132. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
  133. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +103 -0
  134. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
  135. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +34 -0
  136. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
  137. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
  138. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
  139. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
  140. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +66 -9
  141. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
  142. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
  143. package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
  144. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +2 -2
  145. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
  146. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
  147. package/lib/esm/components/Notification/Event/Event.js +21 -3
  148. package/lib/esm/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
  149. package/lib/esm/components/SearchDialog/SearchDialog.d.ts +4 -1
  150. package/lib/esm/components/SearchDialog/SearchDialog.js +2 -2
  151. package/lib/esm/constants/LiveStream.d.ts +1 -0
  152. package/lib/esm/constants/LiveStream.js +1 -0
  153. package/lib/esm/shared/EventActionsMenu/index.js +6 -2
  154. package/lib/esm/shared/UpScalingTierBadge/index.js +9 -0
  155. package/lib/esm/utils/buttonCounters.d.ts +1 -0
  156. package/lib/esm/utils/buttonCounters.js +3 -2
  157. package/lib/esm/utils/events.d.ts +1 -0
  158. package/lib/esm/utils/events.js +4 -0
  159. package/lib/umd/239.js +2 -0
  160. package/lib/umd/react-ui.js +1 -1
  161. package/package.json +14 -13
  162. package/lib/umd/653.js +0 -2
  163. /package/lib/umd/{653.js.LICENSE.txt → 239.js.LICENSE.txt} +0 -0
@@ -23,10 +23,11 @@ const classes = {
23
23
  const Root = styled(BaseDialog, {
24
24
  name: PREFIX,
25
25
  slot: 'Root'
26
- })(({ theme }) => ({
26
+ })(() => ({
27
27
  paddingBottom: '0px !important',
28
28
  [`& .${classes.title}`]: {
29
- display: 'flex'
29
+ display: 'flex',
30
+ alignItems: 'center'
30
31
  },
31
32
  [`& .${classes.content}`]: {
32
33
  paddingBottom: 0
@@ -56,20 +57,21 @@ const Transition = React.forwardRef(function Transition(props, ref) {
56
57
  * @param inProps
57
58
  */
58
59
  export default function CreateLiveStreamDialog(inProps) {
59
- var _a, _b;
60
+ var _a;
60
61
  //PROPS
61
62
  const props = useThemeProps({
62
63
  props: inProps,
63
64
  name: PREFIX
64
65
  });
65
- const { className, open = true, onClose, onSuccess } = props, rest = __rest(props, ["className", "open", "onClose", "onSuccess"]);
66
+ const { className, open = true, onClose, EventFormComponentProps = {}, LiveStreamFormComponentProps = {} } = props, rest = __rest(props, ["className", "open", "onClose", "EventFormComponentProps", "LiveStreamFormComponentProps"]);
66
67
  // CONTEXT
67
68
  const scUserContext = useSCUser();
68
- const canCreateLiveStream = useMemo(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_live_stream; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
69
- const canCreateEvent = useMemo(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_event; }, [(_b = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _b === void 0 ? void 0 : _b.permission]);
69
+ // PERMISSION
70
+ const canCreateEvent = useMemo(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_event; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
70
71
  // STATE
71
72
  const [step, setStep] = useState(canCreateEvent ? CreateLiveStreamStep.SELECT_TYPE : CreateLiveStreamStep.CREATE_LIVE);
72
73
  const [liveType, setLiveType] = useState(canCreateEvent ? null : LiveStreamType.DIRECT_LIVE);
74
+ const canShowBackButton = useMemo(() => step === CreateLiveStreamStep.CREATE_LIVE && canCreateEvent, [step, canCreateEvent]);
73
75
  // HANDLER
74
76
  const handleLiveTypeSelected = useCallback((l) => {
75
77
  setLiveType(l);
@@ -78,23 +80,27 @@ export default function CreateLiveStreamDialog(inProps) {
78
80
  setLiveType(l);
79
81
  setStep(CreateLiveStreamStep.CREATE_LIVE);
80
82
  }, []);
81
- const handleBack = useCallback((l) => {
83
+ const handleBack = useCallback(() => {
82
84
  setStep(CreateLiveStreamStep.SELECT_TYPE);
83
85
  }, []);
84
86
  const handleSubmit = useCallback((e) => {
85
- onSuccess && onSuccess(e);
86
- }, []);
87
+ var _a, _b;
88
+ liveType === LiveStreamType.EVENT_LIVE
89
+ ? (_a = EventFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(EventFormComponentProps, e)
90
+ : (_b = LiveStreamFormComponentProps.onSuccess) === null || _b === void 0 ? void 0 : _b.call(LiveStreamFormComponentProps, e);
91
+ onClose === null || onClose === void 0 ? void 0 : onClose();
92
+ }, [liveType, onClose, EventFormComponentProps, LiveStreamFormComponentProps]);
87
93
  useEffect(() => {
88
94
  if (!canCreateEvent) {
89
95
  setLiveType(LiveStreamType.DIRECT_LIVE);
90
96
  }
91
97
  }, [canCreateEvent]);
92
98
  // user must be logged
93
- if (!scUserContext.user || !canCreateLiveStream) {
99
+ if (!scUserContext.user) {
94
100
  return null;
95
101
  }
96
102
  /**
97
103
  * Renders root object
98
104
  */
99
- return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, maxWidth: 'md', title: _jsxs(Box, Object.assign({ className: classes.title, component: 'span' }, { children: [Boolean(step === CreateLiveStreamStep.CREATE_LIVE && canCreateEvent) && (_jsx(Button, Object.assign({ variant: "text", onClick: handleBack, startIcon: _jsx(Icon, { children: "arrow_back" }) }, { children: _jsx(FormattedMessage, { id: "ui.createLivestreamDialog.button.back", defaultMessage: "ui.createLivestreamDialog.button.back" }) }))), _jsx(Box, Object.assign({ component: 'span' }, { children: _jsx(FormattedMessage, { id: "ui.createLivestreamDialog.title", defaultMessage: "ui.createLivestreamDialog.title" }) }))] })), fullWidth: true, open: open, scroll: "body", onClose: onClose, className: classNames(classes.root, className), TransitionComponent: Transition, PaperProps: { elevation: 0 } }, rest, { children: _jsxs(Box, Object.assign({ className: classes.content }, { children: [step === CreateLiveStreamStep.SELECT_TYPE && (_jsx(LiveStreamSelector, { liveSelected: liveType, onLiveSelected: handleLiveTypeSelected, onNext: handleLiveTypeSelectedNext })), step === CreateLiveStreamStep.CREATE_LIVE && (_jsx(_Fragment, { children: liveType === LiveStreamType.EVENT_LIVE ? (_jsx(EventForm, { EventAddressComponentProps: { locations: [SCEventLocationType.LIVESTREAM] }, onSuccess: handleSubmit })) : (_jsx(LiveStreamForm, { onSuccess: handleSubmit })) }))] })) })));
105
+ return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, maxWidth: "md", title: _jsxs(Box, Object.assign({ className: classes.title, component: "span" }, { children: [canShowBackButton && (_jsx(Button, Object.assign({ variant: "text", onClick: handleBack, startIcon: _jsx(Icon, { children: "arrow_back" }) }, { children: _jsx(FormattedMessage, { id: "ui.createLivestreamDialog.button.back", defaultMessage: "ui.createLivestreamDialog.button.back" }) }))), _jsx(Box, Object.assign({ component: "span" }, { children: _jsx(FormattedMessage, { id: "ui.createLivestreamDialog.title", defaultMessage: "ui.createLivestreamDialog.title" }) }))] })), fullWidth: true, open: open, scroll: "body", onClose: !canShowBackButton ? onClose : undefined, className: classNames(classes.root, className), TransitionComponent: Transition, PaperProps: { elevation: 0 } }, rest, { children: _jsxs(Box, Object.assign({ className: classes.content }, { children: [step === CreateLiveStreamStep.SELECT_TYPE && (_jsx(LiveStreamSelector, { liveSelected: liveType, onLiveSelected: handleLiveTypeSelected, onNext: handleLiveTypeSelectedNext })), step === CreateLiveStreamStep.CREATE_LIVE && (_jsx(_Fragment, { children: liveType === LiveStreamType.EVENT_LIVE ? (_jsx(EventForm, Object.assign({}, EventFormComponentProps, { EventAddressComponentProps: { locations: [SCEventLocationType.LIVESTREAM] }, onSuccess: handleSubmit }))) : (_jsx(LiveStreamForm, Object.assign({}, LiveStreamFormComponentProps, { onSuccess: handleSubmit }))) }))] })) })));
100
106
  }
@@ -12,8 +12,8 @@ import LiveImage from '../../../assets/liveStream/live';
12
12
  import { LiveStreamApiClient } from '@selfcommunity/api-services';
13
13
  import { WARNING_THRESHOLD_EXPIRING_SOON } from '../../LiveStreamRoom/constants';
14
14
  import { Link, SCPreferences, useSCContext, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
15
- import { SCCommunitySubscriptionTier } from '@selfcommunity/types';
16
- import { SELFCOMMUNITY_PRICING } from '../../PlatformWidget/constants';
15
+ import { SCCommunityEnvironment, SCCommunitySubscriptionTier } from '@selfcommunity/types';
16
+ import { HUB_PROD, HUB_STAGE } from '../../PlatformWidget/constants';
17
17
  export const PREFIX = 'SCLiveStreamSelector';
18
18
  const classes = {
19
19
  root: `${PREFIX}-root`,
@@ -80,6 +80,14 @@ export default function LiveStreamSelector(inProps) {
80
80
  SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
81
81
  preferences[SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
82
82
  preferences[SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === SCCommunitySubscriptionTier.FREE_TRIAL, [preferences]);
83
+ const isEnterpriseTier = useMemo(() => preferences &&
84
+ SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
85
+ preferences[SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
86
+ preferences[SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === SCCommunitySubscriptionTier.ENTERPRISE, [preferences]);
87
+ const isStage = useMemo(() => preferences &&
88
+ SCPreferences.STATIC_ENVIRONMENT in preferences &&
89
+ preferences[SCPreferences.STATIC_ENVIRONMENT].value === SCCommunityEnvironment.STAGE, [preferences]);
90
+ const communityStackId = useMemo(() => preferences && SCPreferences.STATIC_ENVIRONMENT in preferences && preferences[SCPreferences.STATIC_STACKID].value, [preferences]);
83
91
  const intl = useIntl();
84
92
  const options = [
85
93
  {
@@ -153,11 +161,11 @@ export default function LiveStreamSelector(inProps) {
153
161
  }, []);
154
162
  const warning = useMemo(() => {
155
163
  let _message;
156
- if (isFreeTrialTier && isCommunityOwner) {
164
+ if (isFreeTrialTier && isCommunityOwner && !isEnterpriseTier) {
157
165
  _message = (_jsx(FormattedMessage, { id: "ui.liveStreamForm.selector.warningSubscriptionRequired", defaultMessage: "ui.liveStreamForm.selector.warningSubscriptionRequired", values: {
158
166
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
159
167
  // @ts-ignore
160
- link: (...chunks) => _jsx(Link, Object.assign({ to: SELFCOMMUNITY_PRICING[scContext.settings.locale.default] }, { children: chunks }))
168
+ link: (...chunks) => (_jsx(Link, Object.assign({ target: "_blank", to: `${isStage ? HUB_STAGE : HUB_PROD}dashboard/community/${communityStackId}/subscription` }, { children: chunks })))
161
169
  } }));
162
170
  }
163
171
  else if (timeRemaining !== null && timeRemaining <= WARNING_THRESHOLD_EXPIRING_SOON) {
@@ -8,19 +8,19 @@ import { useThemeProps } from '@mui/system';
8
8
  import nodes from './nodes';
9
9
  import { LexicalComposer } from '@lexical/react/LexicalComposer';
10
10
  import { ContentEditable } from '@lexical/react/LexicalContentEditable';
11
- import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
11
+ import ToolbarPlugin from './plugins/ToolbarPlugin';
12
+ import { PREFIX } from './constants';
13
+ import { HorizontalRulePlugin } from './plugins/HorizontalRulePlugin';
12
14
  import { RichTextPlugin } from './plugins/LexicalRichTextPlugin';
13
- import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary';
14
- import { HorizontalRulePlugin } from '@lexical/react/LexicalHorizontalRulePlugin';
15
+ import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';
15
16
  import { AutoLinkPlugin, DefaultHtmlValuePlugin, EmojiPlugin, ImagePlugin, MentionsPlugin, OnChangePlugin } from './plugins';
17
+ import OnBlurPlugin from './plugins/OnBlurPlugin';
18
+ import OnFocusPlugin from './plugins/OnFocusPlugin';
16
19
  import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
20
+ import FloatingLinkPlugin from './plugins/FloatingLinkPlugin';
17
21
  import ApiPlugin from './plugins/ApiPlugin';
18
- import ToolbarPlugin from './plugins/ToolbarPlugin';
22
+ import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
19
23
  import { ListPlugin } from '@lexical/react/LexicalListPlugin';
20
- import FloatingLinkPlugin from './plugins/FloatingLinkPlugin';
21
- import OnBlurPlugin from './plugins/OnBlurPlugin';
22
- import OnFocusPlugin from './plugins/OnFocusPlugin';
23
- import { PREFIX } from './constants';
24
24
  const classes = {
25
25
  root: `${PREFIX}-root`,
26
26
  focused: `${PREFIX}-focused`,
@@ -33,6 +33,8 @@ export class HashtagNode extends TextNode {
33
33
  if (inner === null) {
34
34
  return true;
35
35
  }
36
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
37
+ // @ts-ignore
36
38
  super.updateDOM(prevNode, inner, config);
37
39
  return false;
38
40
  }
@@ -47,6 +47,8 @@ export class MentionNode extends TextNode {
47
47
  if (inner === null) {
48
48
  return true;
49
49
  }
50
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
51
+ // @ts-ignore
50
52
  super.updateDOM(prevNode, inner, config);
51
53
  return false;
52
54
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ export declare function HorizontalRulePlugin(): null;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
+ import { $createHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from '@lexical/react/LexicalHorizontalRuleNode';
10
+ import { $insertNodeToNearestRoot } from '@lexical/utils';
11
+ import { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } from 'lexical';
12
+ import { useEffect } from 'react';
13
+ export function HorizontalRulePlugin() {
14
+ const [editor] = useLexicalComposerContext();
15
+ useEffect(() => {
16
+ return editor.registerCommand(INSERT_HORIZONTAL_RULE_COMMAND, (type) => {
17
+ const selection = $getSelection();
18
+ if (!$isRangeSelection(selection)) {
19
+ return false;
20
+ }
21
+ const focusNode = selection.focus.getNode();
22
+ if (focusNode !== null) {
23
+ const horizontalRuleNode = $createHorizontalRuleNode();
24
+ $insertNodeToNearestRoot(horizontalRuleNode);
25
+ }
26
+ return true;
27
+ }, COMMAND_PRIORITY_EDITOR);
28
+ }, [editor]);
29
+ return null;
30
+ }
@@ -1,6 +1,6 @@
1
1
  import { ErrorBoundaryType } from '../shared/useDecorators';
2
2
  export declare function RichTextPlugin({ contentEditable, placeholder, ErrorBoundary }: {
3
3
  contentEditable: JSX.Element;
4
- placeholder: ((isEditable: boolean) => null | JSX.Element) | null | JSX.Element;
5
- ErrorBoundary: ErrorBoundaryType;
4
+ placeholder?: ((isEditable: boolean) => null | JSX.Element) | null | JSX.Element;
5
+ ErrorBoundary?: ErrorBoundaryType;
6
6
  }): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
3
- import useLexicalEditable from '@lexical/react/useLexicalEditable';
3
+ import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
4
4
  import { useDecorators } from '../shared/useDecorators';
5
5
  import { useEditorFocus } from '../shared/useEditorFocus';
6
6
  import { useCanShowPlaceholder } from '../shared/useCanShowPlaceholder';
@@ -17,6 +17,7 @@ import User from '../User';
17
17
  import Widget from '../Widget';
18
18
  import { PREFIX } from './constants';
19
19
  import EventSkeleton from './Skeleton';
20
+ import { checkEventFinished } from '../../utils/events';
20
21
  const classes = {
21
22
  root: `${PREFIX}-root`,
22
23
  detailRoot: `${PREFIX}-detail-root`,
@@ -44,7 +45,8 @@ const classes = {
44
45
  snippetInProgress: `${PREFIX}-snippet-in-progress`,
45
46
  snippetPrimary: `${PREFIX}-snippet-primary`,
46
47
  snippetSecondary: `${PREFIX}-snippet-secondary`,
47
- snippetActions: `${PREFIX}-snippet-actions`
48
+ snippetActions: `${PREFIX}-snippet-actions`,
49
+ finishedChip: `${PREFIX}-finished-chip`
48
50
  };
49
51
  const Root = styled(Widget, {
50
52
  name: PREFIX,
@@ -108,6 +110,7 @@ export default function Event(inProps) {
108
110
  // STATE
109
111
  const { scEvent } = useSCFetchEvent({ id: eventId, event, autoSubscribe: false });
110
112
  const inProgress = useMemo(() => scEvent && scEvent.active && scEvent.running, [scEvent]);
113
+ const isEventFinished = useMemo(() => checkEventFinished(scEvent), [scEvent]);
111
114
  // CONTEXT
112
115
  const scRoutingContext = useSCRouting();
113
116
  // HOOKS
@@ -126,10 +129,10 @@ export default function Event(inProps) {
126
129
  contentObj = (_jsxs(DetailRoot, Object.assign({ className: classes.detailRoot }, { children: [_jsxs(Box, Object.assign({ className: classes.detailImageWrapper }, { children: [_jsx(CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.detailImage }), !hideInProgress && inProgress && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.detailInProgress })), _jsx(Calendar, { day: new Date(scEvent.start_date).getDate() })] })), _jsxs(CardContent, Object.assign({ className: classes.detailContent }, { children: [scEvent.active ? (_jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.detailNameWrapper }, { children: _jsx(Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scEvent.name })) }))) : (_jsx(Box, Object.assign({ className: classes.detailNameWrapper }, { children: _jsx(Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scEvent.name })) }))), _jsx(EventInfoDetails, { event: scEvent }), !hideEventPlanner && (_jsx(User, { user: scEvent.managed_by, elevation: 0, secondary: _jsx(Typography, Object.assign({ variant: "caption" }, { children: _jsx(FormattedMessage, { id: "ui.myEventsWidget.planner", defaultMessage: "ui.myEventsWidget.planner" }) })), actions: _jsx(_Fragment, {}), className: classes.detailUser })), !hideEventParticipants && (_jsxs(_Fragment, { children: [_jsx(Divider, { className: classes.detailFirstDivider }), _jsx(EventParticipantsButton, Object.assign({ event: scEvent }, EventParticipantsButtonComponentProps))] })), _jsx(Divider, { className: classes.detailSecondDivider })] })), actions !== null && actions !== void 0 ? actions : (_jsx(CardActions, Object.assign({ className: classes.detailActions }, { children: _jsx(Button, Object.assign({ size: "small", variant: "outlined", component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
127
130
  }
128
131
  else if (template === SCEventTemplateType.PREVIEW) {
129
- contentObj = (_jsxs(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [_jsxs(Box, Object.assign({ position: "relative", className: classes.previewImageWrapper }, { children: [_jsx(CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.previewImage }), !hideInProgress && inProgress && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.previewInProgress }))] })), _jsxs(CardContent, Object.assign({ className: classes.previewContent }, { children: [_jsx(EventInfoDetails, { event: scEvent, hidePrivacyIcon: true, hasLocationInfo: false, beforePrivacyInfo: _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.previewNameWrapper }, { children: _jsx(Typography, Object.assign({ variant: "h5", className: classes.previewName }, { children: scEvent.name })) })) }), !hideEventParticipants && _jsx(EventParticipantsButton, Object.assign({ event: scEvent, hideCaption: true }, EventParticipantsButtonComponentProps))] })), actions !== null && actions !== void 0 ? actions : (_jsx(CardActions, Object.assign({ className: classes.previewActions }, { children: _jsx(Button, Object.assign({ size: "small", variant: "outlined", component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
132
+ contentObj = (_jsxs(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [_jsxs(Box, Object.assign({ position: "relative", className: classes.previewImageWrapper }, { children: [_jsx(CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.previewImage }), !hideInProgress && inProgress && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.previewInProgress })), isEventFinished && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.event.finished", defaultMessage: "ui.event.finished" }), className: classes.finishedChip }))] })), _jsxs(CardContent, Object.assign({ className: classes.previewContent }, { children: [_jsx(EventInfoDetails, { event: scEvent, hidePrivacyIcon: true, hasLocationInfo: false, beforePrivacyInfo: _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.previewNameWrapper }, { children: _jsx(Typography, Object.assign({ variant: "h5", className: classes.previewName }, { children: scEvent.name })) })) }), !hideEventParticipants && _jsx(EventParticipantsButton, Object.assign({ event: scEvent, hideCaption: true }, EventParticipantsButtonComponentProps))] })), actions !== null && actions !== void 0 ? actions : (_jsx(CardActions, Object.assign({ className: classes.previewActions }, { children: _jsx(Button, Object.assign({ size: "small", variant: "outlined", component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
130
133
  }
131
134
  else {
132
- contentObj = (_jsx(SnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.snippetRoot, image: _jsxs(Box, Object.assign({ className: classes.snippetImage }, { children: [_jsx(Avatar, { variant: "square", alt: scEvent.name, src: scEvent.image_medium, className: classes.snippetAvatar }), ' ', !hideInProgress && inProgress && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.snippetInProgress }))] })), primary: _jsxs(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.snippetPrimary }, { children: [_jsx(Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scEvent.start_date, {
135
+ contentObj = (_jsx(SnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.snippetRoot, image: _jsxs(Box, Object.assign({ className: classes.snippetImage }, { children: [_jsx(Avatar, { variant: "square", alt: scEvent.name, src: scEvent.image_medium, className: classes.snippetAvatar }), ' ', !hideInProgress && inProgress && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.event.inProgress", defaultMessage: "ui.event.inProgress" }), className: classes.snippetInProgress })), isEventFinished && (_jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.event.finished", defaultMessage: "ui.event.finished" }), className: classes.finishedChip }))] })), primary: _jsxs(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.snippetPrimary }, { children: [_jsx(Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scEvent.start_date, {
133
136
  weekday: 'long',
134
137
  month: 'long',
135
138
  day: 'numeric'
@@ -155,5 +155,5 @@ export default function EventAddress(inProps) {
155
155
  }
156
156
  return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [_jsxs(Tabs, Object.assign({ className: classes.tabs, value: location, onChange: handleChange, indicatorColor: "secondary", textColor: "secondary", variant: "fullWidth" }, { children: [isInPersonTabActive && (_jsx(Tab, { value: SCEventLocationType.PERSON, classes: { root: classes.tab }, icon: _jsx(Icon, { children: "add_location_alt" }), iconPosition: "start", label: _jsx(FormattedMessage, { id: "ui.eventForm.address.live.label", defaultMessage: "ui.eventForm.address.live.label" }) })), isOnlineTabActive && (_jsx(Tab, { value: SCEventLocationType.ONLINE, classes: { root: classes.tab }, icon: _jsx(Icon, { children: "play_circle_outline" }), iconPosition: "start", label: _jsx(FormattedMessage, { id: "ui.eventForm.address.online.label", defaultMessage: "ui.eventForm.address.online.label" }) })), isLiveTabActive && (_jsx(Tab, { value: SCEventLocationType.LIVESTREAM, classes: { root: classes.tab }, icon: _jsx(Icon, { children: "photo_camera" }), iconPosition: "start", label: _jsx(FormattedMessage, { id: "ui.eventForm.address.liveStream.label", defaultMessage: "ui.eventForm.address.liveStream.label" }) }))] })), _jsxs(Box, Object.assign({ className: classes.tabContent }, { children: [isInPersonTabActive && location === SCEventLocationType.PERSON && (_jsx(Autocomplete, { disabled: !geocodingApiKey, size: "small", value: geolocation, onChange: handleSelection, inputValue: inputValue, onInputChange: handleLocationChange, options: suggestions, getOptionLabel: (option) => option.description || geolocation.description, noOptionsText: _jsx(FormattedMessage, { id: "ui.eventForm.address.live.noResults", defaultMessage: "ui.eventForm.address.live.noResults" }), isOptionEqualToValue: (option, value) => option.description === value.description, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { label: _jsx(FormattedMessage, { id: "ui.eventForm.address.live.placeholder", defaultMessage: "ui.eventForm.address.live.placeholder" }), variant: "outlined", fullWidth: true, InputProps: Object.assign(Object.assign({}, params.InputProps), { endAdornment: (_jsxs(_Fragment, { children: [_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "add_location_alt" }) })), params.InputProps.endAdornment] })) }) }))) })), isOnlineTabActive && location === SCEventLocationType.ONLINE && (_jsx(UrlTextField, { size: "small", fullWidth: true, type: "url", placeholder: `${intl.formatMessage(messages.virtualPlaceholder)}`, helperText: _jsx(FormattedMessage, { id: "ui.eventForm.address.online.help", defaultMessage: "ui.eventForm.address.online.help" }), InputProps: {
157
157
  endAdornment: _jsx(Icon, { children: "play_circle_outline" })
158
- }, onChange: handleLinkChange })), isLiveTabActive && location === SCEventLocationType.LIVESTREAM && (_jsxs(_Fragment, { children: [_jsx(LiveStream, { template: SCLiveStreamTemplateType.SNIPPET, liveStream: liveStream, actions: _jsx(_Fragment, {}) }), _jsx(LiveStreamFormSettings, { settings: liveStream.settings || LIVESTREAM_DEFAULT_SETTINGS, onChange: handleLiveStreamSettingsChange })] }))] }))] })));
158
+ }, value: event ? event.link : '', onChange: handleLinkChange })), isLiveTabActive && location === SCEventLocationType.LIVESTREAM && (_jsxs(_Fragment, { children: [_jsx(LiveStream, { template: SCLiveStreamTemplateType.SNIPPET, liveStream: liveStream, actions: _jsx(_Fragment, {}) }), _jsx(LiveStreamFormSettings, { settings: liveStream.settings || LIVESTREAM_DEFAULT_SETTINGS, onChange: handleLiveStreamSettingsChange })] }))] }))] })));
159
159
  }
@@ -7,7 +7,7 @@ import { useThemeProps } from '@mui/system';
7
7
  import { LocalizationProvider, MobileDatePicker, MobileTimePicker } from '@mui/x-date-pickers';
8
8
  import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
9
9
  import { EventService, formatHttpErrorCode } from '@selfcommunity/api-services';
10
- import { SCPreferences, useSCContext, useSCPreferences } from '@selfcommunity/react-core';
10
+ import { SCPreferences, useSCContext, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
11
11
  import { SCEventLocationType, SCEventPrivacyType, SCEventRecurrenceType, SCFeatureName } from '@selfcommunity/types';
12
12
  import { Logger } from '@selfcommunity/utils';
13
13
  import classNames from 'classnames';
@@ -22,7 +22,7 @@ import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
22
22
  import { DAILY_LATER_DAYS, MONTHLY_LATER_DAYS, NEVER_LATER_DAYS, PREFIX, WEEKLY_LATER_DAYS } from './constants';
23
23
  import EventAddress from './EventAddress';
24
24
  import UploadEventCover from './UploadEventCover';
25
- import { combineDateAndTime, getLaterDaysDate, getLaterHoursDate, getNewDate } from './utils';
25
+ import { combineDateAndTime, getDateAndHours, getLaterDaysDate, getLaterHoursDate, getNewDate } from './utils';
26
26
  import { LIVESTREAM_DEFAULT_SETTINGS } from '../LiveStreamForm/constants';
27
27
  import CoverPlaceholder from '../../assets/deafultCover';
28
28
  const messages = defineMessages({
@@ -119,7 +119,7 @@ const Root = styled(Box, {
119
119
  * @param inProps
120
120
  */
121
121
  export default function EventForm(inProps) {
122
- var _a, _b, _c, _d, _e;
122
+ var _a, _b, _c, _d, _e, _f;
123
123
  //PROPS
124
124
  const props = useThemeProps({
125
125
  props: inProps,
@@ -128,6 +128,7 @@ export default function EventForm(inProps) {
128
128
  const { className, onSuccess, onError, event, presetLocation, EventAddressComponentProps = {} } = props, rest = __rest(props, ["className", "onSuccess", "onError", "event", "presetLocation", "EventAddressComponentProps"]);
129
129
  // CONTEXT
130
130
  const scContext = useSCContext();
131
+ const scUserContext = useSCUser();
131
132
  // INTL
132
133
  const intl = useIntl();
133
134
  const startDateTime = useMemo(() => getNewDate(event === null || event === void 0 ? void 0 : event.start_date), [event]);
@@ -142,9 +143,11 @@ export default function EventForm(inProps) {
142
143
  endDate: (event === null || event === void 0 ? void 0 : event.end_date) ? endDateTime : getNewDate(),
143
144
  endTime: (event === null || event === void 0 ? void 0 : event.end_date) ? endDateTime : getLaterHoursDate(3),
144
145
  location: (event === null || event === void 0 ? void 0 : event.location)
145
- ? event.location === SCEventLocationType.ONLINE && event.live_stream
146
- ? SCEventLocationType.LIVESTREAM
147
- : SCEventLocationType.ONLINE
146
+ ? event.location === SCEventLocationType.PERSON
147
+ ? SCEventLocationType.PERSON
148
+ : event.location === SCEventLocationType.ONLINE && event.live_stream
149
+ ? SCEventLocationType.LIVESTREAM
150
+ : SCEventLocationType.ONLINE
148
151
  : ((_a = EventAddressComponentProps.locations) === null || _a === void 0 ? void 0 : _a.length)
149
152
  ? presetLocation in EventAddressComponentProps.locations
150
153
  ? presetLocation
@@ -156,7 +159,7 @@ export default function EventForm(inProps) {
156
159
  link: (event === null || event === void 0 ? void 0 : event.link) || '',
157
160
  liveStreamSettings: (event === null || event === void 0 ? void 0 : event.live_stream) ? event === null || event === void 0 ? void 0 : event.live_stream.settings : null,
158
161
  recurring: (event === null || event === void 0 ? void 0 : event.recurring) || SCEventRecurrenceType.NEVER,
159
- isPublic: (event === null || event === void 0 ? void 0 : event.privacy) === SCEventPrivacyType.PUBLIC || true,
162
+ isPublic: (event === null || event === void 0 ? void 0 : event.privacy) ? event.privacy === SCEventPrivacyType.PUBLIC : true,
160
163
  isSubmitting: false
161
164
  };
162
165
  // STATE
@@ -170,6 +173,7 @@ export default function EventForm(inProps) {
170
173
  scPreferences.features.includes(SCFeatureName.LIVE_STREAM) &&
171
174
  SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in scPreferences.preferences &&
172
175
  scPreferences.preferences[SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [scPreferences.preferences, scPreferences.features]);
176
+ const canCreateLiveStream = useMemo(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_live_stream; }, [(_b = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _b === void 0 ? void 0 : _b.permission]);
173
177
  const privateEnabled = useMemo(() => scPreferences.preferences[SCPreferences.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED].value, [scPreferences.preferences]);
174
178
  const visibilityEnabled = useMemo(() => scPreferences.preferences[SCPreferences.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED].value, [scPreferences.preferences]);
175
179
  const disablePastStartTime = useMemo(() => field.startDate.getDate() === getNewDate().getDate(), [field]);
@@ -238,6 +242,11 @@ export default function EventForm(inProps) {
238
242
  formData.append('link', '');
239
243
  formData.append('live_stream_settings', null);
240
244
  }
245
+ if (field.location !== SCEventLocationType.PERSON) {
246
+ formData.append('geolocation', '');
247
+ formData.append('geolocation_lat', '');
248
+ formData.append('geolocation_lng', '');
249
+ }
241
250
  if (privateEnabled) {
242
251
  formData.append('privacy', field.isPublic ? SCEventPrivacyType.PUBLIC : SCEventPrivacyType.PRIVATE);
243
252
  }
@@ -313,17 +322,17 @@ export default function EventForm(inProps) {
313
322
  let disabled = false;
314
323
  switch (field.recurring) {
315
324
  case SCEventRecurrenceType.DAILY:
316
- disabled = date.getTime() > getLaterDaysDate(DAILY_LATER_DAYS, field.startDate).getTime();
325
+ disabled = date.getTime() > getDateAndHours(getLaterDaysDate(DAILY_LATER_DAYS, field.startDate), 23, 59, 59, 59).getTime();
317
326
  break;
318
327
  case SCEventRecurrenceType.WEEKLY:
319
- disabled = date.getTime() > getLaterDaysDate(WEEKLY_LATER_DAYS, field.startDate).getTime();
328
+ disabled = date.getTime() > getDateAndHours(getLaterDaysDate(WEEKLY_LATER_DAYS, field.startDate), 23, 59, 59, 59).getTime();
320
329
  break;
321
330
  case SCEventRecurrenceType.MONTHLY:
322
- disabled = date.getTime() > getLaterDaysDate(MONTHLY_LATER_DAYS, field.startDate).getTime();
331
+ disabled = date.getTime() > getDateAndHours(getLaterDaysDate(MONTHLY_LATER_DAYS, field.startDate), 23, 59, 59, 59).getTime();
323
332
  break;
324
333
  case SCEventRecurrenceType.NEVER:
325
334
  default:
326
- disabled = date.getTime() > getLaterDaysDate(NEVER_LATER_DAYS, field.startDate).getTime();
335
+ disabled = date.getTime() > getDateAndHours(getLaterDaysDate(NEVER_LATER_DAYS, field.startDate), 23, 59, 59, 59).getTime();
327
336
  }
328
337
  return disabled;
329
338
  }, [field]);
@@ -343,7 +352,10 @@ export default function EventForm(inProps) {
343
352
  // @ts-ignore
344
353
  toolbarTitle: _jsx(FormattedMessage, { id: "ui.eventForm.date.title", defaultMessage: "ui.eventForm.date.title" })
345
354
  }
346
- }, onChange: (value) => handleChangeDateTime(value, 'startDate') }), _jsx(MobileTimePicker, { className: classes.picker, disablePast: disablePastStartTime, label: field.startTime && _jsx(FormattedMessage, { id: "ui.eventForm.time.placeholder", defaultMessage: "ui.eventForm.time.placeholder" }), value: field.startTime, slots: {
355
+ }, onChange: (value) => {
356
+ handleChangeDateTime(value, 'startDate');
357
+ handleChangeDateTime(value, 'startTime');
358
+ } }), _jsx(MobileTimePicker, { className: classes.picker, disablePast: disablePastStartTime, label: field.startTime && _jsx(FormattedMessage, { id: "ui.eventForm.time.placeholder", defaultMessage: "ui.eventForm.time.placeholder" }), value: field.startTime, slots: {
347
359
  textField: (params) => (_jsx(TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.startTime)}`, startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "access_time" }) }) }))) }) })))
348
360
  }, slotProps: {
349
361
  toolbar: {
@@ -351,7 +363,10 @@ export default function EventForm(inProps) {
351
363
  // @ts-ignore
352
364
  toolbarTitle: _jsx(FormattedMessage, { id: "ui.eventForm.time.title", defaultMessage: "ui.eventForm.time.title" })
353
365
  }
354
- }, onChange: (value) => handleChangeDateTime(value, 'startTime') })] })) })), _jsxs(FormControl, Object.assign({ className: classes.frequency }, { children: [field.recurring !== SCEventRecurrenceType.NEVER && _jsx(InputLabel, Object.assign({ id: "recurring" }, { children: `${intl.formatMessage(messages.frequency)}` })), _jsx(Select, Object.assign({ name: "recurring", label: field.recurring !== SCEventRecurrenceType.NEVER && `${intl.formatMessage(messages.frequency)}`, labelId: "recurring", value: field.recurring, onChange: handleChange, displayEmpty: true, renderValue: (selected) => {
366
+ }, onChange: (value) => {
367
+ handleChangeDateTime(value, 'startDate');
368
+ handleChangeDateTime(value, 'startTime');
369
+ } })] })) })), _jsxs(FormControl, Object.assign({ className: classes.frequency }, { children: [field.recurring !== SCEventRecurrenceType.NEVER && _jsx(InputLabel, Object.assign({ id: "recurring" }, { children: `${intl.formatMessage(messages.frequency)}` })), _jsx(Select, Object.assign({ name: "recurring", label: field.recurring !== SCEventRecurrenceType.NEVER && `${intl.formatMessage(messages.frequency)}`, labelId: "recurring", value: field.recurring, onChange: handleChange, displayEmpty: true, renderValue: (selected) => {
355
370
  if (!selected) {
356
371
  return _jsx("em", { children: `${intl.formatMessage(messages.frequencyPlaceholder)}` });
357
372
  }
@@ -366,24 +381,27 @@ export default function EventForm(inProps) {
366
381
  // @ts-ignore
367
382
  toolbarTitle: _jsx(FormattedMessage, { id: "ui.eventForm.date.title", defaultMessage: "ui.eventForm.date.title" })
368
383
  }
369
- }, onChange: (value) => handleChangeDateTime(value, 'endDate'), shouldDisableDate: shouldDisableDate }), _jsx(MobileTimePicker, { className: classes.picker, disablePast: disablePastEndTime, label: field.endTime && _jsx(FormattedMessage, { id: "ui.eventForm.time.end.placeholder", defaultMessage: "ui.eventForm.time.end.placeholder" }), value: field.endTime, slots: {
370
- textField: (params) => {
371
- var _a;
372
- return (_jsx(TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endTime)}`, startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "access_time" }) }) }))) }), error: Boolean(error['endDateError']), helperText: ((_a = error['endDateError']) === null || _a === void 0 ? void 0 : _a.error) ? (_jsx(FormattedMessage, { id: "ui.eventForm.time.end.error.invalid", defaultMessage: "ui.eventForm.time.end.error.invalid" })) : null })));
373
- }
384
+ }, onChange: (value) => {
385
+ handleChangeDateTime(value, 'endDate');
386
+ handleChangeDateTime(value, 'endTime');
387
+ }, shouldDisableDate: shouldDisableDate }), _jsx(MobileTimePicker, { className: classes.picker, disablePast: disablePastEndTime, label: field.endTime && _jsx(FormattedMessage, { id: "ui.eventForm.time.end.placeholder", defaultMessage: "ui.eventForm.time.end.placeholder" }), value: field.endTime, slots: {
388
+ textField: (params) => (_jsx(TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endTime)}`, startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "access_time" }) }) }))) }) })))
374
389
  }, slotProps: {
375
390
  toolbar: {
376
391
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
377
392
  // @ts-ignore
378
393
  toolbarTitle: _jsx(FormattedMessage, { id: "ui.eventForm.time.title", defaultMessage: "ui.eventForm.time.title" })
379
394
  }
380
- }, onChange: (value) => handleChangeDateTime(value, 'endTime'), shouldDisableTime: shouldDisableTime })] })) })), _jsx(EventAddress, Object.assign({ forwardGeolocationData: handleGeoData, forwardLivestreamSettingsData: handleLiveStreamSettingsData, event: Object.assign(Object.assign({}, event), {
395
+ }, onChange: (value) => {
396
+ handleChangeDateTime(value, 'endDate');
397
+ handleChangeDateTime(value, 'endTime');
398
+ }, shouldDisableTime: shouldDisableTime })] })) })), _jsx(EventAddress, Object.assign({ forwardGeolocationData: handleGeoData, forwardLivestreamSettingsData: handleLiveStreamSettingsData, event: Object.assign(Object.assign({}, event), {
381
399
  name: field.name,
382
400
  start_date: field.startDate,
383
401
  location: field.location,
384
402
  geolocation: field.geolocation,
385
- live_stream: Object.assign(Object.assign({ title: field.name || `${intl.formatMessage(messages.name)}` }, (event && ((_b = event.live_stream) === null || _b === void 0 ? void 0 : _b.created_at) && { created_at: field.startDate })), { settings: field.liveStreamSettings })
386
- }) }, EventAddressComponentProps)), privateEnabled && (_jsxs(Box, Object.assign({ className: classes.privacySection }, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", justifyContent: "center" }, { children: [_jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: !field.isPublic }) }, { children: [_jsx(Icon, { children: "private" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.private", defaultMessage: "ui.eventForm.privacy.private" })] })), _jsx(Switch, { className: classes.switch, checked: field.isPublic, onChange: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['isPublic']: !field.isPublic }))), disabled: event && !field.isPublic }), _jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: field.isPublic }) }, { children: [_jsx(Icon, { children: "public" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.public", defaultMessage: "ui.eventForm.privacy.public" })] }))] })), _jsx(Typography, Object.assign({ variant: "body2", textAlign: "center", className: classes.privacySectionInfo }, { children: field.isPublic ? (_jsx(FormattedMessage, { id: "ui.eventForm.privacy.public.info", defaultMessage: "ui.eventForm.privacy.public.info", values: {
403
+ live_stream: Object.assign(Object.assign({ title: field.name || `${intl.formatMessage(messages.name)}` }, (event && ((_c = event.live_stream) === null || _c === void 0 ? void 0 : _c.created_at) && { created_at: field.startDate })), { settings: field.liveStreamSettings })
404
+ }) }, EventAddressComponentProps)), privateEnabled && (_jsxs(Box, Object.assign({ className: classes.privacySection }, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", justifyContent: "center" }, { children: [_jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: !field.isPublic }) }, { children: [_jsx(Icon, { children: "private" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.private", defaultMessage: "ui.eventForm.privacy.private" })] })), _jsx(Switch, { className: classes.switch, checked: field.isPublic, onChange: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['isPublic']: !field.isPublic }))), disabled: (event === null || event === void 0 ? void 0 : event.privacy) === SCEventPrivacyType.PRIVATE }), _jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: field.isPublic }) }, { children: [_jsx(Icon, { children: "public" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.public", defaultMessage: "ui.eventForm.privacy.public" })] }))] })), _jsx(Typography, Object.assign({ variant: "body2", textAlign: "center", className: classes.privacySectionInfo }, { children: field.isPublic ? (_jsx(FormattedMessage, { id: "ui.eventForm.privacy.public.info", defaultMessage: "ui.eventForm.privacy.public.info", values: {
387
405
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
388
406
  // @ts-ignores
389
407
  b: (chunks) => _jsx("strong", { children: chunks })
@@ -392,8 +410,8 @@ export default function EventForm(inProps) {
392
410
  // @ts-ignore
393
411
  b: (chunks) => _jsx("strong", { children: chunks })
394
412
  } })) }))] }))), _jsx(TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
395
- 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 })))
396
- }, 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 }), genericError && (_jsx(Box, Object.assign({ className: classes.genericError }, { children: _jsx(Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), _jsx(Box, Object.assign({ className: classes.actions }, { children: _jsx(LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
413
+ endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) ? EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : EVENT_DESCRIPTION_MAX_LENGTH })))
414
+ }, error: Boolean(((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_f = field.description) === null || _f === void 0 ? void 0 : _f.length) > EVENT_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null }), genericError && (_jsx(Box, Object.assign({ className: classes.genericError }, { children: _jsx(Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), _jsx(Box, Object.assign({ className: classes.actions }, { children: _jsx(LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
397
415
  !field.startDate ||
398
416
  !field.startTime ||
399
417
  !field.endDate ||
@@ -405,5 +423,5 @@ export default function EventForm(inProps) {
405
423
  field.isSubmitting ||
406
424
  field.name.length > EVENT_TITLE_MAX_LENGTH ||
407
425
  field.description.length > EVENT_DESCRIPTION_MAX_LENGTH ||
408
- (field.location === SCEventLocationType.LIVESTREAM && !liveStreamEnabled), 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" })) })) }))] }))] })));
426
+ (field.location === SCEventLocationType.LIVESTREAM && (!liveStreamEnabled || !canCreateLiveStream)), 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" })) })) }))] }))] })));
409
427
  }
@@ -2,3 +2,4 @@ export declare function getNewDate(date?: string | Date): Date;
2
2
  export declare function getLaterHoursDate(hours: number, date?: Date): Date;
3
3
  export declare function getLaterDaysDate(days: number, date?: Date): Date;
4
4
  export declare const combineDateAndTime: (date: Date, time: Date) => string;
5
+ export declare function getDateAndHours(date: Date, hours: number, min?: number, sec?: number, ms?: number): Date;
@@ -22,3 +22,7 @@ export const combineDateAndTime = (date, time) => {
22
22
  combined.setMilliseconds(time.getMilliseconds());
23
23
  return combined.toISOString();
24
24
  };
25
+ export function getDateAndHours(date, hours, min, sec, ms) {
26
+ date.setHours(hours, min, sec, ms);
27
+ return date;
28
+ }
@@ -18,7 +18,7 @@ export interface EventFormDialogProps extends BaseDialogProps {
18
18
  onClose?: () => void;
19
19
  /**
20
20
  * Props to spread to EventForm component
21
- * @default undefined
21
+ * @default {}
22
22
  */
23
23
  EventFormComponentProps?: EventFormProps;
24
24
  /**
@@ -40,14 +40,14 @@ export default function EventFormDialog(inProps) {
40
40
  props: inProps,
41
41
  name: PREFIX
42
42
  });
43
- const { className, open = true, onClose, EventFormComponentProps } = props, rest = __rest(props, ["className", "open", "onClose", "EventFormComponentProps"]);
43
+ const { className, open = true, onClose, EventFormComponentProps = {} } = props, rest = __rest(props, ["className", "open", "onClose", "EventFormComponentProps"]);
44
44
  const handleSuccess = useCallback((event) => {
45
45
  var _a;
46
- (_a = EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(EventFormComponentProps, event);
46
+ (_a = EventFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(EventFormComponentProps, event);
47
47
  onClose === null || onClose === void 0 ? void 0 : onClose();
48
48
  }, [onClose, EventFormComponentProps]);
49
49
  /**
50
50
  * Renders root object
51
51
  */
52
- return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, title: (EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.event) ? (_jsx(FormattedMessage, { id: "ui.eventForm.title.edit", defaultMessage: "ui.eventForm.title.edit" })) : (_jsx(FormattedMessage, { id: "ui.eventForm.title", defaultMessage: "ui.eventForm.title" })), open: open, onClose: onClose, className: classNames(classes.root, className) }, rest, { children: _jsx(EventForm, Object.assign({}, (EventFormComponentProps && EventFormComponentProps), { onSuccess: handleSuccess })) })));
52
+ return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, title: (EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.event) ? (_jsx(FormattedMessage, { id: "ui.eventForm.title.edit", defaultMessage: "ui.eventForm.title.edit" })) : (_jsx(FormattedMessage, { id: "ui.eventForm.title", defaultMessage: "ui.eventForm.title" })), open: open, onClose: onClose, className: classNames(classes.root, className) }, rest, { children: _jsx(EventForm, Object.assign({}, EventFormComponentProps, { onSuccess: handleSuccess })) })));
53
53
  }
@@ -18,6 +18,7 @@ import EventSubscribeButton from '../EventSubscribeButton';
18
18
  import User from '../User';
19
19
  import { PREFIX } from './constants';
20
20
  import EventHeaderSkeleton from './Skeleton';
21
+ import { CacheStrategies } from '@selfcommunity/utils';
21
22
  const classes = {
22
23
  root: `${PREFIX}-root`,
23
24
  cover: `${PREFIX}-cover`,
@@ -83,13 +84,13 @@ export default function EventHeader(inProps) {
83
84
  // CONTEXT
84
85
  const scUserContext = useSCUser();
85
86
  // HOOKS
86
- const { scEvent, setSCEvent } = useSCFetchEvent({ id: eventId, event });
87
+ const { scEvent, setSCEvent } = useSCFetchEvent({ id: eventId, event, cacheStrategy: CacheStrategies.NETWORK_ONLY });
87
88
  const theme = useTheme();
88
89
  const isMobile = useMediaQuery(theme.breakpoints.down('md'));
89
90
  // INTL
90
91
  const intl = useIntl();
91
92
  // CONST
92
- const isEventAdmin = useMemo(() => scUserContext.user && scEvent && (scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by.id) === scUserContext.user.id, [scUserContext.user, scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by]);
93
+ const isEventAdmin = useMemo(() => { var _a; return scUserContext.user && scEvent && ((_a = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _a === void 0 ? void 0 : _a.id) === scUserContext.user.id; }, [scUserContext.user, scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by]);
93
94
  const isEventFinished = useMemo(() => checkEventFinished(scEvent), [scEvent]);
94
95
  /**
95
96
  * Handles callback subscribe/unsubscribe event