From 1e60d73d33377f9284c8d0330222c98a1e551589 Mon Sep 17 00:00:00 2001 From: Maxim Karmatskikh Date: Wed, 16 Aug 2023 09:09:04 +0200 Subject: [PATCH 1/3] UBER-479: Add List view for Vacancies Signed-off-by: Maxim Karmatskikh --- models/recruit/src/index.ts | 55 +++++++++++++++++++ models/recruit/src/plugin.ts | 1 + .../src/components/Vacancies.svelte | 51 +++++++++-------- 3 files changed, 83 insertions(+), 24 deletions(-) diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 4b69794a39b..2cea99a891d 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -676,6 +676,7 @@ export function createModel (builder: Builder): void { } return model } + builder.createDoc( view.class.Viewlet, core.space.Model, @@ -754,6 +755,60 @@ export function createModel (builder: Builder): void { recruit.viewlet.ListApplicant ) + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: recruit.class.Vacancy, + descriptor: view.viewlet.List, + config: [ + { key: '', displayProps: { fixed: 'left', key: 'app' } }, + 'description', + { + key: '@applications', + label: recruit.string.Applications + }, + { key: '', displayProps: { grow: true } }, + { + key: '$lookup.company', + displayProps: { key: '$lookup.company', fixed: 'right' } + }, + { + key: 'location', + displayProps: { key: 'location', fixed: 'right' } + }, + ], + configOptions: { + hiddenKeys: ['name', 'space', 'modifiedOn'], + sortable: true + }, + baseQuery: { + doneState: null, + '$lookup.space.archived': false + }, + viewOptions: { + groupBy: ['company', 'location', 'dueTo', 'createdBy'], + orderBy: [ + ['company', SortingOrder.Ascending], + ['dueTo', SortingOrder.Ascending], + ['modifiedOn', SortingOrder.Descending], + ['createdOn', SortingOrder.Descending] + ], + other: [ + { + key: 'shouldShowAll', + type: 'toggle', + defaultValue: false, + actionTarget: 'category', + action: view.function.ShowEmptyGroups, + label: view.string.ShowEmptyGroups + } + ] + } + }, + recruit.viewlet.ListVacancy + ) + builder.createDoc( view.class.Viewlet, core.space.Model, diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index d7cc616f455..621b36fa47b 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -115,6 +115,7 @@ export default mergeIds(recruitId, recruit, { viewlet: { TableCandidate: '' as Ref, TableVacancy: '' as Ref, + ListVacancy: '' as Ref, ApplicantTable: '' as Ref, ApplicantKanban: '' as Ref, ListApplicant: '' as Ref, diff --git a/plugins/recruit-resources/src/components/Vacancies.svelte b/plugins/recruit-resources/src/components/Vacancies.svelte index 0f34c09e709..2adfcbb0a82 100644 --- a/plugins/recruit-resources/src/components/Vacancies.svelte +++ b/plugins/recruit-resources/src/components/Vacancies.svelte @@ -13,10 +13,10 @@ // limitations under the License. -->