From 1adb05e4aeed6aeabf6ac71c8c86a5ee90d36d5b Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Tue, 20 Sep 2022 13:42:24 +0700 Subject: [PATCH] *Candidate Flow & Notifications (#2272) Signed-off-by: Andrey Sobolev --- models/board/src/index.ts | 21 ++- models/chunter/src/index.ts | 15 +- .../presentation/src/components/Card.svelte | 4 +- .../src/components/ObjectPopup.svelte | 65 +++++-- .../src/components/SpaceSelect.svelte | 69 +++++--- .../src/components/SpaceSelector.svelte | 10 +- .../src/components/SpacesPopup.svelte | 13 +- .../src/components/UserBox.svelte | 90 +++++----- packages/theme/styles/_layouts.scss | 1 + .../components/BrowserNotificatator.svelte | 28 ++- .../src/components/NotificationView.svelte | 11 +- plugins/notification/src/index.ts | 1 + .../src/components/CandidateCard.svelte | 49 +++--- .../src/components/CreateApplication.svelte | 161 +++++++++++------- .../src/components/VacancyCard.svelte | 117 +++++++++++-- .../src/components/VacancyOrgPresenter.svelte | 26 +++ plugins/recruit/src/index.ts | 1 + .../src/components/issues/ListView.svelte | 1 - .../src/components/ViewletSetting.svelte | 14 +- .../src/components/Workbench.svelte | 2 +- .../src/components/navigator/SpacesNav.svelte | 39 +---- tests/sanity/.gitignore | 3 +- tests/sanity/tests/recruit.spec.ts | 4 +- 23 files changed, 506 insertions(+), 239 deletions(-) create mode 100644 plugins/recruit-resources/src/components/VacancyOrgPresenter.svelte diff --git a/models/board/src/index.ts b/models/board/src/index.ts index cdf0d1e709..dc8466803f 100644 --- a/models/board/src/index.ts +++ b/models/board/src/index.ts @@ -15,7 +15,7 @@ // To help typescript locate view plugin properly import automation, { AutomationSupport } from '@anticrm/automation' -import { Board, Card, MenuPage, CommonBoardPreference, CardCover, boardId } from '@anticrm/board' +import { Board, boardId, Card, CardCover, CommonBoardPreference, MenuPage } from '@anticrm/board' import type { Employee } from '@anticrm/contact' import { Class, DOMAIN_MODEL, IndexKind, Markup, Ref, Type } from '@anticrm/core' import { @@ -35,13 +35,13 @@ import attachment from '@anticrm/model-attachment' import chunter from '@anticrm/model-chunter' import contact from '@anticrm/model-contact' import core, { TDoc, TType } from '@anticrm/model-core' +import preference, { TPreference } from '@anticrm/model-preference' +import tags from '@anticrm/model-tags' import task, { TSpaceWithStates, TTask } from '@anticrm/model-task' -import view, { actionTemplates, createAction } from '@anticrm/model-view' +import view, { actionTemplates, createAction, actionTemplates as viewTemplates } from '@anticrm/model-view' import workbench, { Application } from '@anticrm/model-workbench' import { IntlString } from '@anticrm/platform' import type { AnyComponent } from '@anticrm/ui' -import preference, { TPreference } from '@anticrm/model-preference' -import tags from '@anticrm/model-tags' import board from './plugin' @Model(board.class.Board, task.class.SpaceWithStates) @@ -526,6 +526,19 @@ export function createModel (builder: Builder): void { }, board.action.ConvertToCard ) + + createAction(builder, { + ...viewTemplates.open, + target: board.class.Board, + context: { + mode: ['browser', 'context'], + group: 'create' + }, + action: workbench.actionImpl.Navigate, + actionProps: { + mode: 'space' + } + }) } export { boardOperation } from './migration' diff --git a/models/chunter/src/index.ts b/models/chunter/src/index.ts index 815e13872f..0c3d10c511 100644 --- a/models/chunter/src/index.ts +++ b/models/chunter/src/index.ts @@ -47,7 +47,7 @@ import attachment from '@anticrm/model-attachment' import core, { TAttachedDoc, TSpace } from '@anticrm/model-core' import notification from '@anticrm/model-notification' import preference, { TPreference } from '@anticrm/model-preference' -import view, { createAction } from '@anticrm/model-view' +import view, { actionTemplates as viewTemplates, createAction } from '@anticrm/model-view' import workbench from '@anticrm/model-workbench' import chunter from './plugin' @@ -478,6 +478,19 @@ export function createModel (builder: Builder): void { builder.mixin(chunter.class.Channel, core.class.Class, view.mixin.ClassFilters, { filters: ['private', 'archived'] }) + + createAction(builder, { + ...viewTemplates.open, + target: chunter.class.Channel, + context: { + mode: ['browser', 'context'], + group: 'create' + }, + action: workbench.actionImpl.Navigate, + actionProps: { + mode: 'space' + } + }) } export { chunterOperation } from './migration' diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index cf9d317fa0..160eb00c57 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -87,7 +87,9 @@ if (r instanceof Promise) { r.then(() => { okProcessing = false - dispatch('close') + if (!createMore) { + dispatch('close') + } }) } else if (!createMore) { okProcessing = false diff --git a/packages/presentation/src/components/ObjectPopup.svelte b/packages/presentation/src/components/ObjectPopup.svelte index 820a84f2fa..c511cd32ef 100644 --- a/packages/presentation/src/components/ObjectPopup.svelte +++ b/packages/presentation/src/components/ObjectPopup.svelte @@ -28,10 +28,10 @@ showPopup, tooltip } from '@anticrm/ui' - import { createEventDispatcher, afterUpdate } from 'svelte' + import { afterUpdate, createEventDispatcher } from 'svelte' import presentation from '..' - import { createQuery, getClient } from '../utils' import { ObjectCreate } from '../types' + import { createQuery, getClient } from '../utils' export let _class: Ref> export let options: FindOptions | undefined = undefined @@ -155,6 +155,35 @@ } afterUpdate(() => dispatch('changeContent')) + + let selectedDiv: HTMLElement | undefined + let scrollDiv: HTMLElement | undefined + let cHeight = 0 + + const updateLocation = (scrollDiv?: HTMLElement, selectedDiv?: HTMLElement, objects?: Doc[], selected?: Ref) => { + const objIt = objects?.find((it) => it._id === selected) + if (objIt === undefined) { + cHeight = 0 + return + } + if (scrollDiv && selectedDiv) { + const r = selectedDiv.getBoundingClientRect() + const r2 = scrollDiv.getBoundingClientRect() + if (r && r2) { + if (r.top > r2.top && r.bottom < r2.bottom) { + cHeight = 0 + } else { + if (r.bottom < r2.bottom) { + cHeight = 1 + } else { + cHeight = -1 + } + } + } + } + } + + $: updateLocation(scrollDiv, selectedDiv, objects, selected) @@ -181,7 +210,10 @@ {/if} -
+ {#if cHeight === 1} +
+ {/if} +
updateLocation(scrollDiv, selectedDiv)} bind:this={scrollDiv}>
@@ -199,6 +231,8 @@ {@const obj = objects[item]}
+ {#if cHeight === -1} +
+ {/if}
diff --git a/plugins/recruit-resources/src/components/VacancyOrgPresenter.svelte b/plugins/recruit-resources/src/components/VacancyOrgPresenter.svelte new file mode 100644 index 0000000000..7e31755351 --- /dev/null +++ b/plugins/recruit-resources/src/components/VacancyOrgPresenter.svelte @@ -0,0 +1,26 @@ + + + +{#if value} + +{/if} diff --git a/plugins/recruit/src/index.ts b/plugins/recruit/src/index.ts index c778e43c78..e322c1f8ba 100644 --- a/plugins/recruit/src/index.ts +++ b/plugins/recruit/src/index.ts @@ -30,6 +30,7 @@ export interface Vacancy extends SpaceWithStates { dueTo?: Timestamp location?: string company?: Ref + comments?: number } /** diff --git a/plugins/tracker-resources/src/components/issues/ListView.svelte b/plugins/tracker-resources/src/components/issues/ListView.svelte index 730e451d8a..4851aa271c 100644 --- a/plugins/tracker-resources/src/components/issues/ListView.svelte +++ b/plugins/tracker-resources/src/components/issues/ListView.svelte @@ -53,7 +53,6 @@ }, { sort: { [orderByKey]: issuesSortOrderMap[orderByKey] }, - limit: 200, lookup: { assignee: contact.class.Employee, status: tracker.class.IssueStatus, diff --git a/plugins/view-resources/src/components/ViewletSetting.svelte b/plugins/view-resources/src/components/ViewletSetting.svelte index cb684ca4f6..79a0270948 100644 --- a/plugins/view-resources/src/components/ViewletSetting.svelte +++ b/plugins/view-resources/src/components/ViewletSetting.svelte @@ -122,19 +122,25 @@ if (presenter === undefined) return if (useMixinProxy) { - result.push({ + const newValue = { value: attribute.attributeOf + '.' + attribute.name, label: attribute.label, enabled: false, _class: attribute.attributeOf - }) + } + if (result.find((it) => it._class === newValue._class && it.value === newValue.value) === undefined) { + result.push(newValue) + } } else { - result.push({ + const newValue = { value, label: attribute.label, enabled: false, _class: attribute.attributeOf - }) + } + if (result.find((it) => it._class === newValue._class && it.value === newValue.value) === undefined) { + result.push(newValue) + } } } function getConfig (viewlet: Viewlet, preference: ViewletPreference | undefined): AttributeConfig[] { diff --git a/plugins/workbench-resources/src/components/Workbench.svelte b/plugins/workbench-resources/src/components/Workbench.svelte index 1ec5f25ffa..12a81b6fd1 100644 --- a/plugins/workbench-resources/src/components/Workbench.svelte +++ b/plugins/workbench-resources/src/components/Workbench.svelte @@ -126,7 +126,7 @@ notification.class.Notification, { attachedTo: account.employee, - status: NotificationStatus.New + status: { $nin: [NotificationStatus.Read] } }, (res) => { hasNotification = res.length > 0 diff --git a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte index 833f065d52..10078f83a6 100644 --- a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte +++ b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte @@ -13,25 +13,14 @@ // limitations under the License. -->