Fixed error while creating schedule and fixed Schedules types mistakes
This commit is contained in:
parent
c1307a44d7
commit
357cd072c9
5 changed files with 13 additions and 10 deletions
|
|
@ -50,7 +50,7 @@ const NewScheduleSelector: FC<NewScheduleSelectorProps> = (props) => {
|
|||
</VerticalGroup>
|
||||
</HorizontalGroup>
|
||||
<WithPermissionControl userAction={UserActions.SchedulesWrite}>
|
||||
<Button variant="primary" icon="plus" onClick={getCreateScheduleClickHandler(ScheduleType.API)}>
|
||||
<Button variant="primary" icon="plus" onClick={getCreateScheduleClickHandler(ScheduleType.Calendar)}>
|
||||
Create
|
||||
</Button>
|
||||
</WithPermissionControl>
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ const SchedulesFilters = (props: SchedulesFiltersProps) => {
|
|||
{ label: 'All', value: undefined },
|
||||
{
|
||||
label: 'Web',
|
||||
value: ScheduleType.API,
|
||||
value: ScheduleType.Calendar,
|
||||
},
|
||||
{
|
||||
label: 'ICal',
|
||||
|
|
@ -80,7 +80,7 @@ const SchedulesFilters = (props: SchedulesFiltersProps) => {
|
|||
},
|
||||
{
|
||||
label: 'API',
|
||||
value: ScheduleType.Calendar,
|
||||
value: ScheduleType.API,
|
||||
},
|
||||
]}
|
||||
value={value?.type}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import { User } from 'models/user/user.types';
|
|||
import { UserGroup } from 'models/user_group/user_group.types';
|
||||
|
||||
export enum ScheduleType {
|
||||
'Calendar',
|
||||
'Ical',
|
||||
'API',
|
||||
'Ical',
|
||||
'Calendar',
|
||||
}
|
||||
|
||||
export interface RotationFormLiveParams {
|
||||
|
|
|
|||
|
|
@ -147,9 +147,12 @@ class SchedulePage extends React.Component<SchedulePageProps, SchedulePageState>
|
|||
)}
|
||||
<HorizontalGroup>
|
||||
<HorizontalGroup>
|
||||
<Button variant="secondary" onClick={this.handleExportClick()}>
|
||||
Export
|
||||
</Button>
|
||||
{schedule?.type === ScheduleType.Ical && (
|
||||
<Button variant="secondary" onClick={this.handleExportClick()}>
|
||||
Export
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{(schedule?.type === ScheduleType.Ical || schedule?.type === ScheduleType.Calendar) && (
|
||||
<Button variant="secondary" onClick={this.handleReloadClick(scheduleId)}>
|
||||
Reload
|
||||
|
|
|
|||
|
|
@ -209,8 +209,8 @@ class SchedulesPage extends React.Component<SchedulesPageProps, SchedulesPageSta
|
|||
};
|
||||
|
||||
handleCreateSchedule = (data: Schedule) => {
|
||||
if (data.type === ScheduleType.API) {
|
||||
LocationHelper.update({ page: 'schedule', id: data.id }, 'replace');
|
||||
if (data.type === ScheduleType.Calendar) {
|
||||
LocationHelper.update({ page: 'schedule', id: data.id }, 'partial');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue