mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-08 21:27:45 +03:00
UBER-1006: Support Ref for Vacancies (#4104)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
d77cb5b807
commit
ca8bc92cbb
@ -217,6 +217,10 @@ export function createModel (builder: Builder): void {
|
|||||||
fields: ['createdBy']
|
fields: ['createdBy']
|
||||||
})
|
})
|
||||||
|
|
||||||
|
builder.mixin(recruit.class.Vacancy, core.class.Class, view.mixin.AttributeEditor, {
|
||||||
|
inlineEditor: recruit.component.VacancyEditor
|
||||||
|
})
|
||||||
|
|
||||||
builder.mixin(recruit.class.Applicant, core.class.Class, notification.mixin.ClassCollaborators, {
|
builder.mixin(recruit.class.Applicant, core.class.Class, notification.mixin.ClassCollaborators, {
|
||||||
fields: ['createdBy']
|
fields: ['createdBy']
|
||||||
})
|
})
|
||||||
|
@ -115,7 +115,8 @@ export default mergeIds(recruitId, recruit, {
|
|||||||
ApplicationMatchPresenter: '' as AnyComponent,
|
ApplicationMatchPresenter: '' as AnyComponent,
|
||||||
|
|
||||||
MatchVacancy: '' as AnyComponent,
|
MatchVacancy: '' as AnyComponent,
|
||||||
NotificationApplicantPresenter: '' as AnyComponent
|
NotificationApplicantPresenter: '' as AnyComponent,
|
||||||
|
VacancyEditor: '' as AnyComponent
|
||||||
},
|
},
|
||||||
template: {
|
template: {
|
||||||
DefaultVacancy: '' as Ref<ProjectType>
|
DefaultVacancy: '' as Ref<ProjectType>
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
export let componentProps: any | undefined = undefined
|
export let componentProps: any | undefined = undefined
|
||||||
export let autoSelect = true
|
export let autoSelect = true
|
||||||
export let readonly = false
|
export let readonly = false
|
||||||
|
export let ignoreFill = false
|
||||||
export let iconWithEmoji: AnySvelteComponent | Asset | ComponentType | undefined = view.ids.IconWithEmoji
|
export let iconWithEmoji: AnySvelteComponent | Asset | ComponentType | undefined = view.ids.IconWithEmoji
|
||||||
export let defaultIcon: AnySvelteComponent | Asset | ComponentType = IconFolder
|
export let defaultIcon: AnySvelteComponent | Asset | ComponentType = IconFolder
|
||||||
export let findDefaultSpace: (() => Promise<Space | undefined>) | undefined = undefined
|
export let findDefaultSpace: (() => Promise<Space | undefined>) | undefined = undefined
|
||||||
@ -131,6 +132,8 @@
|
|||||||
icon={selected?.icon === iconWithEmoji && iconWithEmoji ? IconWithEmoji : selected?.icon ?? defaultIcon}
|
icon={selected?.icon === iconWithEmoji && iconWithEmoji ? IconWithEmoji : selected?.icon ?? defaultIcon}
|
||||||
iconProps={selected?.icon === iconWithEmoji && iconWithEmoji
|
iconProps={selected?.icon === iconWithEmoji && iconWithEmoji
|
||||||
? { icon: selected?.color }
|
? { icon: selected?.color }
|
||||||
|
: ignoreFill
|
||||||
|
? undefined
|
||||||
: {
|
: {
|
||||||
fill:
|
fill:
|
||||||
selected?.color !== undefined
|
selected?.color !== undefined
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
<!--
|
||||||
|
// Copyright © 2023 Hardcore Engineering Inc.
|
||||||
|
//
|
||||||
|
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License. You may
|
||||||
|
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
-->
|
||||||
|
<script lang="ts">
|
||||||
|
import { Ref, RefTo } from '@hcengineering/core'
|
||||||
|
import { IntlString } from '@hcengineering/platform'
|
||||||
|
import { ButtonKind, ButtonSize } from '@hcengineering/ui'
|
||||||
|
import recruit from '../plugin'
|
||||||
|
import { Vacancy } from '@hcengineering/recruit'
|
||||||
|
import { SpaceSelect } from '@hcengineering/presentation'
|
||||||
|
|
||||||
|
export let value: Ref<Vacancy> | undefined
|
||||||
|
export let label: IntlString = recruit.string.Vacancy
|
||||||
|
export let onChange: (value: any) => void
|
||||||
|
export let type: RefTo<Vacancy> | undefined
|
||||||
|
export let kind: ButtonKind = 'no-border'
|
||||||
|
export let size: ButtonSize = 'small'
|
||||||
|
export let justify: 'left' | 'center' = 'center'
|
||||||
|
export let width: string | undefined = undefined
|
||||||
|
$: _value = value != null ? value : undefined
|
||||||
|
$: _class = type?.to ?? recruit.class.Vacancy
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<SpaceSelect
|
||||||
|
{_class}
|
||||||
|
{label}
|
||||||
|
bind:value={_value}
|
||||||
|
{kind}
|
||||||
|
{size}
|
||||||
|
{justify}
|
||||||
|
{width}
|
||||||
|
allowDeselect
|
||||||
|
autoSelect={false}
|
||||||
|
defaultIcon={recruit.icon.Vacancy}
|
||||||
|
iconWithEmoji={recruit.icon.Vacancy}
|
||||||
|
ignoreFill
|
||||||
|
on:change={(e) => {
|
||||||
|
onChange(e.detail)
|
||||||
|
}}
|
||||||
|
/>
|
@ -55,6 +55,7 @@ import VacancyList from './components/VacancyList.svelte'
|
|||||||
import VacancyModifiedPresenter from './components/VacancyModifiedPresenter.svelte'
|
import VacancyModifiedPresenter from './components/VacancyModifiedPresenter.svelte'
|
||||||
import VacancyPresenter from './components/VacancyPresenter.svelte'
|
import VacancyPresenter from './components/VacancyPresenter.svelte'
|
||||||
import VacancyTemplateEditor from './components/VacancyTemplateEditor.svelte'
|
import VacancyTemplateEditor from './components/VacancyTemplateEditor.svelte'
|
||||||
|
import VacancyEditor from './components/VacancyEditor.svelte'
|
||||||
import CreateOpinion from './components/review/CreateOpinion.svelte'
|
import CreateOpinion from './components/review/CreateOpinion.svelte'
|
||||||
import CreateReview from './components/review/CreateReview.svelte'
|
import CreateReview from './components/review/CreateReview.svelte'
|
||||||
import EditReview from './components/review/EditReview.svelte'
|
import EditReview from './components/review/EditReview.svelte'
|
||||||
@ -357,7 +358,8 @@ export default async (): Promise<Resources> => ({
|
|||||||
VacancyTemplateEditor,
|
VacancyTemplateEditor,
|
||||||
|
|
||||||
MatchVacancy,
|
MatchVacancy,
|
||||||
NotificationApplicantPresenter
|
NotificationApplicantPresenter,
|
||||||
|
VacancyEditor
|
||||||
},
|
},
|
||||||
completion: {
|
completion: {
|
||||||
ApplicationQuery: async (
|
ApplicationQuery: async (
|
||||||
|
Loading…
Reference in New Issue
Block a user