EQMS-1381 Use stored document code (#7595)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2025-01-07 19:12:48 +07:00 committed by GitHub
parent c4f8d14a9b
commit 307d7018c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 15 deletions

View File

@ -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<ResolvedLocation
return undefined
}
export async function documentIdentifierProvider (client: Client, ref: Ref<Document>, doc?: Document): Promise<string> {
const document = doc ?? (await client.findOne(documents.class.Document, { _id: ref }))
if (document === undefined) {
return ''
}
return getDocumentId(document)
}

View File

@ -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<Docum
return ''
}
return getDocumentId(document)
return document.code
}
export function documentCompareFn (doc1: Document, doc2: Document): number {