mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 11:01:54 +03:00
remove extra spaces (#5930)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
f9aabe98c3
commit
2fb4763f3f
@ -56,7 +56,7 @@ async function createDefaults (tx: TxOperations): Promise<void> {
|
|||||||
await createOrUpdate(
|
await createOrUpdate(
|
||||||
tx,
|
tx,
|
||||||
tags.class.TagCategory,
|
tags.class.TagCategory,
|
||||||
tags.space.Tags,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
icon: tags.icon.Tags,
|
icon: tags.icon.Tags,
|
||||||
label: 'Other',
|
label: 'Other',
|
||||||
|
@ -243,7 +243,7 @@ async function createTagCategories (tx: TxOperations): Promise<void> {
|
|||||||
await createOrUpdate(
|
await createOrUpdate(
|
||||||
tx,
|
tx,
|
||||||
tags.class.TagCategory,
|
tags.class.TagCategory,
|
||||||
tags.space.Tags,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
icon: tags.icon.Tags,
|
icon: tags.icon.Tags,
|
||||||
label: 'Labels',
|
label: 'Labels',
|
||||||
@ -257,7 +257,7 @@ async function createTagCategories (tx: TxOperations): Promise<void> {
|
|||||||
await createOrUpdate(
|
await createOrUpdate(
|
||||||
tx,
|
tx,
|
||||||
tags.class.TagCategory,
|
tags.class.TagCategory,
|
||||||
tags.space.Tags,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
icon: tags.icon.Tags,
|
icon: tags.icon.Tags,
|
||||||
label: 'Labels',
|
label: 'Labels',
|
||||||
|
@ -13,29 +13,27 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import core, { type Ref, type Space } from '@hcengineering/core'
|
||||||
import { gmailId } from '@hcengineering/gmail'
|
import { gmailId } from '@hcengineering/gmail'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
migrateSpace,
|
||||||
tryUpgrade,
|
tryMigrate,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
type MigrationClient,
|
type MigrationClient,
|
||||||
type MigrationUpgradeClient
|
type MigrationUpgradeClient
|
||||||
} from '@hcengineering/model'
|
} from '@hcengineering/model'
|
||||||
import gmail from './plugin'
|
import { DOMAIN_GMAIL } from '.'
|
||||||
|
|
||||||
export const gmailOperation: MigrateOperation = {
|
export const gmailOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {},
|
async migrate (client: MigrationClient): Promise<void> {
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
await tryMigrate(client, gmailId, [
|
||||||
await tryUpgrade(state, client, gmailId, [
|
|
||||||
{
|
{
|
||||||
state: 'create-defaults-v2',
|
state: 'removeDeprecatedSpace',
|
||||||
func: async (client) => {
|
func: async (client: MigrationClient) => {
|
||||||
await createDefaultSpace(client, gmail.space.Gmail, {
|
await migrateSpace(client, 'gmail:space:Gmail' as Ref<Space>, core.space.Workspace, [DOMAIN_GMAIL])
|
||||||
name: 'Gmail',
|
|
||||||
description: 'Space for all gmail messages'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
},
|
||||||
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import core, { TDoc } from '@hcengineering/model-core'
|
|||||||
import { type Location } from '@hcengineering/ui'
|
import { type Location } from '@hcengineering/ui'
|
||||||
import guest from './plugin'
|
import guest from './plugin'
|
||||||
|
|
||||||
const GUEST_DOMAIN = 'guest' as Domain
|
export const GUEST_DOMAIN = 'guest' as Domain
|
||||||
|
|
||||||
@Model(guest.class.PublicLink, core.class.Doc, GUEST_DOMAIN)
|
@Model(guest.class.PublicLink, core.class.Doc, GUEST_DOMAIN)
|
||||||
export class TPublicLink extends TDoc implements PublicLink {
|
export class TPublicLink extends TDoc implements PublicLink {
|
||||||
|
@ -1,16 +1,23 @@
|
|||||||
import { AccountRole, DOMAIN_TX, type Account, type TxCreateDoc, type TxUpdateDoc } from '@hcengineering/core'
|
import {
|
||||||
|
AccountRole,
|
||||||
|
DOMAIN_TX,
|
||||||
|
type Ref,
|
||||||
|
type Space,
|
||||||
|
type Account,
|
||||||
|
type TxCreateDoc,
|
||||||
|
type TxUpdateDoc
|
||||||
|
} from '@hcengineering/core'
|
||||||
import { guestId } from '@hcengineering/guest'
|
import { guestId } from '@hcengineering/guest'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
migrateSpace,
|
||||||
tryMigrate,
|
tryMigrate,
|
||||||
tryUpgrade,
|
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
type MigrationClient,
|
type MigrationClient,
|
||||||
type MigrationUpgradeClient,
|
type MigrationUpgradeClient,
|
||||||
type ModelLogger
|
type ModelLogger
|
||||||
} from '@hcengineering/model'
|
} from '@hcengineering/model'
|
||||||
import core from '@hcengineering/model-core'
|
import core from '@hcengineering/model-core'
|
||||||
import guest from './plugin'
|
import { GUEST_DOMAIN } from '.'
|
||||||
|
|
||||||
export const guestOperation: MigrateOperation = {
|
export const guestOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient, logger: ModelLogger): Promise<void> {
|
async migrate (client: MigrationClient, logger: ModelLogger): Promise<void> {
|
||||||
@ -58,20 +65,14 @@ export const guestOperation: MigrateOperation = {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
])
|
|
||||||
},
|
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
|
||||||
await tryUpgrade(state, client, guestId, [
|
|
||||||
{
|
{
|
||||||
state: 'create-defaults-v2',
|
state: 'removeDeprecatedSpace',
|
||||||
func: async (client) => {
|
func: async (client: MigrationClient) => {
|
||||||
await createDefaultSpace(client, guest.space.Links, {
|
await migrateSpace(client, 'guest:space:Links' as Ref<Space>, core.space.Workspace, [GUEST_DOMAIN])
|
||||||
name: 'Links',
|
|
||||||
description: 'Space for all guest links'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
},
|
||||||
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {}
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,10 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import { type Ref, TxOperations } from '@hcengineering/core'
|
import { type Space, TxOperations, type Ref } from '@hcengineering/core'
|
||||||
|
import { type Department } from '@hcengineering/hr'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
migrateSpace,
|
||||||
tryMigrate,
|
tryMigrate,
|
||||||
tryUpgrade,
|
tryUpgrade,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
@ -24,7 +25,6 @@ import {
|
|||||||
} from '@hcengineering/model'
|
} from '@hcengineering/model'
|
||||||
import core, { DOMAIN_SPACE } from '@hcengineering/model-core'
|
import core, { DOMAIN_SPACE } from '@hcengineering/model-core'
|
||||||
import hr, { DOMAIN_HR, hrId } from './index'
|
import hr, { DOMAIN_HR, hrId } from './index'
|
||||||
import { type Department } from '@hcengineering/hr'
|
|
||||||
|
|
||||||
async function createDepartment (tx: TxOperations): Promise<void> {
|
async function createDepartment (tx: TxOperations): Promise<void> {
|
||||||
const current = await tx.findOne(hr.class.Department, {
|
const current = await tx.findOne(hr.class.Department, {
|
||||||
@ -33,7 +33,7 @@ async function createDepartment (tx: TxOperations): Promise<void> {
|
|||||||
if (current === undefined) {
|
if (current === undefined) {
|
||||||
await tx.createDoc(
|
await tx.createDoc(
|
||||||
hr.class.Department,
|
hr.class.Department,
|
||||||
hr.space.HR,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
name: 'Organization',
|
name: 'Organization',
|
||||||
description: '',
|
description: '',
|
||||||
@ -49,21 +49,21 @@ async function createDepartment (tx: TxOperations): Promise<void> {
|
|||||||
async function migrateDepartments (client: MigrationClient): Promise<void> {
|
async function migrateDepartments (client: MigrationClient): Promise<void> {
|
||||||
await client.update(
|
await client.update(
|
||||||
DOMAIN_HR,
|
DOMAIN_HR,
|
||||||
{ _class: hr.class.PublicHoliday, space: { $ne: hr.space.HR } },
|
{ _class: hr.class.PublicHoliday, space: { $ne: core.space.Workspace } },
|
||||||
{ space: hr.space.HR }
|
{ space: core.space.Workspace }
|
||||||
)
|
)
|
||||||
const objects = await client.find(DOMAIN_HR, { space: { $ne: hr.space.HR }, _class: hr.class.Request })
|
const objects = await client.find(DOMAIN_HR, { space: { $ne: core.space.Workspace }, _class: hr.class.Request })
|
||||||
for (const obj of objects) {
|
for (const obj of objects) {
|
||||||
await client.update(DOMAIN_HR, { _id: obj._id }, { space: hr.space.HR, department: obj.space })
|
await client.update(DOMAIN_HR, { _id: obj._id }, { space: core.space.Workspace, department: obj.space })
|
||||||
}
|
}
|
||||||
await client.move(DOMAIN_SPACE, { _class: hr.class.Department }, DOMAIN_HR)
|
await client.move(DOMAIN_SPACE, { _class: hr.class.Department }, DOMAIN_HR)
|
||||||
const departments = await client.find<Department>(DOMAIN_HR, {
|
const departments = await client.find<Department>(DOMAIN_HR, {
|
||||||
_class: hr.class.Department,
|
_class: hr.class.Department,
|
||||||
space: { $ne: hr.space.HR }
|
space: { $ne: core.space.Workspace }
|
||||||
})
|
})
|
||||||
for (const department of departments) {
|
for (const department of departments) {
|
||||||
const upd: Partial<Department> = {
|
const upd: Partial<Department> = {
|
||||||
space: hr.space.HR
|
space: core.space.Workspace
|
||||||
}
|
}
|
||||||
if (department._id !== hr.ids.Head) {
|
if (department._id !== hr.ids.Head) {
|
||||||
upd.parent = department.space as unknown as Ref<Department>
|
upd.parent = department.space as unknown as Ref<Department>
|
||||||
@ -83,6 +83,12 @@ export const hrOperation: MigrateOperation = {
|
|||||||
{
|
{
|
||||||
state: 'migrateDepartments',
|
state: 'migrateDepartments',
|
||||||
func: migrateDepartments
|
func: migrateDepartments
|
||||||
|
},
|
||||||
|
{
|
||||||
|
state: 'removeDeprecatedSpace',
|
||||||
|
func: async (client: MigrationClient) => {
|
||||||
|
await migrateSpace(client, 'hr:space:HR' as Ref<Space>, core.space.Workspace, [DOMAIN_HR])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
@ -91,7 +97,6 @@ export const hrOperation: MigrateOperation = {
|
|||||||
{
|
{
|
||||||
state: 'create-defaults-v2',
|
state: 'create-defaults-v2',
|
||||||
func: async (client) => {
|
func: async (client) => {
|
||||||
await createDefaultSpace(client, hr.space.HR, { name: 'HR', description: 'Human Resources' })
|
|
||||||
const tx = new TxOperations(client, core.account.System)
|
const tx = new TxOperations(client, core.account.System)
|
||||||
await createDepartment(tx)
|
await createDepartment(tx)
|
||||||
}
|
}
|
||||||
|
@ -13,33 +13,28 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import core, { type Ref, type Space } from '@hcengineering/core'
|
||||||
import { inventoryId } from '@hcengineering/inventory'
|
import { inventoryId } from '@hcengineering/inventory'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
migrateSpace,
|
||||||
tryUpgrade,
|
tryMigrate,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
type MigrationClient,
|
type MigrationClient,
|
||||||
type MigrationUpgradeClient
|
type MigrationUpgradeClient
|
||||||
} from '@hcengineering/model'
|
} from '@hcengineering/model'
|
||||||
import inventory from './plugin'
|
import { DOMAIN_INVENTORY } from '.'
|
||||||
|
|
||||||
export const inventoryOperation: MigrateOperation = {
|
export const inventoryOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {},
|
async migrate (client: MigrationClient): Promise<void> {
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
await tryMigrate(client, inventoryId, [
|
||||||
await tryUpgrade(state, client, inventoryId, [
|
|
||||||
{
|
{
|
||||||
state: 'create-defaults-v2',
|
state: 'removeDeprecatedSpace',
|
||||||
func: async (client) => {
|
func: async (client: MigrationClient) => {
|
||||||
await createDefaultSpace(client, inventory.space.Category, {
|
await migrateSpace(client, 'inventory:space:Category' as Ref<Space>, core.space.Workspace, [DOMAIN_INVENTORY])
|
||||||
name: 'Categories',
|
await migrateSpace(client, 'inventory:space:Products' as Ref<Space>, core.space.Workspace, [DOMAIN_INVENTORY])
|
||||||
description: 'Space for all inventory categories'
|
|
||||||
})
|
|
||||||
await createDefaultSpace(client, inventory.space.Products, {
|
|
||||||
name: 'Products',
|
|
||||||
description: 'Space for all inventory products'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
},
|
||||||
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {}
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,13 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import contact from '@hcengineering/contact'
|
import contact from '@hcengineering/contact'
|
||||||
import { TxOperations, type Ref } from '@hcengineering/core'
|
import { type Space, TxOperations, type Ref } from '@hcengineering/core'
|
||||||
import drive from '@hcengineering/drive'
|
import drive from '@hcengineering/drive'
|
||||||
import { RoomAccess, RoomType, createDefaultRooms, isOffice, loveId, type Floor } from '@hcengineering/love'
|
import { RoomAccess, RoomType, createDefaultRooms, isOffice, loveId, type Floor } from '@hcengineering/love'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
createDefaultSpace,
|
||||||
|
migrateSpace,
|
||||||
|
tryMigrate,
|
||||||
tryUpgrade,
|
tryUpgrade,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
type MigrationClient,
|
type MigrationClient,
|
||||||
@ -26,6 +28,7 @@ import {
|
|||||||
} from '@hcengineering/model'
|
} from '@hcengineering/model'
|
||||||
import core from '@hcengineering/model-core'
|
import core from '@hcengineering/model-core'
|
||||||
import love from './plugin'
|
import love from './plugin'
|
||||||
|
import { DOMAIN_LOVE } from '.'
|
||||||
|
|
||||||
async function createDefaultFloor (tx: TxOperations): Promise<void> {
|
async function createDefaultFloor (tx: TxOperations): Promise<void> {
|
||||||
const current = await tx.findOne(love.class.Floor, {
|
const current = await tx.findOne(love.class.Floor, {
|
||||||
@ -34,7 +37,7 @@ async function createDefaultFloor (tx: TxOperations): Promise<void> {
|
|||||||
if (current === undefined) {
|
if (current === undefined) {
|
||||||
await tx.createDoc(
|
await tx.createDoc(
|
||||||
love.class.Floor,
|
love.class.Floor,
|
||||||
love.space.Rooms,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
name: 'Main'
|
name: 'Main'
|
||||||
},
|
},
|
||||||
@ -53,7 +56,7 @@ async function createRooms (client: MigrationUpgradeClient): Promise<void> {
|
|||||||
const data = createDefaultRooms(employees.map((p) => p._id))
|
const data = createDefaultRooms(employees.map((p) => p._id))
|
||||||
for (const room of data) {
|
for (const room of data) {
|
||||||
const _class = isOffice(room) ? love.class.Office : love.class.Room
|
const _class = isOffice(room) ? love.class.Office : love.class.Room
|
||||||
await tx.createDoc(_class, love.space.Rooms, room)
|
await tx.createDoc(_class, core.space.Workspace, room)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +68,7 @@ async function createReception (client: MigrationUpgradeClient): Promise<void> {
|
|||||||
if (current !== undefined) return
|
if (current !== undefined) return
|
||||||
await tx.createDoc(
|
await tx.createDoc(
|
||||||
love.class.Room,
|
love.class.Room,
|
||||||
love.space.Rooms,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
name: 'Reception',
|
name: 'Reception',
|
||||||
type: RoomType.Reception,
|
type: RoomType.Reception,
|
||||||
@ -81,15 +84,18 @@ async function createReception (client: MigrationUpgradeClient): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const loveOperation: MigrateOperation = {
|
export const loveOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {},
|
async migrate (client: MigrationClient): Promise<void> {
|
||||||
|
await tryMigrate(client, loveId, [
|
||||||
|
{
|
||||||
|
state: 'removeDeprecatedSpace',
|
||||||
|
func: async (client: MigrationClient) => {
|
||||||
|
await migrateSpace(client, 'love:space:Rooms' as Ref<Space>, core.space.Workspace, [DOMAIN_LOVE])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
},
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
||||||
await tryUpgrade(state, client, loveId, [
|
await tryUpgrade(state, client, loveId, [
|
||||||
{
|
|
||||||
state: 'create-defaults-v2',
|
|
||||||
func: async (client) => {
|
|
||||||
await createDefaultSpace(client, love.space.Rooms, { name: 'Rooms', description: 'Space for all rooms' })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
state: 'initial-defaults',
|
state: 'initial-defaults',
|
||||||
func: async (client) => {
|
func: async (client) => {
|
||||||
|
@ -13,11 +13,10 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import { type Doc, type Ref, type Class, type DocumentQuery, DOMAIN_TX } from '@hcengineering/core'
|
import core, { DOMAIN_TX, type Class, type Doc, type DocumentQuery, type Ref, type Space } from '@hcengineering/core'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
migrateSpace,
|
||||||
tryMigrate,
|
tryMigrate,
|
||||||
tryUpgrade,
|
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
type MigrationClient,
|
type MigrationClient,
|
||||||
type MigrationUpgradeClient
|
type MigrationUpgradeClient
|
||||||
@ -76,37 +75,29 @@ export const notificationOperation: MigrateOperation = {
|
|||||||
func: async (client) => {
|
func: async (client) => {
|
||||||
await removeNotifications(client, { hidden: true })
|
await removeNotifications(client, { hidden: true })
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
])
|
|
||||||
await tryMigrate(client, notificationId, [
|
|
||||||
{
|
{
|
||||||
state: 'delete-invalid-notifications',
|
state: 'delete-invalid-notifications',
|
||||||
func: async (client) => {
|
func: async (client) => {
|
||||||
await removeNotifications(client, { attachedToClass: 'chunter:class:Comment' as Ref<Class<Doc>> })
|
await removeNotifications(client, { attachedToClass: 'chunter:class:Comment' as Ref<Class<Doc>> })
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
])
|
|
||||||
await tryMigrate(client, notificationId, [
|
|
||||||
{
|
{
|
||||||
state: 'remove-old-classes',
|
state: 'remove-old-classes',
|
||||||
func: async (client) => {
|
func: async (client) => {
|
||||||
await client.deleteMany(DOMAIN_NOTIFICATION, { _class: 'notification:class:DocUpdates' as Ref<Class<Doc>> })
|
await client.deleteMany(DOMAIN_NOTIFICATION, { _class: 'notification:class:DocUpdates' as Ref<Class<Doc>> })
|
||||||
await client.deleteMany(DOMAIN_TX, { objectClass: 'notification:class:DocUpdates' as Ref<Class<Doc>> })
|
await client.deleteMany(DOMAIN_TX, { objectClass: 'notification:class:DocUpdates' as Ref<Class<Doc>> })
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
])
|
|
||||||
},
|
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
|
||||||
await tryUpgrade(state, client, notificationId, [
|
|
||||||
{
|
{
|
||||||
state: 'create-defaults-v2',
|
state: 'removeDeprecatedSpace',
|
||||||
func: async (client) => {
|
func: async (client: MigrationClient) => {
|
||||||
await createDefaultSpace(client, notification.space.Notifications, {
|
await migrateSpace(client, 'notification:space:Notifications' as Ref<Space>, core.space.Workspace, [
|
||||||
name: 'Notifications',
|
DOMAIN_NOTIFICATION
|
||||||
description: 'Space for all notifications'
|
])
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
},
|
||||||
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {}
|
||||||
}
|
}
|
||||||
|
@ -13,25 +13,28 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import core, { type Ref, type Space } from '@hcengineering/core'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
migrateSpace,
|
||||||
tryUpgrade,
|
tryMigrate,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
type MigrationClient,
|
type MigrationClient,
|
||||||
type MigrationUpgradeClient
|
type MigrationUpgradeClient
|
||||||
} from '@hcengineering/model'
|
} from '@hcengineering/model'
|
||||||
import preference, { preferenceId } from '@hcengineering/preference'
|
import { DOMAIN_PREFERENCE, preferenceId } from '@hcengineering/preference'
|
||||||
|
|
||||||
export const preferenceOperation: MigrateOperation = {
|
export const preferenceOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {},
|
async migrate (client: MigrationClient): Promise<void> {
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
await tryMigrate(client, preferenceId, [
|
||||||
await tryUpgrade(state, client, preferenceId, [
|
|
||||||
{
|
{
|
||||||
state: 'create-defaults-v2',
|
state: 'removeDeprecatedSpace',
|
||||||
func: async (client) => {
|
func: async (client: MigrationClient) => {
|
||||||
await createDefaultSpace(client, preference.space.Preference, { name: 'Preference' })
|
await migrateSpace(client, 'preference:space:Preference' as Ref<Space>, core.space.Workspace, [
|
||||||
|
DOMAIN_PREFERENCE
|
||||||
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
},
|
||||||
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {}
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import { getCategories } from '@anticrm/skillset'
|
import { getCategories } from '@anticrm/skillset'
|
||||||
import core, { DOMAIN_TX, TxOperations, type Ref, type Status } from '@hcengineering/core'
|
import core, { DOMAIN_TX, TxOperations, type Ref, type Space, type Status } from '@hcengineering/core'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
|
||||||
createOrUpdate,
|
createOrUpdate,
|
||||||
|
migrateSpace,
|
||||||
tryMigrate,
|
tryMigrate,
|
||||||
tryUpgrade,
|
tryUpgrade,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
@ -29,6 +29,7 @@ import tags, { type TagCategory } from '@hcengineering/model-tags'
|
|||||||
import task, { DOMAIN_TASK, createSequence, migrateDefaultStatusesBase } from '@hcengineering/model-task'
|
import task, { DOMAIN_TASK, createSequence, migrateDefaultStatusesBase } from '@hcengineering/model-task'
|
||||||
import { recruitId, type Applicant } from '@hcengineering/recruit'
|
import { recruitId, type Applicant } from '@hcengineering/recruit'
|
||||||
|
|
||||||
|
import { DOMAIN_CALENDAR } from '@hcengineering/model-calendar'
|
||||||
import { DOMAIN_SPACE } from '@hcengineering/model-core'
|
import { DOMAIN_SPACE } from '@hcengineering/model-core'
|
||||||
import recruit from './plugin'
|
import recruit from './plugin'
|
||||||
import { defaultApplicantStatuses } from './spaceType'
|
import { defaultApplicantStatuses } from './spaceType'
|
||||||
@ -53,6 +54,12 @@ export const recruitOperation: MigrateOperation = {
|
|||||||
func: async (client) => {
|
func: async (client) => {
|
||||||
await migrateDefaultTypeMixins(client)
|
await migrateDefaultTypeMixins(client)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
state: 'removeDeprecatedSpace',
|
||||||
|
func: async (client: MigrationClient) => {
|
||||||
|
await migrateSpace(client, 'recruit:space:Reviews' as Ref<Space>, core.space.Workspace, [DOMAIN_CALENDAR])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
@ -164,12 +171,10 @@ async function migrateDefaultTypeMixins (client: MigrationClient): Promise<void>
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createDefaults (client: MigrationUpgradeClient, tx: TxOperations): Promise<void> {
|
async function createDefaults (client: MigrationUpgradeClient, tx: TxOperations): Promise<void> {
|
||||||
await createDefaultSpace(client, recruit.space.Reviews, { name: 'Reviews' })
|
|
||||||
|
|
||||||
await createOrUpdate(
|
await createOrUpdate(
|
||||||
tx,
|
tx,
|
||||||
tags.class.TagCategory,
|
tags.class.TagCategory,
|
||||||
tags.space.Tags,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
icon: recruit.icon.Skills,
|
icon: recruit.icon.Skills,
|
||||||
label: 'Other',
|
label: 'Other',
|
||||||
@ -184,7 +189,7 @@ async function createDefaults (client: MigrationUpgradeClient, tx: TxOperations)
|
|||||||
await createOrUpdate(
|
await createOrUpdate(
|
||||||
tx,
|
tx,
|
||||||
tags.class.TagCategory,
|
tags.class.TagCategory,
|
||||||
tags.space.Tags,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
icon: recruit.icon.Skills,
|
icon: recruit.icon.Skills,
|
||||||
label: c.label,
|
label: c.label,
|
||||||
|
@ -13,26 +13,27 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import core, { type Ref, type Space } from '@hcengineering/core'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
migrateSpace,
|
||||||
tryUpgrade,
|
tryMigrate,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
type MigrationClient,
|
type MigrationClient,
|
||||||
type MigrationUpgradeClient
|
type MigrationUpgradeClient
|
||||||
} from '@hcengineering/model'
|
} from '@hcengineering/model'
|
||||||
import { settingId } from '@hcengineering/setting'
|
import { settingId } from '@hcengineering/setting'
|
||||||
import setting from './plugin'
|
import { DOMAIN_SETTING } from '.'
|
||||||
|
|
||||||
export const settingOperation: MigrateOperation = {
|
export const settingOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {},
|
async migrate (client: MigrationClient): Promise<void> {
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
await tryMigrate(client, settingId, [
|
||||||
await tryUpgrade(state, client, settingId, [
|
|
||||||
{
|
{
|
||||||
state: 'create-defaults-v2',
|
state: 'removeDeprecatedSpace',
|
||||||
func: async (client) => {
|
func: async (client: MigrationClient) => {
|
||||||
await createDefaultSpace(client, setting.space.Setting, { name: 'Setting' })
|
await migrateSpace(client, 'setting:space:Setting' as Ref<Space>, core.space.Workspace, [DOMAIN_SETTING])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
},
|
||||||
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {}
|
||||||
}
|
}
|
||||||
|
@ -1,23 +1,24 @@
|
|||||||
|
import core, { type Ref, type Space } from '@hcengineering/core'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
migrateSpace,
|
||||||
tryUpgrade,
|
tryMigrate,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
type MigrationClient,
|
type MigrationClient,
|
||||||
type MigrationUpgradeClient
|
type MigrationUpgradeClient
|
||||||
} from '@hcengineering/model'
|
} from '@hcengineering/model'
|
||||||
import { tagsId } from '@hcengineering/tags'
|
import { tagsId } from '@hcengineering/tags'
|
||||||
import tags from './plugin'
|
import { DOMAIN_TAGS } from '.'
|
||||||
|
|
||||||
export const tagsOperation: MigrateOperation = {
|
export const tagsOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {},
|
async migrate (client: MigrationClient): Promise<void> {
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
await tryMigrate(client, tagsId, [
|
||||||
await tryUpgrade(state, client, tagsId, [
|
|
||||||
{
|
{
|
||||||
state: 'create-defaults-v2',
|
state: 'removeDeprecatedSpace',
|
||||||
func: async (client) => {
|
func: async (client: MigrationClient) => {
|
||||||
await createDefaultSpace(client, tags.space.Tags, { name: 'Tags', description: 'Space for all tags' })
|
await migrateSpace(client, 'tags:space:Tags' as Ref<Space>, core.space.Workspace, [DOMAIN_TAGS])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
},
|
||||||
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {}
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ import {
|
|||||||
type TxUpdateDoc
|
type TxUpdateDoc
|
||||||
} from '@hcengineering/core'
|
} from '@hcengineering/core'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
|
||||||
createOrUpdate,
|
createOrUpdate,
|
||||||
|
migrateSpace,
|
||||||
tryMigrate,
|
tryMigrate,
|
||||||
tryUpgrade,
|
tryUpgrade,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
@ -51,7 +51,7 @@ import {
|
|||||||
type TaskType
|
type TaskType
|
||||||
} from '@hcengineering/task'
|
} from '@hcengineering/task'
|
||||||
|
|
||||||
import { DOMAIN_TASK } from '.'
|
import { DOMAIN_KANBAN, DOMAIN_TASK } from '.'
|
||||||
import task from './plugin'
|
import task from './plugin'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,18 +59,13 @@ import task from './plugin'
|
|||||||
*/
|
*/
|
||||||
export async function createSequence (tx: TxOperations, _class: Ref<Class<Doc>>): Promise<void> {
|
export async function createSequence (tx: TxOperations, _class: Ref<Class<Doc>>): Promise<void> {
|
||||||
if ((await tx.findOne(task.class.Sequence, { attachedTo: _class })) === undefined) {
|
if ((await tx.findOne(task.class.Sequence, { attachedTo: _class })) === undefined) {
|
||||||
await tx.createDoc(task.class.Sequence, task.space.Sequence, {
|
await tx.createDoc(task.class.Sequence, core.space.Workspace, {
|
||||||
attachedTo: _class,
|
attachedTo: _class,
|
||||||
sequence: 0
|
sequence: 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createDefaults (client: MigrationUpgradeClient): Promise<void> {
|
|
||||||
await createDefaultSpace(client, task.space.Sequence, { name: 'Sequences' })
|
|
||||||
await createDefaultSpace(client, task.space.Statuses, { name: 'Statuses' })
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function migrateDefaultStatusesBase<T extends Task> (
|
export async function migrateDefaultStatusesBase<T extends Task> (
|
||||||
client: MigrationClient,
|
client: MigrationClient,
|
||||||
logger: ModelLogger,
|
logger: ModelLogger,
|
||||||
@ -583,15 +578,17 @@ export const taskOperation: MigrateOperation = {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
state: 'removeDeprecatedSpace',
|
||||||
|
func: async (client: MigrationClient) => {
|
||||||
|
await migrateSpace(client, task.space.Sequence, core.space.Workspace, [DOMAIN_KANBAN])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
||||||
await tryUpgrade(state, client, taskId, [
|
await tryUpgrade(state, client, taskId, [
|
||||||
{
|
|
||||||
state: 'defaults-v2',
|
|
||||||
func: createDefaults
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
state: 'u-task-001',
|
state: 'u-task-001',
|
||||||
func: async (client) => {
|
func: async (client) => {
|
||||||
@ -600,7 +597,7 @@ export const taskOperation: MigrateOperation = {
|
|||||||
await createOrUpdate(
|
await createOrUpdate(
|
||||||
tx,
|
tx,
|
||||||
tags.class.TagCategory,
|
tags.class.TagCategory,
|
||||||
tags.space.Tags,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
icon: tags.icon.Tags,
|
icon: tags.icon.Tags,
|
||||||
label: 'Text Label',
|
label: 'Text Label',
|
||||||
|
@ -13,31 +13,27 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import core, { type Ref, type Space } from '@hcengineering/core'
|
||||||
import {
|
import {
|
||||||
createDefaultSpace,
|
migrateSpace,
|
||||||
tryUpgrade,
|
tryMigrate,
|
||||||
type MigrateOperation,
|
type MigrateOperation,
|
||||||
type MigrationClient,
|
type MigrationClient,
|
||||||
type MigrationUpgradeClient
|
type MigrationUpgradeClient
|
||||||
} from '@hcengineering/model'
|
} from '@hcengineering/model'
|
||||||
import { telegramId } from '@hcengineering/telegram'
|
import { telegramId } from '@hcengineering/telegram'
|
||||||
import telegram from './plugin'
|
import { DOMAIN_TELEGRAM } from '.'
|
||||||
|
|
||||||
export async function createSpace (client: MigrationUpgradeClient): Promise<void> {
|
|
||||||
await createDefaultSpace(client, telegram.space.Telegram, {
|
|
||||||
name: 'Telegram',
|
|
||||||
description: 'Space for all telegram messages'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const telegramOperation: MigrateOperation = {
|
export const telegramOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {},
|
async migrate (client: MigrationClient): Promise<void> {
|
||||||
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {
|
await tryMigrate(client, telegramId, [
|
||||||
await tryUpgrade(state, client, telegramId, [
|
|
||||||
{
|
{
|
||||||
state: 'defaults-v2',
|
state: 'removeDeprecatedSpace',
|
||||||
func: createSpace
|
func: async (client: MigrationClient) => {
|
||||||
|
await migrateSpace(client, 'telegram:space:Telegram' as Ref<Space>, core.space.Workspace, [DOMAIN_TELEGRAM])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
},
|
||||||
|
async upgrade (state: Map<string, Set<string>>, client: () => Promise<MigrationUpgradeClient>): Promise<void> {}
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,6 @@ export function createModel (builder: Builder): void {
|
|||||||
icon: calendarPlugin.icon.Calendar,
|
icon: calendarPlugin.icon.Calendar,
|
||||||
alias: timeId,
|
alias: timeId,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
position: 'top',
|
|
||||||
modern: true,
|
modern: true,
|
||||||
component: time.component.Me
|
component: time.component.Me
|
||||||
},
|
},
|
||||||
|
@ -190,7 +190,7 @@ export const timeOperation: MigrateOperation = {
|
|||||||
await createOrUpdate(
|
await createOrUpdate(
|
||||||
tx,
|
tx,
|
||||||
tags.class.TagCategory,
|
tags.class.TagCategory,
|
||||||
tags.space.Tags,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
icon: tags.icon.Tags,
|
icon: tags.icon.Tags,
|
||||||
label: 'Other',
|
label: 'Other',
|
||||||
|
@ -126,7 +126,7 @@ async function createDefaults (tx: TxOperations): Promise<void> {
|
|||||||
await createOrUpdate(
|
await createOrUpdate(
|
||||||
tx,
|
tx,
|
||||||
tags.class.TagCategory,
|
tags.class.TagCategory,
|
||||||
tags.space.Tags,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
icon: tags.icon.Tags,
|
icon: tags.icon.Tags,
|
||||||
label: 'Other',
|
label: 'Other',
|
||||||
|
@ -159,7 +159,8 @@ export default plugin(coreId, {
|
|||||||
DerivedTx: '' as Ref<Space>,
|
DerivedTx: '' as Ref<Space>,
|
||||||
Model: '' as Ref<Space>,
|
Model: '' as Ref<Space>,
|
||||||
Space: '' as Ref<TypedSpace>,
|
Space: '' as Ref<TypedSpace>,
|
||||||
Configuration: '' as Ref<Space>
|
Configuration: '' as Ref<Space>,
|
||||||
|
Workspace: '' as Ref<Space>
|
||||||
},
|
},
|
||||||
account: {
|
account: {
|
||||||
System: '' as Ref<Account>,
|
System: '' as Ref<Account>,
|
||||||
|
@ -2,6 +2,7 @@ import core, {
|
|||||||
Class,
|
Class,
|
||||||
Client,
|
Client,
|
||||||
DOMAIN_MIGRATION,
|
DOMAIN_MIGRATION,
|
||||||
|
DOMAIN_TX,
|
||||||
Data,
|
Data,
|
||||||
Doc,
|
Doc,
|
||||||
DocumentQuery,
|
DocumentQuery,
|
||||||
@ -223,3 +224,18 @@ export async function createDefaultSpace<T extends Space> (
|
|||||||
await tx.createDoc(_class, core.space.Space, data, _id)
|
await tx.createDoc(_class, core.space.Space, data, _id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export async function migrateSpace (
|
||||||
|
client: MigrationClient,
|
||||||
|
from: Ref<Space>,
|
||||||
|
to: Ref<Space>,
|
||||||
|
domains: Domain[]
|
||||||
|
): Promise<void> {
|
||||||
|
for (const domain of domains) {
|
||||||
|
await client.update(domain, { space: from }, { space: to })
|
||||||
|
}
|
||||||
|
await client.update(DOMAIN_TX, { objectSpace: from }, { objectSpace: to })
|
||||||
|
}
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
import { get } from 'svelte/store'
|
|
||||||
import type { ActivityMessage, Reaction } from '@hcengineering/activity'
|
import type { ActivityMessage, Reaction } from '@hcengineering/activity'
|
||||||
import core, { type Doc, type Ref, type TxOperations, getCurrentAccount, isOtherHour } from '@hcengineering/core'
|
import core, { getCurrentAccount, isOtherHour, type Doc, type Ref, type TxOperations } from '@hcengineering/core'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import {
|
import {
|
||||||
type Location,
|
|
||||||
getEventPositionElement,
|
|
||||||
closePopup,
|
|
||||||
showPopup,
|
|
||||||
EmojiPopup,
|
EmojiPopup,
|
||||||
getCurrentResolvedLocation
|
closePopup,
|
||||||
|
getCurrentResolvedLocation,
|
||||||
|
getEventPositionElement,
|
||||||
|
showPopup,
|
||||||
|
type Location
|
||||||
} from '@hcengineering/ui'
|
} from '@hcengineering/ui'
|
||||||
import { type AttributeModel } from '@hcengineering/view'
|
import { type AttributeModel } from '@hcengineering/view'
|
||||||
import preference from '@hcengineering/preference'
|
import { get } from 'svelte/store'
|
||||||
|
|
||||||
import { savedMessagesStore } from './activity'
|
import { savedMessagesStore } from './activity'
|
||||||
import activity from './plugin'
|
import activity from './plugin'
|
||||||
@ -77,7 +76,7 @@ export async function saveForLater (message?: ActivityMessage): Promise<void> {
|
|||||||
closePopup()
|
closePopup()
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
await client.createDoc(activity.class.SavedMessage, preference.space.Preference, {
|
await client.createDoc(activity.class.SavedMessage, core.space.Workspace, {
|
||||||
attachedTo: message._id
|
attachedTo: message._id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -13,57 +13,56 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import attachment, { type Attachment } from '@hcengineering/attachment'
|
|
||||||
import { type ObjQueryType, SortingOrder, type SortingQuery, type Markup } from '@hcengineering/core'
|
|
||||||
import { type IntlString, type Resources } from '@hcengineering/platform'
|
|
||||||
import preference from '@hcengineering/preference'
|
|
||||||
import { PDFViewer, deleteFile, getClient, uploadFile } from '@hcengineering/presentation'
|
|
||||||
import activity, { type ActivityMessage, type DocUpdateMessage } from '@hcengineering/activity'
|
import activity, { type ActivityMessage, type DocUpdateMessage } from '@hcengineering/activity'
|
||||||
|
import attachment, { type Attachment } from '@hcengineering/attachment'
|
||||||
|
import core, { SortingOrder, type Markup, type ObjQueryType, type SortingQuery } from '@hcengineering/core'
|
||||||
|
import { type IntlString, type Resources } from '@hcengineering/platform'
|
||||||
|
import { PDFViewer, deleteFile, getClient, uploadFile } from '@hcengineering/presentation'
|
||||||
|
|
||||||
|
import AccordionEditor from './components/AccordionEditor.svelte'
|
||||||
import AddAttachment from './components/AddAttachment.svelte'
|
import AddAttachment from './components/AddAttachment.svelte'
|
||||||
import AttachmentDocList from './components/AttachmentDocList.svelte'
|
import AttachmentDocList from './components/AttachmentDocList.svelte'
|
||||||
import AttachmentDroppable from './components/AttachmentDroppable.svelte'
|
import AttachmentDroppable from './components/AttachmentDroppable.svelte'
|
||||||
import AttachmentGalleryPresenter from './components/AttachmentGalleryPresenter.svelte'
|
import AttachmentGalleryPresenter from './components/AttachmentGalleryPresenter.svelte'
|
||||||
import AttachmentList from './components/AttachmentList.svelte'
|
import AttachmentList from './components/AttachmentList.svelte'
|
||||||
import AttachmentPresenter from './components/AttachmentPresenter.svelte'
|
import AttachmentPresenter from './components/AttachmentPresenter.svelte'
|
||||||
|
import AttachmentPreview from './components/AttachmentPreview.svelte'
|
||||||
import AttachmentRefInput from './components/AttachmentRefInput.svelte'
|
import AttachmentRefInput from './components/AttachmentRefInput.svelte'
|
||||||
|
import AttachmentStyleBoxCollabEditor from './components/AttachmentStyleBoxCollabEditor.svelte'
|
||||||
|
import AttachmentStyleBoxEditor from './components/AttachmentStyleBoxEditor.svelte'
|
||||||
|
import AttachmentStyledBox from './components/AttachmentStyledBox.svelte'
|
||||||
import Attachments from './components/Attachments.svelte'
|
import Attachments from './components/Attachments.svelte'
|
||||||
import AttachmentsPresenter from './components/AttachmentsPresenter.svelte'
|
import AttachmentsPresenter from './components/AttachmentsPresenter.svelte'
|
||||||
import FileBrowser from './components/FileBrowser.svelte'
|
|
||||||
import FileDownload from './components/icons/FileDownload.svelte'
|
|
||||||
import Photos from './components/Photos.svelte'
|
|
||||||
import AttachmentStyledBox from './components/AttachmentStyledBox.svelte'
|
|
||||||
import AttachmentStyleBoxEditor from './components/AttachmentStyleBoxEditor.svelte'
|
|
||||||
import AttachmentStyleBoxCollabEditor from './components/AttachmentStyleBoxCollabEditor.svelte'
|
|
||||||
import AccordionEditor from './components/AccordionEditor.svelte'
|
|
||||||
import IconUploadDuo from './components/icons/UploadDuo.svelte'
|
|
||||||
import IconAttachment from './components/icons/Attachment.svelte'
|
|
||||||
import AttachmentPreview from './components/AttachmentPreview.svelte'
|
|
||||||
import AttachmentsUpdatedMessage from './components/activity/AttachmentsUpdatedMessage.svelte'
|
|
||||||
import AttachmentsTooltip from './components/AttachmentsTooltip.svelte'
|
import AttachmentsTooltip from './components/AttachmentsTooltip.svelte'
|
||||||
|
import FileBrowser from './components/FileBrowser.svelte'
|
||||||
|
import Photos from './components/Photos.svelte'
|
||||||
|
import AttachmentsUpdatedMessage from './components/activity/AttachmentsUpdatedMessage.svelte'
|
||||||
|
import IconAttachment from './components/icons/Attachment.svelte'
|
||||||
|
import FileDownload from './components/icons/FileDownload.svelte'
|
||||||
|
import IconUploadDuo from './components/icons/UploadDuo.svelte'
|
||||||
|
|
||||||
export * from './types'
|
export * from './types'
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
AccordionEditor,
|
||||||
AddAttachment,
|
AddAttachment,
|
||||||
|
AttachmentDocList,
|
||||||
AttachmentDroppable,
|
AttachmentDroppable,
|
||||||
|
AttachmentGalleryPresenter,
|
||||||
|
AttachmentList,
|
||||||
|
AttachmentPresenter,
|
||||||
|
AttachmentPreview,
|
||||||
|
AttachmentRefInput,
|
||||||
|
AttachmentStyleBoxCollabEditor,
|
||||||
|
AttachmentStyleBoxEditor,
|
||||||
|
AttachmentStyledBox,
|
||||||
Attachments,
|
Attachments,
|
||||||
AttachmentsPresenter,
|
AttachmentsPresenter,
|
||||||
AttachmentPresenter,
|
AttachmentsTooltip,
|
||||||
AttachmentGalleryPresenter,
|
|
||||||
AttachmentRefInput,
|
|
||||||
AttachmentList,
|
|
||||||
AttachmentDocList,
|
|
||||||
FileDownload,
|
|
||||||
FileBrowser,
|
FileBrowser,
|
||||||
AttachmentStyledBox,
|
FileDownload,
|
||||||
AttachmentStyleBoxEditor,
|
|
||||||
AttachmentStyleBoxCollabEditor,
|
|
||||||
AccordionEditor,
|
|
||||||
IconUploadDuo,
|
|
||||||
IconAttachment,
|
IconAttachment,
|
||||||
AttachmentPreview,
|
IconUploadDuo
|
||||||
AttachmentsTooltip
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum FileBrowserSortMode {
|
export enum FileBrowserSortMode {
|
||||||
@ -211,7 +210,7 @@ export const fileTypeFileBrowserFilters: TypeFilter[] = [
|
|||||||
export async function AddAttachmentToSaved (attach: Attachment): Promise<void> {
|
export async function AddAttachmentToSaved (attach: Attachment): Promise<void> {
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
await client.createDoc(attachment.class.SavedAttachments, preference.space.Preference, {
|
await client.createDoc(attachment.class.SavedAttachments, core.space.Workspace, {
|
||||||
attachedTo: attach._id
|
attachedTo: attach._id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -361,7 +361,7 @@ export async function convert (
|
|||||||
description: '',
|
description: '',
|
||||||
title: vv,
|
title: vv,
|
||||||
targetClass: attr.attributeOf,
|
targetClass: attr.attributeOf,
|
||||||
space: tags.space.Tags,
|
space: core.space.Workspace,
|
||||||
modifiedBy: document.modifiedBy,
|
modifiedBy: document.modifiedBy,
|
||||||
modifiedOn: document.modifiedOn
|
modifiedOn: document.modifiedOn
|
||||||
}
|
}
|
||||||
@ -379,7 +379,7 @@ export async function convert (
|
|||||||
weight: o.weight,
|
weight: o.weight,
|
||||||
modifiedBy: document.modifiedBy,
|
modifiedBy: document.modifiedBy,
|
||||||
modifiedOn: document.modifiedOn,
|
modifiedOn: document.modifiedOn,
|
||||||
space: tags.space.Tags,
|
space: core.space.Workspace,
|
||||||
bitrixId: vv
|
bitrixId: vv
|
||||||
}
|
}
|
||||||
newExtraSyncDocs.push(ref)
|
newExtraSyncDocs.push(ref)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import board, { type Board, type CommonBoardPreference } from '@hcengineering/board'
|
import board, { type Board, type CommonBoardPreference } from '@hcengineering/board'
|
||||||
import core, { getCurrentAccount, type Ref, type TxOperations } from '@hcengineering/core'
|
import core, { getCurrentAccount, type Ref, type TxOperations } from '@hcengineering/core'
|
||||||
import preference from '@hcengineering/preference'
|
|
||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import type { ProjectType } from '@hcengineering/task'
|
import type { ProjectType } from '@hcengineering/task'
|
||||||
import {
|
import {
|
||||||
@ -55,7 +54,7 @@ export const commonBoardPreference = readable<CommonBoardPreference>(undefined,
|
|||||||
set(result[0])
|
set(result[0])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
void getClient().createDoc(board.class.CommonBoardPreference, preference.space.Preference, {
|
void getClient().createDoc(board.class.CommonBoardPreference, core.space.Workspace, {
|
||||||
attachedTo: board.app.Board
|
attachedTo: board.app.Board
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -30,7 +30,7 @@ import {
|
|||||||
import type { Asset, Metadata, Plugin, Resource } from '@hcengineering/platform'
|
import type { Asset, Metadata, Plugin, Resource } from '@hcengineering/platform'
|
||||||
import { IntlString, plugin } from '@hcengineering/platform'
|
import { IntlString, plugin } from '@hcengineering/platform'
|
||||||
import { TemplateField, TemplateFieldCategory } from '@hcengineering/templates'
|
import { TemplateField, TemplateFieldCategory } from '@hcengineering/templates'
|
||||||
import type { AnyComponent, ColorDefinition, ResolvedLocation } from '@hcengineering/ui'
|
import type { AnyComponent, ColorDefinition, ResolvedLocation, Location } from '@hcengineering/ui'
|
||||||
import { Action, FilterMode, Viewlet } from '@hcengineering/view'
|
import { Action, FilterMode, Viewlet } from '@hcengineering/view'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
} from '@hcengineering/core'
|
} from '@hcengineering/core'
|
||||||
import type { Asset, Plugin, Resource } from '@hcengineering/platform'
|
import type { Asset, Plugin, Resource } from '@hcengineering/platform'
|
||||||
import { IntlString, plugin } from '@hcengineering/platform'
|
import { IntlString, plugin } from '@hcengineering/platform'
|
||||||
import type { AnyComponent, ResolvedLocation } from '@hcengineering/ui'
|
import type { AnyComponent, ResolvedLocation, Location } from '@hcengineering/ui'
|
||||||
import { Action } from '@hcengineering/view'
|
import { Action } from '@hcengineering/view'
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import {
|
import core, {
|
||||||
generateId,
|
generateId,
|
||||||
getCurrentAccount,
|
getCurrentAccount,
|
||||||
type Class,
|
type Class,
|
||||||
@ -25,7 +25,6 @@ import {
|
|||||||
} from '@hcengineering/core'
|
} from '@hcengineering/core'
|
||||||
import { type Document, type Teamspace } from '@hcengineering/document'
|
import { type Document, type Teamspace } from '@hcengineering/document'
|
||||||
import { type Resources } from '@hcengineering/platform'
|
import { type Resources } from '@hcengineering/platform'
|
||||||
import preference from '@hcengineering/preference'
|
|
||||||
import { getClient, type ObjectSearchResult } from '@hcengineering/presentation'
|
import { getClient, type ObjectSearchResult } from '@hcengineering/presentation'
|
||||||
import { showPopup } from '@hcengineering/ui'
|
import { showPopup } from '@hcengineering/ui'
|
||||||
import { openDoc } from '@hcengineering/view-resources'
|
import { openDoc } from '@hcengineering/view-resources'
|
||||||
@ -117,7 +116,7 @@ async function editTeamspace (teamspace: Teamspace | undefined): Promise<void> {
|
|||||||
export async function starDocument (doc: Document): Promise<void> {
|
export async function starDocument (doc: Document): Promise<void> {
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
await client.createDoc(document.class.SavedDocument, preference.space.Preference, {
|
await client.createDoc(document.class.SavedDocument, core.space.Workspace, {
|
||||||
attachedTo: doc._id
|
attachedTo: doc._id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
import attachmentP, { Attachment } from '@hcengineering/attachment'
|
import attachmentP, { Attachment } from '@hcengineering/attachment'
|
||||||
import { AttachmentPresenter } from '@hcengineering/attachment-resources'
|
import { AttachmentPresenter } from '@hcengineering/attachment-resources'
|
||||||
import contact, { Channel, Contact, getName } from '@hcengineering/contact'
|
import contact, { Channel, Contact, getName } from '@hcengineering/contact'
|
||||||
import { Data, Markup, generateId } from '@hcengineering/core'
|
import core, { Data, Markup, generateId } from '@hcengineering/core'
|
||||||
import { NewMessage, SharedMessage } from '@hcengineering/gmail'
|
import { NewMessage, SharedMessage } from '@hcengineering/gmail'
|
||||||
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
||||||
import { getResource, setPlatformStatus, unknownError } from '@hcengineering/platform'
|
import { getResource, setPlatformStatus, unknownError } from '@hcengineering/platform'
|
||||||
@ -68,7 +68,7 @@
|
|||||||
async function sendMsg (): Promise<void> {
|
async function sendMsg (): Promise<void> {
|
||||||
await client.createDoc(
|
await client.createDoc(
|
||||||
plugin.class.NewMessage,
|
plugin.class.NewMessage,
|
||||||
plugin.space.Gmail,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
...obj,
|
...obj,
|
||||||
content: markupToHTML(content),
|
content: markupToHTML(content),
|
||||||
@ -120,7 +120,7 @@
|
|||||||
const uuid = await uploadFile(file)
|
const uuid = await uploadFile(file)
|
||||||
await client.addCollection(
|
await client.addCollection(
|
||||||
attachmentP.class.Attachment,
|
attachmentP.class.Attachment,
|
||||||
plugin.space.Gmail,
|
core.space.Workspace,
|
||||||
objectId,
|
objectId,
|
||||||
plugin.class.NewMessage,
|
plugin.class.NewMessage,
|
||||||
'attachments',
|
'attachments',
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
import attachmentP, { Attachment } from '@hcengineering/attachment'
|
import attachmentP, { Attachment } from '@hcengineering/attachment'
|
||||||
import { AttachmentPresenter } from '@hcengineering/attachment-resources'
|
import { AttachmentPresenter } from '@hcengineering/attachment-resources'
|
||||||
import contact, { Channel, Contact, getName as getContactName } from '@hcengineering/contact'
|
import contact, { Channel, Contact, getName as getContactName } from '@hcengineering/contact'
|
||||||
import { generateId, getCurrentAccount, Markup, Ref, toIdMap } from '@hcengineering/core'
|
import core, { generateId, getCurrentAccount, Markup, Ref, toIdMap } from '@hcengineering/core'
|
||||||
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
||||||
import { getResource, setPlatformStatus, unknownError } from '@hcengineering/platform'
|
import { getResource, setPlatformStatus, unknownError } from '@hcengineering/platform'
|
||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
@ -83,7 +83,7 @@
|
|||||||
templateProvider.set(contact.class.Contact, target)
|
templateProvider.set(contact.class.Contact, target)
|
||||||
const htmlContent = markupToHTML(content)
|
const htmlContent = markupToHTML(content)
|
||||||
const message = await templateProvider.fillTemplate(htmlContent)
|
const message = await templateProvider.fillTemplate(htmlContent)
|
||||||
const id = await client.createDoc(plugin.class.NewMessage, plugin.space.Gmail, {
|
const id = await client.createDoc(plugin.class.NewMessage, core.space.Workspace, {
|
||||||
subject,
|
subject,
|
||||||
content: message,
|
content: message,
|
||||||
to: channel.value,
|
to: channel.value,
|
||||||
@ -98,7 +98,7 @@
|
|||||||
for (const attachment of attachments) {
|
for (const attachment of attachments) {
|
||||||
await client.addCollection(
|
await client.addCollection(
|
||||||
attachmentP.class.Attachment,
|
attachmentP.class.Attachment,
|
||||||
plugin.space.Gmail,
|
core.space.Workspace,
|
||||||
id,
|
id,
|
||||||
plugin.class.NewMessage,
|
plugin.class.NewMessage,
|
||||||
'attachments',
|
'attachments',
|
||||||
@ -145,7 +145,7 @@
|
|||||||
const uuid = await uploadFile(file)
|
const uuid = await uploadFile(file)
|
||||||
await client.addCollection(
|
await client.addCollection(
|
||||||
attachmentP.class.Attachment,
|
attachmentP.class.Attachment,
|
||||||
plugin.space.Gmail,
|
core.space.Workspace,
|
||||||
attachmentParentId,
|
attachmentParentId,
|
||||||
plugin.class.NewMessage,
|
plugin.class.NewMessage,
|
||||||
'attachments',
|
'attachments',
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import { ChannelItem } from '@hcengineering/contact'
|
import { ChannelItem } from '@hcengineering/contact'
|
||||||
import type { Account, AttachedDoc, Class, Doc, Ref, Space, Timestamp } from '@hcengineering/core'
|
import type { Account, AttachedDoc, Class, Doc, Ref, Timestamp } from '@hcengineering/core'
|
||||||
|
import { NotificationType } from '@hcengineering/notification'
|
||||||
import type { IntlString, Plugin } from '@hcengineering/platform'
|
import type { IntlString, Plugin } from '@hcengineering/platform'
|
||||||
import { Metadata, plugin } from '@hcengineering/platform'
|
import { Metadata, plugin } from '@hcengineering/platform'
|
||||||
import { NotificationType } from '@hcengineering/notification'
|
|
||||||
import type { Handler, IntegrationType } from '@hcengineering/setting'
|
import type { Handler, IntegrationType } from '@hcengineering/setting'
|
||||||
import type { AnyComponent } from '@hcengineering/ui'
|
import type { AnyComponent } from '@hcengineering/ui'
|
||||||
|
|
||||||
@ -106,10 +106,6 @@ export default plugin(gmailId, {
|
|||||||
ids: {
|
ids: {
|
||||||
EmailNotification: '' as Ref<NotificationType>
|
EmailNotification: '' as Ref<NotificationType>
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
// todo remove, should be in contact
|
|
||||||
Gmail: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
metadata: {
|
metadata: {
|
||||||
GmailURL: '' as Metadata<string>
|
GmailURL: '' as Metadata<string>
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Class, Doc, Ref, Space } from '@hcengineering/core'
|
import { Class, Doc, Ref } from '@hcengineering/core'
|
||||||
import type { Asset, Plugin } from '@hcengineering/platform'
|
import type { Asset, Plugin } from '@hcengineering/platform'
|
||||||
import { plugin } from '@hcengineering/platform'
|
import { plugin } from '@hcengineering/platform'
|
||||||
import { AnyComponent, Location } from '@hcengineering/ui'
|
import { AnyComponent, Location } from '@hcengineering/ui'
|
||||||
@ -30,9 +30,6 @@ export default plugin(guestId, {
|
|||||||
icon: {
|
icon: {
|
||||||
Link: '' as Asset
|
Link: '' as Asset
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
Links: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
component: {
|
component: {
|
||||||
GuestApp: '' as AnyComponent
|
GuestApp: '' as AnyComponent
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Copyright © 2024 Hardcore Engineering Inc.
|
// Copyright © 2024 Hardcore Engineering Inc.
|
||||||
//
|
//
|
||||||
|
|
||||||
import { Doc, TxOperations } from '@hcengineering/core'
|
import core, { Doc, TxOperations } from '@hcengineering/core'
|
||||||
import { type Location } from '@hcengineering/ui'
|
import { type Location } from '@hcengineering/ui'
|
||||||
|
|
||||||
import guest from './index'
|
import guest from './index'
|
||||||
@ -13,7 +13,7 @@ export async function createPublicLink (
|
|||||||
location: Location,
|
location: Location,
|
||||||
revokable: boolean = true
|
revokable: boolean = true
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await client.createDoc(guest.class.PublicLink, guest.space.Links, {
|
await client.createDoc(guest.class.PublicLink, core.space.Workspace, {
|
||||||
attachedTo: object._id,
|
attachedTo: object._id,
|
||||||
location,
|
location,
|
||||||
revokable,
|
revokable,
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Employee } from '@hcengineering/contact'
|
import { Employee } from '@hcengineering/contact'
|
||||||
import { EmployeeBox } from '@hcengineering/contact-resources'
|
import { EmployeeBox } from '@hcengineering/contact-resources'
|
||||||
import { Ref } from '@hcengineering/core'
|
import core, { Ref } from '@hcengineering/core'
|
||||||
import { Card, getClient } from '@hcengineering/presentation'
|
import { Card, getClient } from '@hcengineering/presentation'
|
||||||
import { Button, EditBox, FocusHandler, createFocusManager } from '@hcengineering/ui'
|
import { Button, EditBox, FocusHandler, createFocusManager } from '@hcengineering/ui'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
@ -36,7 +36,7 @@
|
|||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
async function createDepartment () {
|
async function createDepartment () {
|
||||||
const id = await client.createDoc(hr.class.Department, hr.space.HR, {
|
const id = await client.createDoc(hr.class.Department, core.space.Workspace, {
|
||||||
name,
|
name,
|
||||||
description: '',
|
description: '',
|
||||||
parent,
|
parent,
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
if (date === undefined) return
|
if (date === undefined) return
|
||||||
if (type === undefined) return
|
if (type === undefined) return
|
||||||
if (employee === null) return
|
if (employee === null) return
|
||||||
await client.addCollection(hr.class.Request, hr.space.HR, employee, staff._class, 'requests', {
|
await client.addCollection(hr.class.Request, core.space.Workspace, employee, staff._class, 'requests', {
|
||||||
type: type._id,
|
type: type._id,
|
||||||
tzDate: timeToTzDate(date),
|
tzDate: timeToTzDate(date),
|
||||||
tzDueDate: timeToTzDate(dueDate),
|
tzDueDate: timeToTzDate(dueDate),
|
||||||
@ -146,7 +146,7 @@
|
|||||||
bind:this={descriptionBox}
|
bind:this={descriptionBox}
|
||||||
{objectId}
|
{objectId}
|
||||||
_class={hr.class.Request}
|
_class={hr.class.Request}
|
||||||
space={hr.space.HR}
|
space={core.space.Workspace}
|
||||||
alwaysEdit
|
alwaysEdit
|
||||||
showButtons={false}
|
showButtons={false}
|
||||||
maxHeight={'card'}
|
maxHeight={'card'}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Data, Ref, Timestamp } from '@hcengineering/core'
|
import core, { Data, Ref, Timestamp } from '@hcengineering/core'
|
||||||
import { Department, PublicHoliday, timeToTzDate } from '@hcengineering/hr'
|
import { Department, PublicHoliday, timeToTzDate } from '@hcengineering/hr'
|
||||||
import presentation, { Card, getClient } from '@hcengineering/presentation'
|
import presentation, { Card, getClient } from '@hcengineering/presentation'
|
||||||
import { Button, DateRangePresenter, EditBox, Label } from '@hcengineering/ui'
|
import { Button, DateRangePresenter, EditBox, Label } from '@hcengineering/ui'
|
||||||
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
async function saveHoliday () {
|
async function saveHoliday () {
|
||||||
if (existingHoliday !== undefined) {
|
if (existingHoliday !== undefined) {
|
||||||
await client.updateDoc(hr.class.PublicHoliday, hr.space.HR, existingHoliday._id, {
|
await client.updateDoc(hr.class.PublicHoliday, core.space.Workspace, existingHoliday._id, {
|
||||||
title,
|
title,
|
||||||
description
|
description
|
||||||
})
|
})
|
||||||
@ -51,7 +51,7 @@
|
|||||||
date: timeToTzDate(date),
|
date: timeToTzDate(date),
|
||||||
department
|
department
|
||||||
}
|
}
|
||||||
await client.createDoc(hr.class.PublicHoliday, hr.space.HR, holiday)
|
await client.createDoc(hr.class.PublicHoliday, core.space.Workspace, holiday)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
findHoliday()
|
findHoliday()
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import type { Contact, Employee, PersonAccount } from '@hcengineering/contact'
|
import type { Contact, Employee, PersonAccount } from '@hcengineering/contact'
|
||||||
import type { Arr, AttachedDoc, Class, Doc, Markup, Mixin, Ref, Space, Type } from '@hcengineering/core'
|
import type { Arr, AttachedDoc, Class, Doc, Markup, Mixin, Ref, Type } from '@hcengineering/core'
|
||||||
import { NotificationType } from '@hcengineering/notification'
|
import { NotificationType } from '@hcengineering/notification'
|
||||||
import type { Asset, IntlString, Plugin } from '@hcengineering/platform'
|
import type { Asset, IntlString, Plugin } from '@hcengineering/platform'
|
||||||
import { plugin } from '@hcengineering/platform'
|
import { plugin } from '@hcengineering/platform'
|
||||||
@ -123,9 +123,6 @@ const hr = plugin(hrId, {
|
|||||||
mixin: {
|
mixin: {
|
||||||
Staff: '' as Ref<Mixin<Staff>>
|
Staff: '' as Ref<Mixin<Staff>>
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
HR: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
icon: {
|
icon: {
|
||||||
HR: '' as Asset,
|
HR: '' as Asset,
|
||||||
Department: '' as Asset,
|
Department: '' as Asset,
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { DocumentQuery } from '@hcengineering/core'
|
import core, { DocumentQuery } from '@hcengineering/core'
|
||||||
import { Button, Label, Scroller, SearchEdit, showPopup, IconAdd } from '@hcengineering/ui'
|
import { Button, Label, Scroller, SearchEdit, showPopup, IconAdd } from '@hcengineering/ui'
|
||||||
import type { Category } from '@hcengineering/inventory'
|
import type { Category } from '@hcengineering/inventory'
|
||||||
import inventory from '../plugin'
|
import inventory from '../plugin'
|
||||||
@ -30,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showCreateDialog () {
|
function showCreateDialog () {
|
||||||
showPopup(CreateCategory, { space: inventory.space.Category }, 'top')
|
showPopup(CreateCategory, { space: core.space.Workspace }, 'top')
|
||||||
}
|
}
|
||||||
|
|
||||||
// $: twoRows = $deviceInfo.twoRows
|
// $: twoRows = $deviceInfo.twoRows
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AttachedData, AttachedDoc, Doc, Ref, generateId } from '@hcengineering/core'
|
import core, { AttachedData, AttachedDoc, Doc, Ref, generateId } from '@hcengineering/core'
|
||||||
import { OK, Status } from '@hcengineering/platform'
|
import { OK, Status } from '@hcengineering/platform'
|
||||||
import { Card, getClient } from '@hcengineering/presentation'
|
import { Card, getClient } from '@hcengineering/presentation'
|
||||||
import type { Category } from '@hcengineering/inventory'
|
import type { Category } from '@hcengineering/inventory'
|
||||||
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
await client.addCollection(
|
await client.addCollection(
|
||||||
inventory.class.Category,
|
inventory.class.Category,
|
||||||
inventory.space.Category,
|
core.space.Workspace,
|
||||||
attachedTo,
|
attachedTo,
|
||||||
inventory.class.Category,
|
inventory.class.Category,
|
||||||
'categories',
|
'categories',
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Account, Doc, generateId, Ref } from '@hcengineering/core'
|
import core, { Account, Doc, generateId, Ref } from '@hcengineering/core'
|
||||||
import { Category, Product } from '@hcengineering/inventory'
|
import { Category, Product } from '@hcengineering/inventory'
|
||||||
import { Card, createQuery, getClient } from '@hcengineering/presentation'
|
import { Card, createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import { Button, DropdownLabels, DropdownTextItem, EditBox } from '@hcengineering/ui'
|
import { Button, DropdownLabels, DropdownTextItem, EditBox } from '@hcengineering/ui'
|
||||||
@ -26,7 +26,7 @@
|
|||||||
attachedTo: '' as Ref<Doc>,
|
attachedTo: '' as Ref<Doc>,
|
||||||
attachedToClass: inventory.class.Category,
|
attachedToClass: inventory.class.Category,
|
||||||
_class: inventory.class.Product,
|
_class: inventory.class.Product,
|
||||||
space: inventory.space.Products,
|
space: core.space.Workspace,
|
||||||
_id: generateId(),
|
_id: generateId(),
|
||||||
collection: 'products',
|
collection: 'products',
|
||||||
modifiedOn: Date.now(),
|
modifiedOn: Date.now(),
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Account, generateId, Ref } from '@hcengineering/core'
|
import core, { Account, generateId, Ref } from '@hcengineering/core'
|
||||||
import { Card, getClient } from '@hcengineering/presentation'
|
import { Card, getClient } from '@hcengineering/presentation'
|
||||||
import { EditBox, Grid } from '@hcengineering/ui'
|
import { EditBox, Grid } from '@hcengineering/ui'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
@ -29,7 +29,7 @@
|
|||||||
attachedTo: product,
|
attachedTo: product,
|
||||||
attachedToClass: inventory.class.Product,
|
attachedToClass: inventory.class.Product,
|
||||||
_class: inventory.class.Variant,
|
_class: inventory.class.Variant,
|
||||||
space: inventory.space.Products,
|
space: core.space.Workspace,
|
||||||
_id: generateId(),
|
_id: generateId(),
|
||||||
collection: 'variants',
|
collection: 'variants',
|
||||||
modifiedOn: Date.now(),
|
modifiedOn: Date.now(),
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import { AttachedDoc, Class, Doc, Ref, Space } from '@hcengineering/core'
|
import { AttachedDoc, Class, Doc, Ref } from '@hcengineering/core'
|
||||||
import type { Asset, Plugin } from '@hcengineering/platform'
|
import type { Asset, Plugin } from '@hcengineering/platform'
|
||||||
import { plugin } from '@hcengineering/platform'
|
import { plugin } from '@hcengineering/platform'
|
||||||
|
|
||||||
@ -67,10 +67,6 @@ const inventory = plugin(inventoryId, {
|
|||||||
// Global category root, if not attached to some other object.
|
// Global category root, if not attached to some other object.
|
||||||
Category: '' as Ref<Category>
|
Category: '' as Ref<Category>
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
Category: '' as Ref<Space>,
|
|
||||||
Products: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
app: {
|
app: {
|
||||||
Inventory: '' as Ref<Doc>
|
Inventory: '' as Ref<Doc>
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Class, Data, Ref } from '@hcengineering/core'
|
import core, { Class, Data, Ref } from '@hcengineering/core'
|
||||||
import { translate } from '@hcengineering/platform'
|
import { translate } from '@hcengineering/platform'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import { Button, DropdownIntlItem } from '@hcengineering/ui'
|
import { Button, DropdownIntlItem } from '@hcengineering/ui'
|
||||||
@ -64,7 +64,7 @@
|
|||||||
if (val._class === love.class.Office) {
|
if (val._class === love.class.Office) {
|
||||||
;(data as Data<Office>).person = null
|
;(data as Data<Office>).person = null
|
||||||
}
|
}
|
||||||
await client.createDoc(val._class, love.space.Rooms, data)
|
await client.createDoc(val._class, core.space.Workspace, data)
|
||||||
dispatch('close')
|
dispatch('close')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import { EditBox } from '@hcengineering/ui'
|
import { EditBox } from '@hcengineering/ui'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import love from '../plugin'
|
import love from '../plugin'
|
||||||
import { Ref } from '@hcengineering/core'
|
import core, { Ref } from '@hcengineering/core'
|
||||||
import { Floor } from '@hcengineering/love'
|
import { Floor } from '@hcengineering/love'
|
||||||
|
|
||||||
export let id: Ref<Floor> | undefined = undefined
|
export let id: Ref<Floor> | undefined = undefined
|
||||||
@ -20,11 +20,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createFloor (): Promise<void> {
|
async function createFloor (): Promise<void> {
|
||||||
await client.createDoc(love.class.Floor, love.space.Rooms, { name })
|
await client.createDoc(love.class.Floor, core.space.Workspace, { name })
|
||||||
}
|
}
|
||||||
async function updateFloor (): Promise<void> {
|
async function updateFloor (): Promise<void> {
|
||||||
if (id === undefined) return
|
if (id === undefined) return
|
||||||
await client.updateDoc(love.class.Floor, love.space.Rooms, id, { name })
|
await client.updateDoc(love.class.Floor, core.space.Workspace, id, { name })
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Analytics } from '@hcengineering/analytics'
|
import { Analytics } from '@hcengineering/analytics'
|
||||||
import contact, { getName, type Person, type PersonAccount } from '@hcengineering/contact'
|
import contact, { getName, type Person, type PersonAccount } from '@hcengineering/contact'
|
||||||
import { concatLink, getCurrentAccount, type IdMap, type Ref, type Space } from '@hcengineering/core'
|
import core, { concatLink, getCurrentAccount, type IdMap, type Ref, type Space } from '@hcengineering/core'
|
||||||
import { getEmbeddedLabel, getMetadata, type IntlString } from '@hcengineering/platform'
|
import { getEmbeddedLabel, getMetadata, type IntlString } from '@hcengineering/platform'
|
||||||
import presentation, { createQuery, getClient } from '@hcengineering/presentation'
|
import presentation, { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import { getCurrentLocation, navigate, type DropdownTextItem } from '@hcengineering/ui'
|
import { getCurrentLocation, navigate, type DropdownTextItem } from '@hcengineering/ui'
|
||||||
@ -483,7 +483,7 @@ async function moveToRoom (
|
|||||||
room: room._id
|
room: room._id
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await client.createDoc(love.class.ParticipantInfo, love.space.Rooms, {
|
await client.createDoc(love.class.ParticipantInfo, core.space.Workspace, {
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
room: room._id,
|
room: room._id,
|
||||||
@ -606,7 +606,7 @@ export async function tryConnect (
|
|||||||
await client.update(invite, { status: invite.room === room._id ? RequestStatus.Approved : RequestStatus.Rejected })
|
await client.update(invite, { status: invite.room === room._id ? RequestStatus.Approved : RequestStatus.Rejected })
|
||||||
}
|
}
|
||||||
if (room.access === RoomAccess.Knock && (!isOffice(room) || room.person !== currentPerson._id)) {
|
if (room.access === RoomAccess.Knock && (!isOffice(room) || room.person !== currentPerson._id)) {
|
||||||
const _id = await client.createDoc(love.class.JoinRequest, love.space.Rooms, {
|
const _id = await client.createDoc(love.class.JoinRequest, core.space.Workspace, {
|
||||||
person: currentPerson._id,
|
person: currentPerson._id,
|
||||||
room: room._id,
|
room: room._id,
|
||||||
status: RequestStatus.Pending
|
status: RequestStatus.Pending
|
||||||
@ -630,7 +630,7 @@ export async function invite (person: Ref<Person>, room: Ref<Room> | undefined):
|
|||||||
if (room === undefined || room === love.ids.Reception) return
|
if (room === undefined || room === love.ids.Reception) return
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
const me = getCurrentAccount()
|
const me = getCurrentAccount()
|
||||||
await client.createDoc(love.class.Invite, love.space.Rooms, {
|
await client.createDoc(love.class.Invite, core.space.Workspace, {
|
||||||
target: person,
|
target: person,
|
||||||
room,
|
room,
|
||||||
status: RequestStatus.Pending,
|
status: RequestStatus.Pending,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Person } from '@hcengineering/contact'
|
import { Person } from '@hcengineering/contact'
|
||||||
import { Class, Doc, Ref, Space } from '@hcengineering/core'
|
import { Class, Doc, Ref } from '@hcengineering/core'
|
||||||
import { Drive } from '@hcengineering/drive'
|
import { Drive } from '@hcengineering/drive'
|
||||||
import { NotificationType } from '@hcengineering/notification'
|
import { NotificationType } from '@hcengineering/notification'
|
||||||
import { Asset, IntlString, Metadata, Plugin, plugin } from '@hcengineering/platform'
|
import { Asset, IntlString, Metadata, Plugin, plugin } from '@hcengineering/platform'
|
||||||
@ -145,7 +145,6 @@ const love = plugin(loveId, {
|
|||||||
ServiceEnpdoint: '' as Metadata<string>
|
ServiceEnpdoint: '' as Metadata<string>
|
||||||
},
|
},
|
||||||
space: {
|
space: {
|
||||||
Rooms: '' as Ref<Space>,
|
|
||||||
Drive: '' as Ref<Drive>
|
Drive: '' as Ref<Drive>
|
||||||
},
|
},
|
||||||
component: {
|
component: {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { IdMap, Ref, toIdMap } from '@hcengineering/core'
|
import core, { IdMap, Ref, toIdMap } from '@hcengineering/core'
|
||||||
import type {
|
import type {
|
||||||
BaseNotificationType,
|
BaseNotificationType,
|
||||||
NotificationGroup,
|
NotificationGroup,
|
||||||
@ -25,7 +25,6 @@
|
|||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import { Grid, Label, ToggleWithLabel } from '@hcengineering/ui'
|
import { Grid, Label, ToggleWithLabel } from '@hcengineering/ui'
|
||||||
import notification from '../plugin'
|
import notification from '../plugin'
|
||||||
import { validateHeaderName } from 'http'
|
|
||||||
|
|
||||||
export let group: Ref<NotificationGroup>
|
export let group: Ref<NotificationGroup>
|
||||||
export let settings: Map<Ref<BaseNotificationType>, NotificationSetting[]>
|
export let settings: Map<Ref<BaseNotificationType>, NotificationSetting[]>
|
||||||
@ -74,7 +73,7 @@
|
|||||||
}
|
}
|
||||||
const current = getSetting(settings, typeId, providerId)
|
const current = getSetting(settings, typeId, providerId)
|
||||||
if (current === undefined) {
|
if (current === undefined) {
|
||||||
await client.createDoc(notification.class.NotificationSetting, notification.space.Notifications, {
|
await client.createDoc(notification.class.NotificationSetting, core.space.Workspace, {
|
||||||
attachedTo: providerId,
|
attachedTo: providerId,
|
||||||
type: typeId,
|
type: typeId,
|
||||||
enabled: value
|
enabled: value
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
isReactionMessage,
|
isReactionMessage,
|
||||||
messageInFocus
|
messageInFocus
|
||||||
} from '@hcengineering/activity-resources'
|
} from '@hcengineering/activity-resources'
|
||||||
import {
|
import core, {
|
||||||
SortingOrder,
|
SortingOrder,
|
||||||
getCurrentAccount,
|
getCurrentAccount,
|
||||||
type Class,
|
type Class,
|
||||||
@ -713,7 +713,7 @@ export async function subscribePush (): Promise<boolean> {
|
|||||||
userVisibleOnly: true,
|
userVisibleOnly: true,
|
||||||
applicationServerKey: publicKey
|
applicationServerKey: publicKey
|
||||||
})
|
})
|
||||||
await client.createDoc(notification.class.PushSubscription, notification.space.Notifications, {
|
await client.createDoc(notification.class.PushSubscription, core.space.Workspace, {
|
||||||
user: getCurrentAccount()._id,
|
user: getCurrentAccount()._id,
|
||||||
endpoint: subscription.endpoint,
|
endpoint: subscription.endpoint,
|
||||||
keys: {
|
keys: {
|
||||||
@ -727,7 +727,7 @@ export async function subscribePush (): Promise<boolean> {
|
|||||||
endpoint: current.endpoint
|
endpoint: current.endpoint
|
||||||
})
|
})
|
||||||
if (exists === undefined) {
|
if (exists === undefined) {
|
||||||
await client.createDoc(notification.class.PushSubscription, notification.space.Notifications, {
|
await client.createDoc(notification.class.PushSubscription, core.space.Workspace, {
|
||||||
user: getCurrentAccount()._id,
|
user: getCurrentAccount()._id,
|
||||||
endpoint: current.endpoint,
|
endpoint: current.endpoint,
|
||||||
keys: {
|
keys: {
|
||||||
|
@ -24,7 +24,6 @@ import {
|
|||||||
Markup,
|
Markup,
|
||||||
Mixin,
|
Mixin,
|
||||||
Ref,
|
Ref,
|
||||||
Space,
|
|
||||||
Timestamp,
|
Timestamp,
|
||||||
Tx,
|
Tx,
|
||||||
TxOperations
|
TxOperations
|
||||||
@ -380,9 +379,6 @@ const notification = plugin(notificationId, {
|
|||||||
Inbox: '' as Asset,
|
Inbox: '' as Asset,
|
||||||
BellCrossed: '' as Asset
|
BellCrossed: '' as Asset
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
Notifications: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
string: {
|
string: {
|
||||||
Notification: '' as IntlString,
|
Notification: '' as IntlString,
|
||||||
Notifications: '' as IntlString,
|
Notifications: '' as IntlString,
|
||||||
|
@ -49,9 +49,6 @@ const preference = plugin(preferenceId, {
|
|||||||
Preference: '' as Ref<Class<Preference>>,
|
Preference: '' as Ref<Class<Preference>>,
|
||||||
SpacePreference: '' as Ref<Class<SpacePreference>>
|
SpacePreference: '' as Ref<Class<SpacePreference>>
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
Preference: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
icon: {
|
icon: {
|
||||||
Star: '' as Asset
|
Star: '' as Asset
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
Person
|
Person
|
||||||
} from '@hcengineering/contact'
|
} from '@hcengineering/contact'
|
||||||
import { ChannelsDropdown, EditableAvatar, PersonPresenter } from '@hcengineering/contact-resources'
|
import { ChannelsDropdown, EditableAvatar, PersonPresenter } from '@hcengineering/contact-resources'
|
||||||
import {
|
import core, {
|
||||||
Account,
|
Account,
|
||||||
AttachedData,
|
AttachedData,
|
||||||
Data,
|
Data,
|
||||||
@ -418,7 +418,7 @@
|
|||||||
const category = findTagCategory(s, categories)
|
const category = findTagCategory(s, categories)
|
||||||
const cinstance = categoriesMap.get(category)
|
const cinstance = categoriesMap.get(category)
|
||||||
e = TxProcessor.createDoc2Doc(
|
e = TxProcessor.createDoc2Doc(
|
||||||
client.txFactory.createTxCreateDoc(tags.class.TagElement, tags.space.Tags, {
|
client.txFactory.createTxCreateDoc(tags.class.TagElement, core.space.Workspace, {
|
||||||
title,
|
title,
|
||||||
description: `Imported skill ${s} of ${cinstance?.label ?? ''}`,
|
description: `Imported skill ${s} of ${cinstance?.label ?? ''}`,
|
||||||
color: getColorNumberByText(s),
|
color: getColorNumberByText(s),
|
||||||
@ -433,7 +433,7 @@
|
|||||||
if (e !== undefined) {
|
if (e !== undefined) {
|
||||||
newSkills.push(
|
newSkills.push(
|
||||||
TxProcessor.createDoc2Doc(
|
TxProcessor.createDoc2Doc(
|
||||||
client.txFactory.createTxCreateDoc(tags.class.TagReference, tags.space.Tags, {
|
client.txFactory.createTxCreateDoc(tags.class.TagReference, core.space.Workspace, {
|
||||||
title: e.title,
|
title: e.title,
|
||||||
color: e.color,
|
color: e.color,
|
||||||
tag: e._id,
|
tag: e._id,
|
||||||
@ -507,7 +507,7 @@
|
|||||||
attachedTo: '' as Ref<Doc>,
|
attachedTo: '' as Ref<Doc>,
|
||||||
attachedToClass: recruit.mixin.Candidate,
|
attachedToClass: recruit.mixin.Candidate,
|
||||||
collection: 'skills',
|
collection: 'skills',
|
||||||
space: tags.space.Tags,
|
space: core.space.Workspace,
|
||||||
modifiedOn: 0,
|
modifiedOn: 0,
|
||||||
modifiedBy: '' as Ref<Account>,
|
modifiedBy: '' as Ref<Account>,
|
||||||
title: tag.title,
|
title: tag.title,
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
import calendar from '@hcengineering/calendar'
|
import calendar from '@hcengineering/calendar'
|
||||||
import type { Contact, PersonAccount, Organization, Person } from '@hcengineering/contact'
|
import type { Contact, PersonAccount, Organization, Person } from '@hcengineering/contact'
|
||||||
import contact from '@hcengineering/contact'
|
import contact from '@hcengineering/contact'
|
||||||
import {
|
import core, {
|
||||||
Account,
|
Account,
|
||||||
Class,
|
Class,
|
||||||
Client,
|
Client,
|
||||||
@ -68,7 +68,7 @@
|
|||||||
attachedTo: candidate,
|
attachedTo: candidate,
|
||||||
attachedToClass: recruit.mixin.Candidate,
|
attachedToClass: recruit.mixin.Candidate,
|
||||||
_class: recruit.class.Review,
|
_class: recruit.class.Review,
|
||||||
space: recruit.space.Reviews,
|
space: core.space.Workspace,
|
||||||
_id: generateId(),
|
_id: generateId(),
|
||||||
collection: 'reviews',
|
collection: 'reviews',
|
||||||
modifiedOn: Date.now(),
|
modifiedOn: Date.now(),
|
||||||
@ -129,7 +129,8 @@
|
|||||||
location,
|
location,
|
||||||
access: 'reader',
|
access: 'reader',
|
||||||
allDay: false,
|
allDay: false,
|
||||||
eventId: ''
|
eventId: '',
|
||||||
|
calendar: undefined
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,11 +13,11 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import type { Attribute, Class, Doc, Mixin, Ref, Space, Status } from '@hcengineering/core'
|
import type { Attribute, Class, Doc, Mixin, Ref, Status } from '@hcengineering/core'
|
||||||
import type { Asset, IntlString, Plugin, Resource } from '@hcengineering/platform'
|
import type { Asset, IntlString, Plugin, Resource } from '@hcengineering/platform'
|
||||||
import { plugin } from '@hcengineering/platform'
|
import { plugin } from '@hcengineering/platform'
|
||||||
import type { ProjectTypeDescriptor, TaskType } from '@hcengineering/task'
|
import type { ProjectTypeDescriptor, TaskType } from '@hcengineering/task'
|
||||||
import { AnyComponent, ResolvedLocation } from '@hcengineering/ui'
|
import { AnyComponent, Location, ResolvedLocation } from '@hcengineering/ui'
|
||||||
import type { Applicant, ApplicantMatch, Candidate, Opinion, Review, Vacancy, VacancyList } from './types'
|
import type { Applicant, ApplicantMatch, Candidate, Opinion, Review, Vacancy, VacancyList } from './types'
|
||||||
|
|
||||||
export * from './types'
|
export * from './types'
|
||||||
@ -84,9 +84,6 @@ const recruit = plugin(recruitId, {
|
|||||||
resolver: {
|
resolver: {
|
||||||
Location: '' as Resource<(loc: Location) => Promise<ResolvedLocation | undefined>>
|
Location: '' as Resource<(loc: Location) => Promise<ResolvedLocation | undefined>>
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
Reviews: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
taskTypes: {
|
taskTypes: {
|
||||||
Applicant: '' as Ref<TaskType>
|
Applicant: '' as Ref<TaskType>
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,11 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import core from '@hcengineering/core'
|
||||||
import login from '@hcengineering/login'
|
import login from '@hcengineering/login'
|
||||||
import presentation, { createQuery, getClient } from '@hcengineering/presentation'
|
import presentation, { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import setting, { InviteSettings } from '@hcengineering/setting'
|
import setting, { InviteSettings } from '@hcengineering/setting'
|
||||||
import { Button, EditBox, MiniToggle, Header, Breadcrumb } from '@hcengineering/ui'
|
import { Breadcrumb, Button, EditBox, Header, MiniToggle } from '@hcengineering/ui'
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
let expTime: number = 48
|
let expTime: number = 48
|
||||||
@ -43,11 +44,11 @@
|
|||||||
enabled: true
|
enabled: true
|
||||||
}
|
}
|
||||||
if (existingInviteSettings.length === 0) {
|
if (existingInviteSettings.length === 0) {
|
||||||
await client.createDoc(setting.class.InviteSettings, setting.space.Setting, newSettings)
|
await client.createDoc(setting.class.InviteSettings, core.space.Workspace, newSettings)
|
||||||
} else {
|
} else {
|
||||||
await client.updateDoc(
|
await client.updateDoc(
|
||||||
setting.class.InviteSettings,
|
setting.class.InviteSettings,
|
||||||
setting.space.Setting,
|
core.space.Workspace,
|
||||||
existingInviteSettings[0]._id,
|
existingInviteSettings[0]._id,
|
||||||
newSettings
|
newSettings
|
||||||
)
|
)
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getCurrentAccount } from '@hcengineering/core'
|
import core, { getCurrentAccount } from '@hcengineering/core'
|
||||||
import { getResource, translate } from '@hcengineering/platform'
|
import { getResource, translate } from '@hcengineering/platform'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import type { Integration, IntegrationType } from '@hcengineering/setting'
|
import type { Integration, IntegrationType } from '@hcengineering/setting'
|
||||||
@ -62,7 +62,7 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (integration === undefined) {
|
if (integration === undefined) {
|
||||||
const id = await client.createDoc(setting.class.Integration, setting.space.Setting, {
|
const id = await client.createDoc(setting.class.Integration, core.space.Workspace, {
|
||||||
type: integrationType._id,
|
type: integrationType._id,
|
||||||
value: '',
|
value: '',
|
||||||
disabled: false
|
disabled: false
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AvatarType } from '@hcengineering/contact'
|
import { AvatarType } from '@hcengineering/contact'
|
||||||
import { EditableAvatar } from '@hcengineering/contact-resources'
|
import { EditableAvatar } from '@hcengineering/contact-resources'
|
||||||
|
import core from '@hcengineering/core'
|
||||||
import { getEmbeddedLabel } from '@hcengineering/platform'
|
import { getEmbeddedLabel } from '@hcengineering/platform'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import { WorkspaceSetting } from '@hcengineering/setting'
|
import { WorkspaceSetting } from '@hcengineering/setting'
|
||||||
@ -35,7 +36,7 @@
|
|||||||
const avatar = await avatarEditor.createAvatar()
|
const avatar = await avatarEditor.createAvatar()
|
||||||
await client.createDoc(
|
await client.createDoc(
|
||||||
setting.class.WorkspaceSetting,
|
setting.class.WorkspaceSetting,
|
||||||
setting.space.Setting,
|
core.space.Workspace,
|
||||||
{ icon: avatar.avatar },
|
{ icon: avatar.avatar },
|
||||||
setting.ids.WorkspaceSetting
|
setting.ids.WorkspaceSetting
|
||||||
)
|
)
|
||||||
|
@ -13,13 +13,13 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import type { Account, AccountRole, Blob, Class, Configuration, Doc, Mixin, Ref, Space } from '@hcengineering/core'
|
import type { Account, AccountRole, Blob, Class, Configuration, Doc, Mixin, Ref } from '@hcengineering/core'
|
||||||
import type { Plugin } from '@hcengineering/platform'
|
import type { Plugin } from '@hcengineering/platform'
|
||||||
import { Asset, IntlString, plugin, Resource } from '@hcengineering/platform'
|
import { Asset, IntlString, Resource, plugin } from '@hcengineering/platform'
|
||||||
|
import { TemplateField, TemplateFieldCategory } from '@hcengineering/templates'
|
||||||
import { AnyComponent } from '@hcengineering/ui'
|
import { AnyComponent } from '@hcengineering/ui'
|
||||||
import { TemplateFieldCategory, TemplateField } from '@hcengineering/templates'
|
|
||||||
|
|
||||||
import { SpaceTypeEditor, SpaceTypeCreator } from './spaceTypeEditor'
|
import { SpaceTypeCreator, SpaceTypeEditor } from './spaceTypeEditor'
|
||||||
|
|
||||||
export * from './spaceTypeEditor'
|
export * from './spaceTypeEditor'
|
||||||
export * from './utils'
|
export * from './utils'
|
||||||
@ -137,9 +137,6 @@ export default plugin(settingId, {
|
|||||||
SpaceTypeEditor: '' as Ref<Mixin<SpaceTypeEditor>>,
|
SpaceTypeEditor: '' as Ref<Mixin<SpaceTypeEditor>>,
|
||||||
SpaceTypeCreator: '' as Ref<Mixin<SpaceTypeCreator>>
|
SpaceTypeCreator: '' as Ref<Mixin<SpaceTypeCreator>>
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
Setting: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
class: {
|
class: {
|
||||||
SettingsCategory: '' as Ref<Class<SettingsCategory>>,
|
SettingsCategory: '' as Ref<Class<SettingsCategory>>,
|
||||||
WorkspaceSettingCategory: '' as Ref<Class<SettingsCategory>>,
|
WorkspaceSettingCategory: '' as Ref<Class<SettingsCategory>>,
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
// Copyright © 2022 Hardcore Engineering Inc.
|
// Copyright © 2022 Hardcore Engineering Inc.
|
||||||
|
|
||||||
import { type Class, type Data, type Doc, type DocumentQuery, type FindResult, type Ref } from '@hcengineering/core'
|
import core, {
|
||||||
|
type Class,
|
||||||
|
type Data,
|
||||||
|
type Doc,
|
||||||
|
type DocumentQuery,
|
||||||
|
type FindResult,
|
||||||
|
type Ref
|
||||||
|
} from '@hcengineering/core'
|
||||||
import { type Asset } from '@hcengineering/platform'
|
import { type Asset } from '@hcengineering/platform'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import { type InitialKnowledge, type TagCategory, type TagElement, type TagReference } from '@hcengineering/tags'
|
import { type InitialKnowledge, type TagCategory, type TagElement, type TagReference } from '@hcengineering/tags'
|
||||||
@ -81,5 +88,5 @@ export async function createTagElement (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
return await client.createDoc<TagElement>(tags.class.TagElement, tags.space.Tags, tagElement)
|
return await client.createDoc<TagElement>(tags.class.TagElement, core.space.Workspace, tagElement)
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import type { AttachedDoc, Class, Doc, Ref, Space } from '@hcengineering/core'
|
import type { AttachedDoc, Class, Doc, Ref } from '@hcengineering/core'
|
||||||
import type { Asset, IntlString, Plugin } from '@hcengineering/platform'
|
import type { Asset, IntlString, Plugin } from '@hcengineering/platform'
|
||||||
import { plugin } from '@hcengineering/platform'
|
import { plugin } from '@hcengineering/platform'
|
||||||
import { AnyComponent } from '@hcengineering/ui'
|
import { AnyComponent } from '@hcengineering/ui'
|
||||||
@ -89,9 +89,6 @@ const tagsPlugin = plugin(tagsId, {
|
|||||||
TagReference: '' as Ref<Class<TagReference>>,
|
TagReference: '' as Ref<Class<TagReference>>,
|
||||||
TagCategory: '' as Ref<Class<TagCategory>>
|
TagCategory: '' as Ref<Class<TagCategory>>
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
Tags: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
icon: {
|
icon: {
|
||||||
Tags: '' as Asset,
|
Tags: '' as Asset,
|
||||||
Level1: '' as Asset,
|
Level1: '' as Asset,
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
import { AttachmentRefInput } from '@hcengineering/attachment-resources'
|
import { AttachmentRefInput } from '@hcengineering/attachment-resources'
|
||||||
import contact, { Channel, Contact, Person, PersonAccount, getName as getContactName } from '@hcengineering/contact'
|
import contact, { Channel, Contact, Person, PersonAccount, getName as getContactName } from '@hcengineering/contact'
|
||||||
import { Avatar, personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
|
import { Avatar, personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
|
||||||
import { IdMap, Ref, SortingOrder, generateId, getCurrentAccount } from '@hcengineering/core'
|
import core, { IdMap, Ref, SortingOrder, generateId, getCurrentAccount } from '@hcengineering/core'
|
||||||
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
||||||
import { getEmbeddedLabel, getResource } from '@hcengineering/platform'
|
import { getEmbeddedLabel, getResource } from '@hcengineering/platform'
|
||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
@ -117,7 +117,7 @@
|
|||||||
const { message, attachments } = event.detail
|
const { message, attachments } = event.detail
|
||||||
await client.addCollection(
|
await client.addCollection(
|
||||||
telegram.class.NewMessage,
|
telegram.class.NewMessage,
|
||||||
telegram.space.Telegram,
|
core.space.Workspace,
|
||||||
channel._id,
|
channel._id,
|
||||||
channel._class,
|
channel._class,
|
||||||
'newMessages',
|
'newMessages',
|
||||||
@ -173,7 +173,7 @@
|
|||||||
|
|
||||||
async function onConnectClose (res: any): Promise<void> {
|
async function onConnectClose (res: any): Promise<void> {
|
||||||
if (res?.value) {
|
if (res?.value) {
|
||||||
await client.createDoc(setting.class.Integration, setting.space.Setting, {
|
await client.createDoc(setting.class.Integration, core.space.Workspace, {
|
||||||
type: telegram.integrationType.Telegram,
|
type: telegram.integrationType.Telegram,
|
||||||
value: res.value,
|
value: res.value,
|
||||||
disabled: false
|
disabled: false
|
||||||
@ -295,7 +295,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{:else if integration !== undefined && !integration.disabled}
|
{:else if integration !== undefined && !integration.disabled}
|
||||||
<AttachmentRefInput
|
<AttachmentRefInput
|
||||||
space={telegram.space.Telegram}
|
space={core.space.Workspace}
|
||||||
_class={telegram.class.NewMessage}
|
_class={telegram.class.NewMessage}
|
||||||
{objectId}
|
{objectId}
|
||||||
on:message={onMessage}
|
on:message={onMessage}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import { ChannelItem } from '@hcengineering/contact'
|
import { ChannelItem } from '@hcengineering/contact'
|
||||||
import type { AttachedDoc, Class, Doc, Ref, Space, Timestamp } from '@hcengineering/core'
|
import type { AttachedDoc, Class, Doc, Ref, Timestamp } from '@hcengineering/core'
|
||||||
import { NotificationType } from '@hcengineering/notification'
|
import { NotificationType } from '@hcengineering/notification'
|
||||||
import type { Plugin } from '@hcengineering/platform'
|
import type { Plugin } from '@hcengineering/platform'
|
||||||
import { Metadata, plugin } from '@hcengineering/platform'
|
import { Metadata, plugin } from '@hcengineering/platform'
|
||||||
@ -86,10 +86,6 @@ export default plugin(telegramId, {
|
|||||||
SharedMessage: '' as Ref<Class<SharedTelegramMessage>>,
|
SharedMessage: '' as Ref<Class<SharedTelegramMessage>>,
|
||||||
SharedMessages: '' as Ref<Class<SharedTelegramMessages>>
|
SharedMessages: '' as Ref<Class<SharedTelegramMessages>>
|
||||||
},
|
},
|
||||||
space: {
|
|
||||||
// todo should be removed
|
|
||||||
Telegram: '' as Ref<Space>
|
|
||||||
},
|
|
||||||
templateField: {
|
templateField: {
|
||||||
CurrentEmployeeTelegram: '' as Ref<TemplateField>,
|
CurrentEmployeeTelegram: '' as Ref<TemplateField>,
|
||||||
IntegrationOwnerTG: '' as Ref<TemplateField>
|
IntegrationOwnerTG: '' as Ref<TemplateField>
|
||||||
|
@ -267,7 +267,7 @@
|
|||||||
attachedTo: '' as Ref<Doc>,
|
attachedTo: '' as Ref<Doc>,
|
||||||
attachedToClass: tracker.class.Issue,
|
attachedToClass: tracker.class.Issue,
|
||||||
collection: 'labels',
|
collection: 'labels',
|
||||||
space: tags.space.Tags,
|
space: core.space.Workspace,
|
||||||
modifiedOn: 0,
|
modifiedOn: 0,
|
||||||
modifiedBy: '' as Ref<Account>,
|
modifiedBy: '' as Ref<Account>,
|
||||||
title: tag.title,
|
title: tag.title,
|
||||||
|
@ -1,91 +0,0 @@
|
|||||||
<!--
|
|
||||||
// Copyright © 2022 Anticrm Platform Contributors.
|
|
||||||
//
|
|
||||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License. You may
|
|
||||||
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
//
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
-->
|
|
||||||
<script lang="ts">
|
|
||||||
import ui, { Label, Icon } from '@hcengineering/ui'
|
|
||||||
import { createEventDispatcher, onMount } from 'svelte'
|
|
||||||
import { FilterAction } from '../utils'
|
|
||||||
|
|
||||||
export let actions: FilterAction[] = []
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
|
||||||
const actionElements: HTMLButtonElement[] = []
|
|
||||||
|
|
||||||
const keyDown = (event: KeyboardEvent, index: number) => {
|
|
||||||
if (event.key === 'ArrowDown') {
|
|
||||||
actionElements[(index + 1) % actionElements.length].focus()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.key === 'ArrowUp') {
|
|
||||||
actionElements[(actionElements.length + index - 1) % actionElements.length].focus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
actionElements[0]?.focus()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="antiPopup">
|
|
||||||
<div class="ap-space" />
|
|
||||||
<div class="ap-scroll">
|
|
||||||
<div class="ap-box">
|
|
||||||
{#if actions.length === 0}
|
|
||||||
<div class="p-6 error-color">
|
|
||||||
<Label label={ui.string.NoActionsDefined} />
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{#each actions as action, i}
|
|
||||||
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
||||||
<button
|
|
||||||
bind:this={actionElements[i]}
|
|
||||||
class="ap-menuItem flex-row-center withIcon"
|
|
||||||
on:keydown={(event) => {
|
|
||||||
keyDown(event, i)
|
|
||||||
}}
|
|
||||||
on:mouseover={(event) => {
|
|
||||||
event.currentTarget.focus()
|
|
||||||
}}
|
|
||||||
on:click={(event) => {
|
|
||||||
dispatch('close')
|
|
||||||
|
|
||||||
action.onSelect(event)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{#if action.icon}
|
|
||||||
<div class="icon"><Icon icon={action.icon} size={'small'} /></div>
|
|
||||||
{/if}
|
|
||||||
{#if action.label}
|
|
||||||
<div class="ml-3 pr-1"><Label label={action.label} /></div>
|
|
||||||
{/if}
|
|
||||||
</button>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ap-space" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.withIcon {
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
color: var(--content-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus .icon {
|
|
||||||
color: var(--accent-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,137 +0,0 @@
|
|||||||
<!--
|
|
||||||
// Copyright © 2022 Anticrm Platform Contributors.
|
|
||||||
//
|
|
||||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License. You may
|
|
||||||
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
//
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
-->
|
|
||||||
<script lang="ts">
|
|
||||||
import ui, { Label, Icon, CheckBox } from '@hcengineering/ui'
|
|
||||||
import { createEventDispatcher, onMount } from 'svelte'
|
|
||||||
import { FilterSectionElement } from '../utils'
|
|
||||||
|
|
||||||
export let actions: FilterSectionElement[] = []
|
|
||||||
export let onBack: (() => void) | undefined = undefined
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
|
||||||
const actionElements: HTMLButtonElement[] = []
|
|
||||||
|
|
||||||
$: selectedElementsMap = getSelectedElementsMap(actions)
|
|
||||||
|
|
||||||
const getSelectedElementsMap = (actions: FilterSectionElement[]) => {
|
|
||||||
const result: Record<number, boolean> = {}
|
|
||||||
|
|
||||||
for (let i = onBack ? 1 : 0; i < actions.length; ++i) {
|
|
||||||
result[i] = !!actions[i].isSelected
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
const keyDown = (event: KeyboardEvent, index: number) => {
|
|
||||||
if (event.key === 'ArrowDown') {
|
|
||||||
actionElements[(index + 1) % actionElements.length].focus()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.key === 'ArrowUp') {
|
|
||||||
actionElements[(actionElements.length + index - 1) % actionElements.length].focus()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.key === 'ArrowLeft') {
|
|
||||||
dispatch('close')
|
|
||||||
|
|
||||||
onBack?.()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
if (actionElements[0]) actionElements[0].focus()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="antiPopup">
|
|
||||||
<div class="ap-space" />
|
|
||||||
<div class="ap-scroll">
|
|
||||||
<div class="ap-box">
|
|
||||||
{#if actions.length === 0}
|
|
||||||
<div class="p-6 error-color">
|
|
||||||
<Label label={ui.string.NoActionsDefined} />
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{#each actions as action, i}
|
|
||||||
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
||||||
<button
|
|
||||||
bind:this={actionElements[i]}
|
|
||||||
class="ap-menuItem flex-row-center withIcon"
|
|
||||||
on:keydown={(event) => {
|
|
||||||
keyDown(event, i)
|
|
||||||
}}
|
|
||||||
on:mouseover={(event) => {
|
|
||||||
event.currentTarget.focus()
|
|
||||||
}}
|
|
||||||
on:click={(event) => {
|
|
||||||
if (i === 0 && onBack) {
|
|
||||||
dispatch('close')
|
|
||||||
}
|
|
||||||
|
|
||||||
action.onSelect(event)
|
|
||||||
|
|
||||||
if (i !== 0 || !onBack) {
|
|
||||||
selectedElementsMap[i] = !selectedElementsMap[i]
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div class="buttonContent">
|
|
||||||
{#if i !== 0 || (i === 0 && !onBack)}
|
|
||||||
<div class="flex check pointer-events-none">
|
|
||||||
<CheckBox checked={selectedElementsMap[i]} kind={'primary'} />
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{#if action.icon}
|
|
||||||
<div class="icon" class:ml-3={i > 0 || (i === 0 && !onBack)}>
|
|
||||||
<Icon icon={action.icon} size={'small'} />
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{#if action.title}
|
|
||||||
<div class="ml-3 pr-1">{action.title}</div>
|
|
||||||
{/if}
|
|
||||||
{#if action.count !== undefined}
|
|
||||||
<div class="pr-1 countContent">{action.count}</div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ap-space" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.buttonContent {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.countContent {
|
|
||||||
color: var(--content-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.withIcon {
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
color: var(--content-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus .icon {
|
|
||||||
color: var(--accent-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -14,7 +14,7 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AttachmentStyledBox } from '@hcengineering/attachment-resources'
|
import { AttachmentStyledBox } from '@hcengineering/attachment-resources'
|
||||||
import { Account, Doc, generateId, Ref } from '@hcengineering/core'
|
import core, { Account, Doc, generateId, Ref } from '@hcengineering/core'
|
||||||
import presentation, { DraftController, getClient, KeyedAttribute } from '@hcengineering/presentation'
|
import presentation, { DraftController, getClient, KeyedAttribute } from '@hcengineering/presentation'
|
||||||
import tags, { TagElement, TagReference } from '@hcengineering/tags'
|
import tags, { TagElement, TagReference } from '@hcengineering/tags'
|
||||||
import { TaskType } from '@hcengineering/task'
|
import { TaskType } from '@hcengineering/task'
|
||||||
@ -135,7 +135,7 @@
|
|||||||
attachedTo: '' as Ref<Doc>,
|
attachedTo: '' as Ref<Doc>,
|
||||||
attachedToClass: tracker.class.Issue,
|
attachedToClass: tracker.class.Issue,
|
||||||
collection: 'labels',
|
collection: 'labels',
|
||||||
space: tags.space.Tags,
|
space: core.space.Workspace,
|
||||||
modifiedOn: 0,
|
modifiedOn: 0,
|
||||||
modifiedBy: '' as Ref<Account>,
|
modifiedBy: '' as Ref<Account>,
|
||||||
title: tag.title,
|
title: tag.title,
|
||||||
|
@ -35,15 +35,12 @@ import core, {
|
|||||||
type TxResult,
|
type TxResult,
|
||||||
type TxUpdateDoc
|
type TxUpdateDoc
|
||||||
} from '@hcengineering/core'
|
} from '@hcengineering/core'
|
||||||
import { type Asset, type IntlString } from '@hcengineering/platform'
|
import { type IntlString } from '@hcengineering/platform'
|
||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import task, { getStatusIndex, makeRank, type ProjectType } from '@hcengineering/task'
|
import task, { getStatusIndex, makeRank, type ProjectType } from '@hcengineering/task'
|
||||||
import { activeProjects as taskActiveProjects, taskTypeStore } from '@hcengineering/task-resources'
|
import { activeProjects as taskActiveProjects, taskTypeStore } from '@hcengineering/task-resources'
|
||||||
import {
|
import {
|
||||||
IssuePriority,
|
IssuePriority,
|
||||||
IssuesDateModificationPeriod,
|
|
||||||
IssuesGrouping,
|
|
||||||
IssuesOrdering,
|
|
||||||
MilestoneStatus,
|
MilestoneStatus,
|
||||||
TimeReportDayType,
|
TimeReportDayType,
|
||||||
type Component,
|
type Component,
|
||||||
@ -52,23 +49,9 @@ import {
|
|||||||
type Milestone,
|
type Milestone,
|
||||||
type Project
|
type Project
|
||||||
} from '@hcengineering/tracker'
|
} from '@hcengineering/tracker'
|
||||||
import {
|
import { PaletteColorIndexes, areDatesEqual, isWeekend } from '@hcengineering/ui'
|
||||||
MILLISECONDS_IN_WEEK,
|
|
||||||
PaletteColorIndexes,
|
|
||||||
areDatesEqual,
|
|
||||||
getMillisecondsInMonth,
|
|
||||||
isWeekend,
|
|
||||||
type AnyComponent,
|
|
||||||
type AnySvelteComponent
|
|
||||||
} from '@hcengineering/ui'
|
|
||||||
import { type KeyFilter, type ViewletDescriptor } from '@hcengineering/view'
|
import { type KeyFilter, type ViewletDescriptor } from '@hcengineering/view'
|
||||||
import {
|
import { CategoryQuery, ListSelectionProvider, statusStore, type SelectDirection } from '@hcengineering/view-resources'
|
||||||
CategoryQuery,
|
|
||||||
ListSelectionProvider,
|
|
||||||
groupBy,
|
|
||||||
statusStore,
|
|
||||||
type SelectDirection
|
|
||||||
} from '@hcengineering/view-resources'
|
|
||||||
import { derived, get } from 'svelte/store'
|
import { derived, get } from 'svelte/store'
|
||||||
import tracker from './plugin'
|
import tracker from './plugin'
|
||||||
import { defaultMilestoneStatuses, defaultPriorities } from './types'
|
import { defaultMilestoneStatuses, defaultPriorities } from './types'
|
||||||
@ -81,164 +64,6 @@ export const activeProjects = derived(taskActiveProjects, (projects) => {
|
|||||||
})
|
})
|
||||||
export * from './types'
|
export * from './types'
|
||||||
|
|
||||||
export const UNSET_COLOR = -1
|
|
||||||
|
|
||||||
export interface NavigationItem {
|
|
||||||
id: string
|
|
||||||
label: IntlString
|
|
||||||
icon: Asset
|
|
||||||
component: AnyComponent
|
|
||||||
componentProps?: Record<string, string>
|
|
||||||
top: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Selection {
|
|
||||||
currentProject?: Ref<Project>
|
|
||||||
currentSpecial?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type IssuesGroupByKeys = keyof Pick<Issue, 'status' | 'priority' | 'assignee' | 'component' | 'milestone'>
|
|
||||||
export type IssuesOrderByKeys = keyof Pick<Issue, 'status' | 'priority' | 'modifiedOn' | 'dueDate' | 'rank'>
|
|
||||||
|
|
||||||
export const issuesGroupKeyMap: Record<IssuesGrouping, IssuesGroupByKeys | undefined> = {
|
|
||||||
[IssuesGrouping.Status]: 'status',
|
|
||||||
[IssuesGrouping.Priority]: 'priority',
|
|
||||||
[IssuesGrouping.Assignee]: 'assignee',
|
|
||||||
[IssuesGrouping.Component]: 'component',
|
|
||||||
[IssuesGrouping.Milestone]: 'milestone',
|
|
||||||
[IssuesGrouping.NoGrouping]: undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
export const issuesOrderKeyMap: Record<IssuesOrdering, IssuesOrderByKeys> = {
|
|
||||||
[IssuesOrdering.Status]: 'status',
|
|
||||||
[IssuesOrdering.Priority]: 'priority',
|
|
||||||
[IssuesOrdering.LastUpdated]: 'modifiedOn',
|
|
||||||
[IssuesOrdering.DueDate]: 'dueDate',
|
|
||||||
[IssuesOrdering.Manual]: 'rank'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const issuesGroupEditorMap: Record<'status' | 'priority' | 'component' | 'milestone', AnyComponent | undefined> =
|
|
||||||
{
|
|
||||||
status: tracker.component.StatusEditor,
|
|
||||||
priority: tracker.component.PriorityEditor,
|
|
||||||
component: tracker.component.ComponentEditor,
|
|
||||||
milestone: tracker.component.MilestoneEditor
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getIssuesModificationDatePeriodTime = (period: IssuesDateModificationPeriod | null): number => {
|
|
||||||
const today = new Date(Date.now())
|
|
||||||
|
|
||||||
switch (period) {
|
|
||||||
case IssuesDateModificationPeriod.PastWeek: {
|
|
||||||
return today.getTime() - MILLISECONDS_IN_WEEK
|
|
||||||
}
|
|
||||||
case IssuesDateModificationPeriod.PastMonth: {
|
|
||||||
return today.getTime() - getMillisecondsInMonth(today)
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FilterAction {
|
|
||||||
icon?: Asset | AnySvelteComponent
|
|
||||||
label?: IntlString
|
|
||||||
onSelect: (event: MouseEvent | KeyboardEvent) => void
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FilterSectionElement extends Omit<FilterAction, 'label'> {
|
|
||||||
title?: string
|
|
||||||
count?: number
|
|
||||||
isSelected?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IssueFilter {
|
|
||||||
mode: '$in' | '$nin'
|
|
||||||
query: DocumentQuery<Issue>
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getGroupedIssues = (
|
|
||||||
key: IssuesGroupByKeys | undefined,
|
|
||||||
elements: Issue[],
|
|
||||||
orderedCategories?: any[]
|
|
||||||
): Record<string, Issue[]> => {
|
|
||||||
if (key === undefined) {
|
|
||||||
return { [undefined as any]: elements }
|
|
||||||
}
|
|
||||||
|
|
||||||
const unorderedIssues = groupBy(elements, key)
|
|
||||||
|
|
||||||
if (orderedCategories === undefined || orderedCategories.length === 0) {
|
|
||||||
return unorderedIssues
|
|
||||||
}
|
|
||||||
|
|
||||||
return Object.keys(unorderedIssues)
|
|
||||||
.sort((o1, o2) => {
|
|
||||||
const key1 = o1 === 'null' ? null : o1
|
|
||||||
const key2 = o2 === 'null' ? null : o2
|
|
||||||
|
|
||||||
const i1 = orderedCategories.findIndex((x) => x === key1)
|
|
||||||
const i2 = orderedCategories.findIndex((x) => x === key2)
|
|
||||||
|
|
||||||
return i1 - i2
|
|
||||||
})
|
|
||||||
.reduce((obj: Record<string, any[]>, objKey) => {
|
|
||||||
obj[objKey] = unorderedIssues[objKey]
|
|
||||||
return obj
|
|
||||||
}, {})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getIssueFilterAssetsByType = (type: string): { icon: Asset, label: IntlString } | undefined => {
|
|
||||||
switch (type) {
|
|
||||||
case 'status': {
|
|
||||||
return {
|
|
||||||
icon: tracker.icon.CategoryBacklog,
|
|
||||||
label: tracker.string.Status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 'priority': {
|
|
||||||
return {
|
|
||||||
icon: tracker.icon.PriorityHigh,
|
|
||||||
label: tracker.string.Priority
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 'component': {
|
|
||||||
return {
|
|
||||||
icon: tracker.icon.Component,
|
|
||||||
label: tracker.string.Component
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 'milestone': {
|
|
||||||
return {
|
|
||||||
icon: tracker.icon.Milestone,
|
|
||||||
label: tracker.string.Milestone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getArraysIntersection = (a: any[], b: any[]): any[] => {
|
|
||||||
const setB = new Set(b)
|
|
||||||
const intersection = new Set(a.filter((x) => setB.has(x)))
|
|
||||||
|
|
||||||
return Array.from(intersection)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getArraysUnion = (a: any[], b: any[]): any[] => {
|
|
||||||
const setB = new Set(b)
|
|
||||||
const union = new Set(a)
|
|
||||||
|
|
||||||
for (const element of setB) {
|
|
||||||
union.add(element)
|
|
||||||
}
|
|
||||||
|
|
||||||
return Array.from(union)
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ComponentsFilterMode = 'all' | 'backlog' | 'active' | 'closed'
|
export type ComponentsFilterMode = 'all' | 'backlog' | 'active' | 'closed'
|
||||||
|
|
||||||
export type MilestoneViewMode = 'all' | 'planned' | 'active' | 'closed'
|
export type MilestoneViewMode = 'all' | 'planned' | 'active' | 'closed'
|
||||||
|
@ -13,18 +13,17 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createEventDispatcher } from 'svelte'
|
import core, { AnyAttribute, Class, Doc, Ref, Type } from '@hcengineering/core'
|
||||||
import core, { AnyAttribute, ArrOf, Class, Doc, Ref, Type } from '@hcengineering/core'
|
|
||||||
import { Asset, IntlString } from '@hcengineering/platform'
|
import { Asset, IntlString } from '@hcengineering/platform'
|
||||||
import preferencePlugin from '@hcengineering/preference'
|
|
||||||
import { createQuery, getAttributePresenterClass, getClient, hasResource } from '@hcengineering/presentation'
|
import { createQuery, getAttributePresenterClass, getClient, hasResource } from '@hcengineering/presentation'
|
||||||
import { Loading, resizeObserver } from '@hcengineering/ui'
|
import { Loading, resizeObserver } from '@hcengineering/ui'
|
||||||
|
import DropdownLabelsIntl from '@hcengineering/ui/src/components/DropdownLabelsIntl.svelte'
|
||||||
import { BuildModelKey, Viewlet, ViewletPreference } from '@hcengineering/view'
|
import { BuildModelKey, Viewlet, ViewletPreference } from '@hcengineering/view'
|
||||||
import { deepEqual } from 'fast-equals'
|
import { deepEqual } from 'fast-equals'
|
||||||
|
import { createEventDispatcher } from 'svelte'
|
||||||
import view from '../plugin'
|
import view from '../plugin'
|
||||||
import { buildConfigLookup, getKeyLabel } from '../utils'
|
import { buildConfigLookup, getKeyLabel } from '../utils'
|
||||||
import ViewletClassSettings from './ViewletClassSettings.svelte'
|
import ViewletClassSettings from './ViewletClassSettings.svelte'
|
||||||
import DropdownLabelsIntl from '@hcengineering/ui/src/components/DropdownLabelsIntl.svelte'
|
|
||||||
|
|
||||||
export let viewlet: Viewlet
|
export let viewlet: Viewlet
|
||||||
|
|
||||||
@ -273,7 +272,7 @@
|
|||||||
config
|
config
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await client.createDoc(view.class.ViewletPreference, preferencePlugin.space.Preference, {
|
await client.createDoc(view.class.ViewletPreference, core.space.Workspace, {
|
||||||
attachedTo: viewletId,
|
attachedTo: viewletId,
|
||||||
config
|
config
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Class, Doc, Ref, getCurrentAccount } from '@hcengineering/core'
|
import core, { Class, Doc, Ref, getCurrentAccount } from '@hcengineering/core'
|
||||||
import preference from '@hcengineering/preference'
|
|
||||||
import { Card, getClient } from '@hcengineering/presentation'
|
import { Card, getClient } from '@hcengineering/presentation'
|
||||||
import { Button, EditBox, ToggleWithLabel, getCurrentResolvedLocation } from '@hcengineering/ui'
|
import { Button, EditBox, ToggleWithLabel, getCurrentResolvedLocation } from '@hcengineering/ui'
|
||||||
import { ViewOptions } from '@hcengineering/view'
|
import { ViewOptions } from '@hcengineering/view'
|
||||||
@ -22,7 +21,7 @@
|
|||||||
const loc = getCurrentResolvedLocation()
|
const loc = getCurrentResolvedLocation()
|
||||||
loc.fragment = undefined
|
loc.fragment = undefined
|
||||||
const filters = JSON.stringify($filterStore)
|
const filters = JSON.stringify($filterStore)
|
||||||
await client.createDoc(view.class.FilteredView, preference.space.Preference, {
|
await client.createDoc(view.class.FilteredView, core.space.Workspace, {
|
||||||
name: filterName,
|
name: filterName,
|
||||||
location: loc,
|
location: loc,
|
||||||
filterClass: _class,
|
filterClass: _class,
|
||||||
|
@ -13,13 +13,12 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getCurrentAccount, type Ref } from '@hcengineering/core'
|
import core, { getCurrentAccount, type Ref } from '@hcengineering/core'
|
||||||
import type { Application } from '@hcengineering/workbench'
|
import type { Application } from '@hcengineering/workbench'
|
||||||
import { createQuery } from '@hcengineering/presentation'
|
import { createQuery } from '@hcengineering/presentation'
|
||||||
import workbench from '@hcengineering/workbench'
|
import workbench from '@hcengineering/workbench'
|
||||||
import { hideApplication, isAppAllowed, showApplication } from '../utils'
|
import { hideApplication, isAppAllowed, showApplication } from '../utils'
|
||||||
import { Loading, IconCheck, Label, Icon } from '@hcengineering/ui'
|
import { Loading, IconCheck, Label, Icon } from '@hcengineering/ui'
|
||||||
import preference from '@hcengineering/preference'
|
|
||||||
// import Drag from './icons/Drag.svelte'
|
// import Drag from './icons/Drag.svelte'
|
||||||
|
|
||||||
export let apps: Application[] = []
|
export let apps: Application[] = []
|
||||||
@ -59,7 +58,7 @@
|
|||||||
hiddenAppsIdsQuery.query(
|
hiddenAppsIdsQuery.query(
|
||||||
workbench.class.HiddenApplication,
|
workbench.class.HiddenApplication,
|
||||||
{
|
{
|
||||||
space: preference.space.Preference
|
space: core.space.Workspace
|
||||||
},
|
},
|
||||||
(res) => {
|
(res) => {
|
||||||
hiddenAppsIds = res.map((r) => r.attachedTo)
|
hiddenAppsIds = res.map((r) => r.attachedTo)
|
||||||
|
@ -13,14 +13,13 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getCurrentAccount, type Ref } from '@hcengineering/core'
|
import core, { getCurrentAccount, type Ref } from '@hcengineering/core'
|
||||||
import { createQuery } from '@hcengineering/presentation'
|
import { createQuery } from '@hcengineering/presentation'
|
||||||
import { Scroller } from '@hcengineering/ui'
|
import { Scroller } from '@hcengineering/ui'
|
||||||
import { NavLink } from '@hcengineering/view-resources'
|
import { NavLink } from '@hcengineering/view-resources'
|
||||||
import type { Application } from '@hcengineering/workbench'
|
import type { Application } from '@hcengineering/workbench'
|
||||||
import workbench from '@hcengineering/workbench'
|
import workbench from '@hcengineering/workbench'
|
||||||
|
|
||||||
import preference from '@hcengineering/preference'
|
|
||||||
import { isAppAllowed } from '../utils'
|
import { isAppAllowed } from '../utils'
|
||||||
import AppItem from './AppItem.svelte'
|
import AppItem from './AppItem.svelte'
|
||||||
|
|
||||||
@ -34,7 +33,7 @@
|
|||||||
hiddenAppsIdsQuery.query(
|
hiddenAppsIdsQuery.query(
|
||||||
workbench.class.HiddenApplication,
|
workbench.class.HiddenApplication,
|
||||||
{
|
{
|
||||||
space: preference.space.Preference
|
space: core.space.Workspace
|
||||||
},
|
},
|
||||||
(res) => {
|
(res) => {
|
||||||
hiddenAppsIds = res.map((r) => r.attachedTo)
|
hiddenAppsIds = res.map((r) => r.attachedTo)
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Doc, Ref, Space } from '@hcengineering/core'
|
import core, { Doc, Ref, Space, AccountRole, getCurrentAccount, hasAccountRole } from '@hcengineering/core'
|
||||||
import { AccountRole, getCurrentAccount, hasAccountRole } from '@hcengineering/core'
|
|
||||||
import { IntlString, getResource } from '@hcengineering/platform'
|
import { IntlString, getResource } from '@hcengineering/platform'
|
||||||
import preference from '@hcengineering/preference'
|
import preference from '@hcengineering/preference'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
@ -75,7 +74,7 @@
|
|||||||
label: preference.string.Star,
|
label: preference.string.Star,
|
||||||
icon: preference.icon.Star,
|
icon: preference.icon.Star,
|
||||||
action: async (_id: Ref<Space>): Promise<void> => {
|
action: async (_id: Ref<Space>): Promise<void> => {
|
||||||
await client.createDoc(preference.class.SpacePreference, preference.space.Preference, {
|
await client.createDoc(preference.class.SpacePreference, core.space.Workspace, {
|
||||||
attachedTo: _id
|
attachedTo: _id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ import core, { hasAccountRole } from '@hcengineering/core'
|
|||||||
import type { Workspace } from '@hcengineering/login'
|
import type { Workspace } from '@hcengineering/login'
|
||||||
import login, { loginId } from '@hcengineering/login'
|
import login, { loginId } from '@hcengineering/login'
|
||||||
import { getResource, setMetadata } from '@hcengineering/platform'
|
import { getResource, setMetadata } from '@hcengineering/platform'
|
||||||
import preference from '@hcengineering/preference'
|
|
||||||
import { closeClient, getClient } from '@hcengineering/presentation'
|
import { closeClient, getClient } from '@hcengineering/presentation'
|
||||||
import presentation from '@hcengineering/presentation/src/plugin'
|
import presentation from '@hcengineering/presentation/src/plugin'
|
||||||
import {
|
import {
|
||||||
@ -141,7 +140,7 @@ export function isAppAllowed (app: Application, acc: Account): boolean {
|
|||||||
export async function hideApplication (app: Application): Promise<void> {
|
export async function hideApplication (app: Application): Promise<void> {
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
await client.createDoc(workbench.class.HiddenApplication, preference.space.Preference, {
|
await client.createDoc(workbench.class.HiddenApplication, core.space.Workspace, {
|
||||||
attachedTo: app._id
|
attachedTo: app._id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import {
|
import core, {
|
||||||
Branding,
|
Branding,
|
||||||
Doc,
|
Doc,
|
||||||
Hierarchy,
|
Hierarchy,
|
||||||
@ -85,7 +85,7 @@ export async function getPublicLink (
|
|||||||
const fragment = getDocFragment(doc, client)
|
const fragment = getDocFragment(doc, client)
|
||||||
await client.createDoc(
|
await client.createDoc(
|
||||||
guest.class.PublicLink,
|
guest.class.PublicLink,
|
||||||
guest.space.Links,
|
core.space.Workspace,
|
||||||
{
|
{
|
||||||
attachedTo: doc._id,
|
attachedTo: doc._id,
|
||||||
location: {
|
location: {
|
||||||
|
@ -100,13 +100,13 @@ function getTxes (
|
|||||||
removed?: Ref<Department>[]
|
removed?: Ref<Department>[]
|
||||||
): Tx[] {
|
): Tx[] {
|
||||||
const pushTxes = added.map((dep) =>
|
const pushTxes = added.map((dep) =>
|
||||||
factory.createTxUpdateDoc(hr.class.Department, hr.space.HR, dep, {
|
factory.createTxUpdateDoc(hr.class.Department, core.space.Workspace, dep, {
|
||||||
$push: { members: account }
|
$push: { members: account }
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
if (removed === undefined) return pushTxes
|
if (removed === undefined) return pushTxes
|
||||||
const pullTxes = removed.map((dep) =>
|
const pullTxes = removed.map((dep) =>
|
||||||
factory.createTxUpdateDoc(hr.class.Department, hr.space.HR, dep, {
|
factory.createTxUpdateDoc(hr.class.Department, core.space.Workspace, dep, {
|
||||||
$pull: { members: account }
|
$pull: { members: account }
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -80,7 +80,7 @@ async function createUserInfo (acc: Ref<Account>, control: TriggerControl): Prom
|
|||||||
|
|
||||||
const person = (await control.findAll(contact.class.Person, { _id: personId }))[0]
|
const person = (await control.findAll(contact.class.Person, { _id: personId }))[0]
|
||||||
const room = (await control.findAll(love.class.Office, { person: personId }))[0]
|
const room = (await control.findAll(love.class.Office, { person: personId }))[0]
|
||||||
const tx = control.txFactory.createTxCreateDoc(love.class.ParticipantInfo, love.space.Rooms, {
|
const tx = control.txFactory.createTxCreateDoc(love.class.ParticipantInfo, core.space.Workspace, {
|
||||||
person: personId,
|
person: personId,
|
||||||
name: person !== undefined ? getName(control.hierarchy, person, control.branding?.lastNameFirst) : account.email,
|
name: person !== undefined ? getName(control.hierarchy, person, control.branding?.lastNameFirst) : account.email,
|
||||||
room: room?._id ?? love.ids.Reception,
|
room: room?._id ?? love.ids.Reception,
|
||||||
@ -88,7 +88,7 @@ async function createUserInfo (acc: Ref<Account>, control: TriggerControl): Prom
|
|||||||
y: 0
|
y: 0
|
||||||
})
|
})
|
||||||
const ptx = control.txFactory.createTxApplyIf(
|
const ptx = control.txFactory.createTxApplyIf(
|
||||||
love.space.Rooms,
|
core.space.Workspace,
|
||||||
personId,
|
personId,
|
||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
@ -149,7 +149,7 @@ async function roomJoinHandler (info: ParticipantInfo, control: TriggerControl,
|
|||||||
if (roomInfo !== undefined) {
|
if (roomInfo !== undefined) {
|
||||||
roomInfo.persons.push(info.person)
|
roomInfo.persons.push(info.person)
|
||||||
return [
|
return [
|
||||||
control.txFactory.createTxUpdateDoc(love.class.RoomInfo, love.space.Rooms, roomInfo._id, {
|
control.txFactory.createTxUpdateDoc(love.class.RoomInfo, core.space.Workspace, roomInfo._id, {
|
||||||
persons: Array.from(new Set([...roomInfo.persons, info.person]))
|
persons: Array.from(new Set([...roomInfo.persons, info.person]))
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
@ -157,7 +157,7 @@ async function roomJoinHandler (info: ParticipantInfo, control: TriggerControl,
|
|||||||
const room = (await control.findAll(love.class.Room, { _id: info.room }))[0]
|
const room = (await control.findAll(love.class.Room, { _id: info.room }))[0]
|
||||||
if (room === undefined) return []
|
if (room === undefined) return []
|
||||||
return [
|
return [
|
||||||
control.txFactory.createTxCreateDoc(love.class.RoomInfo, love.space.Rooms, {
|
control.txFactory.createTxCreateDoc(love.class.RoomInfo, core.space.Workspace, {
|
||||||
persons: [info.person],
|
persons: [info.person],
|
||||||
room: info.room,
|
room: info.room,
|
||||||
isOffice: isOffice(room)
|
isOffice: isOffice(room)
|
||||||
@ -182,7 +182,7 @@ async function rejectJoinRequests (
|
|||||||
})
|
})
|
||||||
for (const request of requests) {
|
for (const request of requests) {
|
||||||
res.push(
|
res.push(
|
||||||
control.txFactory.createTxUpdateDoc(love.class.JoinRequest, love.space.Rooms, request._id, {
|
control.txFactory.createTxUpdateDoc(love.class.JoinRequest, core.space.Workspace, request._id, {
|
||||||
status: RequestStatus.Rejected
|
status: RequestStatus.Rejected
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@ -198,14 +198,14 @@ function setDefaultRoomAccess (info: ParticipantInfo, roomInfos: RoomInfo[], con
|
|||||||
if (oldRoomInfo !== undefined) {
|
if (oldRoomInfo !== undefined) {
|
||||||
oldRoomInfo.persons = oldRoomInfo.persons.filter((p) => p !== info.person)
|
oldRoomInfo.persons = oldRoomInfo.persons.filter((p) => p !== info.person)
|
||||||
res.push(
|
res.push(
|
||||||
control.txFactory.createTxUpdateDoc(love.class.RoomInfo, love.space.Rooms, oldRoomInfo._id, {
|
control.txFactory.createTxUpdateDoc(love.class.RoomInfo, core.space.Workspace, oldRoomInfo._id, {
|
||||||
persons: oldRoomInfo.persons
|
persons: oldRoomInfo.persons
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
if (oldRoomInfo.persons.length === 0) {
|
if (oldRoomInfo.persons.length === 0) {
|
||||||
const resetAccessTx = control.txFactory.createTxUpdateDoc(
|
const resetAccessTx = control.txFactory.createTxUpdateDoc(
|
||||||
oldRoomInfo.isOffice ? love.class.Office : love.class.Room,
|
oldRoomInfo.isOffice ? love.class.Office : love.class.Room,
|
||||||
love.space.Rooms,
|
core.space.Workspace,
|
||||||
oldRoomInfo.room,
|
oldRoomInfo.room,
|
||||||
{
|
{
|
||||||
access: oldRoomInfo.isOffice ? RoomAccess.Knock : RoomAccess.Open
|
access: oldRoomInfo.isOffice ? RoomAccess.Knock : RoomAccess.Open
|
||||||
|
@ -575,7 +575,7 @@ export async function createPushFromInbox (
|
|||||||
|
|
||||||
const path = [workbenchId, control.workspace.workspaceUrl, notificationId, encodeObjectURI(id, attachedToClass)]
|
const path = [workbenchId, control.workspace.workspaceUrl, notificationId, encodeObjectURI(id, attachedToClass)]
|
||||||
await createPushNotification(control, targetUser, title, body, _id, senderPerson, path)
|
await createPushNotification(control, targetUser, title, body, _id, senderPerson, path)
|
||||||
return control.txFactory.createTxCreateDoc(notification.class.BrowserNotification, notification.space.Notifications, {
|
return control.txFactory.createTxCreateDoc(notification.class.BrowserNotification, core.space.Workspace, {
|
||||||
user: targetUser,
|
user: targetUser,
|
||||||
status: NotificationStatus.New,
|
status: NotificationStatus.New,
|
||||||
title,
|
title,
|
||||||
|
@ -57,7 +57,7 @@ export async function onTagReference (tx: Tx, control: TriggerControl): Promise<
|
|||||||
if (!control.hierarchy.isDerived((actualTx as TxCUD<Doc>).objectClass, tags.class.TagReference)) return []
|
if (!control.hierarchy.isDerived((actualTx as TxCUD<Doc>).objectClass, tags.class.TagReference)) return []
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
const doc = TxProcessor.createDoc2Doc(actualTx as TxCreateDoc<TagReference>)
|
const doc = TxProcessor.createDoc2Doc(actualTx as TxCreateDoc<TagReference>)
|
||||||
const res = control.txFactory.createTxUpdateDoc(tags.class.TagElement, tags.space.Tags, doc.tag, {
|
const res = control.txFactory.createTxUpdateDoc(tags.class.TagElement, core.space.Workspace, doc.tag, {
|
||||||
$inc: { refCount: 1 }
|
$inc: { refCount: 1 }
|
||||||
})
|
})
|
||||||
return [res]
|
return [res]
|
||||||
@ -67,7 +67,7 @@ export async function onTagReference (tx: Tx, control: TriggerControl): Promise<
|
|||||||
const doc = control.removedMap.get(ctx.objectId) as TagReference
|
const doc = control.removedMap.get(ctx.objectId) as TagReference
|
||||||
if (doc !== undefined) {
|
if (doc !== undefined) {
|
||||||
if (!control.removedMap.has(doc.tag)) {
|
if (!control.removedMap.has(doc.tag)) {
|
||||||
const res = control.txFactory.createTxUpdateDoc(tags.class.TagElement, tags.space.Tags, doc.tag, {
|
const res = control.txFactory.createTxUpdateDoc(tags.class.TagElement, core.space.Workspace, doc.tag, {
|
||||||
$inc: { refCount: -1 }
|
$inc: { refCount: -1 }
|
||||||
})
|
})
|
||||||
return [res]
|
return [res]
|
||||||
|
@ -70,6 +70,7 @@ export class SpaceSecurityMiddleware extends BaseMiddleware implements Middlewar
|
|||||||
core.space.DerivedTx,
|
core.space.DerivedTx,
|
||||||
core.space.Model,
|
core.space.Model,
|
||||||
core.space.Space,
|
core.space.Space,
|
||||||
|
core.space.Workspace,
|
||||||
core.space.Tx
|
core.space.Tx
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user