mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
UBER-773: Fix List search anv Vacancy view (#3614)
Signed-off-by: Maxim Karmatskikh <mkarmatskih@gmail.com>
This commit is contained in:
parent
5b7ca98523
commit
5104e5ace6
@ -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
|
||||
|
@ -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))
|
||||
</script>
|
||||
|
||||
<div class="antiCard dialog menu">
|
||||
@ -103,8 +105,10 @@
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div class="antiCard-menu__divider" />
|
||||
{#each config.other.filter((p) => !p.hidden?.(viewOptions)) as model}
|
||||
{#if visibleOthers.length > 0}
|
||||
<div class="antiCard-menu__divider" />
|
||||
{/if}
|
||||
{#each visibleOthers as model}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div
|
||||
class="antiCard-menu__item hoverable ordering"
|
||||
|
@ -84,10 +84,19 @@
|
||||
function getProjection (fields: string[], query: DocumentQuery<Doc>): Record<string, number> {
|
||||
const res: Record<string, number> = {}
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user