diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d273cbafad..a4fcb384ed 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -17676,7 +17676,7 @@ packages: dev: false file:projects/calendar-resources.tgz_a1d864769aaf53d09b76fe134ab55e60: - resolution: {integrity: sha512-/KSbpPzT33ajfBoTvXd075rtPPiYnC1XOF7eI/8lKcCofw3gBCY5ZT3qgxmwwGqWzx/Sfdzp0TwAQhqsGgtcrg==, tarball: file:projects/calendar-resources.tgz} + resolution: {integrity: sha512-zNDWSAzkH0tXFVIy8dr2OUI92YvnIvsxSGpeQuLq3yiXUfCCaRKoROIPeQebjsPzmgwv/KvX32/UojKxQdebxA==, tarball: file:projects/calendar-resources.tgz} id: file:projects/calendar-resources.tgz name: '@rush-temp/calendar-resources' version: 0.0.0 @@ -17689,6 +17689,7 @@ packages: eslint-plugin-n: 15.5.1_eslint@8.27.0 eslint-plugin-promise: 6.1.1_eslint@8.27.0 eslint-plugin-svelte3: 4.0.0_eslint@8.27.0+svelte@3.55.1 + fast-equals: 2.0.4 prettier: 2.8.8 prettier-plugin-svelte: 2.8.0_prettier@2.8.8+svelte@3.55.1 sass: 1.56.1 diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index dbb076d515..5c26877355 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -111,6 +111,7 @@ export { default as ScrollerBar } from './components/ScrollerBar.svelte' export { default as TabList } from './components/TabList.svelte' export { default as Chevron } from './components/Chevron.svelte' export { default as Timeline } from './components/Timeline.svelte' +export { default as TimeShiftPresenter } from './components/TimeShiftPresenter.svelte' export { default as IconAdd } from './components/icons/Add.svelte' export { default as IconStart } from './components/icons/Start.svelte' diff --git a/plugins/calendar-assets/lang/en.json b/plugins/calendar-assets/lang/en.json index df11f6063c..4837498170 100644 --- a/plugins/calendar-assets/lang/en.json +++ b/plugins/calendar-assets/lang/en.json @@ -75,6 +75,7 @@ "Times": "{count, plural, one {time} other {times}}", "AddParticipants": "Add participants", "Sync": "Synchronization", - "Busy": "Busy" + "Busy": "Busy", + "AddReminder": "Add reminder" } } \ No newline at end of file diff --git a/plugins/calendar-assets/lang/ru.json b/plugins/calendar-assets/lang/ru.json index 37f01da0c0..1ff2a93f27 100644 --- a/plugins/calendar-assets/lang/ru.json +++ b/plugins/calendar-assets/lang/ru.json @@ -75,6 +75,7 @@ "Times": "{count, plural, one {раз} few {раза} other {раз}}", "AddParticipants": "Добавить участников", "Sync": "Синхронизация", - "Busy": "Занято" + "Busy": "Занято", + "AddReminder": "Добавить напоминание" } } \ No newline at end of file diff --git a/plugins/calendar-resources/package.json b/plugins/calendar-resources/package.json index 43424cca30..4a18c99080 100644 --- a/plugins/calendar-resources/package.json +++ b/plugins/calendar-resources/package.json @@ -37,6 +37,7 @@ "@hcengineering/ui": "^0.6.10", "@hcengineering/presentation": "^0.6.2", "@hcengineering/calendar": "^0.6.14", + "@hcengineering/setting": "^0.6.9", "@hcengineering/theme": "^0.6.3", "svelte": "3.55.1", "@hcengineering/text-editor": "^0.6.0", @@ -45,6 +46,7 @@ "@hcengineering/contact-resources": "^0.6.0", "@hcengineering/view-resources": "^0.6.0", "@hcengineering/view": "^0.6.8", - "@hcengineering/workbench": "^0.6.8" + "@hcengineering/workbench": "^0.6.8", + "fast-equals": "^2.0.3" } } diff --git a/plugins/calendar-resources/src/components/AddParticipant.svelte b/plugins/calendar-resources/src/components/AddParticipant.svelte index 14d7cb1429..7c863e3b6d 100644 --- a/plugins/calendar-resources/src/components/AddParticipant.svelte +++ b/plugins/calendar-resources/src/components/AddParticipant.svelte @@ -13,20 +13,26 @@ // limitations under the License. --> @@ -117,6 +171,14 @@ use:resizeObserver={(element) => { parentWidth = element.parentElement?.getBoundingClientRect().width }} + on:keydown={(ev) => { + if (ev.key === 'Enter') { + ev.preventDefault() + ev.stopPropagation() + dispatch('enter', value) + value = '' + } + }} >
diff --git a/plugins/calendar-resources/src/components/CreateEvent.svelte b/plugins/calendar-resources/src/components/CreateEvent.svelte index fbbbc5bbd1..96ef2d70d7 100644 --- a/plugins/calendar-resources/src/components/CreateEvent.svelte +++ b/plugins/calendar-resources/src/components/CreateEvent.svelte @@ -25,6 +25,7 @@ import EventTimeEditor from './EventTimeEditor.svelte' import RRulePresenter from './RRulePresenter.svelte' import ReccurancePopup from './ReccurancePopup.svelte' + import EventReminders from './EventReminders.svelte' export let attachedTo: Ref = calendar.ids.NoAttached export let attachedToClass: Ref> = calendar.class.Event @@ -42,6 +43,8 @@ let dueDate = startDate + duration let allDay = false + let reminders = [30 * 60 * 1000] + let description: string = '' let rules: RecurringRule[] = [] @@ -72,6 +75,7 @@ rdate: [], exdate: [], rules, + reminders, description, participants, title, @@ -86,6 +90,7 @@ externalParticipants, description, participants, + reminders, title, allDay, access: 'owner' @@ -105,7 +110,7 @@ } function setRecurrance () { - showPopup(ReccurancePopup, { rules }, undefined, (res) => { + showPopup(ReccurancePopup, { rules, startDate }, undefined, (res) => { if (res) { rules = res } @@ -177,6 +182,10 @@
+
+ +
+
+
+ +
+
+
+{#each reminders as reminder, i} +
+ +
+
+
+{/each} + + diff --git a/plugins/calendar-resources/src/components/ParticipantsPopup.svelte b/plugins/calendar-resources/src/components/ParticipantsPopup.svelte new file mode 100644 index 0000000000..459d70a6cb --- /dev/null +++ b/plugins/calendar-resources/src/components/ParticipantsPopup.svelte @@ -0,0 +1,74 @@ + + + +
+
+
+ + + + {@const doc = participants[item]} +
select(doc)}> + +
+
+
+
+
+
diff --git a/plugins/calendar-resources/src/components/ReccurancePopup.svelte b/plugins/calendar-resources/src/components/ReccurancePopup.svelte index 8cfdc2a607..0db5b2b475 100644 --- a/plugins/calendar-resources/src/components/ReccurancePopup.svelte +++ b/plugins/calendar-resources/src/components/ReccurancePopup.svelte @@ -27,8 +27,10 @@ import { createEventDispatcher } from 'svelte' import calendar from '../plugin' import DateEditor from './DateEditor.svelte' + import { Timestamp } from '@hcengineering/core' export let rules: RecurringRule[] + export let startDate: Timestamp type Freq = 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY' let periodType: Freq = (rules[0]?.freq as Freq) ?? 'WEEKLY' @@ -76,7 +78,7 @@ let count: number = rules[0]?.count ?? 1 - let selectedWeekdays: string[] = rules[0]?.byDay ?? [getWeekday(new Date())] + let selectedWeekdays: string[] = rules[0]?.byDay ?? [getWeekday(new Date(startDate))] function weekdayClick (day: string) { const index = selectedWeekdays.findIndex((p) => p === day) diff --git a/plugins/calendar-resources/src/components/ReminderPopup.svelte b/plugins/calendar-resources/src/components/ReminderPopup.svelte new file mode 100644 index 0000000000..07c2e3cf22 --- /dev/null +++ b/plugins/calendar-resources/src/components/ReminderPopup.svelte @@ -0,0 +1,46 @@ + + + +
+ {#each values as val} +
{ + dispatch('close', val) + }} + > + +
+ {/each} +
diff --git a/plugins/calendar-resources/src/index.ts b/plugins/calendar-resources/src/index.ts index 7a1bfe0a1d..3f104feb77 100644 --- a/plugins/calendar-resources/src/index.ts +++ b/plugins/calendar-resources/src/index.ts @@ -34,12 +34,15 @@ import CalendarIntegrationIcon from './components/icons/Calendar.svelte' import EventElement from './components/EventElement.svelte' import CalendarEventPresenter from './components/CalendarEventPresenter.svelte' import DayCalendar from './components/DayCalendar.svelte' +import EventParticipants from './components/EventParticipants.svelte' +import EventTimeEditor from './components/EventTimeEditor.svelte' import IntegrationConfigure from './components/IntegrationConfigure.svelte' +import EventReminders from './components/EventReminders.svelte' import calendar from './plugin' import contact from '@hcengineering/contact' import { deleteObjects } from '@hcengineering/view-resources' -export { EventElement, CalendarView, DayCalendar } +export { EventElement, CalendarView, DayCalendar, EventParticipants, EventTimeEditor, EventReminders } export * from './utils' diff --git a/plugins/calendar-resources/src/plugin.ts b/plugins/calendar-resources/src/plugin.ts index be79458a7b..beb3cca481 100644 --- a/plugins/calendar-resources/src/plugin.ts +++ b/plugins/calendar-resources/src/plugin.ts @@ -77,6 +77,7 @@ export default mergeIds(calendarId, calendar, { Times: '' as IntlString, AddParticipants: '' as IntlString, Sync: '' as IntlString, - Busy: '' as IntlString + Busy: '' as IntlString, + AddReminder: '' as IntlString } }) diff --git a/plugins/contact-resources/src/index.ts b/plugins/contact-resources/src/index.ts index 8f1ed6a6d5..461206586b 100644 --- a/plugins/contact-resources/src/index.ts +++ b/plugins/contact-resources/src/index.ts @@ -144,7 +144,8 @@ export { IconMembers, SelectAvatars, UserBoxItems, - MembersBox + MembersBox, + PersonRefPresenter } const toObjectSearchResult = (e: WithLookup): ObjectSearchResult => ({