mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
Fix List Category requests (#3938)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
66915d29e3
commit
7872a460e8
@ -707,7 +707,7 @@ export function createModel (builder: Builder): void {
|
||||
label: recruit.string.HideArchivedVacancies
|
||||
}
|
||||
|
||||
const applicantViewOptions = (colors: boolean): ViewOptionsModel => {
|
||||
const applicantViewOptions = (colors: boolean, hides: boolean): ViewOptionsModel => {
|
||||
const model: ViewOptionsModel = {
|
||||
groupBy: ['status', 'assignee', 'space', 'createdBy', 'modifiedBy'],
|
||||
orderBy: [
|
||||
@ -725,14 +725,15 @@ export function createModel (builder: Builder): void {
|
||||
actionTarget: 'category',
|
||||
action: view.function.ShowEmptyGroups,
|
||||
label: view.string.ShowEmptyGroups
|
||||
},
|
||||
applicationDoneOption,
|
||||
vacancyHideOption
|
||||
}
|
||||
]
|
||||
}
|
||||
if (colors) {
|
||||
model.other.push(showColorsViewOption)
|
||||
}
|
||||
if (hides) {
|
||||
model.other.push(...[applicationDoneOption, vacancyHideOption])
|
||||
}
|
||||
return model
|
||||
}
|
||||
|
||||
@ -810,7 +811,7 @@ export function createModel (builder: Builder): void {
|
||||
strict: true,
|
||||
hiddenKeys: ['name', 'attachedTo']
|
||||
},
|
||||
viewOptions: applicantViewOptions(true)
|
||||
viewOptions: applicantViewOptions(true, true)
|
||||
},
|
||||
recruit.viewlet.ListApplicant
|
||||
)
|
||||
@ -977,8 +978,12 @@ export function createModel (builder: Builder): void {
|
||||
attachTo: recruit.class.Applicant,
|
||||
descriptor: task.viewlet.Kanban,
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
baseQuery: {
|
||||
isDone: { $ne: true },
|
||||
'$lookup.space.archived': false
|
||||
},
|
||||
viewOptions: {
|
||||
...applicantViewOptions(false),
|
||||
...applicantViewOptions(false, false),
|
||||
groupDepth: 1
|
||||
},
|
||||
options: {
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
let resultQuery: DocumentQuery<Doc> = query
|
||||
$: getResultQuery(query, viewOptionsConfig, viewOptions).then((p) => {
|
||||
resultQuery = { ...p, ...query }
|
||||
resultQuery = { ...query, ...p }
|
||||
})
|
||||
|
||||
$: queryNoLookup = noLookup(resultQuery)
|
||||
@ -68,7 +68,7 @@
|
||||
|
||||
let categoryQueryOptions: Partial<FindOptions<Doc>>
|
||||
$: categoryQueryOptions = {
|
||||
...resultOptions,
|
||||
...noLookupOptions(resultOptions),
|
||||
projection: {
|
||||
...resultOptions.projection,
|
||||
_id: 1,
|
||||
@ -132,6 +132,11 @@
|
||||
return newQuery
|
||||
}
|
||||
|
||||
function noLookupOptions (options: FindOptions<Doc>): FindOptions<Doc> {
|
||||
const { lookup, ...resultOptions } = options
|
||||
return resultOptions
|
||||
}
|
||||
|
||||
$: dispatch('content', docs)
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
Loading…
Reference in New Issue
Block a user