Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ponchimeow committed Nov 15, 2023
2 parents 6682570 + 79042fa commit 70cbe5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/appointment/AppointmentPeriodItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ const AppointmentPeriodItem: React.FC<{
const { loading: loadingOverlapMeet, overlapMeets } = useOverlapMeets(period.startedAt, period.endedAt)

const currentUseServices = uniq(overlapMeets.map(overlapMeet => overlapMeet.serviceId))
const overlapCreatorMeets = overlapMeets.filter(overlapMeet => overlapMeet.hostMemberId === creatorId)
const overlapCreatorMeets = overlapMeets
.filter(overlapMeet => overlapMeet.hostMemberId === creatorId)
.filter(overlapMeet => overlapMeet.target !== appointmentPlan.id)

let variant: 'bookable' | 'closed' | 'booked' | 'meetingFull' | undefined

Expand Down
11 changes: 8 additions & 3 deletions src/components/appointment/AppointmentPlanBasicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ const AppointmentPlanBasicForm: React.FC<{
UpdateAppointmentPlan,
)
const [loading, setLoading] = useState(false)
const [meetGenerationMethod, setMeetGenerationMethod] = useState<'manual' | 'auto'>(
appointmentPlanAdmin?.meetGenerationMethod as 'auto' | 'manual',
)

if (!appointmentPlanAdmin) {
return <Skeleton active />
Expand All @@ -97,7 +100,7 @@ const AppointmentPlanBasicForm: React.FC<{
rescheduleAmount: values.rescheduleAmount ? values.rescheduleAmount : -1,
rescheduleType: values.rescheduleType ? values.rescheduleType : null,
meetGenerationMethod: values.meetGenerationMethod,
defaultMeetGateway: values.defaultMeetGateway ?? 'jitsi',
defaultMeetGateway: meetGenerationMethod === 'auto' ? 'jitsi' : values.defaultMeetGateway ?? 'jitsi',
},
})
.then(() => {
Expand Down Expand Up @@ -271,7 +274,7 @@ const AppointmentPlanBasicForm: React.FC<{
</Form.Item>

<Form.Item label={formatMessage(appointmentMessages.label.meetingLink)} name="meetGenerationMethod">
<Select style={{ width: '150px' }}>
<Select style={{ width: '150px' }} onChange={value => setMeetGenerationMethod(value as 'auto' | 'manual')}>
<Select.Option key="auto" value="auto">
{formatMessage(appointmentMessages.label.automaticallyGenerated)}
</Select.Option>
Expand All @@ -283,7 +286,9 @@ const AppointmentPlanBasicForm: React.FC<{

{loadingService ? (
<Spin />
) : enabledModules.meet_service && services.filter(service => service.gateway === 'zoom').length !== 0 ? (
) : enabledModules.meet_service &&
services.filter(service => service.gateway === 'zoom').length !== 0 &&
meetGenerationMethod === 'auto' ? (
<Form.Item label="預設會議系統" name="defaultMeetGateway">
<Select style={{ width: '150px' }} defaultValue="zoom">
<Select.Option key="zoom" value="zoom">
Expand Down

0 comments on commit 70cbe5a

Please sign in to comment.