Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-10-13 11:06:35 +02:00
parent 8df449d090
commit 091d8ef5b1
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
7 changed files with 23 additions and 24 deletions

View File

@ -30,8 +30,6 @@
export let spaceLabel: IntlString
export let spacePlaceholder: IntlString
export let label: IntlString
export let okLabel: IntlString
export let cancelLabel: IntlString
export let okAction: () => void
export let canSave: boolean = false
@ -54,8 +52,8 @@
<SpaceSelect _class={spaceClass} label={spaceLabel} placeholder={spacePlaceholder} bind:value={space} />
</div>
<div class="footer">
<Button disabled={!canSave} label={okLabel} size={'small'} transparent primary on:click={() => { okAction(); dispatch('close') }} />
<Button label={cancelLabel} size={'small'} transparent on:click={() => { dispatch('close') }} />
<Button disabled={!canSave} label={'Create'} size={'small'} transparent primary on:click={() => { okAction(); dispatch('close') }} />
<Button label={'Cancel'} size={'small'} transparent on:click={() => { dispatch('close') }} />
</div>
</form>

View File

@ -28,8 +28,8 @@
<div class="overflow-label title"><Label {label} /></div>
<div class="message"><Label label={message} /></div>
<div class="footer">
<Button label={'Ok'} size={'small'} primary on:click={() => dispatch('close', 'OK')} />
<Button label={'Cancel'} size={'small'} on:click={() => dispatch('close', 'CANCEL')} />
<Button label={'Ok'} size={'small'} primary on:click={() => dispatch('close', true)} />
<Button label={'Cancel'} size={'small'} on:click={() => dispatch('close', false)} />
</div>
</div>

View File

@ -43,6 +43,10 @@
const dispatch = createEventDispatcher()
const client = getClient()
export function canClose(): boolean {
return candidate === undefined && employee === undefined
}
async function createApplication() {
dispatch('close')
const state = await client.findOne(core.class.State, { space: _space })
@ -89,7 +93,6 @@
</script>
<Card label={'Create Application'}
okLabel={'Save'}
okAction={createApplication}
canSave={status.severity === Severity.OK}
spaceClass={recruit.class.Vacancy}

View File

@ -140,8 +140,6 @@
<!-- <DialogHeader {space} {object} {newValue} {resume} create={true} on:save={createCandidate}/> -->
<Card label={'Create Candidate'}
okLabel={'Save'}
cancelLabel={'Cancel'}
okAction={createCandidate}
canSave={firstName.length > 0 && lastName.length > 0}
spaceClass={recruit.class.Candidates}

View File

@ -89,7 +89,7 @@
</div>
</div>
Applications
<!-- Applications
<TableView
_class={recruit.class.Applicant}
@ -104,7 +104,7 @@
}
}
search=""
/>
/> -->
<div class="attachments">
<Attachments objectId={object._id} _class={object._class} space={object.space} {object}/>

View File

@ -23,13 +23,21 @@ import TimestampPresenter from './components/TimestampPresenter.svelte'
import TableView from './components/TableView.svelte'
import KanbanView from './components/KanbanView.svelte'
import { getClient } from '@anticrm/presentation'
import { getClient, MessageBox } from '@anticrm/presentation'
import { showPopup } from '@anticrm/ui'
export { TableView }
async function Delete(object: Doc): Promise<void> {
const client = getClient()
await client.removeDoc(object._class, object.space, object._id)
function Delete(object: Doc): void {
showPopup(MessageBox, {
label: 'Delete object',
message: 'Do you want to delete this object?'
}, undefined, (result) => {
if (result) {
const client = getClient()
client.removeDoc(object._class, object.space, object._id)
}
})
}
export default async () => ({

View File

@ -79,15 +79,7 @@
</div>
{#if navigator}
<div class="panel-navigator">
<NavHeader label={'Chat'} action={() => {
showPopup(MessageBox, {
label: 'Dialog title',
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor anem isto orem ipsum dolor sit amet?'
}, undefined, (result) => {
if (result && result === 'OK') console.log('MessageBox - Ok!')
else console.log('MessageBox - Cancel')
})
}} />
<NavHeader label={'Chat'} action={() => {}} />
<Navigator model={navigatorModel}/>
</div>
{/if}