Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: All day option is avaible in 'event reschedule' and 'convert to recuring' when it is disabled in the event profile [SDESK-6726] #1750

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions client/components/Events/EventScheduleInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ export class EventScheduleInput extends React.Component<IProps, IState> {
defaultValue: false,
};
const isRemoteTimeZone = timeUtils.isEventInDifferentTimeZone(diff);
const isAllDayEnabled: boolean = formProfile?.editor?.dates?.all_day?.enabled;

return (
<div>
Expand Down Expand Up @@ -395,7 +396,7 @@ export class EventScheduleInput extends React.Component<IProps, IState> {
/>

<Row flex={true} noPadding>
{!(formProfile?.editor?.dates?.all_day?.enabled ?? true) ? null : (
{!(isAllDayEnabled ?? true) ? null : (
<Field
onChange={this.handleAllDayChange}
field="dates.all_day"
Expand All @@ -413,7 +414,7 @@ export class EventScheduleInput extends React.Component<IProps, IState> {
onChange={this.onChange}
row={false}
{...fieldProps}
halfWidth={formProfile?.editor?.dates?.all_day?.enabled}
halfWidth={isAllDayEnabled}
/>
)}
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import {updateFormValues, eventUtils, timeUtils, gettext} from '../../../utils';

import '../style.scss';

export class ConvertToRecurringEventComponent extends React.Component {
export interface IProps {
original: any;
formProfiles: any;
}
export class ConvertToRecurringEventComponent extends React.Component <IProps> {
constructor(props) {
super(props);
this.state = {
Expand Down Expand Up @@ -114,7 +118,7 @@ export class ConvertToRecurringEventComponent extends React.Component {
}

render() {
const {original} = this.props;
const {original, formProfiles} = this.props;
const timeZone = get(original, 'dates.tz') || appConfig.default_timezone;

return (
Expand Down Expand Up @@ -156,6 +160,7 @@ export class ConvertToRecurringEventComponent extends React.Component {
onChange={this.onChange}
showRepeatToggle={false}
showErrors={true}
formProfile={formProfiles.event}
errors={this.state.errors}
popupContainer={this.getPopupContainer}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export class RescheduleEventComponent extends React.Component {
showRepeatToggle={false}
showErrors={true}
errors={this.state.errors}
formProfile={formProfiles.events}
formProfile={formProfiles.event}
popupContainer={this.getPopupContainer}
showFirstEventLabel={false}
showToBeConfirmed
Expand Down