diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 74eaab2290..ee0d599159 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -763,11 +763,11 @@ export function createModel (builder: Builder): void { descriptor: view.viewlet.List, config: [ { key: '', displayProps: { fixed: 'left', key: 'app' } }, - 'description', { key: '@applications', label: recruit.string.Applications }, + 'description', { key: '', displayProps: { grow: true } }, { key: '$lookup.company', @@ -779,8 +779,8 @@ export function createModel (builder: Builder): void { } ], configOptions: { - hiddenKeys: ['name', 'space', 'modifiedOn'], - sortable: true + strict: true, + hiddenKeys: ['name', 'space', 'modifiedOn'] }, baseQuery: { doneState: null, @@ -794,16 +794,7 @@ export function createModel (builder: Builder): void { ['modifiedOn', SortingOrder.Descending], ['createdOn', SortingOrder.Descending] ], - other: [ - { - key: 'shouldShowAll', - type: 'toggle', - defaultValue: false, - actionTarget: 'category', - action: view.function.ShowEmptyGroups, - label: view.string.ShowEmptyGroups - } - ] + other: [] } }, recruit.viewlet.ListVacancy diff --git a/plugins/view-resources/src/components/ViewOptions.svelte b/plugins/view-resources/src/components/ViewOptions.svelte index 65f1952863..b964a9d74e 100644 --- a/plugins/view-resources/src/components/ViewOptions.svelte +++ b/plugins/view-resources/src/components/ViewOptions.svelte @@ -64,6 +64,8 @@ viewOptions[model.key] = !viewOptions[model.key] dispatch('update', { key: model.key, value: viewOptions[model.key] }) } + + $: visibleOthers = config.other.filter((p) => !p.hidden?.(viewOptions)) -
- {#each config.other.filter((p) => !p.hidden?.(viewOptions)) as model} + {#if visibleOthers.length > 0} +
+ {/if} + {#each visibleOthers as model}
): Record { const res: Record = {} for (const f of fields) { - res[f] = 1 + /* + Mongo projection doesn't support properties fields which + start from $. Such field here is $search. The least we could do + is to filter all properties which start from $. + */ + if (!f.startsWith('$')) { + res[f] = 1 + } } for (const f of Object.keys(query)) { - res[f] = 1 + if (!f.startsWith('$')) { + res[f] = 1 + } } return res }