mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 12:25:17 +00:00
EQMS-1381 Use stored document code (#7595)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
c4f8d14a9b
commit
307d7018c2
@ -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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user