mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-15 12:55:59 +00:00
Application Presenter and labels for custom presenters
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
127e9bff23
commit
9d24dc384e
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -108,7 +108,7 @@ export function createModel (builder: Builder): void {
|
||||
resume: chunter.class.Attachment
|
||||
}
|
||||
} as FindOptions<Doc>, // TODO: fix
|
||||
config: ['', '#' + recruit.component.CreateApplicationPresenter, 'city', '$lookup.resume', 'channels']
|
||||
config: ['', '#' + recruit.component.CreateApplicationPresenter + '/Action', 'city', '$lookup.resume', 'channels']
|
||||
})
|
||||
|
||||
builder.createDoc(view.class.Viewlet, core.space.Model, {
|
||||
@ -122,7 +122,7 @@ export function createModel (builder: Builder): void {
|
||||
state: core.class.State
|
||||
}
|
||||
} as FindOptions<Doc>, // TODO: fix
|
||||
config: ['$lookup.candidate', '$lookup.state', '$lookup.candidate.city', '$lookup.candidate.channels']
|
||||
config: ['$lookup.candidate', '#' + recruit.component.ApplicationPresenter + '/Application', '$lookup.state', '$lookup.candidate.city', '$lookup.candidate.channels']
|
||||
})
|
||||
|
||||
builder.createDoc(view.class.Viewlet, core.space.Model, {
|
||||
|
@ -34,7 +34,8 @@ export default mergeIds(recruitId, recruit, {
|
||||
CreateApplication: '' as AnyComponent,
|
||||
EditCandidate: '' as AnyComponent,
|
||||
KanbanCard: '' as AnyComponent,
|
||||
CreateApplicationPresenter: '' as AnyComponent
|
||||
CreateApplicationPresenter: '' as AnyComponent,
|
||||
ApplicationPresenter: '' as AnyComponent
|
||||
},
|
||||
space: {
|
||||
CandidatesPublic: '' as Ref<Space>
|
||||
|
@ -0,0 +1,26 @@
|
||||
<!--
|
||||
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
||||
// Copyright © 2021 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 type { Applicant } from '@anticrm/recruit'
|
||||
import { IconFile } from '@anticrm/ui'
|
||||
|
||||
export let object: Applicant
|
||||
|
||||
</script>
|
||||
|
||||
<IconFile size={'small'}/>
|
@ -20,14 +20,14 @@
|
||||
import { Label, showPopup } from '@anticrm/ui'
|
||||
import CreateApplication from './CreateApplication.svelte'
|
||||
|
||||
export let object: Doc
|
||||
export let value: Doc
|
||||
|
||||
let button: HTMLElement
|
||||
|
||||
</script>
|
||||
|
||||
<div class="flex-center presenter-container" bind:this={button}
|
||||
on:click={() => { showPopup(CreateApplication, { candidate: object._id, preserveCandidate: true }, button) }}
|
||||
on:click={() => { showPopup(CreateApplication, { candidate: value._id, preserveCandidate: true }, button) }}
|
||||
>
|
||||
<Label label="Create Application" />
|
||||
</div>
|
||||
|
@ -22,6 +22,7 @@ import CandidateGeneral from './components/CandidateGeneral.svelte'
|
||||
import Attachments from './components/Attachments.svelte'
|
||||
import KanbanCard from './components/KanbanCard.svelte'
|
||||
import CreateApplicationPresenter from './components/CreateApplicationPresenter.svelte'
|
||||
import ApplicationPresenter from './components/ApplicationPresenter.svelte'
|
||||
|
||||
export default async () => ({
|
||||
component: {
|
||||
@ -33,6 +34,7 @@ export default async () => ({
|
||||
CandidateGeneral,
|
||||
Attachments,
|
||||
KanbanCard,
|
||||
CreateApplicationPresenter
|
||||
CreateApplicationPresenter,
|
||||
ApplicationPresenter
|
||||
},
|
||||
})
|
||||
|
@ -67,7 +67,7 @@
|
||||
{#each objects as object (object._id)}
|
||||
<tr class="tr-body">
|
||||
{#each model as attribute}
|
||||
<td><svelte:component this={attribute.presenter} {object} value={getValue(object, attribute.key)}/></td>
|
||||
<td><svelte:component this={attribute.presenter} value={getValue(object, attribute.key)}/></td>
|
||||
{/each}
|
||||
</tr>
|
||||
{/each}
|
||||
|
@ -65,10 +65,11 @@ async function getPresenter(client: Client, _class: Ref<Class<Obj>>, key: string
|
||||
return getObjectPresenter(client, _class, preserveKey)
|
||||
} else {
|
||||
if (key.startsWith('#')) {
|
||||
const [presenter, label] = key.substring(1).split('/')
|
||||
return {
|
||||
key: '',
|
||||
label: '' as IntlString,
|
||||
presenter: await getResource(key.substring(1) as AnyComponent)
|
||||
label: label as IntlString,
|
||||
presenter: await getResource(presenter as AnyComponent)
|
||||
}
|
||||
}
|
||||
const split = key.split('.')
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user