diff --git a/models/server-tracker/src/index.ts b/models/server-tracker/src/index.ts index c78e8c693d..7758af3fdd 100644 --- a/models/server-tracker/src/index.ts +++ b/models/server-tracker/src/index.ts @@ -74,6 +74,14 @@ export function createModel (builder: Builder): void { } }) + builder.createDoc(serverCore.class.Trigger, core.space.Model, { + trigger: serverTracker.trigger.OnProjectRemove, + txMatch: { + _class: core.class.TxRemoveDoc, + objectClass: tracker.class.Project + } + }) + builder.mixin( tracker.ids.AssigneeNotification, notification.class.NotificationType, diff --git a/plugins/chunter-resources/src/navigation.ts b/plugins/chunter-resources/src/navigation.ts index 8e13ecae37..1e2d760414 100644 --- a/plugins/chunter-resources/src/navigation.ts +++ b/plugins/chunter-resources/src/navigation.ts @@ -7,7 +7,7 @@ import { navigate, languageStore } from '@hcengineering/ui' -import { type Ref, type Doc, type Class, generateId } from '@hcengineering/core' +import { type Ref, type Doc, type Class, generateId, concatLink } from '@hcengineering/core' import activity, { type ActivityMessage } from '@hcengineering/activity' import { type Channel, @@ -19,10 +19,10 @@ import { import { type DocNotifyContext, notificationId } from '@hcengineering/notification' import workbench, { type Widget, workbenchId, type LocationData } from '@hcengineering/workbench' import { classIcon, getObjectLinkId, parseLinkId } from '@hcengineering/view-resources' -import { getClient } from '@hcengineering/presentation' +import presentation, { getClient } from '@hcengineering/presentation' import view, { encodeObjectURI, decodeObjectURI } from '@hcengineering/view' import { createWidgetTab, isElementFromSidebar, sidebarStore } from '@hcengineering/workbench-resources' -import { type Asset, type IntlString, translate } from '@hcengineering/platform' +import { type Asset, getMetadata, type IntlString, translate } from '@hcengineering/platform' import contact from '@hcengineering/contact' import { get } from 'svelte/store' @@ -113,8 +113,10 @@ export async function getMessageLink (message: ActivityMessage): Promise } const id = encodeURIComponent(encodeObjectURI(_id, _class)) - - return `${window.location.protocol}//${window.location.host}/${workbenchId}/${location.path[1]}/${chunterId}/${id}${threadParent}?message=${message._id}` + const frontUrl = getMetadata(presentation.metadata.FrontUrl) + const protocolAndHost = frontUrl ?? `${window.location.protocol}//${window.location.host}` + const path = `${workbenchId}/${location.path[1]}/${chunterId}/${id}${threadParent}?message=${message._id}` + return concatLink(protocolAndHost, path) } export async function chunterSpaceLinkFragmentProvider (doc: ChunterSpace): Promise { diff --git a/plugins/document/package.json b/plugins/document/package.json index 285188befd..e708df5836 100644 --- a/plugins/document/package.json +++ b/plugins/document/package.json @@ -44,5 +44,9 @@ "@hcengineering/notification": "^0.6.23", "@hcengineering/attachment": "^0.6.14", "@hcengineering/preference": "^0.6.13" + }, + "repository": "https://github.com/hcengineering/platform", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/tracker-resources/src/components/issues/ParentNamesPresenter.svelte b/plugins/tracker-resources/src/components/issues/ParentNamesPresenter.svelte index d65eb64302..b894381643 100644 --- a/plugins/tracker-resources/src/components/issues/ParentNamesPresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/ParentNamesPresenter.svelte @@ -13,7 +13,9 @@ // limitations under the License. --> diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts index e22a6e368e..f85d92f51d 100644 --- a/plugins/tracker-resources/src/index.ts +++ b/plugins/tracker-resources/src/index.ts @@ -14,17 +14,13 @@ // import { Analytics } from '@hcengineering/analytics' -import core, { - type AttachedDoc, +import { type Attribute, type Class, - ClassifierKind, type Client, type Doc, type DocManager, type DocumentQuery, - DOMAIN_CONFIGURATION, - DOMAIN_MODEL, getCurrentAccount, type Ref, type RelatedDocument, @@ -275,52 +271,7 @@ async function deleteProject (project: Project | undefined): Promise { labelProps: { name: project.name }, message: tracker.string.DeleteProjectConfirm, action: async () => { - // void client.update(project, { archived: true }) const client = getClient() - const classes = await client.findAll(core.class.Class, {}) - const h = client.getHierarchy() - for (const c of classes) { - if (c.kind !== ClassifierKind.CLASS) { - continue - } - const d = h.findDomain(c._id) - if (d !== undefined && d !== DOMAIN_MODEL && d !== DOMAIN_CONFIGURATION) { - try { - while (true) { - const docs = await client.findAll(c._id, { space: project._id }, { limit: 50 }) - if (docs.length === 0) { - break - } - const ops = client.apply(undefined, 'delete-project') - for (const object of docs) { - if (client.getHierarchy().isDerived(object._class, core.class.AttachedDoc)) { - const adoc = object as AttachedDoc - await ops - .removeCollection( - object._class, - object.space, - adoc._id, - adoc.attachedTo, - adoc.attachedToClass, - adoc.collection - ) - .catch((err) => { - console.error(err) - }) - } else { - await ops.removeDoc(object._class, object.space, object._id).catch((err) => { - console.error(err) - }) - } - } - await ops.commit() - } - } catch (err: any) { - console.error(err) - Analytics.handleError(err) - } - } - } await client.remove(project) } }) diff --git a/plugins/training-resources/src/components/DocumentPresenter.svelte b/plugins/training-resources/src/components/DocumentPresenter.svelte index 1a30e6b4aa..bb0b532cda 100644 --- a/plugins/training-resources/src/components/DocumentPresenter.svelte +++ b/plugins/training-resources/src/components/DocumentPresenter.svelte @@ -16,16 +16,20 @@ --> diff --git a/plugins/view-resources/src/components/DocNavLink.svelte b/plugins/view-resources/src/components/DocNavLink.svelte index 0aef777229..9d42360aa5 100644 --- a/plugins/view-resources/src/components/DocNavLink.svelte +++ b/plugins/view-resources/src/components/DocNavLink.svelte @@ -13,11 +13,12 @@ // limitations under the License. -->