diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index 5bf2da9f4f..e1c7c21b78 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -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 @@ diff --git a/packages/presentation/src/components/MessageBox.svelte b/packages/presentation/src/components/MessageBox.svelte index bb44ec939a..271d9877fc 100644 --- a/packages/presentation/src/components/MessageBox.svelte +++ b/packages/presentation/src/components/MessageBox.svelte @@ -28,8 +28,8 @@
diff --git a/plugins/recruit-resources/src/components/CreateApplication.svelte b/plugins/recruit-resources/src/components/CreateApplication.svelte index fe63c118a9..a4ca5a9a43 100644 --- a/plugins/recruit-resources/src/components/CreateApplication.svelte +++ b/plugins/recruit-resources/src/components/CreateApplication.svelte @@ -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 @@ --> 0 && lastName.length > 0} spaceClass={recruit.class.Candidates} diff --git a/plugins/recruit-resources/src/components/EditCandidate.svelte b/plugins/recruit-resources/src/components/EditCandidate.svelte index fb3a3699dd..f4c33e2c37 100644 --- a/plugins/recruit-resources/src/components/EditCandidate.svelte +++ b/plugins/recruit-resources/src/components/EditCandidate.svelte @@ -89,7 +89,7 @@ - Applications +
diff --git a/plugins/view-resources/src/index.ts b/plugins/view-resources/src/index.ts index bb2d67e079..6b37a2208f 100644 --- a/plugins/view-resources/src/index.ts +++ b/plugins/view-resources/src/index.ts @@ -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 { - 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 () => ({ diff --git a/plugins/workbench-resources/src/components/Workbench.svelte b/plugins/workbench-resources/src/components/Workbench.svelte index b398b5d24e..e91e5cb1e0 100644 --- a/plugins/workbench-resources/src/components/Workbench.svelte +++ b/plugins/workbench-resources/src/components/Workbench.svelte @@ -79,15 +79,7 @@
{#if navigator}
- { - 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') - }) - }} /> + {}} />
{/if}