Fix console tools accessing model (#4020)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-11-20 22:22:42 +07:00 committed by GitHub
parent db27efca58
commit 273f3de0a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
40 changed files with 53 additions and 46 deletions

View File

@ -25,7 +25,7 @@ import core, { DOMAIN_MODEL, type Class, type Doc, type DocumentQuery, type Ref,
import { Mixin, Model, type Builder } from '@hcengineering/model'
import { TClass, TDoc } from '@hcengineering/model-core'
import type { Asset, IntlString, Resource } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import activity from './plugin'

View File

@ -19,7 +19,7 @@ import attachment from '@hcengineering/attachment-resources/src/plugin'
import type { Ref, Doc } from '@hcengineering/core'
import type { IntlString, Resource } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import type { ActionCategory } from '@hcengineering/view'
export default mergeIds(attachmentId, attachment, {

View File

@ -20,7 +20,7 @@ import { type IntlString, mergeIds } from '@hcengineering/platform'
import { type Action } from '@hcengineering/view'
import { type Ref } from '@hcengineering/core'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
export default mergeIds(bitrixId, bitrix, {
component: {

View File

@ -53,7 +53,7 @@ import task, { actionTemplates as taskActionTemplates, TProject, TTask } from '@
import view, { actionTemplates, createAction, actionTemplates as viewTemplates } from '@hcengineering/model-view'
import workbench, { type Application } from '@hcengineering/model-workbench'
import { type IntlString } from '@hcengineering/platform'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import board from './plugin'
export { boardId } from '@hcengineering/board'

View File

@ -22,7 +22,7 @@ import {
} from '@hcengineering/model'
import core from '@hcengineering/model-core'
import { createProjectType, createSequence } from '@hcengineering/model-task'
import tags from '@hcengineering/tags'
import tags from '@hcengineering/model-tags'
import task, { type ProjectType } from '@hcengineering/task'
import board from './plugin'
import { PaletteColorIndexes } from '@hcengineering/ui/src/colors'

View File

@ -19,7 +19,7 @@ import board from '@hcengineering/board-resources/src/plugin'
import type { Ref } from '@hcengineering/core'
import { type IntlString, mergeIds } from '@hcengineering/platform'
import { type ProjectType, type Sequence } from '@hcengineering/task'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ViewAction, type Viewlet, type ViewletDescriptor } from '@hcengineering/view'
export default mergeIds(boardId, board, {

View File

@ -50,7 +50,7 @@ import { TProject } from '@hcengineering/model-task'
import view, { createAction } from '@hcengineering/model-view'
import notification from '@hcengineering/notification'
import setting from '@hcengineering/setting'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import calendar from './plugin'
export * from '@hcengineering/calendar'

View File

@ -20,7 +20,7 @@ import { type Ref } from '@hcengineering/core'
import { type NotificationGroup } from '@hcengineering/notification'
import type { IntlString } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import {
type Action,
type ActionCategory,

View File

@ -54,7 +54,7 @@ import preference, { TPreference } from '@hcengineering/model-preference'
import view, { createAction, actionTemplates as viewTemplates } from '@hcengineering/model-view'
import workbench from '@hcengineering/model-workbench'
import chunter from './plugin'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
export { chunterId } from '@hcengineering/chunter'
export { chunterOperation } from './migration'

View File

@ -20,7 +20,7 @@ import type { Doc, Ref, Space } from '@hcengineering/core'
import { type NotificationGroup } from '@hcengineering/notification'
import type { IntlString, Resource } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform'
import type { AnyComponent, Location } from '@hcengineering/ui'
import type { AnyComponent, Location } from '@hcengineering/ui/src/types'
import type { Action, ActionCategory, ViewAction, ViewletDescriptor } from '@hcengineering/view'
export default mergeIds(chunterId, chunter, {

View File

@ -70,7 +70,7 @@ import notification from '@hcengineering/notification'
import type { Asset, IntlString, Resource } from '@hcengineering/platform'
import setting from '@hcengineering/setting'
import templates from '@hcengineering/templates'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import contact from './plugin'
export { contactId } from '@hcengineering/contact'

View File

@ -22,7 +22,7 @@ import { type ObjectSearchCategory, type ObjectSearchFactory } from '@hcengineer
import { type NotificationGroup } from '@hcengineering/notification'
import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform'
import { type TemplateFieldFunc } from '@hcengineering/templates'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view'
import { type ActivityExtension } from '@hcengineering/activity'

View File

@ -18,7 +18,7 @@ import { type Doc, type Ref } from '@hcengineering/core'
import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform'
import { gmailId } from '@hcengineering/gmail'
import gmail from '@hcengineering/gmail-resources/src/plugin'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import type { TxViewlet } from '@hcengineering/activity'
import { type Action } from '@hcengineering/view'
import { type NotificationGroup } from '@hcengineering/notification'

View File

@ -18,7 +18,7 @@ import { hrId } from '@hcengineering/hr'
import hr from '@hcengineering/hr-resources/src/plugin'
import { type NotificationGroup } from '@hcengineering/notification'
import { type IntlString, mergeIds } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view'
export default mergeIds(hrId, hr, {

View File

@ -18,7 +18,7 @@ import type { Ref } from '@hcengineering/core'
import { inventoryId } from '@hcengineering/inventory'
import inventory from '@hcengineering/inventory-resources/src/plugin'
import { type IntlString, mergeIds } from '@hcengineering/platform'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction, type Viewlet } from '@hcengineering/view'
import { type ActivityExtension } from '@hcengineering/activity'

View File

@ -21,7 +21,7 @@ import { type NotificationGroup, type NotificationType } from '@hcengineering/no
import type { IntlString } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform'
import { type ProjectType } from '@hcengineering/task'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type Viewlet } from '@hcengineering/view'
import { type ActivityExtension } from '@hcengineering/activity'

View File

@ -55,7 +55,7 @@ import {
} from '@hcengineering/notification'
import type { Asset, IntlString } from '@hcengineering/platform'
import setting from '@hcengineering/setting'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import notification from './plugin'
export { notificationId } from '@hcengineering/notification'
export { notificationOperation } from './migration'

View File

@ -17,7 +17,7 @@
import { type Doc, type Ref } from '@hcengineering/core'
import notification, { notificationId } from '@hcengineering/notification'
import { type IntlString, type Resource, mergeIds } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view'
import { type Application } from '@hcengineering/workbench'
import { type TxViewlet } from '@hcengineering/activity'

View File

@ -18,7 +18,10 @@ import { type Builder, Model, Prop, TypeRef } from '@hcengineering/model'
import core, { TDoc } from '@hcengineering/model-core'
import { type Asset, type IntlString, type Resource } from '@hcengineering/platform'
// Import types to prevent .svelte components to being exposed to type typescript.
import { type PresentationMiddlewareCreator, type PresentationMiddlewareFactory } from '@hcengineering/presentation'
import {
type PresentationMiddlewareCreator,
type PresentationMiddlewareFactory
} from '@hcengineering/presentation/src/pipeline'
import {
type ComponentPointExtension,
type CreateExtensionKind,
@ -30,7 +33,7 @@ import {
type ObjectSearchCategory,
type ObjectSearchFactory
} from '@hcengineering/presentation/src/types'
import { type AnyComponent, type ComponentExtensionId } from '@hcengineering/ui'
import { type AnyComponent, type ComponentExtensionId } from '@hcengineering/ui/src/types'
import presentation from './plugin'
export { presentationId } from '@hcengineering/presentation/src/plugin'

View File

@ -20,7 +20,7 @@ import { mergeIds } from '@hcengineering/platform'
import { recruitId } from '@hcengineering/recruit'
import recruit from '@hcengineering/recruit-resources/src/plugin'
import { type ProjectType } from '@hcengineering/task'
import type { AnyComponent, Location } from '@hcengineering/ui'
import type { AnyComponent, Location } from '@hcengineering/ui/src/types'
import type { Action, ActionCategory, ViewAction, ViewQueryAction, Viewlet } from '@hcengineering/view'
import { type ActivityExtension } from '@hcengineering/activity'

View File

@ -42,7 +42,7 @@ import {
type RequestPresenter,
type RequestStatus
} from '@hcengineering/request'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import request from './plugin'
export { requestId } from '@hcengineering/request'

View File

@ -18,7 +18,7 @@ import type { IntlString } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform'
import { requestId } from '@hcengineering/request'
import request from '@hcengineering/request-resources/src/plugin'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import type { TxViewlet } from '@hcengineering/activity'
import type { NotificationGroup, NotificationType } from '@hcengineering/notification'

View File

@ -36,7 +36,7 @@ import templates from '@hcengineering/templates'
import setting from './plugin'
import workbench from '@hcengineering/model-workbench'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
export { settingId } from '@hcengineering/setting'
export { default } from './plugin'

View File

@ -18,7 +18,7 @@ import { type Doc, type Ref } from '@hcengineering/core'
import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform'
import { settingId } from '@hcengineering/setting'
import setting from '@hcengineering/setting-resources/src/plugin'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view'
import { type TemplateFieldFunc } from '@hcengineering/templates'
import { type NotificationGroup, type NotificationType } from '@hcengineering/notification'

View File

@ -16,7 +16,7 @@ import { type Ref } from '@hcengineering/core'
import { type IntlString, mergeIds } from '@hcengineering/platform'
import { type TagCategory, tagsId } from '@hcengineering/tags'
import tags from '@hcengineering/tags-resources/src/plugin'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type ViewAction } from '@hcengineering/model-view'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import view from '@hcengineering/view'

View File

@ -58,7 +58,7 @@ import {
type Task,
type TodoItem
} from '@hcengineering/task'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type ViewAction } from '@hcengineering/view'
import task from './plugin'

View File

@ -19,7 +19,7 @@ import { mergeIds } from '@hcengineering/platform'
import { type TagCategory } from '@hcengineering/tags'
import { taskId } from '@hcengineering/task'
import task from '@hcengineering/task-resources/src/plugin'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import type { Action, ActionCategory, ViewAction, Viewlet } from '@hcengineering/view'
import {} from '@hcengineering/notification'

View File

@ -18,7 +18,7 @@ import { type Ref } from '@hcengineering/core'
import { type IntlString, type Resource, mergeIds } from '@hcengineering/platform'
import { telegramId } from '@hcengineering/telegram'
import telegram from '@hcengineering/telegram-resources/src/plugin'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import type { TxViewlet } from '@hcengineering/activity'
import { type TemplateFieldFunc } from '@hcengineering/templates'
import { type NotificationGroup } from '@hcengineering/notification'

View File

@ -21,7 +21,7 @@ import { templatesId } from '@hcengineering/templates'
import templates from '@hcengineering/templates-resources/src/plugin'
import { type RefInputAction, type RefInputActionItem } from '@hcengineering/model-text-editor'
import type { AnyComponent } from '@hcengineering/ui'
import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory } from '@hcengineering/view'
export default mergeIds(templatesId, templates, {

View File

@ -30,7 +30,7 @@ import core, { TClass, TDoc } from '@hcengineering/model-core'
import preference, { TPreference } from '@hcengineering/model-preference'
import presentation from '@hcengineering/model-presentation'
import { type Asset, type IntlString, type Resource, type Status } from '@hcengineering/platform'
import { type AnyComponent, type Location } from '@hcengineering/ui'
import { type AnyComponent, type Location } from '@hcengineering/ui/src/types'
import {
type Action,
type ActionCategory,

View File

@ -15,9 +15,9 @@
import { type Ref } from '@hcengineering/core'
import { type IntlString, mergeIds } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import { type FilterFunction, type ViewAction, type ViewCategoryAction, viewId } from '@hcengineering/view'
import { type PresentationMiddlewareFactory } from '@hcengineering/presentation'
import { type PresentationMiddlewareFactory } from '@hcengineering/presentation/src/pipeline'
import view from '@hcengineering/view-resources/src/plugin'
export default mergeIds(viewId, view, {

View File

@ -15,7 +15,7 @@
import { type Doc, type Space } from '@hcengineering/core'
import { type IntlString, type Resource, mergeIds } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui'
import { type AnyComponent } from '@hcengineering/ui/src/types'
import { workbenchId } from '@hcengineering/workbench'
import workbench from '@hcengineering/workbench-resources/src/plugin'

View File

@ -59,6 +59,7 @@
"@hcengineering/rekoni": "^0.6.0",
"@hcengineering/notification": "^0.6.15",
"@hcengineering/tags": "^0.6.11",
"@hcengineering/tags-resources": "^0.6.0",
"@hcengineering/calendar": "^0.6.16",
"@hcengineering/tracker": "^0.6.12"
}

View File

@ -1,5 +1,5 @@
<script lang="ts">
import tags, { selectedTagElements, TagElement } from '@hcengineering/tags'
import tags, { TagElement } from '@hcengineering/tags'
import { Button, Component, getCurrentResolvedLocation, navigate, showPopup } from '@hcengineering/ui'
import recruit from '../plugin'
import { buildFilterKey, setFilters } from '@hcengineering/view-resources'
@ -7,6 +7,7 @@
import { Filter } from '@hcengineering/view'
import { getEmbeddedLabel } from '@hcengineering/platform'
import OptimizeSkills from './OptimizeSkills.svelte'
import { selectedTagElements } from '@hcengineering/tags-resources'
function setFilterTag (tag: TagElement) {
const client = getClient()

View File

@ -18,7 +18,7 @@
import { TagElement, TagReference } from '@hcengineering/tags'
import tags from '../plugin'
import TagItem from './TagItem.svelte'
import { selectedTagElements } from '@hcengineering/tags'
import { selectedTagElements } from '../utils'
import { Label } from '@hcengineering/ui'
export let object: Doc

View File

@ -34,14 +34,14 @@ import CreateTagElement from './components/CreateTagElement.svelte'
import ObjectsTagsEditorPopup from './components/ObjectsTagsEditorPopup.svelte'
import TagElement from './components/TagElement.svelte'
import { type ObjQueryType } from '@hcengineering/core'
import { getRefs } from './utils'
import { getRefs, selectedTagElements } from './utils'
import { type Filter } from '@hcengineering/view'
import WeightPopup from './components/WeightPopup.svelte'
import DraftTagsEditor from './components/DraftTagsEditor.svelte'
import TagsFilterPresenter from './components/TagsFilterPresenter.svelte'
import DocTagsEditor from './components/DocTagsEditor.svelte'
export { WeightPopup, TagElement }
export { WeightPopup, TagElement, selectedTagElements }
export async function tagsInResult (filter: Filter, onUpdate: () => void): Promise<ObjQueryType<any>> {
const result = await getRefs(filter, onUpdate)
return { $in: result }

View File

@ -2,11 +2,12 @@
import { type Doc, type DocumentQuery, type FindResult, type Ref } from '@hcengineering/core'
import { type Asset } from '@hcengineering/platform'
import { type InitialKnowledge, type TagReference } from '@hcengineering/tags'
import { type TagElement, type InitialKnowledge, type TagReference } from '@hcengineering/tags'
import { type ColorDefinition } from '@hcengineering/ui'
import { type Filter } from '@hcengineering/view'
import { FilterQuery } from '@hcengineering/view-resources'
import tags from './plugin'
import { writable } from 'svelte/store'
export function getTagStyle (color: ColorDefinition, selected = false): string {
return `
@ -54,3 +55,8 @@ export interface TagElementInfo {
count: number
modifiedOn: number
}
/**
* @public
*/
export const selectedTagElements = writable<Array<Ref<TagElement>>>([])

View File

@ -17,7 +17,6 @@ import type { AttachedDoc, Class, Doc, Ref, Space } from '@hcengineering/core'
import type { Asset, IntlString, Plugin } from '@hcengineering/platform'
import { plugin } from '@hcengineering/platform'
import { AnyComponent } from '@hcengineering/ui'
import { writable } from 'svelte/store'
import { FilterMode } from '@hcengineering/view'
/**
@ -150,8 +149,3 @@ export function findTagCategory (title: string, categories: TagCategory[]): Ref<
}
return defaultCategory._id
}
/**
* @public
*/
export const selectedTagElements = writable<Ref<TagElement>[]>([])

View File

@ -54,6 +54,7 @@
"@hcengineering/workbench": "^0.6.8",
"@hcengineering/notification": "^0.6.15",
"@hcengineering/tags": "^0.6.11",
"@hcengineering/tags-resources": "^0.6.0",
"@hcengineering/kanban": "^0.6.0",
"@hcengineering/contact-resources": "^0.6.0"
}

View File

@ -17,7 +17,8 @@
import { Class, Doc, DocumentQuery, getCurrentAccount, Ref, Status } from '@hcengineering/core'
import { IntlString } from '@hcengineering/platform'
import { createQuery, getClient } from '@hcengineering/presentation'
import tags, { selectedTagElements, TagCategory, TagElement } from '@hcengineering/tags'
import tags, { TagCategory, TagElement } from '@hcengineering/tags'
import { selectedTagElements } from '@hcengineering/tags-resources'
import { Task } from '@hcengineering/task'
import {
Component,