TSK-1089: Proper Recruit Archive (#2952)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-04-12 09:26:53 +07:00 committed by GitHub
parent 751a65f37e
commit ac0eac5eff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 11 deletions

View File

@ -261,7 +261,10 @@ export function createModel (builder: Builder): void {
icon: recruit.icon.Vacancy, icon: recruit.icon.Vacancy,
label: recruit.string.Vacancies, label: recruit.string.Vacancies,
createItemLabel: recruit.string.VacancyCreateLabel, createItemLabel: recruit.string.VacancyCreateLabel,
position: 'vacancy' position: 'vacancy',
componentProps: {
archived: false
}
}, },
{ {
id: organizationsId, id: organizationsId,
@ -302,12 +305,15 @@ export function createModel (builder: Builder): void {
}, },
{ {
id: archiveId, id: archiveId,
component: workbench.component.Archive, component: recruit.component.Vacancies,
icon: view.icon.Archive, icon: view.icon.Archive,
label: workbench.string.Archive, label: workbench.string.Archive,
position: 'bottom', position: 'bottom',
visibleIf: workbench.function.HasArchiveSpaces, visibleIf: workbench.function.HasArchiveSpaces,
spaceClass: recruit.class.Vacancy spaceClass: recruit.class.Vacancy,
componentProps: {
archived: true
}
}, },
{ {
id: skillsId, id: skillsId,
@ -564,12 +570,14 @@ export function createModel (builder: Builder): void {
lookup: { lookup: {
_id: { _id: {
related: [tracker.class.Issue, 'relations._id'] related: [tracker.class.Issue, 'relations._id']
} },
space: recruit.class.Vacancy
} }
}, },
hiddenKeys: ['name', 'attachedTo'], hiddenKeys: ['name', 'attachedTo'],
baseQuery: { baseQuery: {
doneState: null doneState: null,
'$lookup.space.archived': false
} }
}, },
recruit.viewlet.ApplicantTable recruit.viewlet.ApplicantTable
@ -583,8 +591,14 @@ export function createModel (builder: Builder): void {
descriptor: view.viewlet.Table, descriptor: view.viewlet.Table,
config: ['', 'response', 'attachedTo', 'space', 'modifiedOn'], config: ['', 'response', 'attachedTo', 'space', 'modifiedOn'],
hiddenKeys: [], hiddenKeys: [],
options: {
lookup: {
space: recruit.class.Vacancy
}
},
baseQuery: { baseQuery: {
doneState: null doneState: null,
'$lookup.space.archived': false
} }
}, },
recruit.viewlet.TableApplicantMatch recruit.viewlet.TableApplicantMatch
@ -596,7 +610,8 @@ export function createModel (builder: Builder): void {
{ {
_id: { _id: {
channels: contact.class.Channel channels: contact.class.Channel
} },
space: recruit.class.Vacancy
} }
], ],
assignee: contact.class.Employee, assignee: contact.class.Employee,
@ -633,7 +648,8 @@ export function createModel (builder: Builder): void {
descriptor: task.viewlet.Kanban, descriptor: task.viewlet.Kanban,
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
baseQuery: { baseQuery: {
doneState: null doneState: null,
'$lookup.space.archived': false
}, },
viewOptions: { viewOptions: {
...applicantViewOptions, ...applicantViewOptions,

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import { navigate, parseLocation } from '@hcengineering/ui' import { closePopup, closeTooltip, navigate, parseLocation } from '@hcengineering/ui'
export let href: string | undefined export let href: string | undefined
export let disableClick = false export let disableClick = false
@ -24,12 +24,17 @@
function clickHandler (e: MouseEvent) { function clickHandler (e: MouseEvent) {
if (disableClick) return if (disableClick) return
if (onClick) { if (onClick) {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
onClick(e) onClick(e)
} else if (href !== undefined) { } else if (href !== undefined) {
if (e.metaKey || e.ctrlKey) return if (e.metaKey || e.ctrlKey) return
// we need to close popups and tooltips
closePopup()
closeTooltip()
try { try {
const url = new URL(href) const url = new URL(href)

View File

@ -15,8 +15,8 @@ const emptyTooltip: LabelAndProps = {
let storedValue: LabelAndProps = emptyTooltip let storedValue: LabelAndProps = emptyTooltip
export const tooltipstore = writable<LabelAndProps>(emptyTooltip) export const tooltipstore = writable<LabelAndProps>(emptyTooltip)
let toHandler: any
export function tooltip (node: HTMLElement, options?: LabelAndProps): any { export function tooltip (node: HTMLElement, options?: LabelAndProps): any {
let toHandler: any
if (options === undefined) { if (options === undefined) {
return {} return {}
} }
@ -80,6 +80,7 @@ export function showTooltip (
} }
export function closeTooltip (): void { export function closeTooltip (): void {
clearTimeout(toHandler)
storedValue = emptyTooltip storedValue = emptyTooltip
tooltipstore.set(emptyTooltip) tooltipstore.set(emptyTooltip)
} }

View File

@ -31,6 +31,8 @@
import CreateVacancy from './CreateVacancy.svelte' import CreateVacancy from './CreateVacancy.svelte'
import { deviceOptionsStore as deviceInfo } from '@hcengineering/ui' import { deviceOptionsStore as deviceInfo } from '@hcengineering/ui'
export let archived = false
let search: string = '' let search: string = ''
let searchQuery: DocumentQuery<Doc> = {} let searchQuery: DocumentQuery<Doc> = {}
let resultQuery: DocumentQuery<Doc> = {} let resultQuery: DocumentQuery<Doc> = {}
@ -194,7 +196,7 @@
options={descr.options} options={descr.options}
query={{ query={{
...resultQuery, ...resultQuery,
archived: false archived
}} }}
showNotification showNotification
/> />