mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-08 00:37:42 +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.
|
// limitations under the License.
|
||||||
import documents, {
|
import documents, {
|
||||||
documentsId,
|
documentsId,
|
||||||
getDocumentId,
|
|
||||||
type ControlledDocument,
|
type ControlledDocument,
|
||||||
type Document,
|
type Document,
|
||||||
type Project,
|
type Project,
|
||||||
type ProjectDocument
|
type ProjectDocument
|
||||||
} from '@hcengineering/controlled-documents'
|
} 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 { getClient } from '@hcengineering/presentation'
|
||||||
import { getCurrentResolvedLocation, getPanelURI, type Location, type ResolvedLocation } from '@hcengineering/ui'
|
import { getCurrentResolvedLocation, getPanelURI, type Location, type ResolvedLocation } from '@hcengineering/ui'
|
||||||
import view, { type ObjectPanel } from '@hcengineering/view'
|
import view, { type ObjectPanel } from '@hcengineering/view'
|
||||||
@ -159,13 +158,3 @@ export async function resolveLocation (loc: Location): Promise<ResolvedLocation
|
|||||||
|
|
||||||
return undefined
|
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,
|
type ProjectMeta,
|
||||||
ControlledDocumentState,
|
ControlledDocumentState,
|
||||||
DocumentState,
|
DocumentState,
|
||||||
getDocumentName,
|
getDocumentName
|
||||||
getDocumentId
|
|
||||||
} from '@hcengineering/controlled-documents'
|
} from '@hcengineering/controlled-documents'
|
||||||
import { type Request } from '@hcengineering/request'
|
import { type Request } from '@hcengineering/request'
|
||||||
|
|
||||||
@ -583,7 +582,7 @@ export async function documentIdentifierProvider (client: Client, ref: Ref<Docum
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
return getDocumentId(document)
|
return document.code
|
||||||
}
|
}
|
||||||
|
|
||||||
export function documentCompareFn (doc1: Document, doc2: Document): number {
|
export function documentCompareFn (doc1: Document, doc2: Document): number {
|
||||||
|
Loading…
Reference in New Issue
Block a user