temporarily autoincremented id composition

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-10-14 11:44:25 +02:00
parent 7fb8d31f89
commit 65f8cc4384
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
7 changed files with 918 additions and 879 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -57,6 +57,7 @@ export class TCandidate extends TPerson implements Candidate {
}
@Model(recruit.class.Applicant, core.class.DocWithState, DOMAIN_RECRUIT)
@UX('Application' as IntlString, recruit.icon.RecruitApplication, 'APP' as IntlString)
export class TApplicant extends TDocWithState implements Applicant {
@Prop(TypeString(), 'Candidate' as IntlString)
candidate!: Ref<Candidate>
@ -141,23 +142,9 @@ export function createModel (builder: Builder): void {
state: core.class.State
}
} as FindOptions<Doc>, // TODO: fix
config: ['number', '$lookup.candidate', { presenter: recruit.component.ApplicationPresenter, label: 'Application' }, '$lookup.state', '$lookup.candidate.city', '$lookup.candidate.channels']
config: ['', '$lookup.candidate', '$lookup.state', '$lookup.candidate.city', '$lookup.candidate.channels']
})
// builder.createDoc(view.class.Viewlet, core.space.Model, {
// attachTo: recruit.class.Applicant,
// descriptor: view.viewlet.Kanban,
// open: recruit.component.EditCandidate,
// // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
// options: {
// lookup: {
// candidate: recruit.class.Candidate,
// state: core.class.State
// }
// } as FindOptions<Doc>, // TODO: fix
// config: ['$lookup.candidate', '$lookup.state', '$lookup.candidate.city', '$lookup.candidate.channels']
// })
builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.KanbanCard, {
card: recruit.component.KanbanCard
})
@ -166,6 +153,10 @@ export function createModel (builder: Builder): void {
editor: recruit.component.EditCandidate
})
builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.AttributePresenter, {
presenter: recruit.component.ApplicationPresenter
})
builder.createDoc(view.class.Action, core.space.Model, {
label: 'Create Application' as IntlString,
icon: view.icon.Table,

View File

@ -123,6 +123,7 @@ export type Domain = string & { __domain: true }
export interface Class<T extends Obj> extends Classifier {
extends?: Ref<Class<Obj>>
domain?: Domain
shortLabel?: IntlString
}
/**

View File

@ -58,6 +58,7 @@ interface ClassTxes {
icon?: Asset
txes: Array<NoIDs<Tx>>
kind: ClassifierKind
shortLabel?: IntlString
}
const transactions = new Map<any, ClassTxes>()
@ -151,12 +152,14 @@ export function Mixin<T extends Obj> (
*/
export function UX<T extends Obj> (
label: IntlString,
icon?: Asset
icon?: Asset,
shortLabel?: IntlString
) {
return function classDecorator<C extends new () => T> (constructor: C): void {
const txes = getTxes(constructor.prototype)
txes.label = label
txes.icon = icon
txes.shortLabel = shortLabel
}
}
@ -184,7 +187,8 @@ function _generateTx (tx: ClassTxes): Tx[] {
kind: ClassifierKind.CLASS,
extends: tx.extends,
label: tx.label,
icon: tx.icon
icon: tx.icon,
shortLabel: tx.shortLabel
},
objectId
)

View File

@ -19,9 +19,13 @@
import type { Applicant } from '@anticrm/recruit'
import { IconFile, showPopup } from '@anticrm/ui'
import EditApplication from './EditApplication.svelte'
import { getClient } from '@anticrm/presentation'
export let value: Applicant
const client = getClient()
const shortLabel = client.getHierarchy().getClass(value._class).shortLabel
function show() {
console.log('show!', value)
showPopup(EditApplication, { _id: value._id }, 'full')
@ -30,5 +34,5 @@ function show() {
</script>
<div on:click={show}>
<IconFile size={'small'}/>
<IconFile size={'small'}/>&nbsp;{shortLabel}-{value.number}
</div>

File diff suppressed because it is too large Load Diff