diff --git a/models/core/src/core.ts b/models/core/src/core.ts index c176e8e993..8507bb7533 100644 --- a/models/core/src/core.ts +++ b/models/core/src/core.ts @@ -54,3 +54,6 @@ export class TType extends TDoc implements Type {} @Model(core.class.TypeString, core.class.Type) export class TTypeString extends TType {} + +@Model(core.class.TypeBoolean, core.class.Type) +export class TTypeBoolean extends TType {} diff --git a/models/core/src/index.ts b/models/core/src/index.ts index ddd28cec58..1d8acfc73d 100644 --- a/models/core/src/index.ts +++ b/models/core/src/index.ts @@ -15,7 +15,7 @@ import { Builder } from '@anticrm/model' import core from './component' -import { TAttribute, TClass, TDoc, TMixin, TObj, TType, TTypeString } from './core' +import { TAttribute, TClass, TDoc, TMixin, TObj, TType, TTypeString, TTypeBoolean } from './core' import { TSpace, TAccount, TState, TSpaceWithStates } from './security' import { TTx, TTxCreateDoc, TTxMixin, TTxUpdateDoc, TTxCUD, TTxPutBag, TTxRemoveDoc } from './tx' @@ -43,6 +43,7 @@ export function createModel (builder: Builder): void { TAttribute, TType, TTypeString, + TTypeBoolean, TState ) } diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index bb301ae135..fdfd2fee03 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -14,7 +14,7 @@ // import type { IntlString } from '@anticrm/platform' -import { Builder, Model, UX, Prop, TypeString, Bag as TypeBag } from '@anticrm/model' +import { Builder, Model, UX, Prop, TypeString, TypeBoolean, Bag as TypeBag } from '@anticrm/model' import type { Ref, FindOptions, Doc, Domain, State, Bag } from '@anticrm/core' import core, { TSpace, TSpaceWithStates, TDoc } from '@anticrm/model-core' import type { Vacancy, Candidates, Candidate, Applicant } from '@anticrm/recruit' @@ -48,6 +48,12 @@ export class TCandidate extends TPerson implements Candidate { @Prop(TypeString(), 'Applications' as IntlString) applications?: number + + @Prop(TypeBoolean(), 'Onsite' as IntlString) + onsite?: boolean + + @Prop(TypeBoolean(), 'Remote' as IntlString) + remote?: boolean } @Model(recruit.class.Applicant, core.class.Doc, DOMAIN_RECRUIT) diff --git a/packages/core/src/component.ts b/packages/core/src/component.ts index 08dda38a75..d7e9fae9cb 100644 --- a/packages/core/src/component.ts +++ b/packages/core/src/component.ts @@ -40,6 +40,7 @@ export default plugin(coreId, { Account: '' as Ref>, State: '' as Ref>, TypeString: '' as Ref>>, + TypeBoolean: '' as Ref>>, Bag: '' as Ref>>> }, space: { diff --git a/packages/model/src/dsl.ts b/packages/model/src/dsl.ts index 06f6316dc9..660df8b875 100644 --- a/packages/model/src/dsl.ts +++ b/packages/model/src/dsl.ts @@ -271,6 +271,13 @@ export function TypeString (): Type { return { _class: core.class.TypeString } } +/** + * @public + */ +export function TypeBoolean (): Type { + return { _class: core.class.TypeBoolean } +} + /** * @public */ diff --git a/plugins/recruit-resources/src/components/CreateCandidate.svelte b/plugins/recruit-resources/src/components/CreateCandidate.svelte index 372412566a..0f1e7f4531 100644 --- a/plugins/recruit-resources/src/components/CreateCandidate.svelte +++ b/plugins/recruit-resources/src/components/CreateCandidate.svelte @@ -67,7 +67,9 @@ import { combineName } from '@anticrm/contact'; title: object.title, city: object.city, channels: object.channels, - attachments: {} + attachments: {}, + onsite: object.onsite, + remote: object.remote } if (resume.uuid !== undefined) { @@ -191,8 +193,8 @@ import { combineName } from '@anticrm/contact';
-
-
+
+
diff --git a/plugins/recruit-resources/src/components/YesNo.svelte b/plugins/recruit-resources/src/components/YesNo.svelte index 34d3b88ed9..49a168836c 100644 --- a/plugins/recruit-resources/src/components/YesNo.svelte +++ b/plugins/recruit-resources/src/components/YesNo.svelte @@ -16,25 +16,31 @@ -
{ - if (state === 'yes') state = 'no' - else if (state === 'no') state = 'unknown' - else state = 'yes' +
{ + if (value === true) value = false + else if (value === false) value = undefined + else value = true }}> - {#if state === 'yes'} + {#if value === true} - {:else if state === 'no'} + {:else if value === false} {:else} {/if} - +