From 6bb8bf5e1b56094a10cfa0059152c1f1695e6dcb Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 3 Jun 2022 11:24:38 +0700 Subject: [PATCH] Fix #1947 (#1993) Signed-off-by: Andrey Sobolev --- .gitignore | 3 +- models/recruit/src/index.ts | 40 ++++++------ models/recruit/src/plugin.ts | 3 +- .../presentation/src/components/Card.svelte | 9 ++- plugins/recruit-assets/lang/en.json | 2 +- .../src/components/CreateApplication.svelte | 19 ++++++ plugins/view-resources/src/actions.ts | 9 ++- plugins/view/src/index.ts | 4 ++ tests/sanity/tests/actions.spec.ts | 64 +++++++++++++++++++ tests/sanity/tests/recruit.spec.ts | 2 +- 10 files changed, 131 insertions(+), 24 deletions(-) create mode 100644 tests/sanity/tests/actions.spec.ts diff --git a/.gitignore b/.gitignore index fb78ca92f0..18efe70935 100644 --- a/.gitignore +++ b/.gitignore @@ -71,4 +71,5 @@ common/autoinstallers/*/.npmrc bundle.js dist tsconfig.tsbuildinfo -ingest-attachment-*.zip \ No newline at end of file +ingest-attachment-*.zip +tsdoc-metadata.json \ No newline at end of file diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 919de6078e..223503aa1a 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -389,9 +389,9 @@ export function createModel (builder: Builder): void { input: 'focus', category: recruit.category.Recruit, target: contact.class.Person, - context: { mode: ['context', 'browser'] } + context: { mode: ['context', 'browser'] }, + override: [recruit.action.CreateGlobalApplication] }) - createAction(builder, { action: view.actionImpl.ShowPopup, actionProps: { @@ -428,23 +428,27 @@ export function createModel (builder: Builder): void { } }) - createAction(builder, { - action: view.actionImpl.ShowPopup, - actionProps: { - component: recruit.component.CreateApplication, - element: 'top' + createAction( + builder, + { + action: view.actionImpl.ShowPopup, + actionProps: { + component: recruit.component.CreateApplication, + element: 'top' + }, + label: recruit.string.CreateApplication, + icon: recruit.icon.Create, + keyBinding: [], + input: 'none', + category: recruit.category.Recruit, + target: core.class.Doc, + context: { + mode: ['workbench', 'browser'], + application: recruit.app.Recruit + } }, - label: recruit.string.CreateApplication, - icon: recruit.icon.Create, - keyBinding: [], - input: 'none', - category: recruit.category.Recruit, - target: core.class.Doc, - context: { - mode: ['workbench', 'browser'], - application: recruit.app.Recruit - } - }) + recruit.action.CreateGlobalApplication + ) builder.createDoc( task.class.KanbanTemplateSpace, diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index 2cc91b231e..0519cbae3d 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -25,7 +25,8 @@ import type { Action, ActionCategory, ViewAction } from '@anticrm/view' export default mergeIds(recruitId, recruit, { action: { - CreateOpinion: '' as Ref + CreateOpinion: '' as Ref, + CreateGlobalApplication: '' as Ref }, actionImpl: { CreateOpinion: '' as ViewAction diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index 588fafa079..aaf39e26d1 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -36,10 +36,17 @@ {/if} - + + {#if $$slots.title} + + {:else} +