diff --git a/models/calendar/src/index.ts b/models/calendar/src/index.ts index 7f77746f09..ef07b21687 100644 --- a/models/calendar/src/index.ts +++ b/models/calendar/src/index.ts @@ -20,7 +20,8 @@ import { Event, ReccuringEvent, ReccuringInstance, - RecurringRule + RecurringRule, + Visibility } from '@hcengineering/calendar' import { Contact } from '@hcengineering/contact' import { DateRangeMode, Domain, IndexKind, Markup, Ref, Timestamp } from '@hcengineering/core' @@ -60,7 +61,7 @@ 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 { - visibility!: 'public' | 'freeBusy' | 'private' + visibility!: Visibility sync?: boolean } @@ -108,7 +109,7 @@ export class TEvent extends TAttachedDoc implements Event { access!: 'freeBusyReader' | 'reader' | 'writer' | 'owner' - visibility?: 'public' | 'freeBusy' | 'private' + visibility?: Visibility } @Model(calendar.class.ReccuringEvent, calendar.class.Event) @@ -117,6 +118,7 @@ export class TReccuringEvent extends TEvent implements ReccuringEvent { rules!: RecurringRule[] exdate!: Timestamp[] rdate!: Timestamp[] + originalStartTime!: Timestamp } @Model(calendar.class.ReccuringInstance, calendar.class.Event) diff --git a/models/calendar/src/migration.ts b/models/calendar/src/migration.ts index 94019911f1..fd1988a40b 100644 --- a/models/calendar/src/migration.ts +++ b/models/calendar/src/migration.ts @@ -13,7 +13,7 @@ // limitations under the License. // -import { Calendar, Event } from '@hcengineering/calendar' +import { Calendar, Event, ReccuringEvent } from '@hcengineering/calendar' import core, { Ref, TxOperations } from '@hcengineering/core' import { MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@hcengineering/model' import calendar from './plugin' @@ -76,10 +76,21 @@ async function migrateReminders (client: MigrationClient): Promise { } } +async function fillOriginalStartTime (client: MigrationClient): Promise { + const events = await client.find(DOMAIN_CALENDAR, { + _class: calendar.class.ReccuringEvent, + originalStartTime: { $exists: false } + }) + for (const event of events) { + await client.update(DOMAIN_CALENDAR, { _id: event._id }, { originalStartTime: event.date }) + } +} + export const calendarOperation: MigrateOperation = { async migrate (client: MigrationClient): Promise { await fixEventDueDate(client) await migrateReminders(client) + await fillOriginalStartTime(client) }, async upgrade (client: MigrationUpgradeClient): Promise { const tx = new TxOperations(client, core.account.System) diff --git a/models/tags/src/plugin.ts b/models/tags/src/plugin.ts index 49d34e1822..6c87e2f559 100644 --- a/models/tags/src/plugin.ts +++ b/models/tags/src/plugin.ts @@ -37,7 +37,6 @@ export default mergeIds(tagsId, tags, { ColorLabel: '' as IntlString, WeightLabel: '' as IntlString, TagReferenceLabel: '' as IntlString, - TagLabel: '' as IntlString, TargetClassLabel: '' as IntlString, TargetCategoryLabel: '' as IntlString, TagReference: '' as IntlString, diff --git a/packages/presentation/src/components/SpaceSelector.svelte b/packages/presentation/src/components/SpaceSelector.svelte index 0b42d441a3..9f033d0d78 100644 --- a/packages/presentation/src/components/SpaceSelector.svelte +++ b/packages/presentation/src/components/SpaceSelector.svelte @@ -38,6 +38,7 @@ export let autoSelect = true export let iconWithEmoji: AnySvelteComponent | Asset | ComponentType | undefined = undefined export let defaultIcon: AnySvelteComponent | Asset | ComponentType | undefined = undefined + export let readonly: boolean = false const dispatch = createEventDispatcher() @@ -61,6 +62,7 @@ {component} {componentProps} {autoSelect} + {readonly} {iconWithEmoji} {defaultIcon} bind:value={space} diff --git a/packages/ui/src/components/CheckBox.svelte b/packages/ui/src/components/CheckBox.svelte index 502dae5c5b..898afe633e 100644 --- a/packages/ui/src/components/CheckBox.svelte +++ b/packages/ui/src/components/CheckBox.svelte @@ -17,7 +17,7 @@ export let checked: boolean = false export let symbol: 'check' | 'minus' = 'check' - export let size: 'small' | 'medium' = 'small' + export let size: 'small' | 'medium' | 'large' = 'small' export let circle: boolean = false export let accented: boolean = false export let readonly = false @@ -66,6 +66,10 @@ width: 1rem; height: 1rem; } + &.large { + width: 1.25rem; + height: 1.25rem; + } &.circle { width: 1rem; height: 1rem; diff --git a/packages/ui/src/components/Dropdown.svelte b/packages/ui/src/components/Dropdown.svelte index f72e9d8be2..c6d0d30479 100644 --- a/packages/ui/src/components/Dropdown.svelte +++ b/packages/ui/src/components/Dropdown.svelte @@ -27,6 +27,7 @@ export let placeholder: IntlString export let items: ListItem[] = [] export let selected: ListItem | undefined = undefined + export let disabled: boolean = false export let kind: ButtonKind = 'no-border' export let size: ButtonSize = 'small' @@ -35,6 +36,8 @@ export let labelDirection: TooltipAlignment | undefined = undefined export let focusIndex = -1 + export let withSearch: boolean = true + let container: HTMLElement let opened: boolean = false @@ -45,16 +48,18 @@
+ {#if tags.length} +
+ {#each tags as value} +
+ removeTag(res.detail)} + /> +
+ {/each} +
+ {/if} +
+ + diff --git a/plugins/tags-resources/src/components/DraftTagsPopup.svelte b/plugins/tags-resources/src/components/DraftTagsPopup.svelte new file mode 100644 index 0000000000..8e7bc073af --- /dev/null +++ b/plugins/tags-resources/src/components/DraftTagsPopup.svelte @@ -0,0 +1,51 @@ + + + + diff --git a/plugins/tags-resources/src/components/TagElement.svelte b/plugins/tags-resources/src/components/TagElement.svelte new file mode 100644 index 0000000000..3b3cf76264 --- /dev/null +++ b/plugins/tags-resources/src/components/TagElement.svelte @@ -0,0 +1,36 @@ + + + +
+ + {element.title} + + + diff --git a/plugins/tags-resources/src/components/TagsAttributeEditor.svelte b/plugins/tags-resources/src/components/TagsAttributeEditor.svelte index 7be30acaf1..638538d71a 100644 --- a/plugins/tags-resources/src/components/TagsAttributeEditor.svelte +++ b/plugins/tags-resources/src/components/TagsAttributeEditor.svelte @@ -1,17 +1,19 @@ - + diff --git a/plugins/tags-resources/src/components/icons/TagIcon.svelte b/plugins/tags-resources/src/components/icons/TagIcon.svelte new file mode 100644 index 0000000000..10234996c0 --- /dev/null +++ b/plugins/tags-resources/src/components/icons/TagIcon.svelte @@ -0,0 +1,22 @@ + + + + + + + diff --git a/plugins/tags-resources/src/index.ts b/plugins/tags-resources/src/index.ts index 7a50e0d04f..5c52ae3e2f 100644 --- a/plugins/tags-resources/src/index.ts +++ b/plugins/tags-resources/src/index.ts @@ -12,7 +12,7 @@ // limitations under the License. import { Resources } from '@hcengineering/platform' -import { TagElement } from '@hcengineering/tags' +import { TagElement as TagElementType } from '@hcengineering/tags' import { eventToHTMLElement, showPopup } from '@hcengineering/ui' import TagsCategoryBar from './components/CategoryBar.svelte' import CategoryPresenter from './components/CategoryPresenter.svelte' @@ -32,13 +32,16 @@ import TagsEditorPopup from './components/TagsEditorPopup.svelte' import LabelsPresenter from './components/LabelsPresenter.svelte' import CreateTagElement from './components/CreateTagElement.svelte' import ObjectsTagsEditorPopup from './components/ObjectsTagsEditorPopup.svelte' +import TagElement from './components/TagElement.svelte' import { ObjQueryType } from '@hcengineering/core' import { getRefs } from './utils' import { Filter } from '@hcengineering/view' import WeightPopup from './components/WeightPopup.svelte' +import DraftTagsEditor from './components/DraftTagsEditor.svelte' import TagsFilterPresenter from './components/TagsFilterPresenter.svelte' +import DocTagsEditor from './components/DocTagsEditor.svelte' -export { WeightPopup } +export { WeightPopup, TagElement } export async function tagsInResult (filter: Filter, onUpdate: () => void): Promise> { const result = await getRefs(filter, onUpdate) return { $in: result } @@ -71,10 +74,12 @@ export default async (): Promise => ({ TagsEditorPopup, LabelsPresenter, ObjectsTagsEditorPopup, - TagsFilterPresenter + TagsFilterPresenter, + DraftTagsEditor, + DocTagsEditor }, actionImpl: { - Open: (value: TagElement, evt: MouseEvent) => { + Open: (value: TagElementType, evt: MouseEvent) => { showPopup(EditTagElement, { value, keyTitle: '' }, eventToHTMLElement(evt)) } }, diff --git a/plugins/tags-resources/src/plugin.ts b/plugins/tags-resources/src/plugin.ts index 2e09073c79..49e46f5888 100644 --- a/plugins/tags-resources/src/plugin.ts +++ b/plugins/tags-resources/src/plugin.ts @@ -35,7 +35,6 @@ export default mergeIds(tagsId, tags, { WeightPlaceholder: '' as IntlString, CategoryPlaceholder: '' as IntlString, TagTooltip: '' as IntlString, - Tags: '' as IntlString, Tag: '' as IntlString, TagCreateLabel: '' as IntlString, TagName: '' as IntlString, diff --git a/plugins/tags/src/index.ts b/plugins/tags/src/index.ts index d8afca5d91..dd9d872306 100644 --- a/plugins/tags/src/index.ts +++ b/plugins/tags/src/index.ts @@ -14,7 +14,7 @@ // import type { AttachedDoc, Class, Doc, Ref, Space } from '@hcengineering/core' -import type { Asset, Plugin } from '@hcengineering/platform' +import type { Asset, IntlString, Plugin } from '@hcengineering/platform' import { plugin } from '@hcengineering/platform' import { AnyComponent } from '@hcengineering/ui' import { writable } from 'svelte/store' @@ -100,6 +100,8 @@ const tagsPlugin = plugin(tagsId, { Level3: '' as Asset }, component: { + DraftTagsEditor: '' as AnyComponent, + DocTagsEditor: '' as AnyComponent, TagsView: '' as AnyComponent, TagsEditor: '' as AnyComponent, TagsDropdownEditor: '' as AnyComponent, @@ -111,6 +113,11 @@ const tagsPlugin = plugin(tagsId, { TagsEditorPopup: '' as AnyComponent, ObjectsTagsEditorPopup: '' as AnyComponent }, + string: { + Tags: '' as IntlString, + AddLabel: '' as IntlString, + TagLabel: '' as IntlString + }, category: { NoCategory: '' as Ref },