From 307d7018c2d44183e2bf590fb26ef4494945a56c Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Tue, 7 Jan 2025 19:12:48 +0700 Subject: [PATCH] EQMS-1381 Use stored document code (#7595) Signed-off-by: Alexander Onnikov --- .../src/navigation.ts | 13 +------------ plugins/controlled-documents-resources/src/utils.ts | 5 ++--- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/plugins/controlled-documents-resources/src/navigation.ts b/plugins/controlled-documents-resources/src/navigation.ts index 7be24fd3df..1e42fdf9a9 100644 --- a/plugins/controlled-documents-resources/src/navigation.ts +++ b/plugins/controlled-documents-resources/src/navigation.ts @@ -13,13 +13,12 @@ // limitations under the License. import documents, { documentsId, - getDocumentId, type ControlledDocument, type Document, type Project, type ProjectDocument } from '@hcengineering/controlled-documents' -import { type Client, type Doc, type Ref } from '@hcengineering/core' +import { type Doc, type Ref } from '@hcengineering/core' import { getClient } from '@hcengineering/presentation' import { getCurrentResolvedLocation, getPanelURI, type Location, type ResolvedLocation } from '@hcengineering/ui' import view, { type ObjectPanel } from '@hcengineering/view' @@ -159,13 +158,3 @@ export async function resolveLocation (loc: Location): Promise, doc?: Document): Promise { - const document = doc ?? (await client.findOne(documents.class.Document, { _id: ref })) - - if (document === undefined) { - return '' - } - - return getDocumentId(document) -} diff --git a/plugins/controlled-documents-resources/src/utils.ts b/plugins/controlled-documents-resources/src/utils.ts index 7cb2685325..fe07c0132d 100644 --- a/plugins/controlled-documents-resources/src/utils.ts +++ b/plugins/controlled-documents-resources/src/utils.ts @@ -50,8 +50,7 @@ import documents, { type ProjectMeta, ControlledDocumentState, DocumentState, - getDocumentName, - getDocumentId + getDocumentName } from '@hcengineering/controlled-documents' import { type Request } from '@hcengineering/request' @@ -583,7 +582,7 @@ export async function documentIdentifierProvider (client: Client, ref: Ref