diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index b9948709fe..4a4fa156a7 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -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: { diff --git a/plugins/view-resources/src/components/list/List.svelte b/plugins/view-resources/src/components/list/List.svelte index 9d47ece447..aecf846436 100644 --- a/plugins/view-resources/src/components/list/List.svelte +++ b/plugins/view-resources/src/components/list/List.svelte @@ -59,7 +59,7 @@ let resultQuery: DocumentQuery = query $: getResultQuery(query, viewOptionsConfig, viewOptions).then((p) => { - resultQuery = { ...p, ...query } + resultQuery = { ...query, ...p } }) $: queryNoLookup = noLookup(resultQuery) @@ -68,7 +68,7 @@ let categoryQueryOptions: Partial> $: categoryQueryOptions = { - ...resultOptions, + ...noLookupOptions(resultOptions), projection: { ...resultOptions.projection, _id: 1, @@ -132,6 +132,11 @@ return newQuery } + function noLookupOptions (options: FindOptions): FindOptions { + const { lookup, ...resultOptions } = options + return resultOptions + } + $: dispatch('content', docs) const dispatch = createEventDispatcher()