Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2023-08-14 19:35:07 +07:00
committed by GitHub
parent e92918c6c7
commit 30f255fa7c
18 changed files with 249 additions and 54 deletions
+10 -4
View File
@@ -50,8 +50,8 @@ import view, { createAction } from '@hcengineering/model-view'
import workbench from '@hcengineering/model-workbench'
import notification from '@hcengineering/notification'
import setting from '@hcengineering/setting'
import calendar from './plugin'
import { AnyComponent } from '@hcengineering/ui'
import calendar from './plugin'
export * from '@hcengineering/calendar'
export { calendarId } from '@hcengineering/calendar'
@@ -62,13 +62,16 @@ export const DOMAIN_CALENDAR = 'calendar' as Domain
@Model(calendar.class.Calendar, core.class.Space)
@UX(calendar.string.Calendar, calendar.icon.Calendar)
export class TCalendar extends TSpaceWithStates implements Calendar {
@Prop(TypeString(), calendar.string.HideDetails)
hideDetails?: boolean
visibility!: 'public' | 'freeBusy' | 'private'
sync?: boolean
}
@Model(calendar.class.Event, core.class.AttachedDoc, DOMAIN_CALENDAR)
@UX(calendar.string.Event, calendar.icon.Calendar)
export class TEvent extends TAttachedDoc implements Event {
declare space: Ref<Calendar>
eventId!: string
@Prop(TypeString(), calendar.string.Title)
@@ -106,6 +109,8 @@ export class TEvent extends TAttachedDoc implements Event {
externalParticipants?: string[]
access!: 'freeBusyReader' | 'reader' | 'writer' | 'owner'
visibility?: 'public' | 'freeBusy' | 'private'
}
@Model(calendar.class.ReccuringEvent, calendar.class.Event)
@@ -174,7 +179,8 @@ export function createModel (builder: Builder): void {
icon: calendar.component.CalendarIntegrationIcon,
createComponent: calendar.component.IntegrationConnect,
onDisconnect: calendar.handler.DisconnectHandler,
reconnectComponent: calendar.component.IntegrationConnect
reconnectComponent: calendar.component.IntegrationConnect,
configureComponent: calendar.component.IntegrationConfigure
},
calendar.integrationType.Calendar
)
+7 -1
View File
@@ -33,7 +33,8 @@ async function migrateCalendars (tx: TxOperations): Promise<void> {
description: '',
archived: false,
private: false,
members: [user._id]
members: [user._id],
visibility: 'public'
},
`${user._id}_calendar` as Ref<Calendar>,
undefined,
@@ -49,6 +50,11 @@ async function migrateCalendars (tx: TxOperations): Promise<void> {
if (space !== undefined) {
await tx.remove(space)
}
const calendars = await tx.findAll(calendar.class.Calendar, { visibility: { $exists: false } })
for (const calendar of calendars) {
await tx.update(calendar, { visibility: 'public' })
}
}
async function fixEventDueDate (client: MigrationClient): Promise<void> {
+2 -1
View File
@@ -29,7 +29,8 @@ export default mergeIds(calendarId, calendar, {
CreateCalendar: '' as AnyComponent,
EventPresenter: '' as AnyComponent,
CalendarIntegrationIcon: '' as AnyComponent,
CalendarEventPresenter: '' as AnyComponent
CalendarEventPresenter: '' as AnyComponent,
IntegrationConfigure: '' as AnyComponent
},
action: {
SaveEventReminder: '' as Ref<Action>,